html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

/* ------------------------------------------
   Global Modern SaaS Style Enhancements
-------------------------------------------*/
body {
    background: #f5f7fb;
}

/* Root flex container fills viewport */
#dashboard-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
#sidebar {
    width: 250px;
    background-color: #1f2937; /* Dark sidebar */
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

    #sidebar a.nav-link {
        color: #cbd5e1;
        border-radius: 8px;
        margin-bottom: 5px;
    }

        #sidebar a.nav-link:hover,
        #sidebar a.nav-link.active {
            background: linear-gradient(90deg, #3b82f6, #60a5fa);
            color: white;
        }

/* Main content container */
#main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* only main content scrolls */
    position: relative;
}

/* Floating logout button (top-right) */
#logout-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #3b82f6;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

    #logout-button:hover {
        opacity: 0.8;
    }

/* Main content scrollable */
#main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
    background-color: #f3f4f6;
}

/* Dashboard cards */
.dashboard-card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    background-color: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

#logout-button {
    background: linear-gradient(90deg, #3b82f6, #60a5fa); /* blue gradient */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

    #logout-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
/* Responsive sidebar */
@@media (max-width: 768px) {
    #sidebar {
        position: absolute;
        left: -260px;
        height: 100vh;
        transition: left 0.3s;
        z-index: 1000;
    }

        #sidebar.show {
            left: 0;
        }
}

.bg-purple {
    background-color: #6f42c1 !important;
    color: #fff !important;
}





/* ------------------------------------------
   Filter Card
-------------------------------------------*/
.filter-card {
    border: none;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

    .filter-card .form-control,
    .filter-card .form-select {
        min-width: 150px;
    }

/* ------------------------------------------
   Add Customer Button
-------------------------------------------*/
.modern-btn {
    border-radius: 8px;
    padding: 0.55rem 1.2rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

    .modern-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 14px rgba(0,123,255,0.25);
    }

/* Filters card spacing */
.card {
    border-radius: 12px;
}

.card-body {
    padding: 18px 24px;
}

/* Action buttons */
.btn-group .btn {
    border-radius: 6px !important;
    margin-right: 4px;
}

/* Table header */
table thead th {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Ensure buttons wrap neatly on mobile */
table td .d-flex.flex-wrap {
    justify-content: flex-start;
}

table td .btn {
    margin-bottom: 2px; /* small spacing between wrapped rows */
}

/* ------------------------------------------
   DataTable Controls — Modern Theme
-------------------------------------------*/
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: #374151;
}

.dataTables_wrapper .dataTables_length {
    padding: 1rem 0 0.5rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
}

    .dataTables_wrapper .dataTables_length select {
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 0.25rem 1.5rem 0.25rem 0.5rem;
        margin: 0 0.25rem;
        font-size: 0.8125rem;
        background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.5rem center/12px 12px;
        appearance: none;
        cursor: pointer;
    }

/* Hide default DataTable search (we use our own in filter bar) */
.dataTables_wrapper .dataTables_filter {
    display: none;
}

.dataTables_wrapper .dataTables_info {
    padding: 1rem 0 0.25rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
}

.dataTables_wrapper .dataTables_paginate {
    padding: 0.75rem 0 0.25rem 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
}

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.375rem 0.75rem;
        margin: 0;
        border-radius: 6px;
        border: 1px solid #e5e7eb !important;
        background: #fff !important;
        color: #374151 !important;
        font-size: 0.8125rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.15s ease;
    }

        .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
            background: #f3f4f6 !important;
            border-color: #d1d5db !important;
            color: #111827 !important;
        }

        .dataTables_wrapper .dataTables_paginate .paginate_button.current,
        .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
            background: #3b82f6 !important;
            border-color: #3b82f6 !important;
            color: #fff !important;
            font-weight: 600;
            box-shadow: 0 1px 3px rgba(59,130,246,0.3);
        }

        .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
            opacity: 0.4;
            cursor: default;
            pointer-events: none;
        }



/* ------------------------------------------
   Status Badges
-------------------------------------------*/
table .status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
}


.status-initial {
    background-color: #6c757d;
    color: #fff;
}

.status-invited {
    background-color: #0dcaf0;
    color: #000;
}

.status-onboarding {
    background-color: #ffc107;
    color: #000;
}

.status-mandate {
    background-color: #0d6efd;
    color: #fff;
}

.status-branding {
    background-color: #6f42c1;
    color: #fff;
}

.status-pending {
    background-color: #20c997;
    color: #fff;
}

.status-live {
    background-color: #198754;
    color: #fff;
}

.status-suspended {
    background-color: #dc3545;
    color: #fff;
}

.status-cancelled {
    background-color: #343a40;
    color: #fff;
}

/* ------------------------------------------
   Top Navbar
-------------------------------------------*/
#top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

#sidebarToggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background 0.2s;
}

    #sidebarToggle:hover {
        background: #f3f4f6;
    }

.topbar-title {
    font-size: 1rem;
    color: #1f2937;
}

.notif-bell {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #6b7280;
    transition: color 0.2s;
}

    .notif-bell:hover {
        color: #1f2937;
    }

.notif-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: -2px;
    border: 2px solid #fff;
}

/* Sidebar refinements */
#sidebar {
    position: relative;
    z-index: 1040;
    transition: transform 0.3s ease;
}

    #sidebar .nav-link {
        position: relative;
    }

        #sidebar .nav-link.active::before {
            content: '';
            position: absolute;
            left: -1rem;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 20px;
            background: #3b82f6;
            border-radius: 0 3px 3px 0;
        }

#sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

/* Sidebar overlay for mobile */
#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

    #sidebar-overlay.show {
        display: block;
    }

/* Main content area */
#main-content {
    padding: 1.5rem;
}

/* ------------------------------------------
   Stats Cards
-------------------------------------------*/
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon-total {
    background: #eff6ff;
    color: #3b82f6;
}

.stat-icon-live {
    background: #ecfdf5;
    color: #10b981;
}

.stat-icon-pending {
    background: #fff7ed;
    color: #f97316;
}

.stat-icon-onboarding {
    background: #faf5ff;
    color: #8b5cf6;
}

.stat-icon-danger {
    background: #fef2f2;
    color: #dc2626;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-count {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2937;
}

.stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ------------------------------------------
   Pipeline / Status Legend
-------------------------------------------*/
.pipeline-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.pipeline-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}
.pipeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pipeline-label {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
}
.pipeline-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    min-width: 1.5rem;
    text-align: center;
}
.pipeline-arrow {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
}

/* ------------------------------------------
   Filter Bar Compact
-------------------------------------------*/
.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}

    .filter-bar .form-select-sm,
    .filter-bar .form-control-sm {
        font-size: 0.8125rem;
    }

    .filter-bar .btn-sm {
        font-size: 0.8125rem;
    }

.filter-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

/* ------------------------------------------
   Table Refinements
-------------------------------------------*/
.table-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.modern-table {
    margin-bottom: 0;
}

    .modern-table thead th {
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: #6b7280;
        background: #f9fafb;
        border-bottom: 1px solid #e5e7eb !important;
        padding: 0.75rem 1rem !important;
        white-space: nowrap;
    }

    .modern-table tbody tr {
        transition: background 0.15s ease;
        border-bottom: 1px solid #f3f4f6;
    }

        .modern-table tbody tr:last-child {
            border-bottom: none;
        }

        .modern-table tbody tr:hover {
            background-color: #f8fafc !important;
        }

        .modern-table tbody tr td {
            padding: 0.7rem 1rem !important;
            vertical-align: middle;
            border: none;
        }

    /* Status badges - pill shape */
    .modern-table .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.2rem 0.75rem;
        border-radius: 20px;
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

        .modern-table .status-badge::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
            opacity: 0.6;
        }

    /* Responsive control column button */
    .modern-table tr.parent td:first-child .dt-control {
        background: #3b82f6;
        color: #fff;
    }

    .modern-table .dt-control {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border-radius: 4px;
        background: #f3f4f6;
        color: #6b7280;
        font-size: 0.75rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.15s ease;
    }

        .modern-table .dt-control:hover {
            background: #e5e7eb;
        }

/* Responsive modal styling */
.dt-responsive-modal .modal-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.dt-responsive-modal .modal-body {
    padding: 0.75rem 1rem;
}

/* Email link */
.email-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
}

    .email-link:hover {
        text-decoration: underline;
    }

/* Price display */
.price-display {
    font-weight: 600;
    color: #059669;
    font-size: 0.875rem;
}

.price-display-muted {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* ID column */
.id-col {
    color: #9ca3af;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
}

/* Action buttons group */
.action-group {
    display: flex;
    gap: 0.35rem;
}

    .action-group .btn {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 8px !important;
        font-size: 0.85rem;
        transition: all 0.15s ease;
    }

        .action-group .btn:hover {
            transform: translateY(-1px);
        }

/* ------------------------------------------
   Modal Refinements
-------------------------------------------*/
.form-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

    .form-section-title:first-child {
        margin-top: 0;
    }

.modern-modal .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
}

.modern-modal .modal-body {
    padding: 1.25rem;
}

.modern-modal .modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 0.75rem 1.25rem;
}

.modern-modal .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.modern-modal .form-control,
.modern-modal .form-select {
    font-size: 0.875rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
}

    .modern-modal .form-control:focus,
    .modern-modal .form-select:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    }

.modern-modal textarea.form-control {
    min-height: 80px;
}

/* ------------------------------------------
   Responsive
-------------------------------------------*/
@media (max-width: 991.98px) {
    #sidebarToggle {
        display: inline-flex;
    }

    #sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        transition: left 0.3s ease;
    }

        #sidebar.show {
            left: 0;
        }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

/* Modal full-screen on mobile */
@media (max-width: 575.98px) {
    .modern-modal .modal-dialog {
        margin: 0;
    }

    .modern-modal .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }
}

/* Billing Dashboard KPI sections */
.kpi-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.stat-sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.stat-count.is-warning { color: #d97706; }
.stat-count.is-danger  { color: #dc2626; }
.stat-count.is-success { color: #16a34a; }

.reveal-up {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-up.is-visible {
    opacity: 1;
    transform: none;
}

/* Billing Dashboard full-page loader */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(248, 250, 252, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.35s ease;
}
.page-loader--hidden {
    opacity: 0;
    pointer-events: none;
}
.page-loader__content {
    text-align: center;
}
.page-loader__text {
    margin-top: 0.9rem;
    font-weight: 600;
    color: #334155;
}

/* ------------------------------------------
   Onboarding Guide
-------------------------------------------*/
.guide-nav {
    position: sticky;
    top: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 1.25rem;
}

.guide-nav .nav-link {
    color: #4b5563;
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    margin-bottom: 2px;
}

.guide-nav .nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.guide-nav .nav-link.active {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    color: #fff;
}

.guide-section {
    scroll-margin-top: 1.25rem;
}

.guide-step {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.guide-step-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #eff6ff;
    color: #3b82f6;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.guide-fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.guide-fact {
    background: #f8fafc;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.guide-fact-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.guide-fact-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

@media (max-width: 991.98px) {
    .guide-nav {
        position: static;
    }
}
