
:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --panel-hover: #ebecf0;
    --line: rgba(9, 30, 66, 0.08);
    --border: rgba(9, 30, 66, 0.13);
    --panel-bg: #ffffff;
    --text: #172b4d;
    --muted: #5e6c84;
    --blue: #007AFF;
    --blue-hover: #0063d1;
    --green: #36b37e;
    --orange: #ffab00;
    --red: #ff5630;
    --violet: #6554c0;
    --sidebar-bg: rgba(255, 255, 255, 0.9);
    --sidebar-border: rgba(9, 30, 66, 0.08);
    --sidebar-text: #42526e;
    --sidebar-text-active: #007AFF;
    --sidebar-hover: rgba(0, 82, 204, 0.05);
    --radius: 8px;
    --transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, opacity 0.15s ease-in-out;
    --shadow-sm: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
    --shadow-md: 0 4px 8px -2px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
    --shadow-lg: 0 12px 24px -6px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
    --cosmic-glow: linear-gradient(135deg, #007AFF 0%, #00b8d9 100%);
    --input-bg: #fafbfc;
    --input-border: #dfe1e6;
    --input-hover-bg: #ebecf0;
    --input-hover-border: #4c9aff;
    --input-focus-bg: #ffffff;
}

html[data-theme="dark"] {
    --bg: #0b0f19;
    --panel: #161b2a;
    --panel-hover: #1e2538;
    --line: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.06);
    --panel-bg: #161b2a;
    --text: #f9fafb;
    --muted: #9ca3af;
    --blue: #007AFF;
    --blue-hover: #0063d1;
    --green: #10b981;
    --orange: #f59e0b;
    --red: #ef4444;
    --violet: #007AFF;
    --sidebar-bg: rgba(15, 23, 42, 0.7);
    --sidebar-border: rgba(255, 255, 255, 0.04);
    --sidebar-text: #9ca3af;
    --sidebar-text-active: #007AFF;
    --sidebar-hover: rgba(59, 130, 246, 0.04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --cosmic-glow: linear-gradient(135deg, #007AFF 0%, #60a5fa 100%);
    --input-bg: rgba(255, 255, 255, 0.02);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-hover-bg: rgba(255, 255, 255, 0.04);
    --input-hover-border: #007AFF;
    --input-focus-bg: rgba(59, 130, 246, 0.04);
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.wheel-slow-rotation {
    animation: spin-slow 40s linear infinite;
}


* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    letter-spacing: -0.015em;
    overflow-x: hidden;
    position: relative;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 0);
    background-size: 32px 32px;
    background-position: 0 0;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), transparent 85%);
    z-index: -1;
}
html[data-theme="dark"] body::before {
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 0);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 10% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
}
html[data-theme="dark"] body::after {
    background:
        radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.20) 0%, transparent 55%),
        radial-gradient(circle at 15% 85%, rgba(14, 165, 233, 0.15) 0%, transparent 55%);
}
a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { opacity: 0.85; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }

.sidebar {
    position: fixed;
    inset: 16px auto 16px 16px;
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius);
    z-index: 100;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand.compact { margin-bottom: 24px; }
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--cosmic-glow);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}
.brand strong { display: block; color: var(--text); font-size: 17px; font-weight: 700; }
.brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

nav { display: flex; flex-direction: column; gap: 6px; }
.nav-link {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--sidebar-text);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13.5px;
    font-weight: 600;
    gap: 10px;
}
.nav-link:hover {
    background: var(--sidebar-hover) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
    color: #fff !important;
    transform: translateX(3px);
}
html[data-theme="light"] .nav-link:hover {
    border-color: rgba(0, 0, 0, 0.02) !important;
    color: var(--sidebar-text-active) !important;
}
.nav-link.active {
    background: rgba(99, 102, 241, 0.08) !important;
    border: 1px solid rgba(99, 102, 241, 0.18) !important;
    color: var(--sidebar-text-active) !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.05) !important;
}
html[data-theme="light"] .nav-link.active {
    background: rgba(79, 70, 229, 0.06) !important;
    border-color: rgba(79, 70, 229, 0.18) !important;
    color: #0063d1 !important;
}
.nav-icon {
    flex-shrink: 0;
    opacity: 0.8;
    transition: var(--transition);
}
.nav-link.active .nav-icon {
    color: var(--sidebar-text-active);
    opacity: 1;
}
.nav-link.subtle { color: var(--muted); }
.logout-form { margin-top: auto; }

.shell {
    margin-left: 292px;
    padding: 40px 48px;
    max-width: 1500px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 28px;
}
.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding-bottom: 20px;
    }
    .top-actions {
        width: 100%;
        justify-content: space-between;
    }
}
.eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.025em; }
h2 { margin-bottom: 16px; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.user-chip:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.user-chip div strong, .user-chip div span { display: block; }
.user-chip div strong { font-size: 14px; font-weight: 700; }
.user-chip div span { color: var(--muted); font-size: 12px; }

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, var(--avatar, var(--blue)), rgba(99, 102, 241, 0.2));
    color: #fff !important;
    font-weight: 800;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    border: 2px solid var(--panel);
}

.notifications details {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 24px;
    box-shadow: var(--shadow-sm);
}
.notifications summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15px;
    user-select: none;
    outline: none;
}
.notifications summary span {
    background: var(--red);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}
.notice-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.notice { border-left: 4px solid var(--line); padding: 12px 16px; background: rgba(99, 102, 241, 0.01); border-radius: 8px; transition: var(--transition); }
.notice:hover { background: rgba(99, 102, 241, 0.03); transform: translateX(4px); }
.notice.unread { border-left-color: var(--blue); background: rgba(99, 102, 241, 0.04); }
.notice strong, .notice span { display: block; }
.notice strong { font-size: 14px; font-weight: 700; }
.notice span { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.4; }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 32px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
}
html[data-theme="dark"] .panel {
    background: rgba(13, 17, 28, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
        0 10px 40px -10px rgba(0, 0, 0, 0.5);
}
.panel:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 
        0 8px 32px 0 rgba(99, 102, 241, 0.15),
        0 20px 50px -15px rgba(0, 0, 0, 0.3);
}

/* Premium Metric Cards */
.metric-card {
    position: relative;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
html[data-theme="dark"] .metric-card {
    background: rgba(13, 17, 28, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
        0 10px 30px -10px rgba(0, 0, 0, 0.4);
}
.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 
        0 8px 32px 0 rgba(99, 102, 241, 0.15),
        0 16px 40px -12px rgba(0, 0, 0, 0.3);
}
.metric-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.metric-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.metric-value {
    color: var(--text);
    line-height: 1.2;
}
.metric-value strong {
    font-size: 28px;
    font-weight: 800;
}
.metric-value span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 4px;
}
.metric-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

/* Theme colors for cards */
.metric-card.theme-violet { border-left: 4px solid var(--violet); }
.metric-card.theme-violet .metric-icon-wrap { background: rgba(139, 92, 246, 0.08); color: var(--violet); }
.metric-card.theme-violet:hover { border-color: var(--violet); }

.metric-card.theme-orange { border-left: 4px solid var(--orange); }
.metric-card.theme-orange .metric-icon-wrap { background: rgba(245, 158, 11, 0.08); color: var(--orange); }
.metric-card.theme-orange:hover { border-color: var(--orange); }

.metric-card.theme-green { border-left: 4px solid var(--green); }
.metric-card.theme-green .metric-icon-wrap { background: rgba(16, 185, 129, 0.08); color: var(--green); }
.metric-card.theme-green:hover { border-color: var(--green); }

.metric-card.theme-blue { border-left: 4px solid var(--blue); }
.metric-card.theme-blue .metric-icon-wrap { background: rgba(99, 102, 241, 0.08); color: var(--blue); }
.metric-card.theme-blue:hover { border-color: var(--blue); }

.metric.small {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.metric.small:hover { border-color: var(--blue); transform: translateY(-2px); }
.metric.small span { color: var(--muted); font-size: 13px; font-weight: 600; }
.metric.small strong { font-size: 16px; font-weight: 700; color: var(--text); }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.panel-head h2 { margin: 0; font-size: 20px; font-weight: 700; }

.two-col {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 32px;
}
.week-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
}
.week-day {
    min-height: 130px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    background: var(--panel);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.week-day:hover {
    border-color: var(--blue);
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}
.week-day strong {
    font-size: 14px;
    font-weight: 750;
    color: var(--text);
}
.week-day span {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--line);
    color: var(--muted);
    white-space: nowrap;
}
html[data-theme="dark"] .select-modern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
}
.week-day.work span {
    background: rgba(99, 102, 241, 0.1);
    color: var(--blue);
}
.week-day.vacation span {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
}
.week-day.absence span {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
}
.week-day.day_off span {
    background: var(--line);
    color: var(--muted);
}
.week-day.work { border-top: 3px solid var(--blue); }
.week-day.vacation { border-top: 3px solid var(--green); }
.week-day.absence { border-top: 3px solid var(--orange); }
.week-day.day_off { border-top: 3px solid var(--muted); }
.week-day small {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    margin-top: auto;
}

.cal-cell.work, .today-status.work { border-left: 4px solid var(--blue); background: rgba(99, 102, 241, 0.02); }
.cal-cell.vacation, .today-status.vacation { border-left: 4px solid var(--green); background: rgba(16, 185, 129, 0.02); }
.cal-cell.absence, .today-status.absence { border-left: 4px solid var(--orange); background: rgba(245, 158, 11, 0.02); }
.cal-cell.day_off, .today-status.day_off { border-left: 4px solid var(--muted); background: rgba(100, 116, 139, 0.02); }

.people-list { display: flex; flex-direction: column; gap: 12px; }
.person-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.person-row:hover {
    border-color: var(--blue);
    transform: translateX(6px) translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.08);
}
.person-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}
.person-name-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.person-name-wrap strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.person-info span {
    color: var(--muted);
    font-size: 12px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1;
    text-transform: uppercase;
}
.badge-l1 {
    background: rgba(99, 102, 241, 0.1);
    color: var(--blue);
}
.badge-l2 {
    background: rgba(139, 92, 246, 0.1);
    color: var(--violet);
}

.request-list { display: flex; flex-direction: column; gap: 12px; }
.request-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease;
}
.request-line:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.request-line strong, .request-line span { display: block; }
.request-line strong { font-size: 14px; font-weight: 700; }
.request-line span { color: var(--muted); font-size: 12px; }

.request-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    transition: var(--transition);
}
.request-card:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.request-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-grow: 1;
}
.request-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.request-title strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}
.request-main span {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.request-main small {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}
.request-main p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}
.request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .request-card {
        flex-direction: column;
        align-items: stretch;
    }
    .request-actions {
        justify-content: flex-end;
        margin-top: 12px;
    }
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status.approved { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.status.rejected, .status.canceled { background: rgba(239, 68, 68, 0.1); color: var(--red); }
.status.pending_peer, .status.pending_lead { background: rgba(245, 158, 11, 0.1); color: var(--orange); }

.status.work { background: rgba(99, 102, 241, 0.1); color: var(--blue); }
.status.day_off { background: rgba(148, 163, 184, 0.1); color: var(--muted); }
.status.vacation { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.status.absence { background: rgba(245, 158, 11, 0.1); color: var(--orange); }
.status.sick { background: rgba(239, 68, 68, 0.1); color: var(--red); }

.status-alert {
    margin-bottom: 20px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid var(--border);
}
.status-alert.approved {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--green);
}
.status-alert.rejected {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--red);
}

.button {
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.4);
    color: var(--text);
    border-radius: 12px;
    padding: 0 24px;
    font-weight: 750;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
html[data-theme="dark"] .button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}
.button:hover { 
    border-color: var(--blue); 
    background: rgba(255, 255, 255, 0.6); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}
html[data-theme="dark"] .button:hover { 
    background: rgba(255, 255, 255, 0.1); 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.button:active { transform: scale(0.97) translateY(0); }
.button.primary { 
    background: var(--cosmic-glow); 
    border: none; 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); 
}
.button.primary:hover { 
    opacity: 0.95; 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
.button.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--red);
}
.button.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}
.button.ghost { background: var(--bg); }
.button.full { width: 100%; }
.button.slim { min-height: 32px; height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.calendar-toolbar h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.calendar-toolbar span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.inline-filter {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 24px;
}
.inline-filter label { min-width: 240px; }
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    font-weight: 700;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}
.calendar-weekdays div { padding: 0 8px; }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}
.cal-cell {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 130px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.cal-cell:hover { border-color: var(--blue); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cal-cell.muted { opacity: 0.45; background: rgba(0, 0, 0, 0.015); border-style: dashed; }
html[data-theme="dark"] .cal-cell.muted { background: rgba(255, 255, 255, 0.01); }
.cal-cell.today { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
.cal-date { font-size: 14px; font-weight: 800; color: var(--muted); }
.cal-cell.today .cal-date { color: var(--blue); }
.cal-cell strong { font-size: 13px; font-weight: 700; }
.cal-cell span, .cal-cell small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

.request-forms, .admin-grid, .profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.admin-grid { grid-template-columns: 1.4fr 0.8fr; }
.profile-grid { grid-template-columns: 1fr 1fr; }
.stack-form, .form-grid { display: grid; gap: 16px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 8px; color: var(--text); font-size: 13px; font-weight: 700; }
input, select, textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 10px 16px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
input:hover, select:hover, textarea:hover {
    border-color: var(--input-hover-border);
    background: var(--input-hover-bg);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    padding-right: 36px !important;
    cursor: pointer;
}
html[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
}
textarea { resize: vertical; }

.select-modern {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px !important;
    padding: 6px 32px 6px 12px !important;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--panel) !important;
    color: var(--text);
    outline: none;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s ease;
}
.select-modern:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background-color: var(--panel-hover) !important;
}
.select-modern:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
html[data-theme="dark"] .select-modern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
}

.line-selector-group {
    display: inline-flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
html[data-theme="light"] .line-selector-group {
    background: rgba(0, 0, 0, 0.02);
}
.line-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 750;
    color: var(--muted);
    border-radius: 7px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.line-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}
html[data-theme="light"] .line-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}
.line-btn.active {
    background: var(--blue) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Premium Schedule Spreadsheet Styles */
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: inherit;
    table-layout: fixed;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}
.schedule-table th, .schedule-table td {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0 1px;
    font-size: 10px;
    transition: var(--transition);
}
.schedule-table th {
    background: rgba(99, 102, 241, 0.04);
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 4px 2px;
}
html[data-theme="dark"] .schedule-table th {
    background: rgba(99, 102, 241, 0.08);
    color: #94a3b8;
}
.schedule-table .sticky-col {
    font-weight: 600;
    padding: 0 10px;
    text-align: left;
    background: var(--panel) !important;
    color: var(--text) !important;
    position: sticky;
    left: 0;
    z-index: 10;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    white-space: nowrap !important;
    font-size: 11px;
    line-height: 1.2;
}
html[data-theme="dark"] .schedule-table .sticky-col {
    background: #11151e !important;
    color: #f8fafc !important;
    box-shadow: 6px 0 15px rgba(0, 0, 0, 0.35);
}
.schedule-table .total-col {
    text-align: center;
    padding: 1px 2px;
    font-weight: 700;
    font-size: 10px;
    background: var(--panel);
    color: var(--text);
}
html[data-theme="dark"] .schedule-table .total-col {
    background: #11151e;
    color: #f8fafc;
}
.schedule-table tbody tr:nth-child(even) td:not(.shift-cell):not(.sticky-col) {
    background: rgba(99, 102, 241, 0.015);
}
html[data-theme="dark"] .schedule-table tbody tr:nth-child(even) td:not(.shift-cell):not(.sticky-col) {
    background: rgba(255, 255, 255, 0.01);
}
.schedule-table tr:hover td:not(.shift-cell):not(.sticky-col) {
    background-color: var(--panel-hover) !important;
}

/* Shift Cell Types */
.shift-cell {
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.shift-cell.today-column-cell {
    background-image: linear-gradient(0deg, rgba(234, 179, 8, 0.04), rgba(234, 179, 8, 0.04)) !important;
    font-weight: 700 !important;
}
.shift-cell.shift-work {
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--blue) !important;
    font-weight: 600;
}
html[data-theme="dark"] .shift-cell.shift-work {
    background: rgba(99, 102, 241, 0.16) !important;
    color: #007AFF !important;
}
.shift-cell.shift-overtime {
    background: rgba(249, 115, 22, 0.12) !important;
    color: #ea580c !important;
    font-weight: 700;
}
html[data-theme="dark"] .shift-cell.shift-overtime {
    background: rgba(249, 115, 22, 0.20) !important;
    color: #fb923c !important;
}
.shift-cell.shift-vacation {
    background: rgba(16, 185, 129, 0.08) !important;
    color: var(--green) !important;
    font-weight: 600;
}
html[data-theme="dark"] .shift-cell.shift-vacation {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #34d399 !important;
}
.shift-cell.shift-management {
    background: rgba(16, 185, 129, 0.08) !important;
    color: var(--green) !important;
    font-weight: 700;
}
html[data-theme="dark"] .shift-cell.shift-management {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #34d399 !important;
}
.shift-cell.shift-5-2 {
    background: rgba(139, 92, 246, 0.08) !important;
    color: #8b5cf6 !important;
    font-weight: 600;
}
html[data-theme="dark"] .shift-cell.shift-5-2 {
    background: rgba(139, 92, 246, 0.16) !important;
    color: #c084fc !important;
}
.shift-cell.shift-sick {
    background: rgba(239, 68, 68, 0.08) !important;
    color: var(--red) !important;
    font-weight: 600;
}
html[data-theme="dark"] .shift-cell.shift-sick {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #f87171 !important;
}
.shift-cell.shift-other {
    background: rgba(107, 114, 128, 0.08) !important;
    color: var(--muted) !important;
}
.shift-cell.shift-off {
    background: transparent !important;
    color: var(--muted) !important;
    opacity: 0.45;
}
.shift-cell.shift-l2-sergey {
    background: rgba(245, 158, 11, 0.08) !important;
    color: #f59e0b !important;
    font-weight: 600;
}
html[data-theme="dark"] .shift-cell.shift-l2-sergey {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #fbbf24 !important;
}
.shift-cell.shift-l2-alexander {
    background: rgba(244, 63, 94, 0.08) !important;
    color: #f43f5e !important;
    font-weight: 600;
}
html[data-theme="dark"] .shift-cell.shift-l2-alexander {
    background: rgba(244, 63, 94, 0.16) !important;
    color: #fb7185 !important;
}
.shift-cell.shift-lead-ilya {
    background: rgba(139, 92, 246, 0.08) !important;
    color: var(--violet) !important;
    font-weight: 700;
}
html[data-theme="dark"] .shift-cell.shift-lead-ilya {
    background: rgba(139, 92, 246, 0.16) !important;
    color: #c084fc !important;
}

/* ===== Pill-style schedule cells + avatars (макет 1:1) ===== */
/* td = прозрачный контейнер с отступом; цвет несёт внутренний .cellpill */
html .schedule-table td.shift-cell,
html[data-theme="dark"] .schedule-table td.shift-cell,
html[data-theme="light"] .schedule-table td.shift-cell {
    background: transparent !important;
    background-image: none !important;
    padding: 0 1px !important;
    border-right: 1px solid rgba(15,23,42,0.06) !important;
    border-bottom: 1px solid rgba(15,23,42,0.06) !important;
    height: 18px;
    min-width: 26px;
    vertical-align: middle;
    transition: none !important;
}
html[data-theme="dark"] .schedule-table td.shift-cell {
    border-right: 1px solid rgba(255,255,255,0.05) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
.schedule-table td.shift-cell > .cellpill {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    width: 100%;
    min-width: 22px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
    border: 1px solid transparent;
}
/* Цвета пилюль по типу смены (светлая / тёмная тема) */
.schedule-table td.shift-work > .cellpill      { background: rgba(99,102,241,0.14);  color:#4f46e5; border-color: rgba(99,102,241,0.30); }
.schedule-table td.shift-management > .cellpill { background: rgba(16,185,129,0.15);  color:#047857; border-color: rgba(16,185,129,0.34); }
.schedule-table td.shift-5-2 > .cellpill        { background: rgba(139,92,246,0.15);  color:#6d28d9; border-color: rgba(139,92,246,0.34); }
.schedule-table td.shift-lead-ilya > .cellpill  { background: rgba(139,92,246,0.15);  color:#6d28d9; border-color: rgba(139,92,246,0.34); }
.schedule-table td.shift-vacation > .cellpill   { background: rgba(16,185,129,0.14);  color:#047857; border-color: rgba(16,185,129,0.32); font-size:10px; letter-spacing:0.3px; }
.schedule-table td.shift-sick > .cellpill       { background: rgba(239,68,68,0.14);   color:#dc2626; border-color: rgba(239,68,68,0.34); font-size:10px; }
.schedule-table td.shift-l2-sergey > .cellpill  { background: rgba(245,158,11,0.20);  color:#b45309; border-color: rgba(245,158,11,0.48); }
.schedule-table td.shift-l2-alexander > .cellpill { background: rgba(244,63,94,0.15); color:#e11d48; border-color: rgba(244,63,94,0.42); }
.schedule-table td.shift-overtime > .cellpill   { background: rgba(249,115,22,0.16);  color:#c2410c; border-color: rgba(249,115,22,0.42); }
.schedule-table td.shift-other > .cellpill      { background: rgba(107,114,128,0.12); color:#4b5563; border-color: rgba(107,114,128,0.30); }
.schedule-table td.shift-off > .cellpill        { background: transparent; }
html[data-theme="dark"] .schedule-table td.shift-work > .cellpill      { background: rgba(99,102,241,0.20);  color:#a5b4fc; }
html[data-theme="dark"] .schedule-table td.shift-management > .cellpill { background: rgba(16,185,129,0.20);  color:#6ee7b7; }
html[data-theme="dark"] .schedule-table td.shift-5-2 > .cellpill        { background: rgba(139,92,246,0.22);  color:#c4b5fd; }
html[data-theme="dark"] .schedule-table td.shift-lead-ilya > .cellpill  { background: rgba(139,92,246,0.22);  color:#c4b5fd; }
html[data-theme="dark"] .schedule-table td.shift-vacation > .cellpill   { background: rgba(16,185,129,0.20);  color:#6ee7b7; }
html[data-theme="dark"] .schedule-table td.shift-sick > .cellpill       { background: rgba(239,68,68,0.22);   color:#fca5a5; }
html[data-theme="dark"] .schedule-table td.shift-l2-sergey > .cellpill  { background: rgba(245,158,11,0.22);  color:#fcd34d; }
html[data-theme="dark"] .schedule-table td.shift-l2-alexander > .cellpill { background: rgba(244,63,94,0.22); color:#fda4af; }
html[data-theme="dark"] .schedule-table td.shift-overtime > .cellpill   { background: rgba(249,115,22,0.24); color:#fdba74; border-color: rgba(249,115,22,0.40); }
html[data-theme="dark"] .schedule-table td.shift-other > .cellpill      { background: rgba(148,163,184,0.16); color:#cbd5e1; }
/* Подсветка сегодняшней колонки — нежная обводка по контуру пилюли */
html .schedule-table td.shift-cell.today-column-cell {
    box-shadow: none !important;
    border-radius: 0;
}
.schedule-table td.shift-cell.today-column-cell > .cellpill {
    box-shadow: inset 0 0 0 1.5px rgba(234, 179, 8, 0.45);
}
/* Тост-уведомления */
.fb-toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 10001;
    padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 700;
    color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    opacity: 0; transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.fb-toast.show { opacity: 1; transform: translateY(0); }
.fb-toast.ok  { background: linear-gradient(135deg,#10b981,#059669); }
.fb-toast.err { background: linear-gradient(135deg,#ef4444,#dc2626); }
/* Кастомный тултип ячеек */
.fb-celltip {
    position: fixed; top: 0; left: 0; z-index: 10001; pointer-events: none;
    background: #0b0f19; color: #e8eef8;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); max-width: 220px;
    opacity: 0; transition: opacity .12s ease;
    will-change: transform;
}
.fb-celltip.show { opacity: 1; }
.fb-celltip b { font-size: 12.5px; font-weight: 800; }
.fb-celltip span { display: block; color: #8595b4; margin-top: 2px; }
html[data-theme="light"] .fb-celltip {
    background: #1e2536; color: #f4f6fa;
    border-color: rgba(255,255,255,0.08);
}
@media (prefers-reduced-motion: reduce) {
    .fb-toast, .fb-celltip { transition: none; }
}
/* Аватар у ФИО */
.op-avatar {
    width: 17px;
    height: 17px;
    min-width: 17px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.20), rgba(139,92,246,0.20));
    color: #0063d1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,0.18);
}
html[data-theme="dark"] .op-avatar {
    background: linear-gradient(135deg, rgba(129,140,248,0.28), rgba(167,139,250,0.28));
    color: #c7d2fe;
    box-shadow: inset 0 0 0 1px rgba(129,140,248,0.30);
}
/* Подсветка сотрудника, который сегодня на смене */
.schedule-table .sticky-col.op-onshift {
    background: linear-gradient(90deg, rgba(16,185,129,0.14), rgba(16,185,129,0.02)) !important;
    box-shadow: inset 3px 0 0 #10b981, 4px 0 10px rgba(0,0,0,0.05) !important;
}
.schedule-table .sticky-col.op-onshift .op-name {
    color: #059669 !important;
    font-weight: 800;
}
.schedule-table .sticky-col.op-onshift .op-avatar {
    background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(5,150,105,0.25));
    color: #059669;
    box-shadow: inset 0 0 0 1px rgba(16,185,129,0.35), 0 0 8px rgba(16,185,129,0.25);
}
html[data-theme="dark"] .schedule-table .sticky-col.op-onshift {
    background: linear-gradient(90deg, rgba(16,185,129,0.22), rgba(16,185,129,0.03)) !important;
    box-shadow: inset 3px 0 0 #10b981, 6px 0 15px rgba(0,0,0,0.35) !important;
}
html[data-theme="dark"] .schedule-table .sticky-col.op-onshift .op-name {
    color: #34d399 !important;
}
html[data-theme="dark"] .schedule-table .sticky-col.op-onshift .op-avatar {
    background: linear-gradient(135deg, rgba(52,211,153,0.28), rgba(16,185,129,0.28));
    color: #6ee7b7;
    box-shadow: inset 0 0 0 1px rgba(52,211,153,0.4), 0 0 8px rgba(16,185,129,0.3);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 10px 40px rgba(31, 38, 135, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-theme="dark"] .table-wrap {
    background: rgba(17, 24, 39, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { 
    text-align: left; 
    padding: 16px 18px; 
    border-bottom: 1px solid var(--line); 
    white-space: nowrap; 
    font-size: 13.5px; 
    transition: background 0.25s ease, color 0.25s ease; 
}
#approved-articles-table td:first-child, .tab-content table td:first-child, td:first-child { white-space: normal; }
th { 
    background: rgba(99, 102, 241, 0.05); 
    color: var(--muted); 
    font-size: 11.5px; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 0.08em; 
    border-bottom: 2px solid rgba(99, 102, 241, 0.15);
}
html[data-theme="dark"] th { 
    background: rgba(99, 102, 241, 0.08); 
    border-bottom: 2px solid rgba(99, 102, 241, 0.25);
}
tbody tr td {
    background-color: transparent;
}
tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.05);
}
html[data-theme="dark"] tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.12);
}
tbody tr:hover td:first-child {
    box-shadow: inset 4px 0 0 var(--blue);
}

.audit-list { display: flex; flex-direction: column; gap: 12px; }
.audit-line {
    display: grid;
    grid-template-columns: 140px 1fr 220px;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    align-items: center;
    transition: var(--transition);
}
.audit-line:hover { border-color: var(--blue); transform: translateY(-2px); }
.audit-line strong { font-weight: 700; }
.audit-line small { color: var(--muted); }
.profile-card { text-align: center; padding: 32px 24px; }
.profile-card .avatar { width: 80px; height: 80px; margin: 0 auto 20px; font-size: 24px; }
.empty, .empty-mini { color: var(--muted); text-align: center; padding: 32px; font-size: 14px; }

.notifications-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.notifications-toggle:hover {
    border-color: var(--blue);
    background: var(--panel-hover);
    transform: translateY(-2px) scale(1.05);
}
.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg);
}
.notifications-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 320px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
    overflow: hidden;
}
.notifications-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.notifications-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}
.notifications-list {
    max-height: 280px;
    overflow-y: auto;
}
.notice {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.notice:last-child {
    border-bottom: none;
}
.notice:hover {
    background: var(--panel-hover);
}
.notice.unread {
    background: rgba(99, 102, 241, 0.05);
}
.notice strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.notice span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--blue); transform: translateY(-2px) scale(1.05); }
.theme-icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.theme-icon.sun {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f59e0b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 3v1m0 16v1m9-9h-1M4 12H3m15.364-6.364l-.707.707M6.343 17.657l-.707.707m0-12.728l.707.707m12.728 12.728l.707-.707M12 8a4 4 0 100 8 4 4 0 000-8z'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .theme-icon.sun { display: none; }
.theme-icon.moon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z'/%3E%3C/svg%3E");
    display: none;
}
html[data-theme="dark"] .theme-icon.moon {
    display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23818cf8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z'/%3E%3C/svg%3E");
}

.view-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}
.view-tabs a {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
}
.view-tabs a.active, .view-tabs a:hover {
    color: var(--text);
    background: var(--bg);
}

.team-edit-row {
    background: rgba(255, 255, 255, 0.02) !important;
}
html[data-theme="dark"] .team-edit-row {
    background: rgba(0, 0, 0, 0.25) !important;
}
.team-edit-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 24px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 12px;
    box-shadow: var(--shadow-sm);
}
.team-edit-form label {
    font-size: 12px;
    font-weight: 700;
}
.team-edit-form label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    align-self: end;
    min-height: 42px;
    cursor: pointer;
}
.team-edit-form label.checkbox input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    cursor: pointer;
}
.team-edit-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.team-day { display: flex; flex-direction: column; gap: 12px; }
.team-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    padding: 0 4px;
}
.team-shift {
    border: 1px solid var(--border);
    border-left: 4px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.team-shift.shift-one { border-left-color: var(--blue); }
.team-shift.shift-two { border-left-color: var(--violet); }
.team-shift.shift-five { border-left-color: var(--green); }
.team-shift-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.team-shift-head strong { font-size: 13px; font-weight: 700; }
.team-shift-head span { font-size: 11px; color: var(--muted); }
.team-people { display: flex; flex-direction: column; gap: 8px; }
.team-person {
    position: relative;
    padding: 8px 8px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.team-person::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--avatar, var(--blue));
}
.team-person strong { font-weight: 700; }
.team-person span { color: var(--muted); }
.team-person small { color: var(--muted); font-weight: 700; }

.roster-list { display: flex; flex-direction: column; gap: 14px; }
.roster-day {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.calendar-control-panel label { min-width: 0; }
.calendar-control-panel .button { min-height: 42px; }

.coverage { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.coverage span {
    font-size: 10px;
    font-weight: 750;
    padding: 3px 8px;
    border-radius: 6px;
}
.coverage .support { background: rgba(99, 102, 241, 0.1); color: var(--blue); }
.coverage .office { background: rgba(139, 92, 246, 0.1); color: var(--violet); }

.schedule-note {
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    padding: 14px 20px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.45;
}
.schedule-note strong { color: var(--text); }

.role-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.role-card, .access-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 20px;
    transition: var(--transition);
}
.role-card:hover, .access-preview:hover { border-color: var(--blue); transform: translateY(-2px); }
.role-card strong, .access-preview strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.role-card span, .access-preview span { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.access-preview code { display: block; font-family: monospace; font-size: 12px; background: var(--bg); padding: 10px; border-radius: 8px; margin-top: 10px; overflow-x: auto; }

.login-theme { position: absolute; top: 20px; right: 20px; }

@media (max-width: 1024px) {
    .shell { margin-left: 0; padding: 24px 16px 96px; }
    .sidebar {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom)) !important;
        border-right: 0;
        border-top: 1px solid var(--border);
        background: var(--sidebar-bg);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        align-items: stretch;
        gap: 0;
        z-index: 1000;
        border-radius: 0;
        margin: 0;
        overflow: hidden;
    }
    .sidebar .brand, .sidebar .logout-form { display: none; }
    /* Horizontally scrollable tab bar so every section is reachable */
    .sidebar nav {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        align-items: stretch;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        padding: 0 2px 2px;
    }
    .sidebar nav::-webkit-scrollbar { display: none; }
    .sidebar .nav-link {
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        padding: 8px 6px !important;
        width: 70px !important;
        min-height: 54px !important;
        font-size: 10px !important;
        scroll-snap-align: start;
    }
    .sidebar .nav-link span {
        margin-left: 0 !important;
        font-size: 9.5px !important;
        white-space: nowrap !important;
        line-height: 1.1 !important;
    }
    /* «Статьи и мотивация» длиннее прочих подписей и в плитку 70px одной строкой
       не влезает — только этому пункту разрешаем перенос в две строки. */
    .sidebar .nav-articles span {
        white-space: normal !important;
        text-align: center !important;
        font-size: 9px !important;
    }
    /* Compact tabs: drop the inline "В разработке"/"2.0" pills */
    .sidebar .nav-link .premium-nav-badge { display: none !important; }
    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
        transform: none !important;
    }
}
.tg-person strong,
.tg-person span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tg-person time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.tg-request {
    min-height: 58px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
}

.tg-request strong,
.tg-request span {
    display: block;
}

.tg-empty {
    color: var(--muted);
    padding: 10px 2px;
}

.tg-bottom-nav {
    position: fixed;
    z-index: 80;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    min-height: 62px;
    padding: 7px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tg-bottom-nav::-webkit-scrollbar {
    display: none;
}

.tg-bottom-nav a {
    flex: 1 0 auto;
    min-width: 70px;
    min-height: 46px;
    border-radius: 8px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 850;
    padding: 0 10px;
}

.tg-bottom-nav a.active {
    color: var(--text);
    background: var(--hover);
    box-shadow: var(--inner);
}

@media (max-width: 430px) {
    .tg-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .tg-hero {
        min-height: 250px;
        padding: 14px;
    }

    .tg-hero-main h1 {
        font-size: 32px;
    }

    .tg-hero-main p {
        font-size: 16px;
    }

    .tg-hero-stats {
        grid-template-columns: 1fr 1fr;
    }

    .tg-hero-stats a:first-child {
        grid-column: 1 / -1;
        min-height: 74px;
    }

    .tg-actions {
        grid-template-columns: 1fr;
    }

    .tg-person {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .tg-person time {
        grid-column: 2;
    }
}

/* ── Chats CQ ──────────────────────────────────────────── */
.cq-warning {
    background: var(--orange);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}
.cq-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.cq-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cq-toolbar-right {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.cq-sync-status {
    color: var(--muted);
    font-size: 13px;
}
.cq-total {
    white-space: nowrap;
}
.cq-filters {
    margin-bottom: 16px;
}
.cq-filter-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.cq-search-input {
    flex: 1 1 220px;
    min-width: 180px;
}
.cq-chat-list {
    display: grid;
    gap: 6px;
}
.cq-chat-row {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s, border-color 0.25s;
}
.cq-chat-row:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    border-color: var(--blue);
}
.cq-chat-summary {
    display: grid;
    grid-template-columns: 1fr auto 36px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
}
.cq-chat-main {
    min-width: 0;
}
.cq-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}
.cq-chat-id {
    font-weight: 700;
    color: var(--blue);
}
.cq-status {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.cq-status.open {
    background: #dcfce7;
    color: #166534;
}
.cq-status.closed {
    background: #f1f5f9;
    color: #64748b;
}
.cq-chat-meta time {
    color: var(--muted);
}
.cq-chat-client strong {
    margin-right: 8px;
}
.cq-chat-client span {
    color: var(--muted);
    font-size: 13px;
}
.cq-chat-preview {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.cq-chat-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}
.cq-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--muted);
    transition: transform .2s;
    padding: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}
.cq-expand-btn:hover {
    background: var(--bg);
}
.cq-expand-btn.expanded {
    transform: rotate(180deg);
}
.cq-chat-detail {
    border-top: 1px solid var(--border);
    padding: 16px;
    background: var(--bg);
}
.cq-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}
.cq-msg {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
}
.cq-msg-user {
    align-self: flex-start;
    background: var(--panel);
    border: 1px solid var(--border);
}
.cq-msg-admin {
    align-self: flex-end;
    background: var(--blue);
    color: #fff;
}
.cq-msg-admin .cq-msg-head strong {
    color: rgba(255,255,255,.85);
}
.cq-msg-admin .cq-msg-head time {
    color: rgba(255,255,255,.6);
}
.cq-msg-note {
    align-self: center;
    background: #fef9c3;
    color: #854d0e;
    border: 1px dashed #facc15;
    font-size: 13px;
}
.cq-msg-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 3px;
    font-size: 12px;
}
.cq-msg-head strong {
    color: var(--muted);
    font-weight: 600;
}
.cq-msg-head time {
    color: var(--muted);
    white-space: nowrap;
}
.cq-msg-body {
    word-break: break-word;
}
.cq-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
    font-size: 15px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.cq-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--muted);
}
[data-theme="dark"] .cq-status.open {
    background: #14532d;
    color: #86efac;
}
[data-theme="dark"] .cq-status.closed {
    background: #1e293b;
    color: #94a3b8;
}
[data-theme="dark"] .cq-msg-note {
    background: #422006;
    color: #fde68a;
    border-color: #a16207;
}

/* Assistant / Downloads page styling */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.download-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 28px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}
.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.08);
    border-color: var(--blue);
}
.download-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    margin-bottom: 20px;
}
.download-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text);
}
.download-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 20px 0;
}
.download-card .instructions {
    width: 100%;
    margin-bottom: 24px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
}
.download-card .instructions ol, .download-card .instructions ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}
.download-card .instructions li {
    margin-bottom: 8px;
}
.download-card .button {
    margin-top: auto;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* --- Premium Dashboard Analytics & Heatmap & Schedule styling --- */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 90px;
    text-align: center;
    border: 1px solid transparent;
}
.status-pill.status-on {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}
html[data-theme="light"] .status-pill.status-on {
    background: #e6fdf4;
    color: #047857;
    border-color: #a7f3d0;
}
.status-pill.status-off {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="light"] .status-pill.status-off {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}
.status-pill.status-vacation {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}
html[data-theme="light"] .status-pill.status-vacation {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}
.status-pill.status-sick {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}
html[data-theme="light"] .status-pill.status-sick {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.premium-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 16px;
}
.premium-metric-card {
    position: relative;
    border-radius: 16px;
    padding: 24px 24px 44px 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    min-height: 145px;
}
/* Sweeping diagonal light shine reflection removed for gentler aesthetic */

.premium-metric-card::after {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--card-glow, transparent) 0%, transparent 70%);
    opacity: 0.18;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.premium-metric-card:hover::after {
    opacity: 0.45;
}
.premium-metric-card.card-green {
    --card-glow: #10b981;
    --card-glow-rgb: 16, 185, 129;
    --glow-alt-rgb: 6, 182, 212;
    --glow-alt2-rgb: 52, 211, 153;
}
.premium-metric-card.card-purple {
    --card-glow: #8b5cf6;
    --card-glow-rgb: 139, 92, 246;
    --glow-alt-rgb: 236, 72, 153;
    --glow-alt2-rgb: 99, 102, 241;
}
.premium-metric-card.card-cyan {
    --card-glow: #06b6d4;
    --card-glow-rgb: 6, 182, 212;
    --glow-alt-rgb: 59, 130, 246;
    --glow-alt2-rgb: 16, 185, 129;
}
.premium-metric-card.card-pink {
    --card-glow: #ec4899;
    --card-glow-rgb: 236, 72, 153;
    --glow-alt-rgb: 139, 92, 246;
    --glow-alt2-rgb: 249, 115, 22;
}

.premium-metric-card > * {
    position: relative;
    z-index: 2;
}

@property --border-angle {
    syntax: "<angle>";
    inherits: true;
    initial-value: 0deg;
}

@keyframes spinBorder {
    to { --border-angle: 360deg; }
}

html[data-theme="dark"] .premium-metric-card {
    --base-border: rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.6) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
html[data-theme="light"] .premium-metric-card {
    --base-border: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.88) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--border-angle), var(--base-border) 0%, var(--base-border) 60%, rgba(var(--card-glow-rgb), 1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
    animation: spinBorder 20s linear infinite;
    will-change: --border-angle;
}

.premium-metric-card:hover {
    transform: scale(1.03) !important;
    box-shadow: 
        0 0 30px rgba(var(--card-glow-rgb), 0.35),
        0 20px 40px -10px rgba(0, 0, 0, 0.6) !important;
    z-index: 10;
}
html[data-theme="light"] .premium-metric-card:hover {
    box-shadow: 
        0 0 25px rgba(var(--card-glow-rgb), 0.3),
        0 20px 40px -10px rgba(0, 0, 0, 0.3) !important;
}

.premium-metric-card:hover::before {
    background: rgba(var(--card-glow-rgb), 1);
    animation: none;
    transition: background 0.2s ease-in-out;
}

.premium-op-card {
    position: relative;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

html[data-theme="dark"] .premium-op-card {
    --base-border: rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8)) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
html[data-theme="light"] .premium-op-card {
    --base-border: rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(248, 250, 252, 0.9)) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: none !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.6);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.premium-op-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--border-angle), var(--base-border) 0%, var(--base-border) 60%, rgba(var(--card-glow-rgb), 1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
    animation: spinBorder 20s linear infinite;
    will-change: --border-angle;
}

.premium-op-card:hover {
    transform: translateY(-6px) scale(1.02) !important;
    box-shadow: 
        0 0 35px rgba(var(--card-glow-rgb), 0.4),
        0 20px 40px -10px rgba(0, 0, 0, 0.6) !important;
    z-index: 10;
}
html[data-theme="light"] .premium-op-card:hover {
    box-shadow: 
        0 0 25px rgba(var(--card-glow-rgb), 0.3),
        0 20px 40px -10px rgba(0, 0, 0, 0.3) !important;
}

.premium-op-card:hover::before {
    background: rgba(var(--card-glow-rgb), 1);
    animation: none;
    transition: background 0.2s ease-in-out;
}

.premium-metric-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
    max-width: calc(100% - 85px);
    word-wrap: break-word;
}
.premium-metric-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    margin-top: 8px;
    line-height: 1.1;
    z-index: 1;
}
.premium-metric-subtext {
    font-size: 12px;
    color: var(--muted);
    margin-top: auto;
    padding-top: 8px;
    z-index: 1;
}
.update-badge {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
html[data-theme="light"] .update-badge {
    color: #047857;
    background: #e6fdf4;
    border-color: rgba(4, 120, 87, 0.15);
}
.premium-metric-trend {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 14px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    z-index: 1;
}
.premium-metric-trend.trend-up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}
html[data-theme="light"] .premium-metric-trend.trend-up {
    color: #047857;
    background: #e6fdf4;
}
.premium-metric-trend.trend-neutral {
    color: #007AFF;
    background: rgba(99, 102, 241, 0.1);
}
html[data-theme="light"] .premium-metric-trend.trend-neutral {
    color: #0063d1;
    background: #e0e7ff;
}
.premium-metric-trend.trend-down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}
html[data-theme="light"] .premium-metric-trend.trend-down {
    color: #b91c1c;
    background: #fef2f2;
}

.hm-cell {
    text-align: center;
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}
.hm-cell.hm-0 {
    background: rgba(255, 255, 255, 0.02) !important;
    color: rgba(255, 255, 255, 0.15) !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}
html[data-theme="light"] .hm-cell.hm-0 {
    background: #f8fafc !important;
    color: #cbd5e1 !important;
}
.hm-cell.hm-low {
    background: rgba(14, 165, 233, 0.18) !important;
    color: #38bdf8 !important;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.1) !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}
html[data-theme="light"] .hm-cell.hm-low {
    background: rgba(14, 165, 233, 0.12) !important;
    color: #0063d1 !important;
}
.hm-cell.hm-med {
    background: rgba(139, 92, 246, 0.25) !important;
    color: #c084fc !important;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.15) !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}
html[data-theme="light"] .hm-cell.hm-med {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #6d28d9 !important;
}
.hm-cell.hm-high {
    background: rgba(236, 72, 153, 0.35) !important;
    color: #f472b6 !important;
    box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.2) !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}
html[data-theme="light"] .hm-cell.hm-high {
    background: rgba(236, 72, 153, 0.2) !important;
    color: #be185d !important;
}
.hm-cell.hm-crit {
    background: rgba(239, 68, 68, 0.5) !important;
    color: #fca5a5 !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.3) !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}
html[data-theme="light"] .hm-cell.hm-crit {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #b91c1c !important;
}

.hm-cell:hover {
    transform: scale(1.1) !important;
    z-index: 10 !important;
    position: relative !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    background-color: var(--panel-bg) !important;
    filter: brightness(1.3);
}

.schedule-toggle-btn {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.schedule-toggle-btn.active {
    background: var(--cosmic-glow);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.schedule-toggle-btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.schedule-toggle-btn.ghost:hover {
    background: var(--panel-hover);
}

/* Redesigned Team Schedule Grid & Cards */
.team-card-grid {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}
.team-card-grid.period-month {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.team-card-grid.period-week {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
.team-card-grid.period-day {
    grid-template-columns: 1fr;
}

.team-card {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
}
html[data-theme="dark"] .team-card {
    background: rgba(13, 17, 28, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.team-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 
        0 8px 32px 0 rgba(99, 102, 241, 0.15),
        0 20px 50px -15px rgba(0, 0, 0, 0.3);
}
.team-card.today {
    border-color: var(--blue);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.12);
}
.team-card.today::before {
    content: "СЕГОДНЯ";
    position: absolute;
    top: 0;
    right: 0;
    background: var(--cosmic-glow);
    color: #fff;
    font-size: 9px;
    font-weight: 850;
    padding: 5px 12px;
    border-bottom-left-radius: 10px;
    letter-spacing: 0.08em;
}

.team-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 4px;
}
.team-card-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.team-card-date strong {
    font-size: 26px;
    font-weight: 850;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.03em;
}
.team-card-date span {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-transform: capitalize;
}
.team-card-head small {
    font-size: 11px;
    font-weight: 750;
    color: var(--text);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 4px 10px;
    border-radius: 8px;
}

.team-card-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.team-shift {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-left: 4px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}
.team-shift:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}
.team-shift.shift-one {
    border-left-color: var(--blue);
}
.team-shift.shift-two {
    border-left-color: var(--violet);
}
.team-shift.shift-five {
    border-left-color: var(--green);
}

.team-shift-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 6px;
}
.team-shift-head strong {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.02em;
}
.team-shift-head span {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.team-people {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-person {
    position: relative;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    transition: var(--transition);
}
.team-person:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.22);
}
.team-person::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--avatar, var(--blue));
    box-shadow: 0 0 10px var(--avatar);
}
.team-person strong {
    font-weight: 700;
    color: var(--text);
}
.team-person span {
    color: var(--muted);
    font-size: 11px;
    margin-left: auto;
    margin-right: 12px;
    font-weight: 500;
}
.team-person small {
    color: var(--muted);
    font-weight: 750;
    font-size: 11px;
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.02);
}

.team-empty {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
}

/* Premium Filter Bar & Header */
.calendar-filters-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
}
.filter-quick-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--muted);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.filter-quick-btn:hover,
.filter-quick-btn.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--blue);
    color: var(--text);
}

/* Cal Cell Shifts Customization & Highlights */
.cal-cell.work {
    border-left: 4px solid var(--blue);
}
.cal-cell.off {
    border-left: 4px solid var(--muted);
    background: rgba(255, 255, 255, 0.005);
    opacity: 0.8;
}
.cal-cell.vacation {
    border-left: 4px solid var(--orange);
    background: rgba(245, 158, 11, 0.02);
}
.cal-cell.sick {
    border-left: 4px solid var(--red);
    background: rgba(239, 68, 68, 0.02);
}

/* Operator Positions & Highlighting */
.team-person.middle-operator {
    border-color: rgba(244, 63, 94, 0.2);
    background: rgba(244, 63, 94, 0.04);
}
.team-person.middle-operator strong::after {
    content: "M1";
    font-size: 9px;
    font-weight: 850;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
html[data-theme="light"] .team-person.middle-operator strong::after {
    background: #ffe4e6;
    color: #e11d48;
}

.team-person.teamlead-operator {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.04);
}
.team-person.teamlead-operator strong::after {
    content: "TL1";
    font-size: 9px;
    font-weight: 850;
    color: #007AFF;
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
html[data-theme="light"] .team-person.teamlead-operator strong::after {
    background: #e0e7ff;
    color: #0063d1;
}

.team-person.teamlead-yellow-operator {
    border-color: rgba(234, 179, 8, 0.3);
    background: rgba(234, 179, 8, 0.04);
}
.team-person.teamlead-yellow-operator strong::after {
    content: "TL";
    font-size: 9px;
    font-weight: 850;
    color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
html[data-theme="light"] .team-person.teamlead-yellow-operator strong::after {
    background: #fef9c3;
    color: #ca8a04;
}

/* Group Sergey (Yellow) Card & Cell */
.team-card.group-sergey {
    border-color: rgba(245, 158, 11, 0.18);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.02) 0%, rgba(245, 158, 11, 0.04) 100%), var(--panel);
}
html[data-theme="light"] .team-card.group-sergey {
    border-color: #fef08a;
    background: #fefbeb;
}
.team-card.group-sergey:hover {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.08);
}
.team-card.group-sergey .team-card-head small {
    color: #d97706;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.22);
}
.team-card.group-sergey .team-card-date strong {
    color: #f59e0b;
}
html[data-theme="light"] .team-card.group-sergey .team-card-date strong {
    color: #b45309;
}
.cal-cell.group-sergey-cell.work {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.03);
}
html[data-theme="light"] .cal-cell.group-sergey-cell.work {
    background: #fffbeb;
}
.cal-cell.group-sergey-cell.work:hover {
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}
.cal-cell.group-sergey-cell.work strong {
    color: #f59e0b;
}
html[data-theme="light"] .cal-cell.group-sergey-cell.work strong {
    color: #b45309;
}

/* Group Alexander (Pink) Card & Cell */
.team-card.group-alexander {
    border-color: rgba(244, 63, 94, 0.18);
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.02) 0%, rgba(244, 63, 94, 0.04) 100%), var(--panel);
}
html[data-theme="light"] .team-card.group-alexander {
    border-color: #fbcfe8;
    background: #fff1f2;
}
.team-card.group-alexander:hover {
    border-color: rgba(244, 63, 94, 0.45);
    box-shadow: 0 8px 30px rgba(244, 63, 94, 0.08);
}
.team-card.group-alexander .team-card-head small {
    color: #e11d48;
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.22);
}
.team-card.group-alexander .team-card-date strong {
    color: #f43f5e;
}
html[data-theme="light"] .team-card.group-alexander .team-card-date strong {
    color: #be123c;
}
.cal-cell.group-alexander-cell.work {
    border-left-color: #f43f5e;
    background: rgba(244, 63, 94, 0.03);
}
html[data-theme="light"] .cal-cell.group-alexander-cell.work {
    background: #fff1f2;
}
.cal-cell.group-alexander-cell.work:hover {
    border-color: #f43f5e;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.15);
}
.cal-cell.group-alexander-cell.work strong {
    color: #f43f5e;
}
html[data-theme="light"] .cal-cell.group-alexander-cell.work strong {
    color: #be123c;
}

/* Group Teamlead (Indigo) Cell */
.cal-cell.group-teamlead-cell.work {
    border-left-color: #007AFF;
    background: rgba(99, 102, 241, 0.04);
}
html[data-theme="light"] .cal-cell.group-teamlead-cell.work {
    background: #f5f3ff;
}
.cal-cell.group-teamlead-cell.work:hover {
    border-color: #007AFF;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}
.cal-cell.group-teamlead-cell.work strong {
    color: #007AFF;
}
html[data-theme="light"] .cal-cell.group-teamlead-cell.work strong {
    color: #0063d1;
}

/* Login Page & Card Premium Styling */
.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    padding: 24px;
}
.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}
html[data-theme="dark"] .login-card {
    background: rgba(13, 17, 28, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}
.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}
.login-card h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    text-align: center;
}
.login-error {
    width: 100%;
    margin-bottom: 16px;
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.login-details {
    margin-top: 16px;
    width: 100%;
}
.login-details summary {
    font-size: 12.5px;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    list-style: none;
    user-select: none;
    transition: var(--transition);
    font-weight: 600;
}
.login-details summary::-webkit-details-marker {
    display: none;
}
.login-details summary:hover {
    color: var(--text);
    transform: translateY(-1px);
}

/* ==========================================
   ATLASSIAN PREMIUM THEME OVERRIDES & DYNAMICS
   ========================================== */

:root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --panel-hover: #f8fafc;
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --line: #f1f5f9;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #42526e;
    --sidebar-text-active: #007AFF;
    --sidebar-hover: rgba(9, 30, 66, 0.05);
    --blue: #007AFF;
    --blue-hover: #0063d1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(9, 30, 66, 0.08), 0 2px 4px -1px rgba(9, 30, 66, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(9, 30, 66, 0.08), 0 4px 6px -2px rgba(9, 30, 66, 0.04);
}

html[data-theme="light"] {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --panel-hover: #f8fafc;
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --line: #f1f5f9;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #42526e;
    --sidebar-text-active: #007AFF;
    --sidebar-hover: rgba(9, 30, 66, 0.05);
    --blue: #007AFF;
    --blue-hover: #0063d1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(9, 30, 66, 0.08), 0 2px 4px -1px rgba(9, 30, 66, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(9, 30, 66, 0.08), 0 4px 6px -2px rgba(9, 30, 66, 0.04);
}

html[data-theme="dark"] {
    --bg: #090d16;
    --panel: #111625;
    --panel-hover: #171e30;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #1e293b;
    --line: #1e293b;
    --sidebar-bg: #111625;
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --blue: #38bdf8;
    --blue-hover: #0ea5e9;
    --green: #4ade80;
    --orange: #fb923c;
    --red: #f87171;
    --violet: #a78bfa;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.4), 0 2px 8px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.05);
}

/* Base Body Grid Adjustments */
body {
    background: var(--bg) !important;
    color: var(--text) !important;
}

/* Sidebar Overrides */
.sidebar {
    background: var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    color: var(--sidebar-text) !important;
}

/* Brand and Text inside Sidebar */
.sidebar .brand strong {
    color: var(--text) !important;
}
.sidebar .brand span {
    color: var(--sidebar-text) !important;
}
.sidebar .brand-mark {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-hover) 100%) !important;
}

/* Sidebar Link Variables */
.sidebar .nav-link.nav-dashboard {
    --nav-color: #0ea5e9;
    --nav-color-rgb: 14, 165, 233;
    --nav-glow-1: #0ea5e9;
    --nav-glow-2: #007AFF;
    --nav-glow-3: #007AFF;
}
.sidebar .nav-link.nav-calendar {
    --nav-color: #14b8a6;
    --nav-color-rgb: 20, 184, 166;
    --nav-glow-1: #14b8a6;
    --nav-glow-2: #10b981;
    --nav-glow-3: #34d399;
}
.sidebar .nav-link.nav-requests {
    --nav-color: #eab308;
    --nav-color-rgb: 234, 179, 8;
    --nav-glow-1: #eab308;
    --nav-glow-2: #f59e0b;
    --nav-glow-3: #fb923c;
}
.sidebar .nav-link.nav-assistant {
    --nav-color: #10b981;
    --nav-color-rgb: 16, 185, 129;
    --nav-glow-1: #10b981;
    --nav-glow-2: #06b6d4;
    --nav-glow-3: #007AFF;
}
.sidebar .nav-link.nav-articles {
    --nav-color: #f59e0b;
    --nav-color-rgb: 245, 158, 11;
    --nav-glow-1: #f59e0b;
    --nav-glow-2: #ef4444;
    --nav-glow-3: #ec4899;
}
.sidebar .nav-link.nav-team {
    --nav-color: #8b5cf6;
    --nav-color-rgb: 139, 92, 246;
    --nav-glow-1: #8b5cf6;
    --nav-glow-2: #a855f7;
    --nav-glow-3: #d946ef;
}
.sidebar .nav-link.nav-profile {
    --nav-color: #007AFF;
    --nav-color-rgb: 99, 102, 241;
    --nav-glow-1: #007AFF;
    --nav-glow-2: #0063d1;
    --nav-glow-3: #007AFF;
}
.sidebar .nav-link.nav-admin {
    --nav-color: #f43f5e;
    --nav-color-rgb: 244, 63, 94;
    --nav-glow-1: #f43f5e;
    --nav-glow-2: #dc2626;
    --nav-glow-3: #b91c1c;
}

/* Sidebar Links Universal Styling */
.sidebar .nav-link {
    color: var(--sidebar-text) !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    position: relative !important;
    background: rgba(var(--nav-color-rgb), 0.03) !important;
    border: 1px solid transparent !important;
    box-shadow: 0 2px 8px rgba(var(--nav-color-rgb), 0.12);
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease !important;
}

html[data-theme="light"] .sidebar .nav-link {
    background: rgba(var(--nav-color-rgb), 0.05) !important;
}

.sidebar .nav-link::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: inherit !important;
    padding: 1px !important;
    background: linear-gradient(135deg, var(--nav-glow-1), var(--nav-glow-2), var(--nav-glow-3), var(--nav-glow-1)) !important;
    background-size: 300% 300% !important;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
    -webkit-mask-composite: xor !important;
    mask-composite: exclude !important;
    animation: border-glow-flow 8s ease-in-out infinite !important;
    pointer-events: none !important;
}

.sidebar .nav-link:hover {
    background: rgba(var(--nav-color-rgb), 0.09) !important;
    transform: translateX(4px) !important;
}

.sidebar .nav-link .nav-icon {
    color: var(--nav-color) !important;
    opacity: 1 !important;
    display: inline-block !important;
    transform-origin: center !important;
    transition: filter 0.3s ease, transform 0.3s ease !important;
    filter: drop-shadow(0 0 3px rgba(var(--nav-color-rgb), 0.4)) !important;
}

.sidebar .nav-link:hover .nav-icon {
    filter: drop-shadow(0 0 8px rgba(var(--nav-color-rgb), 0.9)) !important;
    transform: scale(1.15);
}

.sidebar .nav-link span {
    background: linear-gradient(135deg, var(--nav-glow-1), var(--nav-glow-2), var(--nav-glow-3), var(--nav-glow-1)) !important;
    background-size: 300% 300% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    animation: border-glow-flow 8s ease-in-out infinite !important;
    font-weight: 700 !important;
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--nav-glow-1) 0%, var(--nav-glow-2) 100%) !important;
    box-shadow: 0 4px 15px rgba(var(--nav-color-rgb), 0.4) !important;
    animation: none !important;
    color: #ffffff !important;
}
/* В светлой теме общий light-оверрайд nav-link по специфичности перебивал
   активный градиент → белый текст на бледном фоне. Возвращаем насыщенный фон и
   принудительно белый текст (усиленная специфичность через nav). */
html[data-theme="light"] .sidebar nav .nav-link.active {
    background: linear-gradient(135deg, var(--nav-glow-1) 0%, var(--nav-glow-2) 100%) !important;
    box-shadow: 0 4px 14px rgba(var(--nav-color-rgb), 0.35) !important;
}
html[data-theme="light"] .sidebar nav .nav-link.active,
html[data-theme="light"] .sidebar nav .nav-link.active span,
html[data-theme="light"] .sidebar nav .nav-link.active .nav-icon {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.sidebar .nav-link.active::before {
    display: none !important;
}

.sidebar .nav-link.active span {
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    animation: none !important;
}

.sidebar .nav-link.active .nav-icon {
    color: #ffffff !important;
    filter: none !important;
}

@keyframes border-glow-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes nav-glow-pulse-anim {
    0% { box-shadow: 0 2px 8px rgba(var(--nav-color-rgb), 0.08); }
    50% { box-shadow: 0 4px 15px rgba(var(--nav-color-rgb), 0.25); }
    100% { box-shadow: 0 2px 8px rgba(var(--nav-color-rgb), 0.08); }
}

@keyframes nav-icon-pulse-anim {
    0% { filter: drop-shadow(0 0 2px rgba(var(--nav-color-rgb), 0.4)) drop-shadow(0 0 6px rgba(var(--nav-color-rgb), 0.2)); }
    50% { filter: drop-shadow(0 0 6px rgba(var(--nav-color-rgb), 0.85)) drop-shadow(0 0 14px rgba(var(--nav-color-rgb), 0.6)); }
    100% { filter: drop-shadow(0 0 2px rgba(var(--nav-color-rgb), 0.4)) drop-shadow(0 0 6px rgba(var(--nav-color-rgb), 0.2)); }
}

@keyframes nav-icon-hover-pulse-anim {
    0% { filter: drop-shadow(0 0 5px rgba(var(--nav-color-rgb), 0.8)) drop-shadow(0 0 10px rgba(var(--nav-color-rgb), 0.5)); }
    50% { filter: drop-shadow(0 0 12px rgba(var(--nav-color-rgb), 1)) drop-shadow(0 0 24px rgba(var(--nav-color-rgb), 0.95)); }
    100% { filter: drop-shadow(0 0 5px rgba(var(--nav-color-rgb), 0.8)) drop-shadow(0 0 10px rgba(var(--nav-color-rgb), 0.5)); }
}

/* Specific Hover Animations for Icons */
@keyframes star-spin {
    0% { transform: rotate(0deg) scale(0.92); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(0.92); }
}

@keyframes book-levitate {
    0% { transform: rotate(-4deg) translateY(0px) scale(0.92); }
    50% { transform: rotate(4deg) translateY(-4px) scale(1.15); }
    100% { transform: rotate(-4deg) translateY(0px) scale(0.92); }
}

.sidebar .nav-link.nav-dashboard .nav-icon {
    animation: book-levitate 4s ease-in-out infinite !important;
}
.sidebar .nav-link.nav-dashboard:hover .nav-icon {
    animation: book-levitate 1.5s ease-in-out infinite alternate !important;
}
.sidebar .nav-link.nav-calendar .nav-icon {
    animation: book-levitate 4s ease-in-out infinite !important;
}
.sidebar .nav-link.nav-calendar:hover .nav-icon {
    animation: book-levitate 1.5s ease-in-out infinite alternate !important;
}
.sidebar .nav-link.nav-requests .nav-icon {
    animation: book-levitate 4s ease-in-out infinite !important;
}
.sidebar .nav-link.nav-requests:hover .nav-icon {
    animation: book-levitate 1.5s ease-in-out infinite alternate !important;
}
.sidebar .nav-link.nav-assistant .nav-icon {
    animation: star-spin 8s linear infinite !important;
}
.sidebar .nav-link.nav-assistant:hover .nav-icon {
    animation: star-spin 3s linear infinite !important;
}
.sidebar .nav-link.nav-articles .nav-icon {
    animation: book-levitate 4s ease-in-out infinite !important;
}
.sidebar .nav-link.nav-articles:hover .nav-icon {
    animation: book-levitate 1.5s ease-in-out infinite alternate !important;
}
.sidebar .nav-link.nav-team .nav-icon {
    animation: book-levitate 4s ease-in-out infinite !important;
}
.sidebar .nav-link.nav-team:hover .nav-icon {
    animation: book-levitate 1.5s ease-in-out infinite alternate !important;
}
.sidebar .nav-link.nav-profile .nav-icon {
    animation: star-spin 8s linear infinite !important;
}
.sidebar .nav-link.nav-profile:hover .nav-icon {
    animation: star-spin 3s linear infinite !important;
}
.sidebar .nav-link.nav-admin .nav-icon {
    animation: book-levitate 4s ease-in-out infinite !important;
}
.sidebar .nav-link.nav-admin:hover .nav-icon {
    animation: book-levitate 1.5s ease-in-out infinite alternate !important;
}

/* Logout Form Button */
.sidebar .logout-form button.nav-link {
    color: #ff8f73 !important;
}
.sidebar .logout-form button.nav-link:hover {
    background: rgba(255, 86, 48, 0.1) !important;
    color: #ff5630 !important;
}

/* Panels and Cards Glassmorphic Polish */
.panel, .metric-card {
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
}
html[data-theme="dark"] .panel, 
html[data-theme="dark"] .metric-card {
    background: rgba(19, 25, 36, 0.92) !important;
    box-shadow: var(--shadow-md) !important;
    contain: layout style paint !important;
}

/* Panel and card hover transitions */
.panel:hover {
    transform: translateY(-4px) !important;
    border-color: var(--blue) !important;
    box-shadow: var(--shadow-md) !important;
}
html[data-theme="dark"] .panel:hover {
    box-shadow: var(--shadow-lg), 0 0 15px rgba(56, 189, 248, 0.1) !important;
}
.metric-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Metric Cards Gradients & Glows */
.metric-card.theme-blue {
    border-left: 4px solid var(--blue) !important;
    background: linear-gradient(135deg, var(--panel) 0%, rgba(2, 132, 199, 0.02) 100%) !important;
}
.metric-card.theme-violet {
    border-left: 4px solid var(--violet) !important;
    background: linear-gradient(135deg, var(--panel) 0%, rgba(139, 92, 246, 0.02) 100%) !important;
}
.metric-card.theme-green {
    border-left: 4px solid var(--green) !important;
    background: linear-gradient(135deg, var(--panel) 0%, rgba(16, 185, 129, 0.02) 100%) !important;
}
.metric-card.theme-orange {
    border-left: 4px solid var(--orange) !important;
    background: linear-gradient(135deg, var(--panel) 0%, rgba(245, 158, 11, 0.02) 100%) !important;
}

.metric-card.theme-blue:hover { border-color: var(--blue) !important; }
.metric-card.theme-violet:hover { border-color: var(--violet) !important; }
.metric-card.theme-green:hover { border-color: var(--green) !important; }
.metric-card.theme-orange:hover { border-color: var(--orange) !important; }

/* User Chip Styling */
.user-chip {
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
}
.user-chip:hover {
    border-color: var(--blue) !important;
}

/* Table Design Cleanliness */
table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
th {
    background: var(--panel-hover) !important;
    color: var(--muted) !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 14px 16px !important;
    border-bottom: 2px solid var(--border) !important;
}
td {
    padding: 16px !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--panel) !important;
}
tr:last-child td {
    border-bottom: none !important;
}
tr:hover td {
    background: var(--panel-hover) !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Springy Tab Micro-Animations */
@keyframes tabFadeIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.tab-content.active {
    animation: tabFadeIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

/* Leaderboard Podium Overhaul & Glows (podium-aware) */
.leader-card:hover {
    transform: translateY(-10px);
}
.leader-card.rank-1 { transform: translateY(-24px); }
.leader-card.rank-1:hover { transform: translateY(-34px); }

/* Light Theme Leader Card surfaces */
html[data-theme="light"] .leader-card.rank-1 {
    border-color: rgba(245, 158, 11, 0.45) !important;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.16) 0%, #ffffff 62%) !important;
    box-shadow: 0 20px 44px rgba(245, 158, 11, 0.20), var(--shadow-md) !important;
}
html[data-theme="light"] .leader-card.rank-1:hover {
    box-shadow: 0 30px 60px rgba(245, 158, 11, 0.30), var(--shadow-lg) !important;
}
html[data-theme="light"] .leader-card.rank-2 {
    border-color: rgba(148, 163, 184, 0.45) !important;
    background: linear-gradient(180deg, rgba(203, 213, 225, 0.28) 0%, #ffffff 62%) !important;
    box-shadow: 0 16px 40px rgba(148, 163, 184, 0.16), var(--shadow-md) !important;
}
html[data-theme="light"] .leader-card.rank-2:hover {
    box-shadow: 0 24px 50px rgba(148, 163, 184, 0.26), var(--shadow-lg) !important;
}
html[data-theme="light"] .leader-card.rank-3 {
    border-color: rgba(180, 83, 9, 0.35) !important;
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.16) 0%, #ffffff 62%) !important;
    box-shadow: 0 16px 40px rgba(180, 83, 9, 0.12), var(--shadow-md) !important;
}
html[data-theme="light"] .leader-card.rank-3:hover {
    box-shadow: 0 24px 50px rgba(180, 83, 9, 0.2), var(--shadow-lg) !important;
}
html[data-theme="light"] .leader-card .stats-box div {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .leader-card .stats-box { border-top-color: rgba(15,23,42,0.08); }

/* Schedule table compacting overrides */
.schedule-table th, .schedule-table td {
    padding: 4px 1px !important;
    font-size: 11.5px !important;
}
.schedule-table th {
    padding: 6px 1px !important;
    font-size: 11px !important;
}
.schedule-table .sticky-col {
    padding: 5px 10px !important;
    font-size: 12.5px !important;
    width: 200px !important;
    min-width: 200px !important;
}
.schedule-table .total-col {
    padding: 4px 1px !important;
    font-size: 11px !important;
}

/* Mobile responsiveness & adaptations */
@media (max-width: 768px) {
    .schedule-table {
        min-width: 1350px !important;
    }
    .schedule-table .sticky-col {
        position: sticky !important;
        left: 0 !important;
        z-index: 10 !important;
    }
    .calendar-filters-inline {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 12px 14px !important;
    }
    .calendar-filters-inline > div {
        width: 100% !important;
        justify-content: space-between !important;
    }
    .line-selector-group {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        max-width: 100% !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    .line-selector-group::-webkit-scrollbar {
        display: none !important;
    }
    .line-btn {
        flex-shrink: 0 !important;
        padding: 5px 10px !important;
        font-size: 11px !important;
    }
    .calendar-header-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .premium-neon-clock.clock-large {
        gap: 8px !important;
    }
    .premium-neon-clock.clock-large .neon-time {
        font-size: 15px !important;
    }
    .premium-neon-clock.clock-large .neon-date {
        font-size: 11px !important;
    }
    
    /* Adapt forms and profile layout on mobile */
    .request-forms, .admin-grid, .profile-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .roster-day {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 14px !important;
    }
}

@media (max-width: 600px) {
    .calendar-weekdays, .calendar-grid {
        gap: 4px !important;
    }
    .calendar-weekdays {
        font-size: 9px !important;
    }
    .cal-cell {
        min-height: 85px !important;
        padding: 8px !important;
        gap: 4px !important;
    }
    .cal-date {
        font-size: 11px !important;
    }
    .cal-cell strong {
        font-size: 11px !important;
    }
    .cal-cell span, .cal-cell small {
        font-size: 9.5px !important;
    }
}
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); border: 1px solid var(--border); transition: .3s; border-radius: 34px; }
.switch .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: var(--text-dim); transition: .3s; border-radius: 50%; }
.switch input:checked + .slider { background-color: var(--red); border-color: var(--red); }
.switch input:checked + .slider:before { transform: translateX(20px); background-color: #fff; }

/* ========================================================
   PERFORMANCE OVERRIDES — GPU & CPU usage reduction
   Placed at end of CSS for maximum cascade priority.
   ======================================================== */

/* 1) Kill backdrop-filter on everything except sidebar and modal overlays.
   separate offscreen render + Gaussian blur pass. */
.panel,
.metric-card,
.metric.small,
.day-card,
.user-chip,
.notifications details,
.status-alert,
.btn, .btn-primary, .btn-icon,
.form-card,
.form-group input, .form-group select, .form-group textarea,
.cq-chat-row,
.request-card,
.roster-day,
.shift-cell,
.article-card,
.premium-metric-card,
.premium-op-card,
.leader-card,
.team-shift,
.hero-section,
.articles-tabs-bar,
.hero-left-card,
.hero-actions-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 2) Kill the spinBorder animation on premium cards.
   conic-gradient with @property --border-angle recalculates the entire
   gradient on every single frame — extremely expensive for many cards. */
.premium-metric-card::before,
.premium-op-card::before {
    animation: none !important;
    will-change: auto !important;
    background: var(--base-border) !important;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
    -webkit-mask-composite: xor !important;
    mask-composite: exclude !important;
}
/* Restore the glow effect on hover only (costs GPU only when interacting) */
.premium-metric-card:hover::before,
.premium-op-card:hover::before {
    background: rgba(var(--card-glow-rgb), 0.7) !important;
    transition: background 0.3s ease !important;
}

/* 3) Kill the border-glow-flow animation on nav link ::before pseudo-elements.
   This animates background-position on a 300% gradient with mask composite
   on every nav item — very expensive filter+mask pipeline. */
.sidebar .nav-link::before {
    animation: none !important;
    background-size: 100% 100% !important;
}

/* 4) Kill the text gradient animation on nav link spans.
   Animating background-position on clipped text is expensive. */
.sidebar .nav-link span {
    animation: none !important;
    background-size: 100% 100% !important;
}

/* 5) Kill icon hover animations — use transitions instead.
   Transitions only cost GPU during the actual hover, not 24/7. */
.sidebar .nav-link .nav-icon {
    animation: none !important;
    transition: transform 0.3s ease, filter 0.3s ease, color 0.3s ease !important;
}
.sidebar .nav-link:hover .nav-icon {
    animation: none !important;
    transform: scale(1.15) !important;
    filter: drop-shadow(0 0 8px rgba(var(--nav-color-rgb), 0.9)) !important;
}

/* 6) Kill the fire border ::before background-position animation.
   Replace with a static glow that looks similar but costs nothing. */
.top-operator-fire::before {
    animation: none !important;
    background-image: 
        radial-gradient(ellipse at 30% 40%, #ff9900 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, #ffee00 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, #ff4400 0%, transparent 70%) !important;
    opacity: 0.85 !important;
}

/* 7) Kill the glow-pulse ::after on operator cards.
   Static glow instead of animated opacity. */
.glow-green::after, .glow-yellow::after, .glow-red::after {
    animation: none !important;
    opacity: 0.55 !important;
}

/* 8) Remove the nav-link box-shadow glow (was nav-glow-pulse-anim). */
.sidebar .nav-link {
    animation: none !important;
    box-shadow: 0 2px 6px rgba(var(--nav-color-rgb), 0.08) !important;
}
.sidebar .nav-link:hover {
    box-shadow: 0 4px 12px rgba(var(--nav-color-rgb), 0.2) !important;
}

/* 9) Add containment to cards for layout isolation. */
.panel, .metric-card, .premium-metric-card, .premium-op-card {
    contain: layout style paint !important;
}

/* 10) Reduce saturate() which adds extra compositing passes */
.panel, .metric-card {
}

/* 11) Badge shine animation — run once, not infinite */
.badge-shine::after {
    animation-iteration-count: 1 !important;
}

/* 12) Kill ALL remaining infinite nav-icon animations.
   The earlier generic override (.sidebar .nav-link .nav-icon { animation: none })
   was being defeated by higher-specificity per-link selectors below.
   Use matching specificity with !important to win. */
.sidebar .nav-link.nav-dashboard .nav-icon,
.sidebar .nav-link.nav-dashboard:hover .nav-icon,
.sidebar .nav-link.nav-calendar .nav-icon,
.sidebar .nav-link.nav-calendar:hover .nav-icon,
.sidebar .nav-link.nav-requests .nav-icon,
.sidebar .nav-link.nav-requests:hover .nav-icon,
.sidebar .nav-link.nav-assistant .nav-icon,
.sidebar .nav-link.nav-assistant:hover .nav-icon,
.sidebar .nav-link.nav-articles .nav-icon,
.sidebar .nav-link.nav-articles:hover .nav-icon,
.sidebar .nav-link.nav-team .nav-icon,
.sidebar .nav-link.nav-team:hover .nav-icon,
.sidebar .nav-link.nav-profile .nav-icon,
.sidebar .nav-link.nav-profile:hover .nav-icon,
.sidebar .nav-link.nav-admin .nav-icon,
.sidebar .nav-link.nav-admin:hover .nav-icon {
    animation: none !important;
}
.sidebar .nav-link:hover .nav-icon {
    transform: scale(1.12) !important;
    transition: transform 0.25s ease !important;
}

/* 13) Kill nav-link ::before border-glow-flow and span text gradient animation.
   These animate background-position on masked/clipped elements — expensive. */
.sidebar .nav-link::before {
    animation: none !important;
    background-size: 100% 100% !important;
}
.sidebar .nav-link span {
    animation: none !important;
    background-size: 100% 100% !important;
}

/* 14) Kill slow wheel rotation (articles page). */
.wheel-slow-rotation {
    animation: none !important;
}

/* 16) Articles/leaderboard page: kill remaining infinite decorative animations.
   medalFloat + tabShine repaint continuously and stack on weak GPUs. */
.leader-card .medal {
    animation: none !important;
}
.tab-btn.active::after {
    animation: none !important;
    display: none !important;
}

/* 17) Layout isolation on repeated article cards & tables.
   Confines reflow to each element without clipping shadows — no visual change. */
.leader-card,
.article-card,
.table-wrap {
    contain: layout !important;
}

/* 15) Respect prefers-reduced-motion — kill all animations & transitions. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ══════ Анимированная схема установки расширения ══════ */
.xa{--xa-dur:14s;margin:0 0 14px;border:1px solid var(--border);border-radius:12px;padding:12px;
    background:linear-gradient(180deg,rgba(127,127,127,.06),rgba(127,127,127,.015));}
.xa-title{display:flex;align-items:center;gap:7px;font-size:10.5px;font-weight:800;letter-spacing:.06em;
    text-transform:uppercase;color:var(--muted);margin-bottom:9px;}
.xa-stage{position:relative;height:206px;border-radius:10px;overflow:hidden;background:var(--panel);
    border:1px solid var(--border);}
.xa-bar{display:flex;align-items:center;gap:5px;padding:7px 9px;border-bottom:1px solid var(--border);
    background:rgba(127,127,127,.07);}
.xa-dot{width:7px;height:7px;border-radius:50%;background:rgba(127,127,127,.4);flex:0 0 auto;}
.xa-url{margin-left:6px;flex:1;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:10px;
    color:var(--muted);background:rgba(127,127,127,.12);border-radius:20px;padding:3px 10px;}
.xa-body{position:relative;padding:10px 11px;height:calc(100% - 31px);}
.xa-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
.xa-h{font-size:12px;font-weight:800;color:var(--text);}
.xa-dev{display:flex;align-items:center;gap:7px;font-size:9.5px;color:var(--muted);}
.xa-sw{position:relative;width:28px;height:15px;border-radius:20px;background:rgba(127,127,127,.35);
    flex:0 0 auto;animation:xa-sw var(--xa-dur) infinite;}
.xa-sw i{position:absolute;top:2px;left:2px;width:11px;height:11px;border-radius:50%;background:#fff;
    animation:xa-knob var(--xa-dur) infinite;}
@keyframes xa-sw{0%,18%{background:rgba(127,127,127,.35)}22%,100%{background:#10b981}}
@keyframes xa-knob{0%,18%{left:2px}22%,100%{left:15px}}
.xa-btn{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:700;color:var(--text);
    border:1px solid var(--border);background:rgba(127,127,127,.1);border-radius:7px;padding:5px 10px;
    animation:xa-btn var(--xa-dur) infinite;}
@keyframes xa-btn{0%,31%{transform:scale(1);border-color:var(--border)}
    34%{transform:scale(.93);border-color:#10b981}37%,100%{transform:scale(1);border-color:var(--border)}}
.xa-dlg{position:absolute;left:9%;top:26%;width:70%;border:1px solid var(--border);border-radius:9px;
    background:var(--panel);box-shadow:0 16px 36px rgba(0,0,0,.5);padding:8px;opacity:0;z-index:3;
    animation:xa-dlg var(--xa-dur) infinite;}
@keyframes xa-dlg{0%,42%{opacity:0;transform:translateY(8px) scale(.96)}
    46%,71%{opacity:1;transform:none}75%,100%{opacity:0;transform:translateY(-6px) scale(.98)}}
.xa-dlg-t{font-size:9px;color:var(--muted);margin-bottom:6px;font-family:ui-monospace,Menlo,Consolas,monospace;}
.xa-item{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text);padding:5px 8px;
    border-radius:6px;border:1px solid transparent;}
.xa-item.pick{animation:xa-pick var(--xa-dur) infinite;}
.xa-item.pick b{color:#ef4444;font-weight:800;}
@keyframes xa-pick{0%,52%{background:transparent;border-color:transparent;box-shadow:none}
    56%,70%{background:rgba(239,68,68,.16);border-color:#ef4444;box-shadow:0 0 0 3px rgba(239,68,68,.15)}
    74%,100%{background:transparent;border-color:transparent;box-shadow:none}}
.xa-hint{font-size:9px;color:#ef4444;font-weight:800;margin-left:auto;opacity:0;
    animation:xa-hint var(--xa-dur) infinite;}
@keyframes xa-hint{0%,54%{opacity:0}58%,70%{opacity:1}74%,100%{opacity:0}}
.xa-card{display:flex;align-items:center;gap:8px;margin-top:10px;border:1px solid rgba(16,185,129,.5);
    background:rgba(16,185,129,.1);border-radius:8px;padding:7px 9px;font-size:10.5px;color:var(--text);
    opacity:0;animation:xa-card var(--xa-dur) infinite;}
.xa-card b{color:#10b981;}
@keyframes xa-card{0%,74%{opacity:0;transform:translateY(6px)}79%,100%{opacity:1;transform:none}}
.xa-cur{position:absolute;width:15px;height:15px;z-index:6;pointer-events:none;
    filter:drop-shadow(0 2px 3px rgba(0,0,0,.55));animation:xa-cur var(--xa-dur) infinite;}
@keyframes xa-cur{0%,10%{left:36%;top:72%}20%,25%{left:84%;top:14%}
    31%,37%{left:17%;top:34%}52%,70%{left:40%;top:56%}82%,100%{left:36%;top:76%}}
.xa-caps{position:relative;height:18px;margin-top:10px;}
.xa-cap{position:absolute;inset:0;font-size:11.5px;font-weight:700;color:var(--text);opacity:0;}
.xa-cap:nth-of-type(1){animation:xa-c1 var(--xa-dur) infinite;}
.xa-cap:nth-of-type(2){animation:xa-c2 var(--xa-dur) infinite;}
.xa-cap:nth-of-type(3){animation:xa-c3 var(--xa-dur) infinite;}
.xa-cap:nth-of-type(4){animation:xa-c4 var(--xa-dur) infinite;}
.xa-cap:nth-of-type(5){animation:xa-c5 var(--xa-dur) infinite;}
@keyframes xa-c1{0%,2%{opacity:0}5%,13%{opacity:1}16%,100%{opacity:0}}
@keyframes xa-c2{0%,16%{opacity:0}19%,27%{opacity:1}30%,100%{opacity:0}}
@keyframes xa-c3{0%,30%{opacity:0}33%,41%{opacity:1}44%,100%{opacity:0}}
@keyframes xa-c4{0%,44%{opacity:0}47%,69%{opacity:1}72%,100%{opacity:0}}
@keyframes xa-c5{0%,72%{opacity:0}75%,97%{opacity:1}100%{opacity:0}}
@media (max-width:560px){.xa-stage{height:186px}.xa-url{font-size:9px}}
@media (prefers-reduced-motion:reduce){
  .xa-sw,.xa-sw i,.xa-btn,.xa-dlg,.xa-item.pick,.xa-hint,.xa-card,.xa-cur,.xa-cap{animation:none!important}
  .xa-sw{background:#10b981}.xa-sw i{left:15px}
  .xa-dlg{opacity:1;transform:none}
  .xa-item.pick{background:rgba(239,68,68,.16);border-color:#ef4444}
  .xa-hint{opacity:1}.xa-card{opacity:1}.xa-cur{display:none}
  .xa-cap:nth-of-type(4){opacity:1}
}
