*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f3f7fd;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fbff;
    --bg-elevated: #eef3fb;
    --bg-input: #f9fbff;
    --border: #dbe5f2;
    --border-hover: #c8d8eb;
    --text: #1e2a3b;
    --text-secondary: #5f7089;
    --text-muted: #8fa0b7;
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-soft: rgba(29, 78, 216, 0.12);
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.12);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --sidebar-w: 260px;
    --sidebar-collapsed-w: 68px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 12px 36px rgba(18, 43, 73, 0.09);
    --transition: 0.22s ease;
}

:root[data-theme="dark"] {
    --bg: #0f1117;
    --bg-card: #181a20;
    --bg-card-hover: #1e2028;
    --bg-elevated: #1c1e26;
    --bg-input: #1c1e26;
    --border: #2a2d37;
    --border-hover: #3a3d47;
    --text: #e4e4e7;
    --text-secondary: #8b8d97;
    --text-muted: #5b5d67;
    --primary: #6366f1;
    --primary-hover: #5457e5;
    --primary-soft: rgba(99, 102, 241, 0.16);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --shadow: 0 12px 32px rgba(0,0,0,0.26);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(1200px 600px at -15% -15%, rgba(29, 78, 216, 0.10), transparent 56%),
                radial-gradient(900px 480px at 110% -10%, rgba(5, 150, 105, 0.10), transparent 60%),
                var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] body {
    background: radial-gradient(1200px 600px at -15% -15%, rgba(99, 102, 241, 0.16), transparent 56%),
                radial-gradient(900px 480px at 110% -10%, rgba(16, 185, 129, 0.12), transparent 60%),
                var(--bg);
}

body,
.card,
.stat-card,
.sidebar,
.main-header,
.form-input,
.data-table tr,
.btn,
.badge,
.client-status-card,
.soa-document {
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition), opacity var(--transition);
}

a { color: var(--primary); text-decoration: none; }

.text-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.88em; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.flex-1 { flex: 1; }
.p-0 { padding: 0 !important; }

.mode-switcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999;
    width: min(280px, calc(100vw - 26px));
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    padding: 12px;
}

.mode-switcher-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.mode-switcher-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mode-switch-btn {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 9px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.mode-switch-btn.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

body.interactive-mode .card,
body.interactive-mode .stat-card,
body.interactive-mode .client-status-card,
body.interactive-mode .soa-document,
body.interactive-mode .btn,
body.interactive-mode .sidebar-link {
    will-change: transform;
}

body.interactive-mode .card:hover,
body.interactive-mode .stat-card:hover,
body.interactive-mode .client-status-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(21, 46, 77, 0.14);
}

body.interactive-mode .btn:hover {
    transform: translateY(-1px) scale(1.01);
}

body.interactive-mode .sidebar-link:hover {
    transform: translateX(3px);
}

@media (max-width: 800px) {
    .mode-switcher {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition), transform var(--transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-w);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 20px 0;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-nav {
    padding: 8px;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.sidebar-brand-icon.has-logo {
    background: transparent;
    box-shadow: none;
}

.sidebar-brand-icon.has-logo img {
    object-fit: contain;
}

.sidebar-brand h2 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-brand small {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.sidebar-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding: 8px 12px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-link svg { flex-shrink: 0; }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 8px 12px;
}

.sidebar-collapse-btn {
    margin-bottom: 4px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* Main */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

.main-expanded {
    margin-left: var(--sidebar-collapsed-w);
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 52px;
}

.main-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.sidebar-collapse-desktop {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.main-content {
    padding: 24px;
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

/* Page Header */
.page-header-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 2px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-body {
    padding: 20px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-value-compact {
    font-size: clamp(14px, 1.4vw, 18px);
    line-height: 1.25;
    word-break: break-word;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.text-warning { color: var(--warning); }

/* Revenue Summary */
.revenue-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.revenue-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.revenue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

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

.revenue-item-total {
    padding-top: 16px;
    margin-top: 4px;
    border-top: 2px solid var(--border);
}

.revenue-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.revenue-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.revenue-item-label {
    font-size: 14px;
    font-weight: 500;
}

.revenue-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.revenue-item-value {
    font-size: 16px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 220px;
    padding-top: 20px;
}

.bar-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar-chart-bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.bar-chart-bar {
    width: 40%;
    max-width: 32px;
    min-height: 0;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.4s ease;
    cursor: pointer;
}

.bar-chart-bar:hover .bar-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.bar-revenue {
    background: linear-gradient(180deg, var(--primary), rgba(99, 102, 241, 0.5));
}

.bar-expenses {
    background: linear-gradient(180deg, var(--warning), rgba(245, 158, 11, 0.5));
}

.bar-tooltip {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.bar-chart-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 8px;
    text-align: center;
}

.chart-legend {
    display: flex;
    gap: 16px;
    align-items: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.chart-range-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.chart-range-select {
    min-width: 150px;
}

.interactive-chart-wrap {
    height: 250px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    padding: 10px;
}

.interactive-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 4px;
}

.dashboard-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-family: inherit;
}

.dashboard-tab:hover {
    color: var(--text);
    background: var(--bg-elevated);
}

.dashboard-tab.active {
    color: var(--primary);
    background: var(--primary-soft);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.badge-secondary { background: rgba(139,141,151,0.12); color: var(--text-secondary); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.badge-accent { background: var(--primary-soft); color: var(--primary); }

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Tables */
.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

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

.data-table tfoot td {
    padding: 12px 16px;
    border-top: 2px solid var(--border);
    background: var(--bg-elevated);
    font-size: 14px;
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.connection-status.active { color: var(--success); }
.connection-status.disconnected { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--border-hover); background: var(--bg-elevated); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-elevated); }

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-block { width: 100%; }

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-input::placeholder { color: var(--text-muted); }

.form-row {
    display: flex;
    gap: 12px;
}

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.form-input.with-icon { padding-left: 38px; }

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Search */
.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding: 7px 14px 7px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    min-width: 220px;
    transition: border-color var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-input::placeholder { color: var(--text-muted); }

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-elevated);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.filter-tab {
    padding: 5px 14px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.filter-tab:hover { color: var(--text); }
.filter-tab.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.2);
}

.alert-success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 15px; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-body { padding: 20px; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
}

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

.login-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
}

.login-icon.admin { background: linear-gradient(135deg, var(--primary), #818cf8); }
.login-icon.client { background: linear-gradient(135deg, var(--success), #34d399); }

.login-company-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    margin: 0 auto 12px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}

.login-header h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 2px;
}

.login-footer {
    margin-top: 16px;
    text-align: center;
}

/* Client Dashboard */
.client-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
}

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

.client-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.client-header h1 {
    font-size: 20px;
    font-weight: 800;
}

.client-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.client-welcome-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.client-welcome-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
}

.client-welcome-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Client Status Card */
.client-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.client-status-card.status-active {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.client-status-card.status-disconnected {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.client-status-card.status-pleasepay {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.client-status-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-status-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.client-status-icon-wrap.icon-active {
    background: var(--success-soft);
    color: var(--success);
}

.client-status-icon-wrap.icon-disconnected {
    background: var(--danger-soft);
    color: var(--danger);
}

.client-status-icon-wrap.icon-pleasepay {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.client-status-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.client-status-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 2px;
}

.status-active .client-status-value { color: var(--success); }
.status-disconnected .client-status-value { color: var(--danger); }
.status-pleasepay .client-status-value { color: #f59e0b; }

.client-status-pppoe {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.35;
}

/* Stat Card Accents */
.stat-card-accent {
    border-top: 3px solid var(--border);
}

.stat-card-primary { border-top-color: var(--primary); }
.stat-card-danger { border-top-color: var(--danger); }
.stat-card-success { border-top-color: var(--success); }

/* Client Action Buttons */
.client-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-client-soa {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}
.btn-client-soa:hover { opacity: 0.9; }

.btn-client-speedtest {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a1a1a;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 8px;
    flex: 1;
    min-width: 160px;
}
.btn-client-speedtest:hover { opacity: 0.9; }

.btn-client-paynow {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 8px;
    flex: 1;
    min-width: 140px;
}
.btn-client-paynow:hover { opacity: 0.9; }

/* Speed Test Modal */
.modal-wide {
    max-width: 640px;
}

.modal-tall .modal-body {
    height: 500px;
    padding: 0;
}

.speedtest-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    background: #fff;
}

/* SOA Print Styles */
.soa-print {
    background: white;
    color: #333;
    padding: 24px;
    border-radius: 8px;
}

.soa-print-header {
    text-align: center;
    margin-bottom: 16px;
}

.soa-print-header h2 {
    color: #333;
    margin-bottom: 4px;
}

.soa-print-header p {
    color: #666;
    font-size: 13px;
    margin: 2px 0;
}

.soa-print-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 16px 0;
    padding: 8px;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
}

.soa-print-info {
    margin-bottom: 12px;
}

.soa-print-info div {
    margin: 4px 0;
    color: #333;
    font-size: 14px;
}

.soa-print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.soa-print-table th,
.soa-print-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
    color: #333;
    font-size: 14px;
}

.soa-print-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Pay Now Modal */
.paynow-info {
    text-align: center;
    padding: 8px 0;
}

.paynow-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.paynow-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.paynow-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--danger);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 8px;
}

.paynow-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.paynow-details {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.paynow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.paynow-row:last-child {
    border-bottom: none;
}

.paynow-instructions {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: left;
}

.paynow-instructions h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.paynow-instructions p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
}

/* Pay Now Form */
.paynow-form-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.paynow-form-sub strong {
    color: var(--primary);
}

.paynow-form-group {
    margin-bottom: 16px;
}

.paynow-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-file-input {
    padding: 10px !important;
    background: var(--bg-elevated) !important;
}

.paynow-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-style: italic;
}

.paynow-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.paynow-form-actions .btn {
    flex: 1;
    justify-content: center;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Payment Success Page */
.paysuccess-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.paysuccess-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.paysuccess-blob.blob-1 { width: 300px; height: 300px; background: #3b82f6; top: -60px; left: -80px; animation: psFloat1 8s ease-in-out infinite; }
.paysuccess-blob.blob-2 { width: 250px; height: 250px; background: #10b981; bottom: -40px; right: -60px; animation: psFloat2 10s ease-in-out infinite; }
.paysuccess-blob.blob-3 { width: 200px; height: 200px; background: #8b5cf6; top: 40%; left: 60%; animation: psFloat3 12s ease-in-out infinite; }

@keyframes psFloat1 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(40px,30px) } }
@keyframes psFloat2 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(-30px,-40px) } }
@keyframes psFloat3 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(-20px,30px) } }

.paysuccess-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.paysuccess-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 20px 50px -12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.paysuccess-accent {
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981, #8b5cf6);
    background-size: 200% 100%;
    animation: psShimmer 3s ease-in-out infinite;
}

@keyframes psShimmer { 0%,100% { background-position: 0% 50% } 50% { background-position: 100% 50% } }

.paysuccess-inner { padding: 36px 32px 32px; }

.paysuccess-icon-area { text-align: center; margin-bottom: 24px; }

.paysuccess-pulse-ring {
    width: 100px; height: 100px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

.paysuccess-pulse-ring::before,
.paysuccess-pulse-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #10b981;
    opacity: 0;
    animation: psRipple 2.5s ease-out infinite;
}
.paysuccess-pulse-ring::after { animation-delay: 1.25s; }

@keyframes psRipple { 0% { transform: scale(0.8); opacity: 0.6; } 100% { transform: scale(1.6); opacity: 0; } }

.paysuccess-check-circle {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(16,185,129,0.35);
    animation: psScaleIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes psScaleIn { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.paysuccess-check-circle svg {
    width: 32px; height: 32px; color: #fff;
    stroke-dasharray: 30; stroke-dashoffset: 30;
    animation: psDraw 0.6s ease-out 0.3s forwards;
}

@keyframes psDraw { to { stroke-dashoffset: 0; } }

.paysuccess-title {
    text-align: center;
    font-size: 22px; font-weight: 700; color: #0f172a;
    margin-bottom: 6px;
}

.paysuccess-subtitle {
    text-align: center;
    font-size: 14px; color: #64748b; line-height: 1.6;
    margin-bottom: 24px;
}

.paysuccess-status-pill {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin: 0 auto 28px;
    width: fit-content;
    padding: 10px 22px;
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border: 1px solid #fde68a;
    border-radius: 100px;
}

.paysuccess-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.2);
    animation: psBlink 2s ease-in-out infinite;
}

@keyframes psBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.paysuccess-status-pill span { font-size: 13px; font-weight: 600; color: #92400e; }

.paysuccess-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px 0;
    margin-bottom: 24px;
}

.paysuccess-detail-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 18px;
}

.paysuccess-detail-row:not(:last-child) { border-bottom: 1px solid #f1f5f9; }

.paysuccess-dt {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #94a3b8; font-weight: 500;
}
.paysuccess-dt svg { width: 16px; height: 16px; color: #cbd5e1; }

.paysuccess-dd { font-size: 13px; font-weight: 600; color: #1e293b; text-align: right; }

.paysuccess-steps { margin-bottom: 28px; }

.paysuccess-step {
    display: flex; align-items: flex-start; gap: 14px;
    position: relative;
    padding-bottom: 20px;
}
.paysuccess-step:last-child { padding-bottom: 0; }

.paysuccess-step-line {
    position: absolute;
    left: 15px; top: 32px; bottom: 0;
    width: 2px; background: #e2e8f0;
}
.paysuccess-step:last-child .paysuccess-step-line { display: none; }
.paysuccess-step.done .paysuccess-step-line { background: #10b981; }

.paysuccess-step-icon {
    width: 32px; height: 32px;
    border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    position: relative; z-index: 1;
}
.paysuccess-step.done .paysuccess-step-icon { background: #ecfdf5; color: #059669; }
.paysuccess-step.active .paysuccess-step-icon { background: #fffbeb; color: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,0.12); }
.paysuccess-step.waiting .paysuccess-step-icon { background: #f1f5f9; color: #94a3b8; }
.paysuccess-step-icon svg { width: 16px; height: 16px; }

.paysuccess-step-body { padding-top: 5px; }
.paysuccess-step-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.paysuccess-step.done .paysuccess-step-title { color: #059669; }
.paysuccess-step.active .paysuccess-step-title { color: #d97706; }
.paysuccess-step.waiting .paysuccess-step-title { color: #94a3b8; }
.paysuccess-step-desc { font-size: 12px; color: #94a3b8; }

.paysuccess-footer-note {
    text-align: center;
    font-size: 12px; color: #94a3b8;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.paysuccess-footer-note svg { width: 14px; height: 14px; color: #cbd5e1; }

/* SOA Page */
.soa-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
    min-height: 100vh;
}

.soa-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-soa-download {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
}
.btn-soa-download:hover { opacity: 0.9; }

.soa-document {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.soa-header {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    padding: 32px;
    color: white;
}

.soa-company-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.soa-company-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.soa-company-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    background: transparent;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.soa-company-name {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
}

.soa-company-address,
.soa-company-contact {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin: 2px 0;
}

.soa-title-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.15em;
    margin-top: 16px;
}

.soa-info-section {
    padding: 28px 32px;
    border-bottom: 1px solid var(--border);
}

.soa-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.soa-info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.soa-info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.soa-info-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}

.soa-mono {
    font-family: 'JetBrains Mono', monospace;
}

.soa-table-section {
    padding: 0 32px 8px;
}

.soa-table {
    width: 100%;
    border-collapse: collapse;
}

.soa-table thead th {
    padding: 14px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.soa-table tbody td {
    padding: 16px 12px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.soa-table tfoot td {
    padding: 16px 12px;
    font-size: 14px;
    border-top: 2px solid var(--border);
}

.soa-desc-main {
    font-weight: 600;
    margin-bottom: 2px;
}

.soa-desc-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.soa-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    white-space: nowrap;
}

.soa-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.soa-footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0;
}

@media print {
    body { background: white !important; }
    .soa-topbar { display: none !important; }
    .soa-page { padding: 0; max-width: none; }
    .soa-document { box-shadow: none; border: none; }
    .soa-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Mobile */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w) !important;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar.collapsed {
        width: var(--sidebar-w) !important;
    }
    .sidebar.collapsed .sidebar-brand-text,
    .sidebar.collapsed .sidebar-link span,
    .sidebar.collapsed .sidebar-label {
        opacity: 1;
        width: auto;
    }
    .sidebar.collapsed .sidebar-brand {
        justify-content: flex-start;
        padding: 20px 16px;
    }
    .sidebar.collapsed .sidebar-link {
        justify-content: flex-start;
        padding: 10px 12px;
    }
    .sidebar.collapsed .sidebar-nav {
        padding: 12px;
    }
    .sidebar-close { display: block; }
    .sidebar-collapse-btn { display: none; }
    .sidebar-toggle { display: block; }
    .sidebar-collapse-desktop { display: none; }
    .main { margin-left: 0 !important; }
    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-3 { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .revenue-grid { grid-template-columns: 1fr; }
    .dashboard-tabs { flex-wrap: wrap; }
    .filter-tabs { overflow-x: auto; }
    .card-header { flex-direction: column; align-items: flex-start; }
    .card-header-actions { width: 100%; }
    .search-input { min-width: 0; width: 100%; }
    .search-box { width: 100%; }
    .chart-toolbar {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .chart-range-select {
        min-width: 140px;
    }
    .interactive-chart-wrap {
        height: 220px;
    }
    .form-row { flex-direction: column; gap: 0; }
    .soa-info-grid { grid-template-columns: 1fr; }
    .soa-header { padding: 24px 16px; }
    .soa-info-section { padding: 20px 16px; }
    .soa-table-section { padding: 0 8px 8px; }
    .soa-footer { padding: 16px; }
    .soa-table { font-size: 13px; }
    .soa-table thead th, .soa-table tbody td, .soa-table tfoot td { padding: 10px 8px; }
    .soa-topbar { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 20px; }
    .stat-value { font-size: 24px; }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 10px 12px; }
    .btn-group { flex-direction: column; width: 100%; }
    .btn-group .btn, .btn-group form { width: 100%; }
    .btn-group form .btn { width: 100%; }
}

@media (min-width: 1025px) {
    .sidebar-close { display: none; }
    .sidebar-toggle { display: none; }
}

.status-active-warning {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.03));
}
.status-active-warning .client-status-value { color: var(--warning); }
.icon-warning { background: var(--warning-soft); color: var(--warning); }
.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
}
.connection-status.active-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.gcash-info-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}
.gcash-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary);
}
.gcash-number {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 15px;
}
.gcash-number span { color: var(--text-secondary); }
.gcash-number strong { color: var(--text); font-family: 'JetBrains Mono', monospace; }
.gcash-qr {
    text-align: center;
    margin-top: 12px;
}
.gcash-qr img {
    max-width: 200px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.gcash-qr-preview {
    margin-bottom: 12px;
}
.company-logo-preview {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.company-logo-preview img {
    max-width: 110px;
    border-radius: var(--radius);
    display: block;
}
.gcash-qr-preview img {
    max-width: 150px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
    margin-bottom: 8px;
}
.form-divider {
    border-top: 1px solid var(--border);
    margin: 24px 0;
}
.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.form-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}
.form-check-label input[type="checkbox"] {
    accent-color: var(--danger);
}

.page-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.page-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-input-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.bar-chart-single {
    justify-content: center;
}
.bar-chart-single .bar-chart-col {
    max-width: 200px;
    flex: 0 0 200px;
}
.bar-chart-single .bar-chart-bars {
    gap: 16px;
}
.bar-chart-single .bar-chart-bar {
    min-width: 60px;
}

/* Server Monitoring */
.server-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.server-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.server-summary-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.server-summary-card strong {
    font-size: 22px;
    font-weight: 800;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.server-router-host {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 12px;
}

.server-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.server-meta-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    padding: 8px;
}

.server-meta-item span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.server-meta-item strong {
    font-size: 13px;
    color: var(--text);
}

.cpu-wrap {
    margin: 12px 0 14px;
}

.cpu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.cpu-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    overflow: hidden;
}

.cpu-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary));
    border-radius: 999px;
    transition: width 0.45s ease;
}

.server-interfaces-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.server-interfaces {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.interface-row {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.interface-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.interface-row-head strong {
    font-size: 13px;
}

.interface-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.interface-bar-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.interface-bar-rx,
.interface-bar-tx {
    height: 100%;
    border-radius: 999px;
    transition: width 0.45s ease;
}

.interface-bar-rx {
    background: linear-gradient(90deg, #22c55e, #06b6d4);
}

.interface-bar-tx {
    background: linear-gradient(90deg, #f59e0b, #f43f5e);
}

.server-offline {
    border: 1px dashed var(--danger);
    background: var(--danger-soft);
    border-radius: var(--radius);
    padding: 12px;
}

.server-offline-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.server-offline p {
    font-size: 13px;
    color: var(--text-secondary);
}

.server-empty-interface {
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.server-config-form {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.server-config-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    align-items: end;
}

.server-interface-select {
    min-height: 118px;
    color-scheme: dark;
}

.server-interface-picker-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.server-interface-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    max-height: 180px;
    overflow-y: auto;
}

.server-interface-picker.collapsed {
    display: none;
}

.server-iface-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.server-iface-option:last-child {
    border-bottom: none;
}

.server-iface-option input[type="checkbox"] {
    accent-color: var(--primary);
}

.server-config-form .btn {
    margin-top: 4px;
}

@media (max-width: 1200px) {
    .server-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .server-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .server-meta {
        grid-template-columns: 1fr;
    }

    .server-config-grid {
        grid-template-columns: 1fr;
    }
}
