/* Dark header styling for backoffice */
.header.sib-header-dark {
    background: linear-gradient(90deg, #0b1727 0%, #0f2744 35%, #0f2744 65%, #0b1727 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.3);
}

.header.sib-header-dark .logo span {
    color: #e5e7eb;
}

.header.sib-header-dark .toggle-sidebar-btn {
    color: #e5e7eb;
}

.header.sib-header-dark .toggle-sidebar-btn:hover {
    color: #ffffff;
}

.header.sib-header-dark .search-form input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
}

.header.sib-header-dark .search-form input::placeholder {
    color: rgba(229, 231, 235, 0.6);
}

.header.sib-header-dark .search-form input:focus,
.header.sib-header-dark .search-form input:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px 0 rgba(255, 255, 255, 0.1);
}

.header.sib-header-dark .search-form button i {
    color: #e5e7eb;
}

.header.sib-header-dark .header-nav .nav-link,
.header.sib-header-dark .header-nav .nav-icon {
    color: #e5e7eb;
}

.header.sib-header-dark .header-nav .nav-link:hover,
.header.sib-header-dark .header-nav .nav-icon:hover {
    color: #ffffff;
}

.header.sib-header-dark .nav-profile span {
    color: #e5e7eb;
}

/* ===== HEADER CTA BUTTONS ===== */
.header.sib-header-dark .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    transition: all 0.2s ease;
}

.header.sib-header-dark .btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.35);
}

.header.sib-header-dark .btn-outline-dark {
    border-color: rgba(255, 255, 255, 0.5);
    color: #e5e7eb;
    background: transparent;
    transition: all 0.2s ease;
}

.header.sib-header-dark .btn-outline-dark:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: #ffffff;
}

.header.sib-header-dark .btn-link.text-muted {
    color: rgba(229, 231, 235, 0.8) !important;
    transition: color 0.2s ease;
}

.header.sib-header-dark .btn-link.text-muted:hover {
    color: #ffffff !important;
}

.header.sib-header-dark .dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.header.sib-header-dark .dropdown-item:active {
    background-color: #28a745;
}

/* Mobile menu button */
.header.sib-header-dark .btn-outline-success {
    border-color: #28a745;
    color: #28a745;
    background: transparent;
}

.header.sib-header-dark .btn-outline-success:hover {
    background: #28a745;
    color: #ffffff;
}

/* Sticky footer helpers (scoped) — only apply when body has .sib-sticky-footer */
html.sib-sticky-footer,
body.sib-sticky-footer {
    height: 100%;
}

body.sib-sticky-footer .body-wrapper {
    min-height: calc(100vh - 70px - 40px); /* header 70px + footer 40px */
    display: flex;
    flex-direction: column;
}

body.sib-sticky-footer footer.footer {
    margin-top: auto;
}

/*--------------------------------------------------------------
# Public Layout Styles
--------------------------------------------------------------*/

/* PUBLIC LAYOUT */
body.public-layout {
    background-color: #f6f9ff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header.public-header {
    /* Dark gradient matching backoffice header style */
    background: linear-gradient(90deg, #0b1727 0%, #0f2744 35%, #0f2744 65%, #0b1727 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

body.public-layout header.public-header .navbar,
body.public-layout header.public-header .header-nav {
    background: transparent;
}

body.public-layout header.public-header .nav-link,
body.public-layout header.public-header .nav-profile,
body.public-layout header.public-header .nav-profile span {
    color: #e5e7eb !important;
}

body.public-layout header.public-header .nav-link:hover,
body.public-layout header.public-header .nav-link:focus {
    color: #ffffff !important;
}

.public-header .navbar-brand {
    font-size: 26px !important;
    font-family: 'Nunito', sans-serif;
    height: 60px !important;
}

.public-header .navbar-brand img {
    max-height: 26px !important;
}

.public-header .nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.public-header .btn-cta-main {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.45rem 1.3rem;
}

/* MatDash profile avatar sizing for public header */
body.public-layout header.public-header .nav-profile img {
    width: 36px;
    height: 36px;
    object-fit: cover;
}

/* Override default layout: remove sidebar margin on public pages */
body.public-layout #main {
    margin-left: 0 !important;
    padding: 0 !important;
}

/* Override default layout: remove sidebar offset on footer for public pages */
body.public-layout #footer {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
    flex-shrink: 0;
    margin-top: auto;
}

/* Ensure footer never overlaps content on mobile & keep footer at the bottom */
body.public-layout #main.main {
    padding-bottom: 120px !important;
    flex: 1 0 auto;
}

/*--------------------------------------------------------------
# Hero Section (Public Homepage)
--------------------------------------------------------------*/
.hero-public {
    width: 100%;
    margin-top: 92px;
    padding: 24px 12px 32px 12px;
    background-color: #f6f9ff;
    display: flex;
    justify-content: center;
}

.hero-wrapper {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 14px 20px 14px;
    border-radius: 1.75rem;
    background: radial-gradient(circle at top, #1f8ed8 0, #0b1727 55%, #02060b 100%);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.hero-public-inner {
    max-width: 1120px;
    margin: 0 auto;
}

.hero-card {
    background-color: #ffffff;
    border-radius: 1.25rem;
    overflow: hidden;
}

.hero-card-left {
    padding: 2.2rem 2.2rem 2rem 2.2rem;
}

.hero-badge {
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .9rem;
}

.hero-badge i {
    font-size: 1rem;
}

.hero-public h1 {
    font-weight: 700;
    font-size: 2.2rem;
    line-height: 1.25;
    color: #0b1727;
}

@media (min-width: 992px) {
    .hero-public h1 {
        font-size: 2.6rem;
    }
}

.hero-public p.lead {
    font-size: 1.02rem;
    color: #4a5568;
}

.hero-highlight {
    color: #21b995;
}

.hero-quick-metrics {
    margin-top: 1.4rem;
}

.hero-quick-metrics .metric {
    font-size: .85rem;
    color: #4a5568;
}

.hero-quick-metrics .metric span {
    display: block;
    font-weight: 700;
    color: #0b1727;
    font-size: 1rem;
}

.hero-public .btn-primary {
    background: linear-gradient(90deg, #1977cc, #21b995);
    border: none;
}

.hero-public .btn-outline-dark {
    border-radius: 999px;
}

.hero-card-right {
    background: radial-gradient(circle at top, #0f172a 0, #020617 80%);
    color: #e5e7eb;
    padding: 1.8rem 1.8rem 1.6rem 1.8rem;
}

.hero-card-right-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}

.hero-card-right-header span {
    font-size: .8rem;
    opacity: .8;
}

.hero-card-right-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .3rem;
}

.hero-mini-carousel {
    margin-top: .75rem;
}

.hero-mini-pill {
    border-radius: .75rem;
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: .6rem .75rem;
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .8rem;
    margin-bottom: .5rem;
}

.hero-mini-pill i {
    color: #21b995;
}

.hero-card-right-footer {
    margin-top: 1.2rem;
    font-size: .75rem;
    opacity: .75;
}

.public-main {
    background-color: #f6f9ff;
}

@media (max-width: 991.98px) {
    .hero-card {
        margin: 0 .25rem;
    }
    .hero-card-left {
        padding: 1.8rem 1.6rem 1.6rem 1.6rem;
    }
    .hero-card-right {
        padding: 1.4rem 1.4rem 1.3rem 1.4rem;
    }
}

/* ================================
   Customer dashboard KPI cards
   ================================ */

/* Container */
.customer-dashboard .dashboard {
  position: relative;
}

/* KPI cards base */
.customer-dashboard .dashboard .card.sib-kpi-card {
  position: relative;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(16, 24, 40, 0.08);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 6px 14px rgba(16, 24, 40, 0.10);
  overflow: hidden;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

/* Subtle top accent */
.customer-dashboard .dashboard .card.sib-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--sib-kpi-accent, #5d7fb0),
    rgba(93, 127, 176, 0.35)
  );
}

/* Hover state */
.customer-dashboard .dashboard .card.sib-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 10px rgba(16, 24, 40, 0.12),
    0 12px 22px rgba(16, 24, 40, 0.14);
}

/* Remove any default outline */
.customer-dashboard .dashboard .card {
  outline: none !important;
}

/* ================================
   Accent colors (mais suaves)
   ================================ */

.customer-dashboard .dashboard .card.sib-kpi-card.sib-accent-blue   { --sib-kpi-accent: #5d7fb0; }
.customer-dashboard .dashboard .card.sib-kpi-card.sib-accent-green  { --sib-kpi-accent: #6aa88a; }
.customer-dashboard .dashboard .card.sib-kpi-card.sib-accent-amber  { --sib-kpi-accent: #c7a15b; }
.customer-dashboard .dashboard .card.sib-kpi-card.sib-accent-purple { --sib-kpi-accent: #7a79b6; }
.customer-dashboard .dashboard .card.sib-kpi-card.sib-accent-red    { --sib-kpi-accent: #c77676; }
.customer-dashboard .dashboard .card.sib-kpi-card.sib-accent-slate  { --sib-kpi-accent: #6b7a8b; }

/* ================================
   Acessibilidade
   ================================ */
@media (prefers-reduced-motion: reduce) {
  .customer-dashboard .dashboard .card.sib-kpi-card {
    transition: none;
  }

  .customer-dashboard .dashboard .card.sib-kpi-card:hover {
    transform: none;
  }
}

/* ================================
   Global Card Styling (MatDash)
   Arredondamento consistente em todas as views
   ================================ */

/* All cards: consistent rounded corners */
.card {
    border-radius: 0.875rem !important;
    border: none;
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Card headers and footers inherit corner radius */
.card > .card-header:first-child {
    border-top-left-radius: 0.875rem;
    border-top-right-radius: 0.875rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card > .card-footer:last-child {
    border-bottom-left-radius: 0.875rem;
    border-bottom-right-radius: 0.875rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Tables inside cards */
.card .table {
    margin-bottom: 0;
}

.card .table-responsive {
    border-radius: 0;
}

/* Icon bubbles in info-cards: rounded instead of circle */
.card.info-card .card-icon {
    border-radius: 0.75rem !important;
}

/* ================================
   Admin Dashboard KPI Cards
   MatDash-style info-cards
   ================================ */

/* Base info-card styling */
.dashboard .info-card {
    padding-bottom: 0;
}

.dashboard .info-card h6 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #012970;
}

.dashboard .info-card .card-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
}

/* KPI Card Colors - SIBERTEX palette */
.dashboard .contracts-active-card .card-icon {
    color: #4154f1;
    background: #f0f2ff;
}

.dashboard .contracts-terminated-card .card-icon {
    color: #6c757d;
    background: #f4f4f4;
}

.dashboard .rent-card .card-icon {
    color: #2eca6a;
    background: #e0f8e9;
}

.dashboard .penalties-card .card-icon {
    color: #ff771d;
    background: #ffecdf;
}

.dashboard .credits-card .card-icon {
    color: #0dcaf0;
    background: #e0f7fa;
}

.dashboard .balance-card .card-icon {
    color: #012970;
    background: #e6effb;
}

/* Balance variants */
.dashboard .balance-card.has-debt .card-icon {
    color: #dc3545;
    background: #fde8ea;
}

.dashboard .balance-card.is-balanced .card-icon {
    color: #198754;
    background: #e0f8e9;
}

/* Card hover effect */
.dashboard .info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* Snapshot badge */
.dashboard .snapshot-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: #f8f9fa;
    color: #6c757d;
}

/* ================================
   Admin Dashboard Charts
   ================================ */

.dashboard .chart-container {
    position: relative;
    min-height: 300px;
}

/* Reports card */
.dashboard .card-reports {
    min-height: 400px;
}

/* Top contracts table */
.dashboard .top-contracts-table th,
.dashboard .top-contracts-table td {
    vertical-align: middle;
    padding: 0.75rem;
}

.dashboard .top-contracts-table .contract-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #012970;
}

.dashboard .top-contracts-table .amount-positive {
    color: #dc3545;
    font-weight: 600;
}

.dashboard .top-contracts-table .amount-zero {
    color: #198754;
    font-weight: 600;
}

/* ================================
   Ledger Table (Conta Corrente)
   Subtle styling for readability
   ================================ */

/* Container with soft scroll */
.ledger-table-container {
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Base table styling */
.ledger-table {
    font-size: 0.85rem;
    color: #374151;
}

/* Header: subtle light gray background */
.ledger-table thead tr {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.ledger-table thead th {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.75rem;
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 1;
}

/* Body rows: zebra striping */
.ledger-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.ledger-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.ledger-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Cell padding */
.ledger-table td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}

/* Row type indicators - subtle left border only */
.ledger-table tbody tr.ledger-row-penalty {
    border-left: 3px solid #f59e0b;
}

.ledger-table tbody tr.ledger-row-payment {
    border-left: 3px solid #10b981;
}

.ledger-table tbody tr.ledger-row-adjustment {
    border-left: 3px solid #06b6d4;
}

.ledger-table tbody tr.ledger-row-settled {
    border-left: 3px solid #8b5cf6;
}

/* Balance column colors - subtle text only */
.ledger-table .ledger-balance-debt {
    color: #b91c1c;
}

.ledger-table .ledger-balance-zero {
    color: #047857;
}

.ledger-table .ledger-balance-credit {
    color: #0369a1;
}

/* Footer totals row */
.ledger-table tfoot tr.ledger-totals-row {
    background-color: #f1f5f9;
    border-top: 2px solid #e5e7eb;
}

.ledger-table tfoot td {
    padding: 0.75rem;
}

/* Icons in description column */
.ledger-table td i {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .ledger-table {
        font-size: 0.8rem;
    }
    
    .ledger-table thead th {
        font-size: 0.72rem;
        padding: 0.5rem;
    }
    
    .ledger-table td {
        padding: 0.5rem;
    }
}
