
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
    --primary: #3b82f6;
    --primary-ink: #93c5fd;
    --secondary: #111827;
    --accent: #3b82f6;
    --danger: #f87171;
    --warning: #f59e0b;
    --success: #34d399;
    --bg: #0b1220;
    --bg-2: #111827;
    --surface: #1f2937;
    --surface-2: #0f172a;
    --muted: #9ca3af;
    --text: #e5e7eb;
    --stroke: #273244;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.35);
    --glow: 0 0 0 4px rgba(59, 130, 246, 0.35);
    --body-grad-1: rgba(59, 130, 246, 0.2);
    --body-grad-2: rgba(59, 130, 246, 0.12);
    --body-bg-top: #0b1220;
    --body-bg-mid: #0e1627;
    --body-bg-bottom: #0b1220;
    --alert-success-bg: rgba(52, 211, 153, 0.14);
    --alert-success-border: rgba(52, 211, 153, 0.3);
    --alert-success-text: #d1fae5;
    --alert-error-bg: rgba(248, 113, 113, 0.14);
    --alert-error-border: rgba(248, 113, 113, 0.3);
    --alert-error-text: #fee2e2;
}

body[data-theme="light"] {
    --primary: #2563eb;
    --primary-ink: #1d4ed8;
    --secondary: #dbeafe;
    --accent: #0ea5e9;
    --danger: #dc2626;
    --warning: #b45309;
    --success: #047857;
    --bg: #f4f8ff;
    --bg-2: #e8f0ff;
    --surface: #ffffff;
    --surface-2: #eef4ff;
    --muted: #5b6b83;
    --text: #10213d;
    --stroke: #d7e3f6;
    --shadow: 0 20px 50px rgba(30, 64, 175, 0.12);
    --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.09);
    --glow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    --body-grad-1: rgba(37, 99, 235, 0.12);
    --body-grad-2: rgba(14, 165, 233, 0.12);
    --body-bg-top: #f8fbff;
    --body-bg-mid: #eef4ff;
    --body-bg-bottom: #f5f8ff;
    --alert-success-bg: rgba(16, 185, 129, 0.12);
    --alert-success-border: rgba(16, 185, 129, 0.26);
    --alert-success-text: #065f46;
    --alert-error-bg: rgba(239, 68, 68, 0.1);
    --alert-error-border: rgba(239, 68, 68, 0.24);
    --alert-error-text: #991b1b;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Space Grotesk", "Cairo", "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
    background: radial-gradient(circle at 10% 12%, var(--body-grad-1), transparent 45%),
        radial-gradient(circle at 85% 0%, var(--body-grad-2), transparent 40%),
        linear-gradient(180deg, var(--body-bg-top) 0%, var(--body-bg-mid) 45%, var(--body-bg-bottom) 100%);
    color: var(--text);
    min-height: 100%;
}

body[data-dir="rtl"] {
    direction: rtl;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 45%, #0b1220 100%);
    border-inline-end: 1px solid rgba(39, 50, 68, 0.9);
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: inset -1px 0 0 rgba(59, 130, 246, 0.12);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 45%, #1e40af 100%);
    box-shadow: 0 14px 30px rgba(59, 130, 246, 0.35);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin: 6px 10px 0;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #f8fafc;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22);
    transform: translateY(-1px);
}

.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    font-size: 14px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed rgba(59, 130, 246, 0.35);
    font-size: 14px;
    color: var(--muted);
}

.main {
    padding: 28px 36px 120px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.topbar {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(39, 50, 68, 0.9);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.topbar-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.breadcrumbs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.breadcrumbs span {
    opacity: 0.7;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    min-width: 132px;
}

.topbar .title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
}

.topbar p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switch {
    display: inline-flex;
    gap: 6px;
    background: rgba(17, 24, 39, 0.85);
    padding: 4px;
    border-radius: 999px;
}

.lang-switch button {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.lang-switch button.active {
    background: rgba(59, 130, 246, 0.2);
    color: #e5e7eb;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.primary-btn,
.ghost-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.35);
}

.ghost-btn {
    background: rgba(17, 24, 39, 0.85);
    color: var(--text);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.primary-btn:hover,
.ghost-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.screen {
    background: rgba(17, 24, 39, 0.9);
    border-radius: 20px;
    padding: 22px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    box-shadow: var(--shadow-soft);
}

.screen--online {
    border-color: rgba(52, 211, 153, 0.35);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(17, 24, 39, 0.92));
}

.screen--offline {
    border-color: rgba(248, 113, 113, 0.35);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(17, 24, 39, 0.92));
}

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

.screen-header h2 {
    margin: 0;
    font-size: 20px;
}

.muted {
    color: var(--muted);
}

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

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

.dashboard-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.dashboard-chart canvas {
    max-width: 220px;
    max-height: 220px;
}

.dashboard-chart {
    min-height: 240px;
}

.dashboard-chart canvas {
    width: 100% !important;
    max-width: 520px;
    height: 240px !important;
    max-height: 240px;
}

.pie-chart-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    display: grid;
    place-items: center;
}

.pie-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #1f2937;
    box-shadow: inset 0 0 0 12px #0f172a, 0 18px 35px rgba(0, 0, 0, 0.45);
}

.pie-chart-center {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.pie-chart-total {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.pie-chart-sub {
    font-size: 12px;
    color: var(--muted);
}

.pie-legend {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
}

.pie-legend-item {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text);
}

.pie-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}

.pie-legend-label {
    font-weight: 600;
}

.pie-legend-value {
    font-weight: 600;
    color: var(--primary-ink);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-radius: 24px;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.28), transparent 45%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.95));
    color: #f8fafc;
    margin-bottom: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.dashboard-hero h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.dashboard-hero p {
    margin: 0 0 12px;
    color: rgba(248, 250, 252, 0.8);
}

.dashboard-meta {
    display: inline-flex;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.12);
    font-size: 12px;
    color: rgba(248, 250, 252, 0.8);
}

.dashboard-total {
    min-width: 220px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.35);
    text-align: center;
}

.dashboard-kicker {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.7);
}

.dashboard-value {
    font-size: 28px;
    font-weight: 700;
    margin: 10px 0 6px;
}

.dashboard-sub {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.7);
}

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

.ap-rollup {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.ap-rollup-stat {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(15, 23, 42, 0.65);
}

.ap-rollup-stat--good {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.12);
}

.ap-rollup-stat--warn {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.14);
}

.ap-rollup-stat--bad {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.14);
}

.ap-rollup-stat--idle {
    background: rgba(17, 24, 39, 0.7);
}

.ap-rollup-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.ap-rollup-label {
    font-size: 12px;
    color: var(--muted);
}

.ap-rollup-grid {
    display: grid;
    gap: 10px;
}

.ap-rollup-card {
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ap-rollup-name {
    font-weight: 600;
    color: var(--text);
}

.ap-rollup-meta {
    font-size: 12px;
    color: var(--muted);
}

.ap-rollup-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ap-rollup-clients {
    font-size: 12px;
    color: var(--muted);
}

.ap-rollup-note {
    margin-top: 12px;
    font-size: 12px;
}

.pulse-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.pulse-card {
    position: relative;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    background: rgba(17, 24, 39, 0.9);
    box-shadow: var(--shadow-soft);
    min-height: 160px;
    overflow: hidden;
    animation: pulse-rise 0.6s ease both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pulse-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pulse-card--accent {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.9)), #111827;
}

.pulse-card:nth-child(1) {
    animation-delay: 0.05s;
}

.pulse-card:nth-child(2) {
    animation-delay: 0.1s;
}

.pulse-card:nth-child(3) {
    animation-delay: 0.15s;
}

.pulse-card:nth-child(4) {
    animation-delay: 0.2s;
}

.pulse-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.pulse-stat {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.pulse-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.pulse-label {
    font-size: 12px;
    color: var(--muted);
}

.pulse-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pulse-link {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--primary-ink);
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s ease;
}

.pulse-link:hover {
    color: var(--primary);
}

.pulse-muted {
    font-size: 12px;
    color: var(--muted);
}

.pulse-user {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pulse-user-name {
    font-weight: 700;
    font-size: 16px;
}

.pulse-user-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pulse-balance {
    font-weight: 600;
    color: var(--primary-ink);
    font-size: 13px;
}

.pulse-actions {
    display: grid;
    gap: 8px;
}

.pulse-action {
    text-decoration: none;
    text-align: center;
}

@keyframes pulse-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-panel {
    background: rgba(17, 24, 39, 0.9);
    border-radius: 20px;
    padding: 18px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    box-shadow: var(--shadow-soft);
}

.panel-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.method-card {
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(39, 50, 68, 0.9);
}

.method-name {
    font-size: 12px;
    color: var(--muted);
}

.method-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-top: 6px;
}

.cash-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(39, 50, 68, 0.9);
    font-size: 12px;
    color: var(--muted);
}

.cash-summary strong {
    display: block;
    font-size: 14px;
    color: var(--text);
    margin-top: 4px;
}

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

@media (max-width: 900px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-total {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .pulse-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.95));
    border: 1px solid rgba(39, 50, 68, 0.9);
    padding: 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    font-weight: 700;
}

.kpi-card h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    border: 1px solid rgba(39, 50, 68, 0.9);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.7);
}

.task-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge--pending {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.badge--approved {
    background: rgba(52, 211, 153, 0.18);
    color: #6ee7b7;
}

.badge--rejected {
    background: rgba(248, 113, 113, 0.18);
    color: #fca5a5;
}

.badge--issue {
    background: rgba(248, 113, 113, 0.16);
    color: var(--danger);
}

.badge--active {
    background: rgba(52, 211, 153, 0.16);
    color: #6ee7b7;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-search {
    max-width: 520px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.client-search label {
    margin-bottom: 0;
}

.client-search input {
    margin-top: 4px;
}

.client-search .primary-btn {
    min-width: 110px;
}

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

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

input,
select,
textarea {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    background: rgba(15, 23, 42, 0.8);
    font-size: 14px;
    font-family: inherit;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow);
    background: rgba(15, 23, 42, 0.95);
}

.inline-feedback {
    font-size: 12px;
    color: var(--danger);
}

.success-message {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.tower-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tower-card {
    padding: 14px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tower-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ap-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed var(--stroke);
    background: rgba(15, 23, 42, 0.65);
    font-size: 12px;
    color: var(--muted);
}

.ap-metrics div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ap-metrics strong {
    font-size: 13px;
    color: var(--text);
}

.ap-status-good {
    border-color: rgba(52, 211, 153, 0.5);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.14), rgba(15, 23, 42, 0.95));
}

.ap-status-warn {
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(15, 23, 42, 0.95));
}

.ap-status-bad {
    border-color: rgba(248, 113, 113, 0.5);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.16), rgba(15, 23, 42, 0.95));
}

.ap-status-idle {
    border-color: var(--stroke);
    background: rgba(15, 23, 42, 0.7);
}

.map-widget {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(15, 23, 42, 0.85));
    border-radius: 16px;
    padding: 16px;
    border: 1px dashed var(--stroke);
    min-height: 180px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.map-pin {
    border-radius: 12px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--stroke);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.data-table th,
.data-table td {
    text-align: start;
    padding: 10px;
    border-bottom: 1px solid var(--stroke);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.55);
}

.data-table th {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.8);
}

.incident-panel {
    background: rgba(17, 24, 39, 0.92);
}

.incident-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.incident-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(15, 23, 42, 0.7);
}

.incident-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.incident-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 12px;
}

.incident-time {
    color: var(--muted);
}

.field-notes-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field-notes-input {
    resize: vertical;
    min-height: 90px;
}

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

.field-notes-history {
    display: grid;
    gap: 10px;
}

.field-note-item {
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(15, 23, 42, 0.7);
    padding: 10px 12px;
    font-size: 13px;
}

.field-note-time {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}

.speed-test-panel {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 55%), rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.speed-test-form .form-grid {
    grid-template-columns: minmax(0, 220px);
}

.speed-test-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.speed-test-result {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    background: rgba(15, 23, 42, 0.75);
    font-size: 13px;
    color: var(--text);
    min-height: 60px;
}

.speed-test-result strong {
    color: var(--primary-ink);
}

.speed-test-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.speed-test-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-weight: 600;
    font-size: 12px;
    color: var(--text);
}

.speed-test-kpis {
    display: grid;
    gap: 12px;
}

.speed-test-section {
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--stroke);
}

.speed-test-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 600;
}

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

.speed-test-stat {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.speed-test-label {
    font-size: 12px;
    color: var(--muted);
}

.install-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.install-total {
    margin-inline-start: auto;
    font-size: 12px;
    color: var(--muted);
    align-self: center;
}

.ap-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ap-form {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(15, 23, 42, 0.75);
}

.ap-form .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ap-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.ap-table {
    border: 1px solid var(--stroke);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: var(--shadow-soft);
}

.ap-table input,
.ap-table select {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.ap-row-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 10px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.status-chip--ok {
    background: rgba(52, 211, 153, 0.18);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.35);
}

.status-chip--warn {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.detail-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-pill--online {
    background: rgba(52, 211, 153, 0.18);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.35);
}

.status-pill--offline {
    background: rgba(248, 113, 113, 0.18);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
}

.detail-card--warning {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.15);
}

.detail-card--success {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.15);
}

.detail-card--danger {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.16);
}

.topup-shell {
    position: relative;
    overflow: hidden;
}

.topup-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(37, 99, 235, 0.18), transparent 55%);
    pointer-events: none;
}

.topup-head {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    z-index: 1;
}

.topup-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.topup-form {
    position: relative;
    z-index: 1;
}

.topup-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
}

.topup-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
}

.topup-card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.topup-select {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-weight: 600;
}

.topup-hint {
    font-size: 13px;
}

.topup-steps {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.topup-step {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
    font-weight: 700;
}

.topup-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topup-phone {
    display: flex;
    gap: 10px;
    align-items: center;
}

.topup-phone select {
    width: 140px;
    flex: 0 0 140px;
}

.topup-phone input {
    flex: 1 1 auto;
}

.topup-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
}

.topup-note {
    font-size: 12px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.8);
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid var(--stroke);
}

.topup-status {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.12);
}

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

    .topup-steps {
        grid-template-columns: auto 1fr;
        row-gap: 6px;
    }

    .topup-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

body[data-dir="rtl"] .topup-steps {
    grid-template-columns: 1fr auto 1fr auto 1fr auto;
}

body[data-dir="rtl"] .topup-steps > div {
    text-align: right;
}

body[data-dir="rtl"] .topup-actions {
    justify-content: flex-start;
}

body[data-dir="rtl"] .topup-phone {
    direction: ltr;
}

body[data-dir="rtl"] .topup-phone input {
    text-align: right;
}

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

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

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    font-size: 12px;
}

.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(15, 23, 42, 0.7);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(39, 50, 68, 0.9);
}

.tab-link {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tab-link.active,
.tab-link:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #e5e7eb;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
}

.toast {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(52, 211, 153, 0.18);
    color: #6ee7b7;
    font-weight: 600;
    font-size: 13px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 14px;
    color: var(--text);
}

.alert-success {
    background: var(--alert-success-bg);
    border-color: var(--alert-success-border);
    color: var(--alert-success-text);
}

.alert-error {
    background: var(--alert-error-bg);
    border-color: var(--alert-error-border);
    color: var(--alert-error-text);
}

.flash-spotlight {
    position: relative;
    padding: 16px 18px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.flash-spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.flash-spotlight.flash-focused {
    animation: flash-pulse 1.2s ease;
}

@keyframes flash-pulse {
    0% {
        transform: translateY(8px);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35);
        opacity: 0.4;
    }
    100% {
        transform: translateY(0);
        box-shadow: var(--shadow-soft);
        opacity: 1;
    }
}

body[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #f6f9ff 0%, #eef4ff 45%, #e6efff 100%);
    border-inline-end: 1px solid var(--stroke);
    box-shadow: inset -1px 0 0 rgba(37, 99, 235, 0.1);
}

body[data-theme="light"] .topbar,
body[data-theme="light"] .screen,
body[data-theme="light"] .dashboard-panel,
body[data-theme="light"] .pulse-card,
body[data-theme="light"] .task-item,
body[data-theme="light"] .method-card,
body[data-theme="light"] .incident-item,
body[data-theme="light"] .detail-card,
body[data-theme="light"] .report-filters-card,
body[data-theme="light"] .report-summary-card,
body[data-theme="light"] .report-table,
body[data-theme="light"] .topup-card,
body[data-theme="light"] .speed-test-section,
body[data-theme="light"] .speed-test-stat,
body[data-theme="light"] .speed-test-result,
body[data-theme="light"] .field-note-item,
body[data-theme="light"] .map-pin,
body[data-theme="light"] .ap-rollup-card,
body[data-theme="light"] .detail-card,
body[data-theme="light"] .kpi-card,
body[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--stroke);
    color: var(--text);
}

body[data-theme="light"] .sidebar-footer,
body[data-theme="light"] .lang-switch,
body[data-theme="light"] .ghost-btn,
body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea,
body[data-theme="light"] .topup-select,
body[data-theme="light"] .topup-note,
body[data-theme="light"] .speed-test-pill,
body[data-theme="light"] .tab-nav,
body[data-theme="light"] .bottom-nav,
body[data-theme="light"] .report-pill,
body[data-theme="light"] .report-hero__badge {
    background: rgba(242, 247, 255, 0.95);
    border-color: var(--stroke);
    color: var(--text);
}

body[data-theme="light"] .screen--online {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(255, 255, 255, 0.96));
}

body[data-theme="light"] .screen--offline {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(255, 255, 255, 0.96));
}

body[data-theme="light"] .dashboard-hero,
body[data-theme="light"] .report-hero,
body[data-theme="light"] .speed-test-panel,
body[data-theme="light"] .topup-shell {
    color: var(--text);
}

body[data-theme="light"] .dashboard-hero {
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 45%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 240, 255, 0.95));
}

body[data-theme="light"] .topup-shell::before {
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(14, 165, 233, 0.12), transparent 55%);
}

body[data-theme="light"] .bottom-nav a.active,
body[data-theme="light"] .pulse-link,
body[data-theme="light"] .topup-card-title,
body[data-theme="light"] .brand,
body[data-theme="light"] .nav-link,
body[data-theme="light"] .panel-title,
body[data-theme="light"] .detail-value,
body[data-theme="light"] .ap-rollup-name,
body[data-theme="light"] .method-value,
body[data-theme="light"] .pulse-number,
body[data-theme="light"] .report-card-title,
body[data-theme="light"] .report-kpi__value,
body[data-theme="light"] .report-table__title,
body[data-theme="light"] .pie-chart-total,
body[data-theme="light"] label,
body[data-theme="light"] .ap-rollup-value,
body[data-theme="light"] .speed-test-result,
body[data-theme="light"] .topbar h1,
body[data-theme="light"] .topbar p strong {
    color: var(--text);
}

body[data-theme="light"] .nav-link.active,
body[data-theme="light"] .nav-link:hover,
body[data-theme="light"] .tab-link.active,
body[data-theme="light"] .tab-link:hover,
body[data-theme="light"] .lang-switch button.active {
    color: #0f172a;
}

.support-shell {
    display: grid;
    grid-template-columns: minmax(520px, 1.45fr) minmax(320px, 1fr);
    grid-template-areas:
        "topline topline"
        "thread stack";
    gap: 18px;
    align-items: stretch;
}

.support-topline {
    grid-area: topline;
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
}

.support-thread {
    grid-area: thread;
}

.support-column--stack {
    grid-area: stack;
}

.support-kpi {
    border: 1px solid rgba(39, 50, 68, 0.9);
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.9);
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.support-kpi-label {
    font-size: 12px;
    color: var(--muted);
}

.support-kpi-value {
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    color: var(--text);
}

.support-kpi--status .muted {
    font-size: 12px;
}

.support-kpi-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #86efac;
}

.support-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15);
}

.support-kpi-status.is-offline {
    color: #fca5a5;
}

.support-kpi-status.is-offline .support-live-dot {
    background: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
}

.support-column,
.support-thread {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(39, 50, 68, 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    min-height: 72vh;
}

.support-column {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.support-panel-controls {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    border-bottom: 1px solid rgba(39, 50, 68, 0.9);
}

.support-panel-controls--stack {
    grid-template-columns: 1fr;
}

.support-control-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 8px;
}

.support-search {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    font-size: 13px;
    padding: 10px 12px;
}

.support-filter-btn {
    min-width: 120px;
}

.support-filter-btn.is-active {
    background: rgba(59, 130, 246, 0.18);
    color: #e5e7eb;
    border-color: rgba(59, 130, 246, 0.35);
}

.support-panel-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.support-panel-badge--mine {
    color: #86efac;
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.28);
}

.support-panel-head {
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(39, 50, 68, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.support-panel-head h2,
.support-thread-head h2 {
    margin: 0;
    font-size: 18px;
}

.support-panel-head p,
.support-thread-head p,
.support-empty p,
.support-card-meta,
.support-thread-subtext,
.support-thread-caption,
.support-thread-file {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.support-panel-count {
    min-width: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    color: #dbeafe;
    font-weight: 700;
    text-align: center;
}

.support-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
}

.support-list--stack {
    min-height: calc(72vh - 152px);
}

.support-card {
    border: 1px solid rgba(39, 50, 68, 0.9);
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.92);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.support-card-priority {
    position: absolute;
    inset-inline-start: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: transparent;
}

.support-card--unread {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(17, 24, 39, 0.9));
}

.support-card--unread .support-card-priority {
    background: #38bdf8;
}

.support-card:hover,
.support-card.is-active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(59, 130, 246, 0.45);
}

.support-card-head,
.support-card-actions,
.support-thread-head,
.support-thread-actions,
.support-compose-row,
.support-thread-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.support-card-head,
.support-thread-head {
    justify-content: space-between;
}

.support-card-title,
.support-thread-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.support-card-title strong,
.support-thread-contact strong {
    font-size: 15px;
    color: var(--text);
}

.support-card-preview {
    font-size: 13px;
    color: var(--text);
    line-height: 1.45;
}

.support-card-badges,
.support-thread-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.support-pill {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.24);
    background: rgba(59, 130, 246, 0.14);
    font-size: 12px;
    color: #dbeafe;
    font-weight: 600;
}

.support-pill--queue {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.24);
    color: #fcd34d;
}

.support-pill--mine {
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.24);
    color: #86efac;
}

.support-pill--closed {
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(248, 113, 113, 0.26);
    color: #fca5a5;
}

.support-thread {
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    overflow: hidden;
}

.support-thread-head {
    padding: 20px 22px 14px;
    border-bottom: 1px solid rgba(39, 50, 68, 0.9);
}

.support-thread-assistant {
    padding: 12px 22px;
    border-bottom: 1px solid rgba(39, 50, 68, 0.9);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.support-thread-meta {
    padding: 12px 22px 0;
}

.support-thread-body {
    padding: 18px 22px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.65), rgba(15, 23, 42, 0.35));
}

.support-message {
    max-width: 78%;
    border-radius: 22px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-soft);
}

.support-message strong {
    font-size: 12px;
}

.support-message p {
    margin: 0;
    line-height: 1.55;
    color: inherit;
}

.support-message time {
    font-size: 11px;
    opacity: 0.8;
}

.support-message--inbound {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
}

.support-message--outbound {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(37, 99, 235, 0.22));
    color: #f8fafc;
}

.support-message--system {
    align-self: center;
    background: rgba(59, 130, 246, 0.12);
    color: #dbeafe;
    text-align: center;
}

.support-message-media {
    width: min(320px, 100%);
    border-radius: 16px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    overflow: hidden;
}

.support-message-media img,
.support-message-media video {
    width: 100%;
    display: block;
}

.support-message-media audio {
    width: 100%;
}

.support-compose {
    padding: 18px 22px 22px;
    border-top: 1px solid rgba(39, 50, 68, 0.9);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-compose textarea {
    min-height: 120px;
    resize: vertical;
}

.support-compose-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.support-compose-hint {
    font-size: 12px;
    color: var(--muted);
}

.support-select,
.support-upload {
    min-width: 180px;
}

.support-empty {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
}

.support-empty-card {
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-banner {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.26);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(17, 24, 39, 0.92));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.support-banner p {
    margin: 0;
    color: var(--muted);
}

.support-banner strong {
    color: var(--text);
}

.support-status {
    min-height: 20px;
    font-size: 13px;
}

.support-status.is-error {
    color: #fca5a5;
}

.support-status.is-success {
    color: #86efac;
}

body[data-theme="light"] .support-column,
body[data-theme="light"] .support-thread,
body[data-theme="light"] .support-card,
body[data-theme="light"] .support-banner,
body[data-theme="light"] .support-message--inbound,
body[data-theme="light"] .support-message--system {
    background: rgba(255, 255, 255, 0.94);
    border-color: var(--stroke);
    color: var(--text);
}

body[data-theme="light"] .support-message--outbound {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(16, 185, 129, 0.16));
    color: var(--text);
}

body[data-theme="light"] .support-pill {
    color: var(--text);
}

@media (max-width: 1280px) {
    .support-topline {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .support-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "topline"
            "stack"
            "thread";
    }

    .support-thread {
        min-height: 65vh;
    }
}

@media (max-width: 860px) {
    .support-topline {
        grid-template-columns: 1fr;
    }

    .support-shell {
        grid-template-columns: 1fr;
    }

    .support-column,
    .support-thread {
        min-height: auto;
    }

    .support-message {
        max-width: 92%;
    }

    .support-panel-controls {
        grid-template-columns: 1fr;
    }

    .support-control-group {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.2), transparent 40%),
        radial-gradient(circle at 90% 20%, rgba(37, 99, 235, 0.2), transparent 40%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(39, 50, 68, 0.9);
    box-shadow: var(--shadow);
}

.login-card h2 {
    margin: 0 0 10px;
}

.login-card p {
    margin: 0 0 20px;
    color: var(--muted);
}

.login-footer {
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

.bottom-nav {
    display: none;
}

.lang {
    display: none;
}

body[data-lang="en"] .lang[data-lang="en"],
body[data-lang="ar"] .lang[data-lang="ar"] {
    display: inline;
}

body[data-lang="en"] .lang-block[data-lang="en"],
body[data-lang="ar"] .lang-block[data-lang="ar"] {
    display: block;
}

.lang-block {
    display: none;
}

.report-filters {
    align-items: end;
}

.report-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.report-summary {
    margin-top: 16px;
}

.report-page {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 55%), rgba(15, 23, 42, 0.85);
    position: relative;
    overflow: hidden;
}

.report-page::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.22), transparent 40%);
    pointer-events: none;
}

.report-hero {
    position: relative;
    z-index: 1;
    padding: 24px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(37, 99, 235, 0.85));
    color: #f8fafc;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.report-title {
    margin: 0 0 8px;
    font-size: 24px;
}

.report-subtitle {
    margin: 0 0 16px;
    color: rgba(248, 250, 252, 0.78);
}

.report-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.report-pill strong {
    font-weight: 600;
}

.report-hero__badge {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.6);
    font-weight: 600;
}

.report-split {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
}

.report-filters-card,
.report-summary-card {
    background: rgba(15, 23, 42, 0.85);
    border-radius: 18px;
    border: 1px solid var(--stroke);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.report-card-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

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

.report-actions {
    margin-top: 14px;
}

.report-summary-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-kpis {
    display: grid;
    gap: 12px;
}

.report-kpi {
    padding: 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(39, 50, 68, 0.9);
}

.report-kpi__label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.report-kpi__value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.report-note {
    font-size: 12px;
    color: var(--muted);
    padding-top: 6px;
    border-top: 1px dashed rgba(39, 50, 68, 0.9);
}

.report-empty {
    margin-top: 18px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px dashed rgba(39, 50, 68, 0.9);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-table {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--stroke);
    background: rgba(15, 23, 42, 0.85);
    box-shadow: var(--shadow-soft);
}

.report-table__title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

@media (max-width: 1000px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main {
        padding: 20px 20px 120px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .form-grid,
    .tower-grid {
        grid-template-columns: 1fr;
    }

    .client-search {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .client-search .primary-btn {
        width: 100%;
    }

    .client-insights {
        grid-template-columns: 1fr;
    }

    .speed-test-form .form-grid {
        grid-template-columns: 1fr;
    }

    .speed-test-grid {
        grid-template-columns: 1fr;
    }

    .ap-rollup {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bottom-nav {
        position: fixed;
        bottom: 16px;
        inset-inline: 16px;
        background: rgba(15, 23, 42, 0.9);
        border: 1px solid var(--stroke);
        border-radius: 18px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        padding: 10px 12px;
        box-shadow: var(--shadow);
        z-index: 10;
    }

    .bottom-nav a {
        text-decoration: none;
        color: var(--muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        font-weight: 600;
    }

    .bottom-nav a.active {
        color: var(--primary-ink);
    }
}

@media (max-width: 900px) {
    .report-hero {
        flex-direction: column;
    }

    .report-split {
        grid-template-columns: 1fr;
    }

    .report-filters-grid {
        grid-template-columns: 1fr;
    }

    .ap-rollup {
        grid-template-columns: 1fr;
    }

    .incident-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .incident-status {
        align-items: flex-start;
    }
}

@media print {
    body[data-print="1"] {
        background: #ffffff;
    }

    body[data-print="1"] .sidebar,
    body[data-print="1"] .topbar,
    body[data-print="1"] .nav,
    body[data-print="1"] .lang-switch,
    body[data-print="1"] .ghost-btn,
    body[data-print="1"] .primary-btn,
    body[data-print="1"] .chip,
    body[data-print="1"] .toast,
    body[data-print="1"] .screen:not(#sales-report) {
        display: none !important;
    }

    body[data-print="1"] .main {
        padding: 0;
    }

    body[data-print="1"] #sales-report {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    body[data-print="1"] .report-actions {
        display: none !important;
    }
}
