/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #eef2f7;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

body.login-page {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Login — glassmorphism (scoped to login page only) */
.login-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    overflow: hidden;
    background:
        linear-gradient(155deg, #0c1929 0%, #132f3d 38%, #0d3d3d 72%, #0a2520 100%);
}

.login-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 55% at 15% 20%, rgba(34, 211, 238, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 75%, rgba(45, 212, 191, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(14, 165, 233, 0.12) 0%, transparent 50%);
}

.login-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 44px 40px 40px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.12),
        0 24px 64px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: rgba(204, 251, 241, 0.98);
    filter: drop-shadow(0 2px 14px rgba(45, 212, 191, 0.4));
}

.login-usd-icon {
    width: 48px;
    height: 48px;
    display: block;
}

.login-header h1 {
    color: #f8fafc;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.login-header p {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.login-container .alert-error {
    background: rgba(254, 202, 202, 0.12);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Form Styles */
.login-form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-container .form-group label {
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-container .form-group input {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: #f1f5f9;
    padding: 14px 16px;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-container .form-group input::placeholder {
    color: rgba(148, 163, 184, 0.75);
}

.login-container .form-group input:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.42);
}

.login-container .form-group input:focus {
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
    background: rgba(15, 23, 42, 0.5);
}

.login-container .form-group input:-webkit-autofill,
.login-container .form-group input:-webkit-autofill:hover,
.login-container .form-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9;
    caret-color: #f1f5f9;
    box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.65) inset;
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.65) inset;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .login-box {
        background: rgba(17, 34, 48, 0.92);
    }
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-container .btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    border-radius: 12px;
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
}

.login-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(14, 165, 233, 0.35);
    filter: brightness(1.05);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-block {
    width: 100%;
}

/* Dashboard Styles */
.dashboard-container {
    height: 100vh;
    max-height: 100vh;
    background: #f5f7fa;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-info strong {
    color: #333;
    font-size: 14px;
}

.user-email {
    color: #666;
    font-size: 12px;
}

.dashboard-container > .dashboard-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.dashboard-toolbar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.dashboard-toolbar-brand {
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #1e293b;
}

.quick-stats-bar {
    width: 100%;
    min-width: 0;
}

.quick-stats-heading {
    color: #333;
    font-size: 11px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quick-stats-items {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 6px;
}

.quick-stats-divider {
    align-self: stretch;
    width: 1px;
    min-height: 36px;
    margin: 2px 4px;
    background: #e0e0e0;
    flex-shrink: 0;
}

.stat-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    min-width: 72px;
}

.stat-chip .stat-label {
    color: #666;
    font-size: 10px;
}

.stat-chip .stat-value {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.15;
}

.stat-chip--ac-share {
    min-width: 96px;
}

.stat-chip .stat-sub {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: #64748b;
}

.dashboard-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.dashboard-toolbar-actions .btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
}

.toolbar-user {
    color: #666;
    font-size: 13px;
    font-weight: 500;
    max-width: min(260px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.stat-label {
    color: #666;
    font-size: 13px;
}

.stat-value {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.dashboard-main {
    width: 100%;
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.dashboard-content {
    background: white;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-content .alert {
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
}

.welcome-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.welcome-section h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 8px;
}

.welcome-section p {
    color: #666;
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.dashboard-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.dashboard-card h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 8px;
}

.dashboard-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.dashboard-card .btn {
    width: 100%;
}

/* Clients Section Styles */
.clients-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* Search Bar */
.search-bar-container {
    margin-bottom: 8px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-input {
    flex: 1;
    padding: 6px 32px 6px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
    background-color: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.12);
}

.search-clear-btn {
    position: absolute;
    right: 6px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
    padding: 0;
}

.search-clear-btn:hover {
    background: #dc3545;
    color: white;
}

.account-filters {
    margin-bottom: 10px;
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 500;
    color: #333;
    font-size: 12px;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 5px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    background-color: white;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-block;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background-color: #f8f9fa;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.filter-btn.active:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
    color: white;
}

.filter-btn-special {
    margin-left: auto;
}

.filter-btn-special.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
}

.filter-btn-special.active:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

.section-header h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.client-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
    gap: 10px;
}

.table-options {
    display: flex;
    gap: 6px;
}

.btn-column-toggle {
    padding: 5px 10px;
    background: white;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-column-toggle:hover {
    border-color: #667eea;
    color: #667eea;
    background-color: #f8f9fa;
}

/* Column Visibility Menu */
.column-visibility-menu {
    position: absolute;
    top: 72px;
    right: 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    min-width: 200px;
    max-height: min(420px, 70vh);
    overflow-y: auto;
}

.column-menu-header {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-menu-header h4 {
    margin: 0;
    color: #333;
    font-size: 14px;
}

.column-menu-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.column-menu-header .close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.column-menu-body {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.column-menu-body label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    padding: 4px 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.column-menu-body label:hover {
    background-color: #f8f9fa;
}

.column-menu-body input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.clients-table th {
    user-select: none;
}

.clients-table th.resizing {
    background: rgba(255, 255, 255, 0.1);
}

/* Tabs Styles */
.tabs-container {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.tab-button {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-button:hover {
    color: #667eea;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: #f8f9fa;
}

.tab-count {
    background: #e0e0e0;
    color: #666;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.tab-button.active .tab-count {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

.table-container {
    overflow: auto;
    overflow-anchor: none;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
    position: relative;
}

.clients-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

.clients-table thead {
    background: #667eea;
    color: white;
}

/* Sticky header row + sticky Client Name column (scroll inside .table-container) */
.clients-table thead th {
    position: sticky;
    top: 0;
    z-index: 35;
    padding: 7px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    user-select: none;
    background: #667eea;
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.clients-table thead th[data-column="0"] {
    left: 0;
    z-index: 45;
    text-align: left;
    box-shadow:
        inset 0 -1px 0 rgba(0, 0, 0, 0.08),
        2px 0 8px rgba(0, 0, 0, 0.12);
}

.clients-table tbody td.client-name {
    position: sticky;
    left: 0;
    z-index: 25;
    min-width: 9rem;
    background-color: #ffffff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}

.clients-table tfoot .table-totals-row td[data-column="0"] {
    position: sticky;
    left: 0;
    z-index: 28;
    min-width: 9rem;
    background-color: #f8f9fa;
    color: #667eea;
    font-weight: 700;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    vertical-align: middle;
}

.clients-table tbody tr:hover td.client-name {
    background-color: #f8f9fa;
}

.clients-table tbody tr.row-urgent td.client-name {
    background-color: #fff3cd;
}

.clients-table tbody tr.row-urgent:hover td.client-name {
    background-color: #ffe69c;
}

.clients-table tbody tr.row-normal td.client-name {
    background-color: #d4edda;
}

.clients-table tbody tr.row-normal:hover td.client-name {
    background-color: #c3e6cb;
}

.clients-table tbody tr.row-overdue td.client-name {
    background-color: #f8d7da;
}

.clients-table tbody tr.row-overdue:hover td.client-name {
    background-color: #f5c6cb;
}

.clients-table th span {
    display: inline-block;
    padding-right: 4px;
}

.clients-table th:last-child .resize-handle {
    display: none;
}

.clients-table th:first-child {
    text-align: left;
}

.clients-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.clients-table tbody tr:hover {
    background-color: #f8f9fa;
}

.clients-table tbody tr.row-urgent {
    background-color: #fff3cd;
}

.clients-table tbody tr.row-urgent:hover {
    background-color: #ffe69c;
}

.clients-table tbody tr.row-normal {
    background-color: #d4edda;
}

.clients-table tbody tr.row-normal:hover {
    background-color: #c3e6cb;
}

.clients-table tbody tr.row-overdue {
    background-color: #f8d7da;
}

.clients-table tbody tr.row-overdue:hover {
    background-color: #f5c6cb;
}

/* Paused / Cancelled tabs: single flat row color only (no urgency or cancellation-alert styling) */
#tab-paused .clients-table tbody tr.row-paused-tab {
    background-color: #fffbeb;
}

#tab-paused .clients-table tbody tr.row-paused-tab:hover {
    background-color: #fef3c7;
}

#tab-paused .clients-table tbody tr.row-paused-tab td.client-name {
    background-color: #fff7d6;
}

#tab-paused .clients-table tbody tr.row-paused-tab:hover td.client-name {
    background-color: #fde68a;
}

#tab-cancelled .clients-table tbody tr.row-cancelled-tab {
    background-color: #fef2f2;
}

#tab-cancelled .clients-table tbody tr.row-cancelled-tab:hover {
    background-color: #fee2e2;
}

#tab-cancelled .clients-table tbody tr.row-cancelled-tab td.client-name {
    background-color: #ffe4e6;
}

#tab-cancelled .clients-table tbody tr.row-cancelled-tab:hover td.client-name {
    background-color: #fecdd3;
}

/* Cancellation/Pause — paint on TDs: <tr> background/animation is often invisible behind cells in browsers */
.clients-table tbody tr.row-cancellation-pause-alert {
    box-shadow: inset 0 0 0 1px rgba(254, 202, 202, 0.45);
}

.clients-table tbody tr.row-cancellation-pause-alert:hover {
    filter: brightness(1.05);
}

.clients-table tbody tr.row-cancellation-pause-alert > td {
    animation: billing-row-flash-red 1.2s ease-in-out infinite;
    background-color: #5c1010;
    color: #fef2f2 !important;
}

/* Beat generic gray row hover (.clients-table tbody tr:hover) on each cell */
.clients-table tbody tr.row-cancellation-pause-alert:hover > td {
    animation: billing-row-flash-red 1.2s ease-in-out infinite;
    color: #fef2f2 !important;
}

@media (prefers-reduced-motion: reduce) {
    .clients-table tbody tr.row-cancellation-pause-alert > td {
        animation: none;
        background-color: #6b1212 !important;
    }
}

.clients-table tbody tr.row-cancellation-pause-alert .client-name {
    color: #ffffff;
    font-weight: 600;
}

.clients-table tbody tr.row-cancellation-pause-alert .days-overdue {
    color: #fecaca;
}

.clients-table tbody tr.row-cancellation-pause-alert .status-badge {
    filter: saturate(1.1) brightness(1.15);
}

.clients-table tbody tr.row-cancellation-pause-alert .amount-value.amount-badge {
    color: #fef2f2;
    border-color: rgba(254, 242, 242, 0.45);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.clients-table tbody tr.row-cancellation-pause-alert .amount-value.amount-badge:hover {
    filter: brightness(1.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.55);
}

.clients-table tbody tr.row-cancellation-pause-alert .missing-warning {
    color: #fecaca;
}

@keyframes billing-row-flash-red {
    0%, 100% {
        background-color: #5c1010;
    }
    50% {
        background-color: #7f1515;
    }
}

.clients-table tbody tr:last-child {
    border-bottom: none;
}

.clients-table td {
    padding: 7px 8px;
    font-size: 12px;
    color: #333;
    text-align: center;
    position: relative;
    overflow: visible;
}

.clients-table td:first-child {
    text-align: left !important;
}

.client-name {
    font-weight: 500;
    color: #667eea;
    text-align: left !important;
}

.clients-table th:first-child,
.clients-table td:first-child {
    text-align: left !important;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.days-overdue {
    color: #dc3545;
    font-weight: 500;
}

.actions-cell {
    text-align: center;
    white-space: nowrap;
    position: relative;
    width: 100px;
}

.action-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.btn-dropdown {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #667eea;
    color: white;
    display: inline-block;
    width: auto;
    min-width: 84px;
}

.btn-dropdown:hover {
    background-color: #5568d3;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.dropdown-menu {
    display: none !important;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    min-width: 176px;
    max-width: 200px;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.dropdown-menu form {
    margin: 0 !important;
    display: block !important;
    width: 100% !important;
    float: none !important;
}

.dropdown-item {
    width: 100% !important;
    padding: 7px 10px;
    border: none;
    background: none;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
    display: block !important;
    border-bottom: 1px solid #f0f0f0;
    box-sizing: border-box;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.btn-paid-item {
    color: #28a745;
}

.btn-paid-item:hover {
    background-color: #d4edda;
    color: #155724;
}

.btn-refused-item {
    color: #dc3545;
}

.btn-refused-item:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-failed-item {
    color: #ffc107;
}

.btn-failed-item:hover {
    background-color: #fff3cd;
    color: #856404;
}

.btn-resumed-item {
    color: #007bff;
}

.btn-resumed-item:hover {
    background-color: #cce5ff;
    color: #004085;
}

.btn-paused-item {
    color: #6c757d;
}

.btn-paused-item:hover {
    background-color: #e9ecef;
    color: #495057;
}

.btn-scheduled-item {
    color: #ff9800;
}

.btn-scheduled-item:hover {
    background-color: #fff3e0;
    color: #e65100;
}

/* Comments Styles */
.comments-cell {
    text-align: center !important;
    white-space: nowrap;
}

.btn-comments {
    padding: 4px 8px !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    background-color: #17a2b8 !important;
    color: white !important;
    display: inline-block !important;
    text-decoration: none !important;
    width: auto !important;
}

.btn-comments:hover {
    background-color: #138496 !important;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none !important;
    position: fixed !important;
    z-index: 2000 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.modal[style*="block"] {
    display: block !important;
}

/* App alert/confirm/prompt replacements must sit above feature modals (same base z-index, later DOM wins). */
#appAlertModal.modal[style*="block"],
#appConfirmModal.modal[style*="block"],
#amountEditModal.modal[style*="block"] {
    z-index: 5000 !important;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 12px 14px;
    overflow-y: auto;
    flex: 1;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.comment-item {
    padding: 12px;
    margin-bottom: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    position: relative;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-date {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.btn-delete-comment {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-delete-comment:hover {
    opacity: 1;
    background: #c82333;
    transform: scale(1.1);
}

.comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.no-comments {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.error {
    color: #dc3545;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
}

.add-comment-section {
    margin-top: 20px;
}

.add-comment-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.add-comment-section textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.add-comment-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.add-comment-section .btn {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
}

.modal .btn {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 5px;
}

.missing-warning {
    color: #dc3545;
    font-weight: 500;
}

/* Status Badge Styles */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-paused {
    background-color: #fff3cd;
    color: #856404;
}

.status-cancellation-notice {
    background-color: #f8d7da;
    color: #721c24;
}

.status-cancelled {
    background-color: #f5c6cb;
    color: #721c24;
}

.status-onboarding {
    background-color: #cce5ff;
    color: #004085;
}

/* Progress Bar Styles */
.progress-bar {
    position: relative;
    width: 100%;
    height: 18px;
    background-color: #e9ecef;
    border-radius: 9px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 600;
    color: #333;
    z-index: 1;
}

.no-clients {
    text-align: center;
    padding: 24px 16px;
    color: #666;
    font-size: 13px;
}

/* Hidden Column */
.hidden-column {
    display: none !important;
}

.clients-table tbody td.hidden-column {
    display: none !important;
}

.clients-table thead th.hidden-column {
    display: none !important;
}

/* Trial Days Button */
.btn-trial-days {
    padding: 4px 8px;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    background-color: #f8f9fa;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-trial-days.enabled {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-trial-days.enabled:hover {
    background-color: #5568d3;
    border-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-trial-days.disabled {
    background-color: #e0e0e0;
    color: #999;
    border-color: #d0d0d0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Amount Button and Value Styles — pill badges below */
/* Amount column: pill badges */
.amount-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.12) 100%);
    color: #4c51bf;
    border: 1px solid rgba(102, 126, 234, 0.35);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

.amount-badge--total {
    padding: 5px 12px;
    font-size: 13px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.amount-value.amount-badge {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.amount-value.amount-badge:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.35);
    transform: translateY(-1px);
}

.btn-add-amount {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(102, 126, 234, 0.12);
    color: #5568d3;
    border: 1px dashed rgba(102, 126, 234, 0.5);
}

.btn-add-amount:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-style: solid;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.btn-add-phone {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(102, 126, 234, 0.12);
    color: #5568d3;
    border: 1px dashed rgba(102, 126, 234, 0.5);
}

.btn-add-phone:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-style: solid;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.amount-cell {
    min-width: 84px;
    vertical-align: middle;
}

/* Escalation Styles */
.escalation-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.escalation-content {
    margin-top: 10px;
}

.escalation-field {
    margin-bottom: 10px;
    padding: 8px;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.escalation-field strong {
    color: #333;
    display: inline-block;
    min-width: 140px;
    margin-right: 10px;
}

.escalation-field .status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.escalation-field .status-badge.status-open {
    background-color: #fff3cd;
    color: #856404;
}

.escalation-field .status-badge.status-closed {
    background-color: #d4edda;
    color: #155724;
}

/* Table Totals Row Styles */
.table-totals-row {
    background-color: #f8f9fa;
    border-top: 1px solid #667eea;
    font-weight: bold;
}

.table-totals-row td {
    padding: 6px 8px;
    border-top: 1px solid #667eea;
    font-size: 12px;
}

.table-totals-row td:first-child {
    font-size: 12px;
    color: #667eea;
}

.table-totals-row td strong {
    color: #333;
    font-size: 12px;
}

.trial-days-cell {
    min-width: 120px;
}

/* Loading Spinner Modal */
.loading-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.loading-modal-content {
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 250px;
}

.loading-text {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Spinner Animation */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-main {
        padding: 10px 12px;
    }
    
    .clients-table th,
    .clients-table td {
        padding: 6px 6px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .login-box {
        padding: 32px 22px 28px;
        max-width: 100%;
        margin: 0;
        border-radius: 20px;
    }

    .login-container {
        padding: 16px;
    }
    
    .dashboard-container {
        position: relative;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .dashboard-container > .dashboard-main {
        flex: none;
        min-height: 0;
        overflow: visible;
    }
    
    .dashboard-main {
        width: 100%;
        padding: 8px 10px 12px 10px;
        margin-left: 0;
        flex: none;
        min-height: 0;
        overflow: visible;
    }
    
    .dashboard-content {
        padding: 10px 12px;
        height: auto;
        max-height: none;
        flex: none;
        overflow: visible;
    }

    .clients-section {
        flex: none;
        min-height: 0;
        overflow: visible;
    }

    .tab-content.active {
        flex: none;
        min-height: 0;
        overflow: visible;
    }

    .table-container {
        flex: none;
        max-height: none;
        min-height: 0;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    .dashboard-toolbar {
        gap: 10px;
        padding-bottom: 10px;
    }

    .dashboard-toolbar-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .dashboard-title {
        font-size: 1.2rem;
    }

    .dashboard-toolbar-actions {
        justify-content: space-between;
        width: 100%;
    }

    .toolbar-user {
        max-width: none;
        text-align: left;
    }
    
    .quick-stats-items {
        gap: 6px;
    }
    
    .stat-chip {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 6px 8px;
    }
    
    .welcome-section h2 {
        font-size: 18px;
    }
    
    .welcome-section p {
        font-size: 12px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .section-header h3 {
        font-size: 15px;
    }
    
    .search-bar-container {
        margin-bottom: 8px;
    }
    
    .search-input {
        padding: 8px 36px 8px 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .account-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 10px;
    }
    
    .filter-label {
        font-size: 12px;
        width: 100%;
    }
    
    .filter-buttons {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .filter-btn {
        padding: 6px 10px;
        font-size: 12px;
        flex: 1;
        min-width: calc(33.333% - 6px);
        text-align: center;
    }
    
    .filter-btn-special {
        margin-left: 0;
        width: 100%;
        margin-top: 5px;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .tabs-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 4px;
        padding-bottom: 5px;
    }
    
    .tabs-container::-webkit-scrollbar {
        height: 4px;
    }
    
    .tabs-container::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 2px;
    }
    
    .tab-button {
        padding: 7px 12px;
        font-size: 12px;
        white-space: nowrap;
        min-width: fit-content;
        flex-shrink: 0;
    }
    
    .table-options {
        width: 100%;
        justify-content: flex-end;
    }
    
    .btn-column-toggle {
        padding: 6px 12px;
        font-size: 12px;
        width: auto;
    }
    
    .column-visibility-menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
    }
    
    .table-container {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
        position: relative;
        /* Add scroll snap for better mobile UX */
        scroll-snap-type: x mandatory;
    }
    
    .table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 3px;
    }
    
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #5568d3;
    }
    
    .table-container::after {
        content: '← Swipe to scroll →';
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(102, 126, 234, 0.9);
        color: white;
        padding: 8px 12px;
        font-size: 11px;
        border-radius: 20px;
        z-index: 5;
        pointer-events: none;
        animation: fadeOut 3s forwards;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    @keyframes fadeOut {
        0% { opacity: 1; }
        70% { opacity: 1; }
        100% { opacity: 0; }
    }
    
    .clients-table {
        min-width: 1000px;
        font-size: 13px;
    }
    
    .clients-table th {
        padding: 12px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .clients-table td {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .client-name {
        font-size: 13px;
        font-weight: 600;
    }
    
    .btn-dropdown {
        padding: 8px 12px;
        font-size: 11px;
        min-width: 80px;
    }
    
    .btn-comments {
        padding: 8px 12px !important;
        font-size: 11px !important;
        white-space: nowrap;
    }
    
    .btn-trial-days {
        padding: 8px 12px;
        font-size: 11px;
        white-space: normal;
        word-wrap: break-word;
        max-width: 120px;
    }
    
    .btn-add-amount {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .status-badge {
        padding: 4px 10px;
        font-size: 10px;
        white-space: nowrap;
    }
    
    /* Actions menu: JS moves .dropdown-menu to body on small screens + sets top/height; these defaults avoid clipping in-table */
    .dropdown-menu {
        position: fixed !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        min-width: 200px !important;
        z-index: 10000 !important;
        margin: 0 !important;
        transform: none !important;
        background-color: white !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 6px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .dropdown-menu.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure table container doesn't clip dropdowns */
    .table-container {
        overflow-x: auto;
        overflow-y: visible;
    }
    
    /* Make sure dropdown items are visible and clickable */
    .dropdown-item {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
        touch-action: manipulation;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10% auto;
        max-height: 85vh;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: calc(85vh - 100px);
    }
    
    .comments-list {
        max-height: 250px;
    }
    
    .comment-item {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .comment-text {
        font-size: 13px;
    }
    
    .add-comment-section textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .add-comment-section .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .table-totals-row td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .loading-modal-content {
        padding: 30px 40px;
        min-width: 200px;
        max-width: 90%;
    }
    
    .loading-text {
        font-size: 14px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 12px 8px 15px 8px;
    }
    
    .dashboard-content {
        padding: 12px;
    }
    
    .section-header h3 {
        font-size: 16px;
    }
    
    .search-input {
        padding: 12px 35px 12px 12px;
        font-size: 16px;
    }
    
    .filter-btn {
        min-width: calc(50% - 4px);
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .tab-button {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .tab-count {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .clients-table {
        min-width: 900px;
        font-size: 12px;
    }
    
    .clients-table th {
        padding: 10px 6px;
        font-size: 10px;
    }
    
    .clients-table td {
        padding: 10px 6px;
        font-size: 11px;
    }
    
    .client-name {
        font-size: 12px;
    }
    
    .btn-dropdown {
        padding: 6px 10px;
        font-size: 10px;
        min-width: 70px;
    }
    
    .btn-comments {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }
    
    .btn-trial-days {
        padding: 6px 10px;
        font-size: 10px;
        max-width: 100px;
    }
    
    .status-badge {
        padding: 3px 8px;
        font-size: 9px;
    }
    
    .modal-content {
        width: 98%;
        max-width: 98%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 12px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 12px;
        max-height: calc(90vh - 80px);
    }
    
    .comments-list {
        max-height: 200px;
    }
    
    .comment-item {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .comment-text {
        font-size: 12px;
    }
    
    .column-visibility-menu {
        width: 95%;
        max-width: 95%;
    }
    
    .column-menu-header {
        padding: 12px;
    }
    
    .column-menu-header h4 {
        font-size: 14px;
    }
    
    .column-menu-body {
        padding: 12px;
    }
    
    .column-menu-body label {
        font-size: 13px;
        padding: 8px;
    }
    
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .btn-dropdown,
    .btn-comments,
    .btn-trial-days,
    .btn-add-amount,
    .filter-btn,
    .tab-button {
        min-height: 44px; /* iOS recommended touch target */
    }
    
    .search-clear-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .dropdown-item {
        padding: 14px 16px;
        min-height: 44px;
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
    }
    
    .clients-table td {
        padding: 14px 8px; /* More padding for easier tapping */
    }
    
    .actions-cell {
        min-width: 100px;
    }
    
    .btn-dropdown {
        min-width: 90px;
        padding: 10px 14px;
    }
}

/* Additional mobile-specific improvements */
@media (max-width: 768px) {
    /* Improve button spacing in action cells */
    .actions-cell .action-dropdown {
        width: 100%;
        position: relative;
        z-index: 1;
    }
    
    /* Ensure dropdown button is touch-friendly */
    .btn-dropdown {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
        user-select: none;
        position: relative;
        z-index: 1;
    }
    
    /* Ensure dropdown menu appears above other elements */
    .action-dropdown {
        z-index: 1;
    }
    
    /* Prevent table from clipping dropdowns */
    .table-container {
        overflow-x: auto;
        overflow-y: visible;
        position: relative;
    }
    
    /* Ensure dropdowns are not clipped */
    .clients-table {
        position: relative;
    }
    
    .clients-table tbody tr {
        position: relative;
    }
    
    /* Better spacing for table rows on mobile */
    .clients-table tbody tr {
        border-bottom: 2px solid #f0f0f0;
    }
    
    /* Improve readability of numbers */
    .clients-table td.text-right,
    .clients-table td.text-center {
        font-weight: 500;
    }
    
    /* Make progress bars more visible on mobile */
    .progress-bar {
        height: 28px;
    }
    
    .progress-text {
        font-size: 12px;
    }
    
    /* Improve modal button spacing */
    .modal-body .btn {
        margin-top: 10px;
    }
    
    /* Better spacing for cycle option buttons in client paid modal */
    .cycle-option-btn {
        padding: 15px !important;
        margin-bottom: 10px;
    }
    
    /* Improve custom date input on mobile */
    #customStartDate {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        width: 100%;
    }
}

/* =============================================================================
   Billing dashboard dark theme — matches login page (glass + teal/cyan accents)
   ============================================================================= */
body.billing-dashboard {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #e2e8f0;
    background: #0c1929;
}

body.billing-dashboard .dashboard-container {
    position: relative;
    background: linear-gradient(155deg, #0c1929 0%, #132f3d 38%, #0d3d3d 72%, #0a2520 100%);
    overflow: hidden;
}

body.billing-dashboard .dashboard-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 55% at 15% 20%, rgba(34, 211, 238, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 75%, rgba(45, 212, 191, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(14, 165, 233, 0.12) 0%, transparent 50%);
}

body.billing-dashboard .dashboard-container > .dashboard-main {
    position: relative;
    z-index: 1;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.billing-dashboard .dashboard-content {
        background: rgba(17, 34, 48, 0.92);
    }
}

body.billing-dashboard .dashboard-content {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        0 24px 64px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    color: #e2e8f0;
}

body.billing-dashboard .dashboard-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    overflow: visible;
}

body.billing-dashboard .dashboard-title {
    color: #f8fafc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.billing-dashboard .quick-stats-heading,
body.billing-dashboard .section-header h3 {
    color: rgba(248, 250, 252, 0.92);
}

body.billing-dashboard .stat-chip {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(255, 255, 255, 0.12);
}

body.billing-dashboard .stat-chip .stat-label {
    color: rgba(148, 163, 184, 0.95);
}

body.billing-dashboard .stat-chip .stat-value {
    color: #5eead4;
}

body.billing-dashboard .stat-chip .stat-sub {
    color: rgba(148, 220, 200, 0.95);
}

body.billing-dashboard .quick-stats-items {
    overflow: visible;
}

body.billing-dashboard .quick-stats-divider {
    background: rgba(255, 255, 255, 0.18);
}

body.billing-dashboard .stat-chip--turnover {
    position: relative;
    overflow: visible;
}

body.billing-dashboard .turnover-cohort-popup {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 600;
    min-width: min(360px, 92vw);
    max-width: min(440px, 94vw);
    max-height: min(480px, 60vh);
    overflow: auto;
    padding: 10px 12px 12px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

body.billing-dashboard .stat-chip--turnover:hover .turnover-cohort-popup,
body.billing-dashboard .stat-chip--turnover:focus-within .turnover-cohort-popup {
    display: block;
}

body.billing-dashboard .turnover-cohort-popup__meta {
    margin: 0 0 10px;
    color: rgba(203, 213, 225, 0.95);
    font-size: 10px;
}

body.billing-dashboard .turnover-cohort-popup__meta strong {
    color: #5eead4;
}

body.billing-dashboard .turnover-cohort-popup__section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.billing-dashboard .turnover-cohort-popup__section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

body.billing-dashboard .turnover-cohort-popup__title {
    font-weight: 600;
    color: #a5f3fc;
    margin-bottom: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.billing-dashboard .turnover-cohort-popup__list {
    margin: 0;
    padding-left: 1.1rem;
    color: #cbd5e1;
}

body.billing-dashboard .turnover-cohort-popup__list li {
    margin-bottom: 2px;
}

body.billing-dashboard .turnover-cohort-popup__empty {
    margin: 0;
    color: rgba(148, 163, 184, 0.85);
    font-style: italic;
}

body.billing-dashboard .toolbar-user {
    color: rgba(226, 232, 240, 0.75);
}

body.billing-dashboard .dashboard-toolbar-actions .btn {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
}

body.billing-dashboard .dashboard-toolbar-actions .btn:hover {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(45, 212, 191, 0.45);
}

body.billing-dashboard .dashboard-content .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

body.billing-dashboard .dashboard-content .alert-error {
    background: rgba(254, 202, 202, 0.1);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

body.billing-dashboard .search-input {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
}

body.billing-dashboard .search-input::placeholder {
    color: rgba(148, 163, 184, 0.75);
}

body.billing-dashboard .search-input:focus {
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

body.billing-dashboard .search-clear-btn {
    background: rgba(51, 65, 85, 0.8);
    color: #cbd5e1;
}

body.billing-dashboard .account-filters {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.billing-dashboard .filter-label {
    color: rgba(226, 232, 240, 0.85);
}

body.billing-dashboard .filter-btn {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

body.billing-dashboard .filter-btn:hover {
    border-color: rgba(45, 212, 191, 0.45);
    color: #5eead4;
    background: rgba(15, 23, 42, 0.7);
}

body.billing-dashboard .filter-btn.active {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

body.billing-dashboard .filter-btn-special.active {
    background: linear-gradient(135deg, #059669 0%, #14b8a6 100%);
    border-color: rgba(52, 211, 153, 0.4);
}

body.billing-dashboard .btn-column-toggle {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

body.billing-dashboard .btn-column-toggle:hover {
    border-color: rgba(45, 212, 191, 0.45);
    color: #5eead4;
    background: rgba(15, 23, 42, 0.75);
}

body.billing-dashboard .tabs-container {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.billing-dashboard .tab-button {
    color: rgba(148, 163, 184, 0.95);
}

body.billing-dashboard .tab-button:hover {
    color: #5eead4;
    background: rgba(15, 23, 42, 0.4);
}

body.billing-dashboard .tab-button.active {
    color: #5eead4;
    border-bottom-color: #2dd4bf;
    background: rgba(15, 23, 42, 0.35);
}

body.billing-dashboard .tab-count {
    background: rgba(51, 65, 85, 0.9);
    color: #cbd5e1;
}

body.billing-dashboard .tab-button.active .tab-count {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    color: #f8fafc;
}

body.billing-dashboard .table-container {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.25);
}

body.billing-dashboard .clients-table {
    background: transparent;
}

body.billing-dashboard .clients-table thead {
    background: #0d9488;
    color: #f8fafc;
}

body.billing-dashboard .clients-table thead th {
    background: #0d9488;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.billing-dashboard .clients-table thead th[data-column="0"] {
    box-shadow:
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        2px 0 12px rgba(0, 0, 0, 0.45);
}

body.billing-dashboard .clients-table tbody td.client-name {
    background-color: rgba(15, 23, 42, 0.97);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
}

body.billing-dashboard .clients-table tbody tr:hover td.client-name {
    background-color: rgba(30, 41, 59, 0.98);
}

body.billing-dashboard .clients-table tbody tr.row-urgent td.client-name {
    background-color: rgba(234, 179, 8, 0.2);
}

body.billing-dashboard .clients-table tbody tr.row-urgent:hover td.client-name {
    background-color: rgba(234, 179, 8, 0.28);
}

body.billing-dashboard .clients-table tbody tr.row-normal td.client-name {
    background-color: rgba(34, 197, 94, 0.16);
}

body.billing-dashboard .clients-table tbody tr.row-normal:hover td.client-name {
    background-color: rgba(34, 197, 94, 0.24);
}

body.billing-dashboard .clients-table tbody tr.row-overdue td.client-name {
    background-color: rgba(239, 68, 68, 0.18);
}

body.billing-dashboard .clients-table tbody tr.row-overdue:hover td.client-name {
    background-color: rgba(239, 68, 68, 0.26);
}

body.billing-dashboard .clients-table tfoot .table-totals-row td[data-column="0"] {
    background-color: rgba(15, 23, 42, 0.95);
    color: #5eead4;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
}

body.billing-dashboard .clients-table tbody tr {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.billing-dashboard .clients-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

body.billing-dashboard .clients-table td {
    color: #e2e8f0;
}

body.billing-dashboard .client-name {
    color: #7dd3fc;
}

body.billing-dashboard .client-name:hover {
    color: #a5f3fc;
}

body.billing-dashboard .clients-table tbody tr.row-urgent {
    background-color: rgba(234, 179, 8, 0.12);
}

body.billing-dashboard .clients-table tbody tr.row-urgent:hover {
    background-color: rgba(234, 179, 8, 0.18);
}

body.billing-dashboard .clients-table tbody tr.row-normal {
    background-color: rgba(34, 197, 94, 0.1);
}

body.billing-dashboard .clients-table tbody tr.row-normal:hover {
    background-color: rgba(34, 197, 94, 0.16);
}

body.billing-dashboard .clients-table tbody tr.row-overdue {
    background-color: rgba(239, 68, 68, 0.12);
}

body.billing-dashboard .clients-table tbody tr.row-overdue:hover {
    background-color: rgba(239, 68, 68, 0.18);
}

body.billing-dashboard #tab-paused .clients-table tbody tr.row-paused-tab {
    background-color: rgba(234, 179, 8, 0.2);
}

body.billing-dashboard #tab-paused .clients-table tbody tr.row-paused-tab:hover {
    background-color: rgba(234, 179, 8, 0.3);
}

body.billing-dashboard #tab-paused .clients-table tbody tr.row-paused-tab td.client-name {
    background-color: rgba(234, 179, 8, 0.28);
}
body.billing-dashboard #tab-paused .clients-table tbody tr.row-paused-tab:hover td.client-name {
    background-color: rgba(234, 179, 8, 0.38);
}

body.billing-dashboard #tab-cancelled .clients-table tbody tr.row-cancelled-tab {
    background-color: rgba(239, 68, 68, 0.16);
}

body.billing-dashboard #tab-cancelled .clients-table tbody tr.row-cancelled-tab:hover {
    background-color: rgba(239, 68, 68, 0.26);
}

body.billing-dashboard #tab-cancelled .clients-table tbody tr.row-cancelled-tab td.client-name {
    background-color: rgba(239, 68, 68, 0.22);
}

body.billing-dashboard #tab-cancelled .clients-table tbody tr.row-cancelled-tab:hover td.client-name {
    background-color: rgba(239, 68, 68, 0.32);
}

body.billing-dashboard .days-overdue {
    color: #fca5a5;
}

body.billing-dashboard .btn-dropdown {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.billing-dashboard .btn-dropdown:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
}

body.billing-dashboard .dropdown-menu {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.billing-dashboard .dropdown-item {
    color: #e2e8f0;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.billing-dashboard .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

body.billing-dashboard .btn-paid-item {
    color: #4ade80;
}

body.billing-dashboard .btn-paid-item:hover {
    background-color: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

body.billing-dashboard .btn-refused-item {
    color: #f87171;
}

body.billing-dashboard .btn-refused-item:hover {
    background-color: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

body.billing-dashboard .btn-failed-item {
    color: #fbbf24;
}

body.billing-dashboard .btn-failed-item:hover {
    background-color: rgba(234, 179, 8, 0.12);
    color: #fde68a;
}

body.billing-dashboard .btn-resumed-item {
    color: #38bdf8;
}

body.billing-dashboard .btn-resumed-item:hover {
    background-color: rgba(14, 165, 233, 0.12);
    color: #7dd3fc;
}

body.billing-dashboard .btn-paused-item {
    color: #94a3b8;
}

body.billing-dashboard .btn-paused-item:hover {
    background-color: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

body.billing-dashboard .btn-scheduled-item {
    color: #fb923c;
}

body.billing-dashboard .btn-scheduled-item:hover {
    background-color: rgba(251, 146, 60, 0.12);
    color: #fdba74;
}

body.billing-dashboard .column-visibility-menu {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.billing-dashboard .column-menu-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.billing-dashboard .column-menu-header h4 {
    color: #f8fafc;
}

body.billing-dashboard .column-menu-header .close-btn {
    color: #94a3b8;
}

body.billing-dashboard .column-menu-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

body.billing-dashboard .column-menu-body label {
    color: #e2e8f0;
}

body.billing-dashboard .column-menu-body label:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.billing-dashboard .status-badge {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.billing-dashboard .status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

body.billing-dashboard .status-paused {
    background: rgba(234, 179, 8, 0.18);
    color: #fde047;
}

body.billing-dashboard .status-cancellation-notice {
    background: rgba(248, 113, 113, 0.15);
    color: #fecaca;
}

body.billing-dashboard .status-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.billing-dashboard .status-onboarding {
    background: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}

body.billing-dashboard .progress-bar {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.billing-dashboard .progress-fill {
    background: linear-gradient(90deg, #0d9488 0%, #0ea5e9 100%);
}

body.billing-dashboard .progress-text {
    color: #f1f5f9;
}

body.billing-dashboard .amount-badge {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.2) 0%, rgba(14, 165, 233, 0.14) 100%);
    color: #a5f3fc;
    border-color: rgba(45, 212, 191, 0.4);
}

body.billing-dashboard .amount-badge--total {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.35);
}

body.billing-dashboard .amount-value.amount-badge:hover {
    filter: brightness(1.08);
    color: #ecfeff;
    box-shadow: 0 2px 12px rgba(45, 212, 191, 0.35);
}

body.billing-dashboard .btn-trial-days {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

body.billing-dashboard .btn-trial-days.enabled {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

body.billing-dashboard .btn-add-amount {
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
    border: 1px dashed rgba(45, 212, 191, 0.45);
}

body.billing-dashboard .btn-add-amount:hover {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    color: #f8fafc;
    border-style: solid;
    border-color: transparent;
}

body.billing-dashboard .btn-add-phone {
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
    border: 1px dashed rgba(45, 212, 191, 0.45);
}

body.billing-dashboard .btn-add-phone:hover {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    color: #f8fafc;
    border-style: solid;
    border-color: transparent;
}

body.billing-dashboard .table-totals-row {
    background: rgba(15, 23, 42, 0.55);
    border-top-color: rgba(45, 212, 191, 0.35);
}

body.billing-dashboard .table-totals-row td {
    color: #e2e8f0;
    border-top-color: rgba(45, 212, 191, 0.35);
}

body.billing-dashboard .table-totals-row td:first-child {
    color: #5eead4;
}

body.billing-dashboard .no-clients {
    color: #94a3b8;
}

body.billing-dashboard .missing-warning {
    color: #fca5a5;
}

/* Modals & app overlays */
body.billing-dashboard .modal {
    background-color: rgba(2, 6, 23, 0.72) !important;
}

body.billing-dashboard .modal-content {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #e2e8f0;
}

body.billing-dashboard .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.billing-dashboard .modal-header h2 {
    color: #f8fafc;
}

body.billing-dashboard .modal-close {
    color: #94a3b8;
}

body.billing-dashboard .modal-close:hover {
    color: #f1f5f9;
}

body.billing-dashboard .modal-body {
    color: #cbd5e1;
}

body.billing-dashboard .comments-list {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.billing-dashboard .comment-item {
    background: rgba(15, 23, 42, 0.6);
    border-left-color: #2dd4bf;
}

body.billing-dashboard .comment-date {
    color: #94a3b8;
}

body.billing-dashboard .comment-text {
    color: #e2e8f0;
}

body.billing-dashboard .no-comments {
    color: #64748b;
}

body.billing-dashboard .add-comment-section h3 {
    color: #f1f5f9;
}

body.billing-dashboard .add-comment-section textarea {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
}

body.billing-dashboard .add-comment-section textarea:focus {
    border-color: rgba(45, 212, 191, 0.5);
    outline: none;
}

body.billing-dashboard .loading-modal {
    background-color: rgba(2, 6, 23, 0.75);
}

body.billing-dashboard .loading-modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

body.billing-dashboard .loading-text {
    color: #e2e8f0;
}

body.billing-dashboard .spinner {
    border-color: rgba(51, 65, 85, 0.8);
    border-top-color: #2dd4bf;
}

/* Primary / secondary buttons (dashboard + modals) */
body.billing-dashboard .btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.22);
}

body.billing-dashboard .btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 28px rgba(14, 165, 233, 0.32);
}

body.billing-dashboard .btn-secondary {
    background: rgba(51, 65, 85, 0.85);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.billing-dashboard .btn-secondary:hover {
    background: rgba(71, 85, 105, 0.95);
}

body.billing-dashboard .btn-info,
body.billing-dashboard .cycle-option-btn.btn-info {
    background: linear-gradient(135deg, #0891b2 0%, #0ea5e9 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

body.billing-dashboard #amountEditHint {
    color: rgba(203, 213, 225, 0.9) !important;
}

body.billing-dashboard #amountEditInput,
body.billing-dashboard #cancellationDate,
body.billing-dashboard #customStartDate,
body.billing-dashboard #pauseDate {
    background: rgba(15, 23, 42, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f1f5f9 !important;
    border-radius: 12px !important;
}

body.billing-dashboard #amountEditInput:focus,
body.billing-dashboard #cancellationDate:focus,
body.billing-dashboard #customStartDate:focus,
body.billing-dashboard #pauseDate:focus {
    border-color: rgba(45, 212, 191, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
    outline: none;
}

body.billing-dashboard #customDateSection {
    background: rgba(15, 23, 42, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.billing-dashboard #scheduleCancellationModal .modal-body p,
body.billing-dashboard #schedulePauseModal .modal-body p,
body.billing-dashboard #clientPaidModal .modal-body p {
    color: #cbd5e1 !important;
}

body.billing-dashboard #scheduleCancellationModal label,
body.billing-dashboard #schedulePauseModal label,
body.billing-dashboard #clientPaidModal label,
body.billing-dashboard #amountEditModal label {
    color: rgba(248, 250, 252, 0.9) !important;
}

body.billing-dashboard .escalation-field {
    background: rgba(15, 23, 42, 0.5);
    border-left-color: #2dd4bf;
}

body.billing-dashboard .escalation-field strong {
    color: #e2e8f0;
}

body.billing-dashboard .table-container::-webkit-scrollbar-thumb {
    background: rgba(45, 212, 191, 0.35);
}

body.billing-dashboard .table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
}

body.billing-dashboard .client-count {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    color: #f8fafc;
}

body.billing-dashboard .btn-comments {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.billing-dashboard .btn-comments:hover {
    filter: brightness(1.08);
}

body.billing-dashboard .loading {
    color: #94a3b8;
}

body.billing-dashboard .error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

body.billing-dashboard .escalation-item {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

body.billing-dashboard .modal .btn-secondary.cycle-option-btn {
    background: rgba(51, 65, 85, 0.9);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.billing-dashboard .modal .btn-primary.cycle-option-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Dark dashboard: allow full-page scroll on small screens (override overflow: hidden) */
@media (max-width: 768px) {
    body.billing-dashboard .dashboard-container {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none;
        overflow-x: hidden;
        overflow-y: visible;
    }
}
