/* Notification Settings/WhatsApp Settings custom layout */
.settings-page {
    background: none;
}
.settings-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px var(--shadow);
}
.settings-actions {
    gap: 1rem;
}
.channel-option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: center;
}
.channel-option-card {
    min-width: 120px;
    min-height: 80px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 0.6rem;
    box-shadow: 0 1px 4px var(--shadow);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}
.channel-option-card.is-selected {
    border-color: #dc2626;
    box-shadow: 0 2px 8px #dc2626333;
}
.option-card input[type="checkbox"] {
    accent-color: #dc2626;
    margin-bottom: 0.5rem;
}
.form-row-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem 0.8rem;
}
@media (max-width: 768px) {
    .settings-container {
        padding: 0 0.5rem;
    }
    .form-row-grid {
        flex-direction: column;
        gap: 0.7rem 0;
    }
    .settings-card {
        padding: 0.5rem;
    }
}
/* Modern gradient theme with sleek design */
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #f5c451;
    --accent: #d4a017;
    --bg-dark: #0b0f19;
    --bg-darker: #05070d;
    --bg-card: #111827;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #2a3244;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-shell {
    background: radial-gradient(circle at top left, #0b1e33 0%, var(--bg-dark) 38%, var(--bg-darker) 100%);
    color: var(--text-primary);
}

.app-topbar {
    background: linear-gradient(180deg, rgba(8, 14, 26, 0.96) 0%, rgba(6, 11, 20, 0.92) 100%) !important;
    border-bottom: 1px solid rgba(212, 160, 23, 0.45);
}

.app-topbar .navbar-brand {
    color: #f8d47a;
    letter-spacing: 0.2px;
}

.app-sidebar {
    background: linear-gradient(180deg, rgba(8, 12, 22, 0.95) 0%, rgba(9, 14, 26, 0.95) 100%) !important;
    border-right: 1px solid rgba(212, 160, 23, 0.35);
}

.app-sidebar .nav-link {
    color: #d8e2f0 !important;
    border-left: 2px solid transparent;
    border-radius: 0;
}

.app-sidebar .nav-link:hover {
    color: #f8d47a !important;
    background: rgba(14, 165, 233, 0.12) !important;
    border-left-color: #d4a017;
}

.app-main {
    background: transparent;
}

.app-main .card,
.app-main .stat-box,
.app-main table {
    border-color: rgba(212, 160, 23, 0.22);
}

.app-main .btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-color: #0284c7;
}

.app-main .btn-success {
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    border-color: #b8860b;
    color: #111;
}

.pricing-accent-soft {
    background: rgba(14, 165, 233, 0.12);
}

.invoice-summary-box {
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: var(--bg-card);
}

.metric-tile {
    border-left: 3px solid var(--primary-light);
}

.metric-value {
    color: var(--primary-light);
}

.metric-theme-primary {
    border-left-color: var(--primary-light);
}

.metric-theme-primary .metric-value {
    color: var(--primary-light);
}

.metric-theme-secondary {
    border-left-color: var(--secondary);
}

.metric-theme-secondary .metric-value {
    color: var(--secondary);
}

.metric-theme-accent {
    border-left-color: var(--accent);
}

.metric-theme-accent .metric-value {
    color: var(--accent);
}

.metric-theme-warning {
    border-left-color: #f59e0b;
}

.metric-theme-warning .metric-value {
    color: #f59e0b;
}

.metric-theme-danger {
    border-left-color: #ef4444;
}

.metric-theme-danger .metric-value {
    color: #ef4444;
}

.metric-empty {
    color: var(--text-muted);
    grid-column: 1/-1;
}

.col-actions-220 {
    width: 220px;
}

.col-w-180 {
    width: 180px;
}

.col-w-160 {
    width: 160px;
}

.col-w-120 {
    width: 120px;
}

.col-w-110 {
    width: 110px;
}

.col-w-30 {
    width: 30%;
}

.col-w-12 {
    width: 12%;
}

.col-w-6 {
    width: 6%;
}

.ml-20 {
    margin-left: 20px;
}

.billing-debug-banner {
    margin: 10px 0 14px;
    padding: 10px 12px;
    border: 1px solid #d4af37;
    color: #d4af37;
    font-weight: 700;
}

.billing-debug-meta {
    margin: 0 0 14px;
    padding: 8px 10px;
    border: 1px dashed #d4af37;
    color: #9ca3af;
    font-size: 13px;
}

.settings-logo-preview {
    max-height: 80px;
    background: #fff;
    padding: 4px;
    border-radius: 4px;
}

.fieldops-dark-form .form-label,
.card.bg-dark .form-label,
.modal-content.bg-dark .form-label,
.card.bg-dark label,
.modal-content.bg-dark label {
    color: var(--text-secondary);
}

.fieldops-dark-form .text-secondary {
    color: #cbd5e1 !important;
}

.crm-stage-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.crm-template-preview-card .card-header {
    background: rgba(14, 165, 233, 0.14);
    border-bottom: 1px solid rgba(56, 189, 248, 0.35);
}

.crm-template-preview-box {
    background: #0b1220;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 8px;
    padding: 12px;
    color: #f8fafc;
}

.crm-channel-badge {
    background: #7dd3fc !important;
    color: #082f49 !important;
    border: 1px solid rgba(8, 47, 73, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.crm-placeholder-chip {
    background: #fef3c7 !important;
    color: #78350f !important;
    border: 1px solid rgba(146, 64, 14, 0.25);
}

.crm-template-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #fde68a !important;
}

.crm-placeholder-missing {
    background: #fecaca !important;
    color: #7f1d1d !important;
    border: 1px solid rgba(127, 29, 29, 0.25);
    margin-left: 4px;
}

.crm-template-content {
    max-width: 320px;
    white-space: pre-wrap;
}

.print-page {
    background: #fff;
    color: #111;
    padding: 20px;
    border: 1px solid #ddd;
}

.print-page h2,
.print-page h4 {
    margin: 0;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.print-table th,
.print-table td {
    border: 1px solid #333;
    padding: 6px;
    font-size: 12px;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.line {
    border-bottom: 1px solid #000;
    display: inline-block;
    min-width: 240px;
}

.print-btn {
    margin-bottom: 12px;
}

.print-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.print-logo {
    height: 60px;
    max-width: 180px;
    object-fit: contain;
}

.print-head-company {
    text-align: right;
}

.print-title {
    text-align: center;
    margin: 10px 0 !important;
}

.print-job-type {
    margin-top: 8px;
}

.print-section-title {
    margin-top: 16px !important;
}

.print-notes-box {
    border: 1px solid #333;
    min-height: 80px;
    padding: 8px;
}

.print-sign-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.legacy-print-body {
    font-family: Arial, sans-serif;
    color: #111;
    margin: 20px;
    background: #fff;
}

.legacy-print-toolbar {
    margin-bottom: 10px;
}

.legacy-letterhead {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid #111;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.legacy-logo {
    width: 220px;
    height: auto;
}

.legacy-title {
    margin: 0;
    font-size: 20px;
    color: #111;
}

.legacy-muted {
    color: #555;
    font-size: 12px;
}

.legacy-meta {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

.legacy-meta td {
    border: 1px solid #999;
    padding: 6px;
    font-size: 13px;
    color: #111;
}

.legacy-section-title {
    margin: 14px 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

.legacy-table {
    width: 100%;
    border-collapse: collapse;
}

.legacy-table th,
.legacy-table td {
    border: 1px solid #999;
    padding: 6px;
    font-size: 12px;
    vertical-align: top;
    color: #111;
}

.legacy-sig-wrap {
    margin-top: 24px;
    display: flex;
    gap: 16px;
}

.legacy-sig-box {
    flex: 1;
    border-top: 1px solid #222;
    padding-top: 8px;
    font-size: 12px;
    min-height: 60px;
    color: #111;
}

.legacy-sig-line {
    margin-top: 30px;
    border-top: 1px solid #333;
}

@media print {
    nav,
    footer,
    .print-btn,
    .alert,
    .sidebar {
        display: none !important;
    }

    body,
    .container-fluid,
    main {
        background: #fff !important;
        color: #111 !important;
    }

    .print-page {
        border: none;
        padding: 0;
    }

    .legacy-print-body {
        margin: 0;
    }

    @page {
        size: A4;
        margin: 12mm;
    }
}

.app-footer {
    background: linear-gradient(180deg, rgba(7, 10, 18, 0.96) 0%, rgba(5, 8, 14, 0.98) 100%) !important;
    border-top: 1px solid rgba(212, 160, 23, 0.35);
}

.app-footer .text-muted {
    color: #c4b48c !important;
}

body.no-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    background: radial-gradient(circle at top, #0b1f36 0%, #0b0f19 45%, #05070d 100%);
}

header {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px var(--shadow);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
    white-space: nowrap;
}

.brand-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.brand-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    transform: translateY(-1px);
}

.nav-link:hover svg {
    opacity: 1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.user-info svg {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

.logout-btn, .login-btn {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.logout-btn:hover, .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

body.no-nav main {
    padding: 2rem 1rem;
    max-width: none;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.no-nav > footer {
    display: none;
}
/* Login page styles */
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: block;
    margin: 0 auto 0.75rem;
    max-width: 240px;
    max-height: 80px;
    width: auto;
    height: auto;
}

.login-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
}

.login-form label svg {
    width: 18px;
    height: 18px;
    color: #6366f1;
}

.login-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    color: #1e293b;
    background: white;
    transition: all 0.2s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-form input::placeholder {
    color: #94a3b8;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-button svg {
    width: 20px;
    height: 20px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.login-button:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.login-footer p {
    margin: 0.2rem 0;
    color: #64748b;
    font-size: 0.85rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow);
}

table th,
table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

table th {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

table tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

table tr:last-child td {
    border-bottom: none;
}

/* Buttons */
button,
input[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

button:hover,
input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

button:active,
input[type="submit"]:active {
    transform: translateY(0);
}

/* Forms */
form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-light);
    font-weight: 700;
    margin-top: 0;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }

/* Search & Pagination */
.search-form {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-form input[type="text"] {
    width: 300px;
    display: inline-block;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--bg-card);
    color: var(--primary-light);
}

.pagination span.current {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* Status badges */
.status-paid {
    color: var(--secondary);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-unpaid {
    color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-unpaid.overdue {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Dashboard stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.72rem;
    margin-bottom: 1.15rem;
}

.stat-box {
    background: var(--bg-card);
    padding: 0.75rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.stats-grid .stat-box:nth-child(6n + 1) {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.14) 0%, var(--bg-card) 40%);
}

.stats-grid .stat-box:nth-child(6n + 1)::before {
    background: var(--primary-light);
}

.stats-grid .stat-box:nth-child(6n + 2) {
    background: linear-gradient(180deg, rgba(245, 196, 81, 0.14) 0%, var(--bg-card) 40%);
}

.stats-grid .stat-box:nth-child(6n + 2)::before {
    background: var(--secondary);
}

.stats-grid .stat-box:nth-child(6n + 3) {
    background: linear-gradient(180deg, rgba(212, 160, 23, 0.14) 0%, var(--bg-card) 40%);
}

.stats-grid .stat-box:nth-child(6n + 3)::before {
    background: var(--accent);
}

.stats-grid .stat-box:nth-child(6n + 4)::before {
    background: #f59e0b;
}

.stats-grid .stat-box:nth-child(6n + 5)::before {
    background: #ef4444;
}

.stats-grid .stat-box:nth-child(6n + 6)::before {
    background: var(--primary-dark);
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow);
    border-color: var(--primary);
}

.stat-box h3 {
    font-size: 1.2rem;
    margin: 0.3rem 0;
    color: var(--primary-light);
    line-height: 1.15;
}

.stat-box p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-box strong {
    color: var(--text-secondary);
    font-size: 0.83rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.compact-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.compact-kpi-card {
    padding: 0.5rem 0.46rem;
    height: 84px;
}

.compact-kpi-card h3 {
    font-size: 0.95rem;
    margin: 0.15rem 0;
}

.compact-kpi-card p {
    font-size: 0.62rem;
    line-height: 1.2;
}

.compact-kpi-card .metric-label-sm {
    font-size: 0.7rem;
}

.compact-kpi-card .kpi-icon {
    width: 16px;
    height: 16px;
}

.compact-kpi-card .kpi-icon-sm {
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .compact-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        gap: 0.58rem;
    }

    .compact-kpi-card {
        padding: 0.54rem 0.58rem;
        height: auto;
        min-height: 80px;
    }

    .compact-kpi-card h3 {
        font-size: 1rem;
    }

    .compact-kpi-card p {
        font-size: 0.66rem;
    }
}

/* Clickable stat boxes */
.stat-clickable {
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.stat-clickable:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px var(--shadow);
}

.stat-success {
    border-left: 4px solid var(--secondary);
}

.stat-warning {
    border-left: 4px solid var(--accent);
}

.stat-danger {
    border-left: 4px solid #ef4444;
}

/* Utility classes */
.mt-4 {
    margin-top: 2rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: -0.5rem;
    margin-bottom: 2rem;
}

.billing-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.billing-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.85rem;
    box-shadow: 0 3px 8px var(--shadow);
}

.billing-action-card h3 {
    margin: 0;
    color: var(--primary-light);
    font-size: 0.95rem;
}

.billing-action-card p {
    margin: 0.3rem 0 0.65rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.billing-action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.billing-actions-menu .billing-action-card {
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.billing-actions-menu .billing-action-links {
    margin-top: auto;
}

.billing-actions-menu .billing-action-links .btn {
    min-width: 126px;
}

.billing-settings-page {
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
}

.billing-settings-subtitle {
    margin-bottom: 1.2rem;
}

.billing-settings-section-title {
    margin-top: 1.35rem !important;
    margin-bottom: 0.7rem;
    font-size: 1.15rem;
}

.billing-settings-page .billing-settings-section-title + form,
.billing-settings-page .billing-settings-section-title + .billing-action-grid,
.billing-settings-page .billing-settings-section-title + .billing-callout {
    margin-top: 0;
    margin-bottom: 1.1rem;
}

.billing-settings-page .billing-callout {
    margin-bottom: 1.1rem;
}

.billing-settings-page .billing-action-grid {
    margin-bottom: 0.95rem;
}

.billing-settings-page .billing-action-card {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.billing-settings-page form .billing-action-grid {
    align-items: stretch;
}

.billing-settings-page .billing-action-card label {
    display: block;
    margin-bottom: 0.35rem;
}

.billing-settings-page .billing-action-card .form-control,
.billing-settings-page .billing-action-card .form-select {
    width: 100%;
}

.billing-settings-page .billing-action-card .form-check {
    min-height: 1.55rem;
}

.billing-settings-page > form > .btn.btn-primary {
    min-width: 220px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.billing-settings-page .billing-action-card form .btn.btn-sm {
    min-width: 220px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.billing-settings-page .billing-callout {
    margin-top: 0.8rem !important;
}

.billing-settings-page .billing-action-card .billing-action-links,
.billing-settings-page .billing-action-card form.mt-3 {
    margin-top: auto !important;
}

.billing-settings-page .billing-action-card h3 {
    min-height: 2.4em;
    line-height: 1.2;
}

.billing-settings-page .billing-action-card p {
    min-height: 2.8em;
}

@media (max-width: 768px) {
    .billing-settings-page .billing-action-card h3 {
        min-height: 0;
    }

    .billing-settings-page .billing-action-card p {
        min-height: 0;
    }
}

/* Cards */
.card-dark {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow);
}

.card-dark .card-header {
    background: rgba(99, 102, 241, 0.1);
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: 1px solid var(--border);
}

/* Login modern view (module auth) */
.login-modern-wrap {
    min-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-modern-card {
    width: 100%;
    max-width: 460px;
    border: 1px solid rgba(212, 160, 23, 0.35);
    border-radius: 20px;
    background: rgba(11, 15, 25, 0.96);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.login-modern-top {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    padding: 1.25rem 1.5rem;
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(212, 160, 23, 0.35);
}

.login-modern-logo {
    max-width: 220px;
    max-height: 74px;
    width: 100%;
    height: 74px;
    display: block;
    object-fit: contain;
    background: #ffffff;
    border-radius: 10px;
    padding: 6px 10px;
}

.login-modern-body {
    padding: 1.5rem;
}

.login-modern-title {
    margin: 0;
    color: #f8d47a;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
}

.login-modern-sub {
    margin: .35rem 0 1.25rem;
    text-align: center;
    color: #cbd5e1;
    font-size: .95rem;
}

.login-modern-footer {
    margin-top: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: .84rem;
}

.login-modern-body .form-label {
    color: #cbd5e1;
}

.login-modern-body .form-control {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #2a3244;
}

.login-modern-body .form-control:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 .2rem rgba(14, 165, 233, .25);
}

.login-modern-body .btn-primary {
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    border: 0;
    color: #0b0f19;
    font-weight: 700;
}

/* Billing dashboard home */
.dashboard-modern .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.7rem;
}

.dashboard-modern .stat-box {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 8px var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
    min-height: 86px;
}

.dashboard-modern .stat-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow);
}

.dashboard-modern .chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.dashboard-modern .chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 8px var(--shadow);
    padding: 0.9rem;
}

.stats-grid-top {
    margin-top: 1rem;
}

.kpi-primary-light { border-left: 3px solid var(--primary-light); }
.kpi-secondary { border-left: 3px solid var(--secondary); }
.kpi-accent { border-left: 3px solid var(--accent); }
.kpi-danger { border-left: 3px solid #ef4444; }
.kpi-warning { border-left: 3px solid #f59e0b; }
.kpi-primary { border-left: 3px solid var(--primary); }
.kpi-info { border-left: 3px solid #0ea5e9; }
.kpi-orange { border-left: 3px solid #f97316; }

.billing-callout {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-card);
}

.billing-callout-link {
    margin-left: 0.5rem;
    color: var(--secondary);
    font-weight: 700;
}

.metric-label-sm { font-size: 0.85rem; }
.chart-title { font-size: 1.1rem; margin-bottom: 0.9rem; }

/* NOC devices / wallboard */
.noc-toolbar { display:flex; gap:.75rem; flex-wrap:wrap; align-items:end; margin:1rem 0; }
.noc-toolbar .field { min-width: 180px; flex:1; }
.noc-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(270px,1fr)); gap:1rem; margin-top:1rem; }
.noc-card { background:var(--bg-card); border:1px solid var(--border); border-radius:.75rem; box-shadow:0 4px 8px var(--shadow); padding:.85rem; position:relative; overflow:hidden; }
.noc-card::before { content:""; position:absolute; left:0; top:0; width:100%; height:3px; background:var(--primary); }
.noc-grid .noc-card:nth-child(3n + 1)::before { background:var(--primary-light); }
.noc-grid .noc-card:nth-child(3n + 2)::before { background:var(--secondary); }
.noc-grid .noc-card:nth-child(3n + 3)::before { background:var(--accent); }
.noc-head { display:flex; justify-content:space-between; gap:.5rem; align-items:flex-start; }
.noc-title { font-weight:700; margin:0; }
.noc-sub { color:var(--text-muted); font-size:.85rem; margin-top:.25rem; }
.noc-badge { font-size:.75rem; padding:.2rem .55rem; border-radius:999px; border:1px solid var(--border); }
.noc-row { display:flex; justify-content:space-between; gap:.5rem; margin-top:.45rem; font-size:.9rem; }
.noc-label { color:var(--text-muted); }
.status-dot { width:12px; height:12px; border-radius:50%; display:inline-block; margin-right:.4rem; vertical-align:middle; --pulse-color: rgba(34,197,94,.45); background: currentColor; }
.status-dot-online { color:#22c55e; --pulse-color: rgba(34,197,94,.45); }
.status-dot-online-cambium { color:#3b82f6; --pulse-color: rgba(59,130,246,.45); }
.status-dot-stale { color:#f59e0b; --pulse-color: rgba(245,158,11,.45); }
.status-dot-offline { color:#ef4444; --pulse-color: rgba(239,68,68,.45); }
.status-dot-maintenance { color:#9ca3af; --pulse-color: rgba(156,163,175,.45); }
.status-line { font-weight:600; font-size:.85rem; }
.noc-actions { margin-top:.9rem; display:flex; flex-wrap:wrap; gap:.45rem; }
.pulse-fast { animation:pulseGlow .8s infinite; }
.pulse-medium { animation:pulseGlow 1.2s infinite; }
.pulse-slow { animation:pulseGlow 1.8s infinite; }
.live-toggle { display:flex; align-items:center; gap:.45rem; margin-left:auto; }
.toast-wrap { position:fixed; right:1rem; bottom:1rem; z-index:9999; display:flex; flex-direction:column; gap:.5rem; }
.toast { background:#1f2937; border:1px solid #ef4444; color:#fff; padding:.7rem .9rem; border-radius:.5rem; box-shadow:0 6px 14px rgba(0,0,0,.25); }
.router-panel { margin-top:1rem; background:var(--bg-card); border:1px solid var(--border); border-radius:.75rem; box-shadow:0 4px 8px var(--shadow); padding:1rem; }
.router-head { display:flex; justify-content:space-between; gap:1rem; align-items:center; flex-wrap:wrap; }
.router-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:.75rem; margin-top:.75rem; }
.router-kpi { border:1px solid var(--border); border-radius:.6rem; padding:.5rem .65rem; background:rgba(255,255,255,0.01); position:relative; overflow:hidden; }
.router-kpi::before { content:""; position:absolute; left:0; top:0; width:100%; height:2px; background:var(--primary-light); }
.router-grid .router-kpi:nth-child(3n + 2)::before { background:var(--secondary); }
.router-grid .router-kpi:nth-child(3n + 3)::before { background:var(--accent); }
.router-kpi .label { color:var(--text-muted); font-size:.8rem; }
.router-kpi .value { font-size:1rem; font-weight:700; margin-top:.15rem; }
.router-state { font-weight:700; }
.router-state-up { color:#22c55e; }
.router-state-degraded { color:#f59e0b; }
.router-state-down { color:#ef4444; }
.router-util-wrap { margin-top:.9rem; }
.router-util-label { margin-bottom:.35rem; }
.progress-track { width:100%; height:10px; border-radius:999px; background:rgba(148,163,184,.25); overflow:hidden; }
.progress-fill { height:100%; background:var(--secondary); width:0; }
.field-narrow { max-width:220px; }
.noc-sub-space { margin-top:.5rem; }
.noc-row-top { margin-top:.65rem; }
.map-title { margin-top:1.35rem; }
#nocMap { margin-top:1rem; width:100%; height:430px; border-radius:.75rem; border:1px solid var(--border); box-shadow:0 4px 8px var(--shadow); }

.wallboard-grid { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:.6rem; margin-top:.8rem; }
.wall-kpi { background:var(--bg-card); border:1px solid var(--border); border-radius:.75rem; padding:.55rem .7rem; box-shadow:0 4px 8px var(--shadow); position:relative; overflow:hidden; }
.wall-kpi::before { content:""; position:absolute; left:0; top:0; width:100%; height:3px; background:var(--primary); }
.wallboard-grid .wall-kpi:nth-child(2)::before { background:var(--secondary); }
.wallboard-grid .wall-kpi:nth-child(3)::before { background:#f59e0b; }
.wallboard-grid .wall-kpi:nth-child(4)::before { background:#ef4444; }
.wallboard-grid .wall-kpi:nth-child(5)::before { background:#9ca3af; }
.wall-kpi .label { color:var(--text-muted); font-size:.78rem; }
.wall-kpi .value { font-size:1.15rem; font-weight:800; margin-top:.1rem; }
.wall-router { margin-top:.85rem; background:var(--bg-card); border:1px solid var(--border); border-radius:.75rem; padding:.85rem 1rem; box-shadow:0 4px 8px var(--shadow); display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.wall-router .meta { color:var(--text-muted); font-size:.86rem; }
.wall-router .state { font-weight:800; }
#wallMap { margin-top:1rem; height:68vh; border:1px solid var(--border); border-radius:.75rem; box-shadow:0 4px 8px var(--shadow); }
.live-pill { display:inline-flex; align-items:center; gap:.4rem; border:1px solid var(--border); border-radius:999px; padding:.25rem .6rem; font-size:.8rem; }
.dot { width:8px; height:8px; border-radius:50%; background:#22c55e; }
.wallboard-head { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.kpi-online { color:#22c55e; }
.kpi-stale { color:#f59e0b; }
.kpi-offline { color:#ef4444; }
.kpi-maint { color:#9ca3af; }

.map-marker-dot { display:block; border-radius:50%; border:2px solid #fff; background:currentColor; }
.map-marker-dot-sm { width:14px; height:14px; box-shadow:0 0 0 2px rgba(0,0,0,.25); }
.map-marker-dot-lg { width:16px; height:16px; box-shadow:0 0 0 2px rgba(0,0,0,.35); }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 var(--pulse-color); }
    70% { box-shadow: 0 0 0 9px rgba(0,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* Form controls */
.form-control,
.form-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 0.5rem;
}

/* Responsive design */
@media (min-width: 1700px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.65rem;
    }

    .dashboard-modern .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    }

    .stat-box {
        min-height: 84px;
        padding: 0.62rem 0.68rem;
    }

    .stat-box h3 {
        font-size: 1.05rem;
    }
}

@media (max-width: 1366px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        gap: 0.6rem;
    }

    .dashboard-modern .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    }

    .stat-box {
        min-height: 78px;
        padding: 0.56rem 0.6rem;
    }

    .stat-box h3 {
        font-size: 0.96rem;
    }

    .stat-box p,
    .stat-box strong {
        font-size: 0.69rem;
    }
}

@media (max-width: 1440px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
        gap: 0.8rem;
    }

    .dashboard-modern .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .stat-box {
        min-height: 86px;
        padding: 0.66rem 0.72rem;
    }

    .stat-box h3 {
        font-size: 1.1rem;
    }

    .wallboard-grid {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    }

    .dashboard-modern .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    }

    .stat-box {
        min-height: 82px;
    }

    .wallboard-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .noc-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 1024px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    nav {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 1rem;
    }

    body.no-nav main {
        padding: 2rem 1rem;
    }

    .stat-box {
        min-height: 78px;
        padding: 0.58rem 0.62rem;
    }

    .stat-box h3 {
        font-size: 1rem;
    }

    .wallboard-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-link span {
        display: none;
    }
    
    main {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 2rem;
    }

    .login-container {
        padding: 1rem;
    }
}

