/**
 * CTV Portal - Tgroup Operational Shell
 *
 * Enterprise redesign layer for the modular CTV portal. Loaded last so the
 * legacy glass styles can remain in place while this file defines the current
 * visual authority.
 */

:root {
    --primary-blue: #c89849;
    --primary-purple: #a87526;
    --primary-gradient: linear-gradient(135deg, #c89849 0%, #a87526 100%);
    --accent-blue: #0ea5e9;
    --accent-green: #059669;
    --accent-red: #dc2626;
    --accent-orange: #c89849;
    --accent-purple: #7c3aed;
    --accent-yellow: #d97706;
    --priority-low: #059669;
    --priority-medium: #c89849;
    --bg-body: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #fffdf8;
    --bg-tertiary: #fff8e7;
    --glass-bg: #fffdf8;
    --glass-bg-hover: #fff8e7;
    --glass-border: rgba(168, 117, 38, 0.18);
    --glass-shadow: 0 10px 28px rgba(115, 82, 31, 0.08);
    --glass-blur: none;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --success: #059669;
    --success-light: #ecfdf5;
    --info: #0284c7;
    --info-light: #eff6ff;
    --warning: #c89849;
    --warning-light: #fff8e7;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --pink: #db2777;
    --pink-light: #fdf2f8;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --radius-2xl: 8px;
    --sidebar-width-expanded: 250px;
    --sidebar-width-collapsed: 72px;
    --sidebar-bg: #c8b99e;
    --sidebar-bg-hover: #b7a682;
    --sidebar-active: rgba(255, 253, 248, 0.58);
    --sidebar-text: #5f513d;
    --sidebar-text-strong: #3f3322;
    --border-subtle: rgba(168, 117, 38, 0.16);
    --shadow-card: 0 10px 26px rgba(115, 82, 31, 0.08);
    --shadow-panel: 0 18px 42px rgba(115, 82, 31, 0.14);
    --focus-ring: 0 0 0 3px rgba(200, 152, 73, 0.18);
    --metal-champagne: linear-gradient(135deg, #fff9e8 0%, #f8df96 36%, #d7a84e 66%, #fff0bd 100%);
    --metal-gold: linear-gradient(135deg, #fff4bd 0%, #e7bd54 35%, #b97a1b 68%, #ffe7a3 100%);
    --metal-brass: linear-gradient(135deg, #f5d48a 0%, #c99535 34%, #8d5d18 70%, #e9be65 100%);
    --metal-bronze: linear-gradient(135deg, #e5b06a 0%, #b16a25 36%, #6f3f16 72%, #d5964a 100%);
    --metal-copper: linear-gradient(135deg, #f0b078 0%, #b65f2d 38%, #6f2f17 72%, #d27b42 100%);
}

html {
    background: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background-color: #ffffff !important;
    background-image:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.86) 28%, transparent 52%),
        radial-gradient(circle at 86% 24%, rgba(205, 158, 78, 0.22) 0%, rgba(232, 208, 156, 0.18) 28%, transparent 56%),
        linear-gradient(145deg, #ffffff 0%, #fffdf8 34%, #fbf3df 68%, #d6b272 100%) !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    color: var(--text-primary);
    letter-spacing: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: repeating-linear-gradient(115deg, rgba(180, 150, 90, 0.025) 0 2px, transparent 2px 7px);
}

.portal.active {
    position: relative;
    z-index: 1;
    background: transparent;
}

.page-section.active {
    animation: none;
}

#page-dashboard.active {
    position: relative;
    isolation: isolate;
    min-height: calc(100svh - 116px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: clamp(40px, 7vh, 84px) 0 clamp(56px, 8vh, 92px);
    box-sizing: border-box;
    overflow: visible;
    box-shadow: none;
}

#page-dashboard.active::before {
    content: "";
    position: absolute;
    inset: -72px -32px -160px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 70% at 50% 18%, rgba(255, 244, 210, 0.92), rgba(250, 235, 200, 0) 55%),
        radial-gradient(ellipse 55% 55% at 82% 60%, rgba(232, 195, 130, 0.46), rgba(232, 195, 130, 0) 60%),
        radial-gradient(ellipse 60% 60% at 12% 92%, rgba(210, 165, 95, 0.36), rgba(210, 165, 95, 0) 60%),
        linear-gradient(180deg, rgba(251, 242, 216, 0.62) 0%, rgba(244, 225, 180, 0.52) 55%, rgba(231, 207, 148, 0.36) 100%);
    filter: blur(10px);
}

#page-dashboard.active > * {
    position: relative;
    z-index: 1;
}

.dashboard-commission-pill {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    min-height: 146px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    border: 1px solid rgba(198, 148, 56, 0.46);
    border-radius: 0 28px 28px 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.16) 20%, rgba(120, 72, 18, 0.08) 55%, rgba(255, 255, 255, 0.22) 100%),
        linear-gradient(112deg, #fff9df 0%, #f4d98d 18%, #ca9337 42%, #ffe7a7 57%, #c1812a 76%, #f3cf80 100%);
    color: #5d3815;
    box-shadow:
        0 18px 42px rgba(143, 97, 32, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        inset 0 -1px 0 rgba(104, 61, 16, 0.18);
    cursor: pointer;
    font: inherit;
    text-align: left;
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.dashboard-commission-pill::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.54), transparent 42%),
        linear-gradient(90deg, transparent 0 14%, rgba(255, 255, 255, 0.42) 22%, transparent 34% 63%, rgba(255, 242, 184, 0.36) 74%, transparent 88%);
    opacity: 0.78;
}

.dashboard-commission-pill::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 0 27px 27px 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.36) 0 2px, transparent 2px 48%, rgba(91, 50, 9, 0.12) 50%, transparent 66%),
        radial-gradient(ellipse at 100% 0%, rgba(255, 246, 207, 0.46), transparent 46%);
    mix-blend-mode: screen;
}

.dashboard-commission-pill:hover,
.dashboard-commission-pill:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(198, 148, 56, 0.62);
    box-shadow:
        0 24px 52px rgba(143, 97, 32, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
    outline: none;
}

.dashboard-commission-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    min-width: 0;
}

.dashboard-commission-label {
    color: #765015;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.dashboard-commission-value {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    color: #5c3510;
    font-size: clamp(42px, 6vw, 62px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0;
    white-space: nowrap;
}

.dashboard-commission-number {
    font-variant-numeric: tabular-nums;
}

.dashboard-commission-currency {
    color: #7b5419;
    font-size: 0.46em;
    font-weight: 900;
}

.dashboard-commission-trend {
    color: #7b5419;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
}

.dashboard-commission-icon {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #7b5419;
}

.dashboard-commission-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Shell */
.sidebar {
    width: var(--sidebar-width-expanded);
    padding: 20px 12px;
    background: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(115, 82, 31, 0.12);
    box-shadow: 16px 0 40px rgba(115, 82, 31, 0.1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    padding: 20px 14px;
}

.sidebar-header {
    padding: 0 8px 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(115, 82, 31, 0.12);
    gap: 10px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    overflow: visible;
    padding: 0 0 18px;
}

.sidebar-logo {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 12px;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(200, 152, 73, 0.34);
    box-shadow: none;
    padding: 6px;
}

.sidebar-logo .sidebar-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar.collapsed .sidebar-logo {
    width: 50px;
    height: 50px;
    min-width: 50px;
    padding: 5px;
}

.sidebar-brand {
    color: var(--sidebar-text-strong);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}

.sidebar-menu {
    align-items: stretch;
    gap: 4px;
}

.nav-label {
    display: block;
    margin: 14px 10px 6px;
    padding: 0;
    color: rgba(63, 51, 34, 0.62);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-icon {
    width: 100%;
    height: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    transform: none;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar:not(.collapsed) .sidebar-header {
    justify-content: flex-start;
}

.sidebar:not(.collapsed) .sidebar-brand {
    display: inline-block;
    width: auto;
    opacity: 1;
    overflow: visible;
}

.sidebar:not(.collapsed) .sidebar-menu {
    align-items: stretch;
}

.sidebar:not(.collapsed) .sidebar-icon {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
}

.sidebar:not(.collapsed) .sidebar-icon span:not(.lang-current):not(.logout-exit-label) {
    display: inline-block;
    width: auto;
    min-width: 0;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .nav-label {
    display: none;
}

.sidebar-icon:hover {
    background: var(--sidebar-bg-hover);
    color: #3f3322;
    border-color: rgba(115, 82, 31, 0.1);
    box-shadow: none;
    transform: none;
}

.sidebar-icon.active {
    background: var(--sidebar-active);
    color: #3f3322;
    border-color: rgba(115, 82, 31, 0.12);
    box-shadow: none;
}

.sidebar-icon.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 11px;
    width: 3px;
    height: 28px;
    border-radius: 999px;
    background: #d6ad66;
}

.sidebar-icon svg {
    width: 26px;
    height: 26px;
    min-width: 26px;
    opacity: 0.76;
    color: currentColor;
    stroke: currentColor;
    filter: none;
}

.sidebar-icon.active svg,
.sidebar-icon:hover svg {
    opacity: 1;
    color: currentColor;
    stroke: currentColor;
    filter: none;
}

.sidebar-icon.sidebar-referral,
.sidebar-icon.sidebar-catalogue,
.sidebar-icon.sidebar-pricing {
    background: transparent !important;
    color: var(--sidebar-text) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.sidebar-icon.sidebar-referral:hover,
.sidebar-icon.sidebar-catalogue:hover,
.sidebar-icon.sidebar-pricing:hover {
    background: var(--sidebar-bg-hover) !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

.sidebar-icon.sidebar-referral svg,
.sidebar-icon.sidebar-catalogue svg,
.sidebar-icon.sidebar-pricing svg,
.sidebar-icon.sidebar-referral span,
.sidebar-icon.sidebar-catalogue span,
.sidebar-icon.sidebar-pricing span {
    color: inherit !important;
    stroke: currentColor !important;
}

.sidebar-lang .lang-current {
    color: #5f513d;
    background: rgba(255, 253, 248, 0.5);
    border: 1px solid rgba(115, 82, 31, 0.12);
}

.sidebar-lang.active .sidebar-icon {
    background: var(--sidebar-bg-hover);
}

.sidebar-collapse-btn {
    height: 48px;
    min-height: 48px;
    margin-top: 10px;
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.28);
    border-color: rgba(115, 82, 31, 0.14);
    color: #5f513d;
    box-shadow: inset 0 1px 0 rgba(255, 253, 248, 0.26);
}

.sidebar-collapse-btn svg {
    width: 24px;
    height: 24px;
}

.sidebar.collapsed .sidebar-icon,
.sidebar.collapsed .sidebar-collapse-btn {
    width: 50px;
    min-width: 50px;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 253, 248, 0.5);
    border-color: rgba(115, 82, 31, 0.2);
    color: #3f3322;
}

.sidebar-logout-bottom {
    border-radius: 8px;
    color: #5f513d;
}

.sidebar-logout:hover {
    background: rgba(255, 253, 248, 0.42);
    color: #3f3322;
}

.logout-exit-label {
    color: #5f513d;
}

.sidebar-tooltip,
.lang-popup,
.header-lang-dropdown {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: var(--shadow-panel);
    color: var(--text-primary);
}

.sidebar-tooltip::before,
.lang-popup::before {
    border-right-color: #ffffff;
}

.sidebar-menu {
    overflow-x: visible;
}

.sidebar-icon {
    overflow: visible;
}

.sidebar-tooltip {
    display: block;
    left: calc(100% + 10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sidebar-icon:hover .sidebar-tooltip,
.sidebar-icon:focus-visible .sidebar-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.sidebar-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    z-index: 10000;
    min-width: max-content;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: var(--shadow-panel);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
    display: none;
}

.sidebar-icon[data-tooltip]::before {
    content: '';
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    border: 6px solid transparent;
    border-right-color: #ffffff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease;
    display: none;
}

.sidebar-icon[data-tooltip]:hover::after,
.sidebar-icon[data-tooltip]:focus-visible::after,
.sidebar-icon[data-tooltip]:hover::before,
.sidebar-icon[data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

.sidebar-icon[data-tooltip]:hover::after,
.sidebar-icon[data-tooltip]:focus-visible::after {
    transform: translateY(-50%) translateX(0);
}

.sidebar.collapsed .sidebar-icon:hover span:not(.lang-current):not(.logout-exit-label),
.sidebar.collapsed .sidebar-icon:focus-visible span:not(.lang-current):not(.logout-exit-label) {
    display: block;
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10002;
    min-width: max-content;
    max-width: 180px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #111827;
    color: #ffffff !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
}

.sidebar.collapsed .sidebar-icon:hover .sidebar-tooltip,
.sidebar.collapsed .sidebar-icon:focus-visible .sidebar-tooltip {
    display: none;
}

.sidebar-hover-label {
    position: fixed;
    z-index: 2147483647;
    transform: translateY(-50%);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #111827;
    color: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.34);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 120ms ease, visibility 120ms ease;
}

.sidebar-hover-label.active {
    opacity: 1;
    visibility: visible;
}

.dashboard-subject-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(84px, 1fr));
    grid-auto-rows: auto;
    align-items: start;
    gap: clamp(14px, 3vw, 22px);
    max-width: 620px;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-subject-card {
    position: relative;
    isolation: isolate;
    overflow: visible;
    width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 4px;
    border: 0;
    outline: none;
    border-radius: 28px;
    background: transparent;
    color: var(--subject-text, var(--text-primary));
    box-shadow: none;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', Inter, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    text-shadow: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 180ms ease, transform 180ms ease;
}

.dashboard-subject-card::before {
    content: none;
}

.dashboard-subject-card > span[data-i18n] {
    position: relative;
    z-index: 1;
    display: block;
    min-height: 0;
    max-width: 100%;
    line-height: 1.25;
    color: #6b4416;
    overflow-wrap: anywhere;
}

.dashboard-subject-card:nth-child(1) {
    --subject-chip-top: #b9904d;
    --subject-chip-mid: #9a6f2d;
    --subject-chip-bottom: #735018;
    --subject-glow: #ffd97a;
}

.dashboard-subject-card:nth-child(2) {
    --subject-chip-top: #9b7432;
    --subject-chip-mid: #76521c;
    --subject-chip-bottom: #56390f;
    --subject-glow: #ffb259;
}

.dashboard-subject-card:nth-child(3) {
    --subject-chip-top: #80591f;
    --subject-chip-mid: #603d12;
    --subject-chip-bottom: #3f2809;
    --subject-glow: #d97546;
}

.dashboard-subject-card:nth-child(4) {
    --subject-chip-top: #674416;
    --subject-chip-mid: #452a09;
    --subject-chip-bottom: #281805;
    --subject-glow: #a45d25;
}

.dashboard-subject-card:hover,
.dashboard-subject-card:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.dashboard-subject-card:hover .dashboard-subject-icon,
.dashboard-subject-card:focus-visible .dashboard-subject-icon {
    transform: translateY(-3px);
    box-shadow:
        0 22px 32px -12px rgba(80, 50, 10, 0.5),
        inset 0 1px 0 rgba(255, 232, 175, 0.48),
        inset 0 -1px 0 rgba(0, 0, 0, 0.32);
}

.dashboard-subject-card:hover .dashboard-subject-icon::before,
.dashboard-subject-card:focus-visible .dashboard-subject-icon::before {
    inset: -14px;
    opacity: 0.96;
}

.dashboard-subject-card:focus-visible .dashboard-subject-icon {
    outline: 2px solid rgba(255, 224, 165, 0.72);
    outline-offset: 4px;
}

.dashboard-subject-icon {
    position: relative;
    z-index: 1;
    isolation: isolate;
    width: 88px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 26px;
    background:
        linear-gradient(180deg, var(--subject-chip-top, #8a6428) 0%, var(--subject-chip-mid, #6e4d1c) 45%, var(--subject-chip-bottom, #4f3712) 100%);
    color: #fff4d2;
    box-shadow:
        0 18px 28px -10px rgba(80, 50, 10, 0.45),
        inset 0 1px 0 rgba(255, 232, 175, 0.45),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.dashboard-subject-icon::before {
    content: "";
    position: absolute;
    inset: -10px;
    z-index: -1;
    border-radius: 32px;
    background: radial-gradient(circle, var(--subject-glow, #ffb259) 0%, rgba(255, 178, 89, 0) 70%);
    filter: blur(18px);
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 250ms ease, inset 250ms ease;
}

.dashboard-subject-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    border: 1px solid rgba(255, 224, 165, 0.32);
    background: linear-gradient(180deg, rgba(255, 240, 200, 0.28) 0%, rgba(255, 240, 200, 0) 50%);
}

.dashboard-subject-icon svg {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 7px rgba(255, 224, 160, 0.55));
}

.earnings-commission-note {
    margin-bottom: 20px;
    padding: 18px 22px;
    border: 1px solid rgba(168, 117, 38, 0.22);
    border-radius: 8px;
    background:
        radial-gradient(ellipse at 8% 18%, rgba(255, 255, 255, 0.72), rgba(255, 253, 248, 0) 44%),
        linear-gradient(135deg, #fff8df 0%, #f6dfaa 100%);
    color: #332819;
    box-shadow: 0 14px 30px rgba(168, 117, 38, 0.12);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.45;
}

.lang-popup-title {
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.lang-option {
    border-radius: 6px;
}

.lang-option:hover,
.lang-option.active,
.header-lang-dropdown .lang-option:hover,
.header-lang-dropdown .lang-option.active {
    background: #fff7ed;
}

.lang-flag {
    background: #fff7ed;
    color: #ea580c;
}

.main-wrapper {
    margin-left: var(--sidebar-width-expanded);
    padding: 88px 24px 28px;
    background: transparent;
    transition: margin-left var(--sidebar-transition);
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-width-collapsed);
}

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

.floating-header {
    top: 0;
    left: var(--sidebar-width-expanded);
    right: 0;
    min-height: 64px;
    border-radius: 0;
    background: rgba(255, 253, 248, 0.92);
    border: 0;
    border-bottom: 1px solid rgba(168, 117, 38, 0.14);
    box-shadow: 0 8px 22px rgba(115, 82, 31, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.floating-header.sidebar-collapsed {
    left: var(--sidebar-width-collapsed);
}

.floating-header:hover {
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.floating-header-inner {
    min-height: 64px;
    padding: 0 24px;
    gap: 16px;
}

.floating-header .header-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    width: auto;
}

.header-menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #fff8e7;
    border: 1px solid var(--border-subtle);
}

.header-menu-btn:hover {
    background: #fff4d8;
    transform: none;
}

.header-menu-btn svg {
    stroke: #374151;
}

.floating-header .header-logo {
    width: 48px;
    height: 48px;
    padding: 6px;
    border-radius: 12px;
    background: #fff8e7;
    border: 1px solid rgba(200, 152, 73, 0.22);
}

.floating-header .header-logo .logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
}

.header-brand {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    letter-spacing: 0;
}

.header-actions {
    gap: 8px;
    flex: 0 0 auto;
}

.header-action-btn {
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 253, 248, 0.9);
    color: #6b5430;
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    transform: none;
}

.header-action-btn:hover {
    transform: none;
    box-shadow: none;
}

.action-signup {
    background: rgba(255, 253, 248, 0.9);
    color: #6b5430;
    border-color: var(--border-subtle);
    box-shadow: none;
}

.action-signup:hover {
    background: #fff8e7;
    color: #5c431e;
}

.action-booking {
    background: #c89849;
    color: #ffffff;
    border-color: #c89849;
    box-shadow: none;
}

.action-booking:hover,
.action-booking:focus-visible {
    background: #a87526;
    color: #ffffff;
    border-color: #a87526;
    box-shadow: none;
}

.action-booking svg,
.action-booking:hover svg,
.action-signup svg {
    stroke: currentColor;
}

.floating-header .header-right {
    display: flex;
    align-items: center;
    position: relative;
    width: auto;
    flex: 0 0 auto;
    gap: 8px;
}

.header-user {
    display: none;
    align-items: center;
    max-width: 280px;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff8e7;
    border: 1px solid var(--border-subtle);
}

.header-user.is-loaded {
    display: inline-flex;
}

.floating-header .user-name {
    min-width: 0;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.floating-header .user-badge {
    display: none;
}

.user-badge,
.floating-header .user-badge {
    background: #fffdf8 !important;
    border: 1px solid rgba(200, 152, 73, 0.24) !important;
    color: #8a6620 !important;
    border-radius: 999px;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
}

.user-badge:hover {
    transform: none;
    box-shadow: none;
}

.header-lang-btn {
    min-height: 36px;
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid var(--border-subtle);
}

.header-lang-btn:hover {
    background: #fff8e7;
}

.header-lang-btn svg {
    stroke: #6b7280;
}

.header-lang-label {
    color: #374151;
}

.header-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: max-content;
    min-width: 160px;
}

/* Panels, cards, and metrics */
.card,
.stat-card,
.phone-check-card,
.chart-card,
.recent-activity,
.client-card,
.client-table-wrapper,
.commission-request-card,
.settings-card,
.tree-card {
    background: rgba(255, 253, 248, 0.94) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-card) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.card,
.phone-check-card,
.recent-activity,
.client-card {
    overflow: hidden;
}

.card:hover,
.stat-card:hover,
.client-card:hover,
.chart-card:hover {
    transform: none;
    box-shadow: var(--shadow-card) !important;
}

.card-header {
    padding: 16px 18px;
    background: rgba(255, 253, 248, 0.96);
    border-bottom: 1px solid var(--border-subtle);
}

.card-header h3,
.chart-title,
.phone-check-card h3,
.recent-activity h3 {
    margin: 0;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.card-header h3.badge-header {
    background: transparent;
    color: #111827;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
}

.card-body {
    padding: 18px;
}

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

.stat-card {
    min-height: 126px;
    padding: 18px;
    justify-content: space-between;
}

.stat-header {
    margin-bottom: 12px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #fff8e7 !important;
    box-shadow: none;
    color: #a87526 !important;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-trend {
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    padding: 3px 8px;
    font-size: 12px;
}

.stat-trend.down {
    background: #fef2f2;
    color: #dc2626;
}

.stat-card .label,
.stat-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stat-card .value,
.stat-value {
    color: #111827;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.12;
}

.metric-trend,
.activity-time,
.client-phone,
.client-info-label,
.filter-label {
    color: #6b7280;
}

.charts-section {
    gap: 16px;
    margin-bottom: 18px;
}

.chart-card {
    height: 380px;
    padding: 18px;
}

.chart-btn,
.btn-filter-preset,
.view-toggle-btn {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.94);
    color: #4b5563;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
}

.chart-btn:hover,
.chart-btn.active,
.btn-filter-preset:hover,
.btn-filter-preset.active,
.view-toggle-btn:hover,
.view-toggle-btn.active {
    background: #fff8e7;
    border-color: rgba(200, 152, 73, 0.32);
    color: #8a6620;
    box-shadow: none;
    transform: none;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-filter,
.btn-check-phone,
.floating-book-btn,
.cta-action-btn {
    border-radius: 8px;
    font-weight: 700;
    box-shadow: none;
    transform: none;
}

.btn-primary,
.btn-filter,
.btn-check-phone,
.floating-book-btn,
.cta-action-btn {
    background: #c89849 !important;
    color: #ffffff !important;
    border: 1px solid #c89849 !important;
}

.btn-primary:hover,
.btn-filter:hover,
.btn-check-phone:hover,
.floating-book-btn:hover,
.cta-action-btn:hover {
    background: #a87526 !important;
    border-color: #a87526 !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

#bookingSubmitBtn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 52px;
    border-radius: 8px !important;
    border: 1px solid rgba(116, 67, 18, 0.62) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0.18) 32%, rgba(255, 255, 255, 0) 48%),
        radial-gradient(ellipse at 20% 12%, rgba(255, 255, 255, 0.85), rgba(255, 244, 206, 0.18) 42%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(135deg, #ffe8a7 0%, #d79d3a 34%, #8b5317 70%, #e6b35c 100%) !important;
    color: #fff8e6 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        inset 0 -12px 20px rgba(78, 38, 8, 0.2),
        0 10px 24px rgba(132, 82, 24, 0.18),
        0 0 22px rgba(220, 162, 62, 0.2) !important;
    text-shadow: 0 1px 2px rgba(70, 34, 8, 0.35);
}

#bookingSubmitBtn::before {
    content: "";
    position: absolute;
    inset: 4px 8px auto 8px;
    height: 36%;
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: -1;
}

#bookingSubmitBtn:hover:not(:disabled),
#bookingSubmitBtn:focus-visible {
    border-color: rgba(92, 50, 13, 0.72) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 32%, rgba(255, 255, 255, 0) 48%),
        radial-gradient(ellipse at 20% 12%, rgba(255, 255, 255, 0.9), rgba(255, 244, 206, 0.2) 42%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(135deg, #fff0b9 0%, #e2aa42 34%, #965c1b 70%, #edbd68 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        inset 0 -12px 20px rgba(78, 38, 8, 0.22),
        0 12px 28px rgba(132, 82, 24, 0.22),
        0 0 26px rgba(220, 162, 62, 0.24) !important;
}

#bookingSubmitBtn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    filter: saturate(0.76);
}

.cta-action-container {
    margin-bottom: 18px !important;
}

.cta-action-btn {
    justify-content: space-between !important;
    padding: 16px 18px !important;
    min-height: 74px !important;
    background: rgba(255, 253, 248, 0.94) !important;
    color: #111827 !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-card) !important;
    overflow: visible !important;
}

.cta-action-btn:hover {
    background: #fff8e7 !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
    box-shadow: var(--shadow-card) !important;
}

.cta-action-btn:active {
    transform: none !important;
}

.cta-content {
    justify-content: flex-start !important;
    gap: 10px !important;
}

.cta-icon {
    width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background: #fff8e7 !important;
    color: #a87526 !important;
    font-size: 18px !important;
    filter: none !important;
}

.cta-text {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.cta-badge {
    top: 50% !important;
    right: 18px !important;
    transform: translateY(-50%) !important;
    min-width: 28px !important;
    height: 28px !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #c89849 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    animation: none !important;
}

.btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.floating-book-btn {
    right: 24px;
    bottom: 24px;
    min-height: 44px;
    padding: 0 18px;
}

.form-group label {
    color: #374151;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea,
.form-group select,
.phone-check-row input,
.date-input,
.client-search-box input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111827;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.phone-check-row input:focus,
.date-input:focus,
.client-search-box input:focus {
    border-color: #f97316;
    box-shadow: var(--focus-ring);
    background-color: #ffffff;
}

.form-group input[readonly],
.form-group input:disabled {
    background: #f3f4f6 !important;
    color: #6b7280;
}

.phone-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.phone-input-row input {
    width: 100%;
    min-width: 0;
}

.phone-check-result {
    justify-self: start;
    min-width: 0;
    min-height: 28px;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.phone-check-result.checking {
    background: #eff6ff;
    color: #0369a1;
}

.phone-check-result.trung {
    background: #fef2f2;
    color: #dc2626;
}

.phone-check-result.khong-trung {
    background: #ecfdf5;
    color: #047857;
}

.phone-check-result.warning {
    background: #fff7ed;
    color: #c2410c;
}

.remember-me input[type="checkbox"] {
    accent-color: #f97316;
}

/* Tables */
.recent-commissions-table,
.stats-table,
.direct-downline-table,
.client-table,
.services-list-table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

.recent-commissions-table thead th,
.stats-table thead th,
.direct-downline-table thead th,
.client-table thead th,
.services-list-table thead th {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-subtle);
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.recent-commissions-table tbody tr,
.stats-table tbody tr,
.direct-downline-table tbody tr,
.client-table tbody tr,
.services-list-table tbody tr {
    background: #ffffff;
    box-shadow: none;
    transform: none;
}

.recent-commissions-table tbody tr:hover,
.stats-table tbody tr:hover,
.direct-downline-table tbody tr:hover,
.client-table tbody tr:hover,
.services-list-table tbody tr:hover {
    background: #f9fafb;
    box-shadow: none;
    transform: none;
}

.recent-commissions-table td,
.stats-table td,
.direct-downline-table td,
.client-table td,
.services-list-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    background: transparent;
    color: #374151;
}

.recent-commissions-table td:first-child,
.recent-commissions-table td:last-child,
.direct-downline-table td:first-child,
.direct-downline-table td:last-child,
.services-list-table tbody tr td:first-child,
.services-list-table tbody tr td:last-child {
    border-radius: 0;
}

.col-total,
.col-revenue,
.activity-amount,
.svc-price {
    color: #059669 !important;
}

.level-badge,
.priority-badge,
.svc-status,
.client-status-badge,
.service-count-badge {
    border-radius: 999px;
    box-shadow: none;
}

.level-badge {
    background: #eff6ff;
    color: #0369a1;
}

/* Client records */
.client-card {
    border-radius: 8px;
}

.client-card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 18px;
}

.client-avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #fff7ed;
    color: #ea580c;
}

.client-name {
    color: #111827;
}

.client-phone {
    color: #6b7280;
}

.service-count-badge {
    background: #eff6ff;
    color: #0369a1;
}

.client-info-row {
    border-bottom: 1px solid #eef2f7;
}

.client-info-item {
    min-width: min(100%, 148px);
}

.client-info-money .client-info-value {
    color: #059669;
}

.client-empty-state {
    grid-column: 1 / -1;
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    padding: 22px;
    color: var(--text-secondary);
}

.client-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #fff7ed;
    color: #c89849;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.client-empty-icon svg {
    width: 26px;
    height: 26px;
}

.client-empty-state p {
    margin: 0 0 16px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
}

.client-empty-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.client-empty-field {
    min-height: 82px;
    border: 1px solid #eadcc5;
    border-radius: 8px;
    background: rgba(255, 248, 231, 0.62);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.client-empty-field span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.client-empty-field strong {
    color: #111827;
    font-size: 18px;
    font-weight: 800;
}

.client-table-empty {
    text-align: center;
    color: #6b7280 !important;
    font-weight: 700;
}

.services-container {
    background: #f9fafb;
    padding: 14px 18px;
}

.svc-index {
    background: #fff7ed;
    color: #ea580c;
    box-shadow: none;
}

.svc-status.completed,
.svc-status.deposited,
.client-status-badge.deposited {
    background: #ecfdf5;
    color: #047857;
}

.svc-status.pending,
.client-status-badge.not-deposited {
    background: #fff7ed;
    color: #c2410c;
}

.svc-status.cancel {
    background: #fef2f2;
    color: #dc2626;
}

.svc-status.consulting {
    background: #eff6ff;
    color: #0369a1;
}

/* Login */
.login-container {
    background: #f3f4f6;
}

.login-box {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: var(--shadow-panel);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
}

.login-logo {
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.18);
    border-radius: 10px;
    box-shadow: none;
}

.login-logo svg path {
    stroke: #f97316;
}

.login-box h1 {
    color: #111827;
    font-size: 24px;
    letter-spacing: 0;
}

.login-box .btn-login {
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, #8b541f 0%, #c89849 48%, #e1b86c 100%);
    border: 1px solid rgba(128, 82, 28, 0.5);
    color: #ffffff;
    box-shadow:
        0 14px 32px rgba(168, 117, 38, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -1px 0 rgba(101, 62, 20, 0.26);
    letter-spacing: 0;
    transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.login-box .btn-login::before {
    display: block;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    opacity: 0;
    transition: left 0.5s ease, opacity 0.22s ease;
}

.login-box .btn-login:hover::before {
    opacity: 1;
}

.login-box .btn-login:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(135deg, #9a6126 0%, #d4a75a 48%, #f0cf83 100%);
    transform: translateY(-1px);
    box-shadow:
        0 18px 40px rgba(168, 117, 38, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(101, 62, 20, 0.28);
}

.login-box .btn-login .btn-icon {
    border-radius: 6px;
}

.back-link {
    border-top: 1px solid var(--border-subtle);
}

.back-link a:hover {
    color: #b7792b;
}

.error-msg {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.success-checkmark {
    background: #059669;
    box-shadow: none;
}

.signup-link {
    margin-top: 16px;
    text-align: center;
}

.signup-link a {
    color: #c89849 !important;
    font-weight: 600;
    text-decoration: none;
}

.signup-link a:hover {
    color: #9a6126 !important;
}

/* Voice input */
.voice-input-compact {
    gap: 10px;
}

.voice-pill-btn {
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #ffffff;
    color: #ea580c;
    border: 1px solid rgba(249, 115, 22, 0.28);
    box-shadow: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.voice-pill-btn:hover {
    background: #fff7ed;
    color: #c2410c;
    border-color: rgba(249, 115, 22, 0.42);
    transform: none;
    box-shadow: none;
}

.voice-pill-btn:active {
    transform: none;
}

.voice-pill-icon {
    stroke: currentColor;
}

.voice-pill-text {
    letter-spacing: 0;
}

.voice-pill-btn.recording {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    animation: pill-pulse 1.2s ease-in-out infinite;
}

.voice-pill-btn.processing {
    background: #f97316;
    color: #ffffff;
    border-color: #f97316;
    box-shadow: none;
}

.voice-status-inline {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 999px;
}

.voice-result-tag {
    background: #ecfdf5;
    border-color: #a7f3d0;
    border-radius: 999px;
}

/* Mobile */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .header-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 1100;
        display: flex !important;
        flex-direction: column;
        transform: translateX(0);
        transition: transform 0.3s ease-in-out;
        background: var(--sidebar-bg) !important;
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1099;
        opacity: 0;
        visibility: hidden;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    #page-dashboard.active {
        min-height: calc(100svh - 220px);
        padding: 24px 0 40px;
    }

    #page-dashboard.active::before {
        inset: -36px -24px -120px;
        filter: blur(14px);
    }

    .dashboard-commission-pill {
        width: 100%;
        min-height: 112px;
        padding: 20px;
        gap: 14px;
        border-radius: 0 22px 22px 0;
    }

    .dashboard-commission-label {
        font-size: 13px;
    }

    .dashboard-commission-value {
        font-size: clamp(34px, 10vw, 44px);
    }

    .dashboard-commission-trend {
        font-size: 13px;
    }

    .dashboard-commission-icon {
        width: 28px;
        height: 28px;
    }

    .main-wrapper,
    .main-wrapper.sidebar-collapsed {
        width: 100%;
        max-width: 100vw;
        margin-left: 0 !important;
        padding: 80px 12px 92px !important;
        overflow-x: hidden;
    }

    .floating-header,
    .floating-header.sidebar-collapsed {
        top: 0;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0;
    }

    .floating-header-inner {
        width: 100%;
        max-width: none;
        min-height: 60px;
        margin: 0;
        padding: 0 12px;
        gap: 8px;
        justify-content: space-between;
    }

    .floating-header .header-left,
    .floating-header .header-right,
    .header-actions {
        flex: 0 0 auto;
    }

    .floating-header .header-left {
        flex: 1 1 auto;
        justify-content: flex-start;
        min-width: 0;
    }

    .header-menu-btn {
        display: flex !important;
    }

    .header-actions {
        gap: 6px;
    }

    .header-action-btn {
        width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        justify-content: center;
    }

    .header-action-btn span {
        display: none;
    }

    .header-user {
        max-width: 148px;
        min-height: 38px;
        padding: 0 10px;
        flex: 0 1 auto;
        border-radius: 8px;
    }

    .header-user.is-loaded {
        display: inline-flex !important;
    }

    .floating-header .user-name {
        max-width: 156px;
        font-size: 16px;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        min-height: 112px;
    }

    .chart-card {
        height: 320px;
    }

    .card-header,
    .card-body,
    .phone-check-card,
    .recent-activity,
    .chart-card {
        padding: 14px;
    }

    .phone-check-row {
        align-items: stretch;
    }

    .phone-check-row input,
    .phone-check-row .btn-check-phone {
        width: 100%;
        min-width: 100%;
    }

    .ctv-clients-grid {
        grid-template-columns: 1fr;
    }

    .client-card-header,
    .client-info-row,
    .services-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .mobile-menu-content {
        background: #ffffff;
        border-radius: 0 0 8px 8px;
        box-shadow: var(--shadow-panel);
    }

    .mobile-menu-header {
        border-bottom: 1px solid var(--border-subtle);
    }

    .mobile-menu-close {
        border-radius: 8px;
        background: #f9fafb;
        border: 1px solid var(--border-subtle);
    }

    .mobile-menu-item {
        border-radius: 8px;
        color: #374151;
    }

    .mobile-menu-item:hover,
    .mobile-menu-item.active,
    .mobile-menu-item.mobile-referral {
        background: #fff7ed;
        color: #ea580c;
    }

    .mobile-menu-item.mobile-menu-logout {
        color: #dc2626;
    }

    .floating-book-btn {
        right: 14px;
        bottom: 14px;
        min-height: 42px;
        padding: 0 14px;
        border-radius: 999px;
    }

    .dashboard-subject-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
        gap: 18px 12px;
        max-width: 360px;
    }

    .dashboard-subject-card {
        height: auto;
        min-height: 0;
        padding: 6px 4px;
        gap: 12px;
        font-size: 13px;
    }

    .dashboard-subject-card > span[data-i18n] {
        min-height: 0;
        line-height: 1.25;
    }

    .dashboard-subject-icon {
        width: 82px;
        height: 82px;
        border-radius: 24px;
    }

    .client-empty-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (hover: none), (pointer: coarse) {
    .sidebar-collapse-btn {
        display: none;
    }

    .sidebar-hover-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .main-wrapper,
    .main-wrapper.sidebar-collapsed {
        padding-left: 10px;
        padding-right: 10px;
    }

    .floating-header .user-badge {
        display: none;
    }

    .recent-commissions-table,
    .stats-table,
    .direct-downline-table,
    .client-table,
    .services-list-table {
        min-width: 640px;
    }

    .login-box {
        padding: 34px 22px;
    }

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