/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ==========================================
   DESIGN SYSTEM & VARIABLES (THEMES)
   ========================================== */
:root {
    /* Transition speeds */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* 1. DEEP SPACE (DARK THEME - DEFAULT) */
[data-theme="dark"] {
    --bg-app: #090b0f;
    --bg-card: #131722;
    --bg-card-hover: #181d2a;
    --bg-header: rgba(15, 18, 28, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f3f4f6;
    --text-muted: #8e9aa8;
    --accent-color: #6366f1; /* Indigo */
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success-color: #10b981; /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.3);
    --day-completed-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
    --day-completed-glow: 0 0 20px rgba(16, 185, 129, 0.15);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --scrollbar-thumb: #2c354a;
    --scrollbar-track: #0e121a;
}

/* 2. NORDIC LIGHT (LIGHT THEME) */
[data-theme="light"] {
    --bg-app: #f5f7fb;
    --bg-card: #ffffff;
    --bg-card-hover: #fcfdfe;
    --bg-header: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --accent-glow: rgba(79, 70, 229, 0.1);
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --success-border: rgba(16, 185, 129, 0.25);
    --day-completed-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 0.5) 100%);
    --day-completed-glow: 0 8px 20px rgba(16, 185, 129, 0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 16px 24px rgba(0,0,0,0.06);
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-track: #f1f5f9;
}

/* 2b. SOFT LIGHT (GENTLE LIGHT THEME) */
[data-theme="soft"] {
    --bg-app: #f5f1e8;
    --bg-card: #faf7f0;
    --bg-card-hover: #f3efe6;
    --bg-header: rgba(250, 247, 240, 0.92);
    --border-color: rgba(74, 69, 61, 0.1);
    --border-hover: rgba(74, 69, 61, 0.18);
    --text-primary: #4a453d;
    --text-muted: #8a8378;
    --accent-color: #6b8f9c;
    --accent-hover: #5a7a86;
    --accent-glow: rgba(107, 143, 156, 0.12);
    --success-color: #6b9e7a;
    --success-bg: rgba(107, 158, 122, 0.1);
    --success-border: rgba(107, 158, 122, 0.25);
    --day-completed-bg: linear-gradient(135deg, rgba(107, 158, 122, 0.06) 0%, rgba(250, 247, 240, 0.9) 100%);
    --day-completed-glow: 0 6px 16px rgba(107, 158, 122, 0.08);
    --shadow-sm: 0 1px 4px rgba(74, 69, 61, 0.06);
    --shadow-md: 0 4px 12px rgba(74, 69, 61, 0.07);
    --shadow-lg: 0 12px 24px rgba(74, 69, 61, 0.08);
    --scrollbar-thumb: #c9c2b5;
    --scrollbar-track: #f0ebe2;
}

/* 3. CYBERPUNK THEME */
[data-theme="cyberpunk"] {
    --bg-app: #0a0813;
    --bg-card: #151125;
    --bg-card-hover: #1c1732;
    --bg-header: rgba(10, 8, 19, 0.8);
    --border-color: #ff007f;
    --border-hover: #00ffff;
    --text-primary: #00ffff;
    --text-muted: #8b85b1;
    --accent-color: #ff007f; /* Neon pink */
    --accent-hover: #ff0055;
    --accent-glow: rgba(255, 0, 127, 0.2);
    --success-color: #00ff66; /* Neon green */
    --success-bg: rgba(0, 255, 102, 0.08);
    --success-border: rgba(0, 255, 102, 0.3);
    --day-completed-bg: linear-gradient(135deg, rgba(0, 255, 102, 0.06) 0%, rgba(21, 17, 37, 0.8) 100%);
    --day-completed-glow: 0 0 25px rgba(0, 255, 102, 0.25);
    --shadow-sm: 0 0 5px rgba(255, 0, 127, 0.2);
    --shadow-md: 0 0 15px rgba(255, 0, 127, 0.3);
    --shadow-lg: 0 0 25px rgba(0, 255, 255, 0.2);
    --scrollbar-thumb: #ff007f;
    --scrollbar-track: #0a0813;
}

/* 4. EMERALD FOREST */
[data-theme="forest"] {
    --bg-app: #0b130e;
    --bg-card: #122218;
    --bg-card-hover: #192f21;
    --bg-header: rgba(11, 19, 14, 0.7);
    --border-color: rgba(76, 175, 80, 0.12);
    --border-hover: rgba(76, 175, 80, 0.25);
    --text-primary: #e8f5e9;
    --text-muted: #7fa18a;
    --accent-color: #2e7d32; /* Forest green */
    --accent-hover: #1b5e20;
    --accent-glow: rgba(46, 125, 50, 0.2);
    --success-color: #8bc34a; /* Light green */
    --success-bg: rgba(139, 195, 74, 0.08);
    --success-border: rgba(139, 195, 74, 0.3);
    --day-completed-bg: linear-gradient(135deg, rgba(139, 195, 74, 0.08) 0%, rgba(18, 34, 24, 0.9) 100%);
    --day-completed-glow: 0 0 20px rgba(139, 195, 74, 0.15);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.5);
    --scrollbar-thumb: #233e2c;
    --scrollbar-track: #0b130e;
}

/* 5. SUNSET GLOW */
[data-theme="sunset"] {
    --bg-app: #120b10;
    --bg-card: #20111a;
    --bg-card-hover: #291621;
    --bg-header: rgba(18, 11, 16, 0.7);
    --border-color: rgba(254, 95, 85, 0.12);
    --border-hover: rgba(254, 95, 85, 0.25);
    --text-primary: #ffebee;
    --text-muted: #a68494;
    --accent-color: #fe5f55; /* Coral Coral */
    --accent-hover: #e04a41;
    --accent-glow: rgba(254, 95, 85, 0.2);
    --success-color: #feca57; /* Gold */
    --success-bg: rgba(254, 202, 87, 0.1);
    --success-border: rgba(254, 202, 87, 0.3);
    --day-completed-bg: linear-gradient(135deg, rgba(254, 202, 87, 0.08) 0%, rgba(32, 17, 26, 0.9) 100%);
    --day-completed-glow: 0 0 20px rgba(254, 202, 87, 0.15);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.5);
    --scrollbar-thumb: #3b1f30;
    --scrollbar-track: #120b10;
}

/* ==========================================
   BASE STYLES & RESET
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: background-color var(--transition-slow), color var(--transition-normal);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* App Wrapper */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================
   HEADER COMPONENT
   ========================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-slow), border-color var(--transition-normal);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

/* Logo */
.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--success-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    bottom: 6px;
    right: -8px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .nav-tab:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.nav-tab.active {
    color: var(--text-primary);
    background-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--accent-glow);
    color: #ffffff;
}

/* Header Right Actions */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Dropdown Firm selector */
.firm-selector-wrapper {
    position: relative;
}

.firm-select {
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    min-width: 160px;
}

.firm-select:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.firm-selector-wrapper::after {
    content: '▼';
    font-size: 0.65rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Settings Gear button */
.settings-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    position: relative;
}

.settings-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-color);
    transform: rotate(30deg);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Theme picker dropdown */
.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    z-index: 110;
}

.theme-dropdown.show {
    display: flex;
}

.theme-opt {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.theme-opt:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .theme-opt:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.theme-opt.active {
    color: var(--accent-color);
    font-weight: 600;
    background-color: var(--accent-glow);
}

.theme-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ==========================================
   APP SCREENS CONTAINER
   ========================================== */
.app-screen {
    display: none;
    flex: 1;
    padding: 2rem;
    animation: fadeIn 0.4s ease;
}

.app-screen.active {
    display: block;
}

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

/* ==========================================
   CALENDAR SCREEN
   ========================================== */
.calendar-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.month-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.month-nav-btn:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-glow);
    color: var(--accent-color);
}

.current-month-label {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: capitalize;
    min-width: 200px;
    text-align: center;
}

/* Weekday header row */
.weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.weekday-lbl {
    padding: 0.5rem;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Calendar Days Grid */
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(240px, auto);
    gap: 0.75rem;
}

.days-grid.list-view {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
}

.days-grid.calendar-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    /* Feed itself never scrolls from user input; months switch only
       programmatically (double-scroll gesture / buttons / drag) with rAF animation */
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior-y: contain;
    grid-template-columns: unset;
    grid-auto-rows: unset;
    touch-action: pan-y;
    position: relative;
}

.days-grid.calendar-feed.calendar-feed-drag-edge-next {
    box-shadow: inset 0 -3px 0 var(--accent-color);
}

.days-grid.calendar-feed.calendar-feed-drag-edge-prev {
    box-shadow: inset 0 3px 0 var(--accent-color);
}

.days-grid.calendar-feed.calendar-feed-page-armed-next {
    box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--accent-color) 70%, transparent);
}

.days-grid.calendar-feed.calendar-feed-page-armed-prev {
    box-shadow: inset 0 3px 0 color-mix(in srgb, var(--accent-color) 70%, transparent);
}

.calendar-month-section {
    flex: 0 0 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    overflow: hidden;
}

.calendar-month-section-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    flex: 0 0 auto;
    color: var(--text-muted);
    text-transform: capitalize;
}

.calendar-month-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(250px, auto);
    gap: 0.75rem;
    flex: 1 1 0%;
    min-height: 0;
    height: 0; /* force flex child to take remaining space and scroll internally */
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.calendar-month-days.list-view,
.days-grid.list-view .calendar-month-days {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
}

.weekdays-grid.calendar-weekdays-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-app);
    padding-bottom: 0.35rem;
    flex: 0 0 auto;
}

/* Calendar screen: chrome fixed, months page-flip in feed scroller */
#screen-calendar.app-screen.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height, 64px));
    height: calc(100dvh - var(--header-height, 64px));
    max-height: calc(100vh - var(--header-height, 64px));
    max-height: calc(100dvh - var(--header-height, 64px));
    overflow: hidden;
    box-sizing: border-box;
}

#screen-calendar .calendar-view-header,
#screen-calendar .calendar-summary-bar,
#screen-calendar .calendar-empty-month-banner,
#screen-calendar .weekdays-grid {
    flex: 0 0 auto;
}

#screen-calendar .calendar-view-header {
    position: static;
}

/* Day Card */
.day-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all var(--transition-normal), border-color var(--transition-fast);
    min-height: 250px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.day-card.drop-target {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
    animation: dropTargetPulse 1.2s ease infinite;
}

.calendar-list-day.drop-target {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
    animation: dropTargetPulse 1.2s ease infinite;
}

.day-card.drop-target::after,
.calendar-list-day.drop-target::after {
    content: 'Отпустите здесь';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-color);
    background: var(--accent-glow);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    pointer-events: none;
    z-index: 2;
}

@keyframes dropTargetPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35); }
    50% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.55); }
}

.day-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.day-card.other-month {
    opacity: 0.45;
    pointer-events: auto;
    cursor: pointer;
}

.day-card.other-month:hover {
    opacity: 0.65;
    transform: translateY(-1px);
}

.day-card.other-month:hover .day-number {
    text-decoration: underline;
    color: var(--accent-color);
}

.day-card.today {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.day-card.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--accent-color);
}

/* Day Card Completion State */
.day-card.day-completed {
    background: var(--day-completed-bg) !important;
    border-color: var(--success-color) !important;
    box-shadow: var(--day-completed-glow);
    animation: completionPulse 0.8s ease-out;
}

.day-card.day-completed .event-item.completed {
    opacity: 0.85;
}

@keyframes completionPulse {
    0% {
        box-shadow: 0 0 0 0 var(--success-color);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px var(--success-color);
        transform: scale(1.02);
    }
    100% {
        box-shadow: var(--day-completed-glow);
        transform: scale(1);
    }
}

/* Day Card Header */
.day-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--border-color);
    flex-shrink: 0;
}

.day-number {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
}

.day-week {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.4rem;
}

/* Events Container — carousel (one task + arrows) */
.day-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 0.15rem;
}

.day-events-carousel-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: stretch;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

.day-events-carousel-stage > .event-item,
.day-events-carousel-stage > .day-empty-placeholder {
    width: 100%;
    min-height: 0;
}

.day-card-header .day-events-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex-shrink: 0;
    min-height: 0;
    margin-left: auto;
}

.day-events-carousel-nav[hidden] {
    display: none !important;
}

.day-card-header .day-events-carousel-btn {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    padding: 0;
}

.day-card-header .day-events-carousel-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.day-card-header .day-events-carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.day-card-header .day-events-carousel-counter {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 2rem;
    text-align: center;
    user-select: none;
}

.day-events-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Add event button inside day card */
.add-event-card-btn {
    width: 100%;
    padding: 0.4rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: var(--text-muted);
    margin-top: auto;
    flex-shrink: 0;
}

.add-event-card-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: var(--accent-glow);
}

/* ==========================================
   EVENT ITEM COMPONENT (Inside day card)
   ========================================== */
.event-item {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.event-item:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-glow);
    transform: translateY(-1px);
}

[data-theme="light"] .event-item {
    background-color: rgba(0, 0, 0, 0.02);
}

.event-item.completed {
    border-color: var(--success-border);
    background-color: var(--success-bg);
}

.event-item.completed .event-card-comment {
    text-decoration: line-through;
    opacity: 0.65;
}

.event-item.empty-event {
    border-style: dashed;
    opacity: 0.75;
}

.event-item-curwa {
    border-left: 3px solid #c084fc !important;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(192, 132, 252, 0.08) 100%) !important;
}
.event-item-curwa:hover {
    box-shadow: 0 4px 12px rgba(192, 132, 252, 0.2) !important;
    border-color: #d8b4fe !important;
}

.event-item-curwa-manager-approved {
    border-left-color: #38bdf8 !important;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(56, 189, 248, 0.1) 100%) !important;
}

.curwa-read-receipt {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}

.curwa-read-receipt .tick {
    color: var(--text-muted);
    letter-spacing: -0.15em;
}

.curwa-read-receipt .tick.delivered {
    color: #53bdeb;
}

.curwa-status-val.manager_approved {
    color: #38bdf8;
}

.event-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
}

.event-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: var(--accent-glow);
    color: var(--accent-color);
    border: 1px solid rgba(99, 102, 241, 0.25);
    white-space: nowrap;
}

.event-card-badge.empty {
    color: var(--text-muted);
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.event-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.event-card-comment {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.event-card-comment.muted {
    color: var(--text-muted);
    font-style: italic;
}

.event-card-checkbox {
    flex-shrink: 0;
    margin-top: 2px;
}

.event-card-checkbox input {
    width: 15px;
    height: 15px;
    accent-color: var(--success-color);
    cursor: pointer;
}

/* Event Item actions row */
.event-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-buttons {
    display: flex;
    gap: 0.2rem;
}

/* Grid fields */
.event-fields {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.event-row-half {
    display: flex;
    gap: 0.3rem;
}

/* Event Item Grid Row (Form controls + Checkbox) */
.event-main-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Custom Checkbox */
.custom-checkbox {
    width: 20px;
    height: 20px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.custom-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox:hover .checkmark {
    border-color: var(--accent-color);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--success-color);
    border-color: var(--success-color);
    animation: checkboxPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 3px;
    left: 6px;
}

.custom-checkbox input:checked ~ .checkmark::after {
    display: block;
}

@keyframes checkboxPop {
    0% { transform: scale(0.6); }
    100% { transform: scale(1); }
}

/* Dropdowns & Selects in event item */
.event-dropdowns {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

/* Actions panel in event item (AI generator button, delete button) */
.event-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .event-actions {
    border-top-color: rgba(0, 0, 0, 0.03);
}

.event-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.event-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.event-btn.ai-btn {
    color: var(--accent-color);
    font-weight: 600;
}

.event-btn.ai-btn:hover {
    background-color: var(--accent-glow);
}

.event-btn.delete-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* ==========================================
   REPORTS SCREEN
   ========================================== */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.filters-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select, .filter-input {
    padding: 0.6rem 1rem;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    width: 100%;
}

[data-theme="light"] .filter-select, 
[data-theme="light"] .filter-input {
    background-color: rgba(0, 0, 0, 0.02);
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--accent-color);
}

.clear-filters-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
    font-size: 0.88rem;
    height: 40px;
}

.clear-filters-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.filters-panel-actions {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-shrink: 0;
}

.filters-panel-actions .export-btn,
.filters-panel-actions .clear-filters-btn {
    height: 40px;
    white-space: nowrap;
}

/* Reports Table */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.reports-table th, .reports-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.reports-table th {
    background-color: rgba(0, 0, 0, 0.1);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="light"] .reports-table th {
    background-color: rgba(0, 0, 0, 0.02);
}

.reports-table tbody tr {
    transition: background-color var(--transition-fast);
}

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

.reports-table select, .reports-table input {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    width: 100%;
    transition: all var(--transition-fast);
}

.reports-table select:hover, .reports-table input:hover {
    border-color: var(--border-color);
}

.reports-table select:focus, .reports-table input:focus {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: var(--accent-color);
}

[data-theme="light"] .reports-table select:focus, 
[data-theme="light"] .reports-table input:focus {
    background-color: #f1f5f9;
}

.reports-table .date-col {
    width: 130px;
    font-weight: 600;
}

.reports-table .firm-col {
    width: 150px;
    color: var(--accent-color);
    font-weight: 600;
}

.reports-table .format-col {
    width: 150px;
}

.reports-table .perf-col {
    width: 160px;
}

.reports-table .link-col {
    width: 180px;
}

.reports-table .actions-col {
    width: 80px;
    text-align: center;
}

.reports-table .uncheck-btn {
    color: var(--success-color);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem;
    border-radius: 4px;
}

.reports-table .uncheck-btn:hover {
    background-color: rgba(16, 185, 129, 0.1);
    transform: scale(1.1);
}

.report-cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
    line-height: 1.35;
}

.report-cost-line {
    color: var(--text-muted);
    white-space: nowrap;
}

.report-cost-total {
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px dashed var(--border-color);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.performer-rates-card {
    margin-top: 1.25rem;
}

.rate-role-row .rate-clear-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.rate-role-row .rate-clear-btn:hover {
    color: var(--accent-color);
    background: var(--accent-glow);
}

.rate-role-inputs input::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
    font-weight: 500;
}

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    fill: currentColor;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1.05rem;
}

/* ==========================================
   GUIDES / CATALOGS SCREEN
   ========================================== */
.guides-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    min-height: 500px;
}

/* Sidebar selectors */
.guides-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guide-menu-item {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guide-menu-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .guide-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.guide-menu-item.active {
    color: var(--text-primary);
    background-color: var(--accent-glow);
    border-left: 4px solid var(--accent-color);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.guide-badge {
    background-color: rgba(255, 255, 255, 0.06);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

[data-theme="light"] .guide-badge {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Details Panel */
.guide-details-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.guide-details-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.guide-details-title {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

/* List elements */
.guide-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.guide-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.1);
    transition: all var(--transition-fast);
}

[data-theme="light"] .guide-item-row {
    background-color: rgba(0, 0, 0, 0.01);
}

.guide-item-row:hover {
    border-color: var(--border-hover);
}

.guide-item-input {
    flex: 1;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.guide-item-input:focus {
    background-color: rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

[data-theme="light"] .guide-item-input:focus {
    background-color: #f1f5f9;
}

.guide-item-delete {
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.guide-item-delete:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Add input */
.guide-add-form {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.guide-add-input {
    flex: 1;
    padding: 0.75rem 1.2rem;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.92rem;
}

[data-theme="light"] .guide-add-input {
    background-color: rgba(0, 0, 0, 0.02);
}

.guide-add-input:focus {
    border-color: var(--accent-color);
}

.guide-add-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 10px var(--accent-glow);
}

.guide-add-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.guide-links-add-form {
    display: grid;
    grid-template-columns: 1.2fr 160px 1.5fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

#guide-add-form[hidden],
#guide-links-add-form[hidden] {
    display: none !important;
}

#guide-details-panel:not(.guide-panel--links) #guide-links-add-form {
    display: none !important;
}

#guide-details-panel.guide-panel--links #guide-add-form {
    display: none !important;
}

#guide-details-panel.guide-panel--links #guide-links-add-form {
    display: grid !important;
}

.guide-link-row {
    display: grid;
    grid-template-columns: 1fr 150px 1.5fr auto;
    gap: 0.5rem;
    align-items: center;
}

.guide-link-platform-select {
    font-size: 0.85rem;
    padding: 0.55rem 0.65rem;
}

.guide-link-url-input {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .guide-links-add-form,
    .guide-link-row {
        grid-template-columns: 1fr;
    }
}

.platform-link-fields {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.publish-links-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: -0.25rem 0 0.5rem;
    line-height: 1.4;
}

.publish-links-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.publish-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--accent-color);
    background: var(--accent-glow);
    color: var(--accent-color);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.publish-link-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.publish-link-arrow {
    font-size: 0.9rem;
    opacity: 0.85;
}

.event-card-publish-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--success-color);
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-color);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.event-card-publish-btn:hover {
    background: var(--success-color);
    color: #fff;
}

.publish-links-popover {
    position: fixed;
    z-index: 150;
    min-width: 240px;
    max-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.publish-links-popover-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.35rem 0.5rem 0.5rem;
}

.publish-link-popover-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.88rem;
}

.publish-link-popover-item:hover {
    background: var(--accent-glow);
}

.publish-link-popover-item .publish-link-name {
    font-weight: 600;
}

.publish-link-popover-item .publish-link-platform {
    font-size: 0.72rem;
    color: var(--text-muted);
}

#context-menu-publish {
    color: var(--success-color);
    font-weight: 600;
}

/* ==========================================
   PROMPTS SCREEN
   ========================================== */
.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.prompt-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.prompt-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prompt-format-badge {
    background-color: var(--accent-glow);
    color: var(--accent-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.prompt-textarea {
    width: 100%;
    height: 120px;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    line-height: 1.5;
    resize: none;
    transition: all var(--transition-fast);
}

[data-theme="light"] .prompt-textarea {
    background-color: rgba(0, 0, 0, 0.02);
}

.prompt-textarea:focus {
    border-color: var(--accent-color);
    background-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .prompt-textarea:focus {
    background-color: #ffffff;
}

.prompt-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.prompt-save-indicator {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.prompt-save-indicator.show {
    opacity: 1;
}

.prompt-save-indicator.saving {
    color: var(--text-muted);
}

.prompt-delete-btn {
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.prompt-delete-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Add new prompt card */
.prompt-card.add-prompt-card {
    border-style: dashed;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    min-height: 220px;
    color: var(--text-muted);
}

.prompt-card.add-prompt-card:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: var(--accent-glow);
}

.add-prompt-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ==========================================
   MODALS / POPUPS (AI Generator & Warnings)
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    overflow: hidden;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

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

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Generated prompt container */
.prompt-preview-box {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 250px;
    overflow-y: auto;
    position: relative;
}

[data-theme="light"] .prompt-preview-box {
    background-color: #f8fafc;
}

.modal-meta-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.meta-item strong {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-footer {
    background-color: #f8fafc;
}

.modal-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.modal-btn.secondary {
    border: 1px solid var(--border-color);
}

.modal-btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .modal-btn.secondary:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.modal-btn.primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 10px var(--accent-glow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-btn.primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* Copy notification animation */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--success-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================
   EVENT EDITOR MODAL
   ========================================== */
.event-editor-content {
    max-width: 640px;
}

.event-editor-context {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-glow) 0%, rgba(0, 0, 0, 0.08) 100%);
    border-bottom: 1px solid var(--border-color);
}

.event-context-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.event-context-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.event-context-item strong {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.event-editor-body {
    gap: 1rem;
}

.event-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.event-editor-full {
    grid-column: 1 / -1;
}

.event-editor-input,
.event-editor-textarea {
    background-color: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .event-editor-input,
[data-theme="light"] .event-editor-textarea {
    background-color: #f8fafc !important;
}

.event-editor-textarea {
    min-height: 110px;
    resize: vertical;
}

.event-editor-completed {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.event-editor-completed input {
    width: 16px;
    height: 16px;
    accent-color: var(--success-color);
}

.event-editor-footer {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.event-editor-footer-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.modal-btn.danger-btn {
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ef4444;
    background: transparent;
}

.modal-btn.danger-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 560px) {
    .event-editor-context {
        grid-template-columns: 1fr;
    }

    .event-editor-grid {
        grid-template-columns: 1fr;
    }

    .event-editor-footer-right {
        width: 100%;
        margin-left: 0;
    }

    .event-editor-footer-right .modal-btn {
        flex: 1;
        justify-content: center;
    }
}

.platform-chips-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.chip-preset-btn {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
}

.chip-preset-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.platform-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.platform-chip {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.platform-chip.active {
    border-color: var(--accent-color);
    background: var(--accent-glow);
    color: var(--accent-color);
}

.platform-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.single-platform-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.single-platform-link-row .platform-link-channel-select {
    flex: 0 0 auto;
    min-width: 8rem;
}

.single-platform-link-row .platform-link-channel-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.single-platform-link-row input[type="url"] {
    flex: 1 1 12rem;
    min-width: 0;
}

.platform-link-row label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.team-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.team-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.9fr 0.9fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.1);
}

.team-row select,
.team-row input {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    font-size: 0.82rem;
}

.team-row-remove {
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
}

.team-add-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.team-add-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.team-cost-preview {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: var(--accent-glow);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.rates-format-card {
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0;
    height: 100%;
}

.rates-format-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
}

.rate-role-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0;
}

.rate-role-row + .rate-role-row {
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.rate-role-name {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rate-role-inputs {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.rate-mini-field {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.15rem 0.35rem;
}

.rate-mini-field span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rate-mini-field.bonus span {
    color: var(--success-color);
}

.rate-mini-field input {
    width: 52px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.78rem;
    text-align: right;
    padding: 0.1rem;
}

.rate-mini-field input:focus {
    outline: none;
}

.salary-presets-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.salary-presets-section h4 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.format-preset-block {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.6rem;
}

.format-preset-header {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.format-preset-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.format-preset-row select {
    font-size: 0.78rem;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
    min-width: 0;
}

.format-preset-remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.35rem;
}

.format-preset-remove:hover {
    color: #ef4444;
}

.format-preset-add {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
}

.format-preset-add:hover {
    border-color: var(--accent-color);
}

.format-preset-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.25rem 0;
}

.team-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.team-editor-header label {
    margin-bottom: 0;
}

.rate-cell-inputs {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.rate-cell-inputs input {
    width: 64px;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    font-size: 0.78rem;
    text-align: right;
}

.rate-matrix-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    justify-content: center;
    align-items: center;
}

.rate-matrix-cell input {
    width: 58px;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    font-size: 0.78rem;
    text-align: right;
}

.rate-matrix-cell .currency-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rate-matrix-cell .currency-label.bonus {
    color: var(--success-color);
}

.report-editable-cell {
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.35;
}

.report-editable-cell:hover {
    color: var(--accent-color);
}

.guide-performer-row {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    gap: 0.5rem;
    align-items: center;
}

.guide-performer-row select {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

.event-editor-content .modal-body {
    max-height: min(62vh, 560px);
    overflow-y: auto;
}

@media (max-width: 640px) {
    .team-row {
        grid-template-columns: 1fr;
    }

    .guide-performer-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   UTILITY STYLES
   ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================
   EXPORT BUTTONS & COMMON
   ========================================== */
.export-btn {
    padding: 0.6rem 1.2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.export-btn:hover {
    border-color: var(--accent-color);
    background-color: var(--bg-card-hover);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

.export-btn svg {
    color: var(--accent-color);
    transition: transform var(--transition-fast);
}

.export-btn:hover svg {
    transform: translateY(1px);
}

/* ==========================================
   SALARY SCREEN STYLING
   ========================================== */
.salary-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.salary-header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.special-calc-open-btn {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(16, 185, 129, 0.12));
    border-color: rgba(79, 70, 229, 0.35);
}

.special-calc-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem 0 2rem;
}

.special-calc-header h2 {
    margin: 0.75rem 0 0.35rem;
}

.special-calc-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.special-calc-month-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.special-calc-month-input {
    max-width: 220px;
    margin-bottom: 0;
}

.special-calc-exports {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
}

.special-calc-export-btn {
    padding: 1rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 650;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.special-calc-export-btn:hover:not(:disabled) {
    border-color: rgba(79, 70, 229, 0.55);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
}

.special-calc-export-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.salary-layout-grid {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .salary-layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Rates Card sidebar */
.salary-rates-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-slow), border-color var(--transition-normal);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.salary-rates-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.salary-rates-card .section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.salary-rates-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.rate-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rate-field-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rate-input-wrapper {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="light"] .rate-input-wrapper {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="soft"] .rate-input-wrapper {
    background-color: rgba(74, 69, 61, 0.03);
}

.rate-input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.rate-input-wrapper input {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: right;
    width: 100%;
}

.rate-input-wrapper .currency-label {
    margin-left: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Main Panel Right side */
.salary-main-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Summary stats widgets */
.salary-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .salary-summary-grid {
        grid-template-columns: 1fr;
    }
}

.salary-summary-grid .metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-slow), border-color var(--transition-normal);
}

.salary-summary-grid .metric-card.highlight {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .salary-summary-grid .metric-card.highlight {
    background: linear-gradient(135deg, #ffffff 0%, rgba(79, 70, 229, 0.03) 100%);
}

.salary-summary-grid .metric-card.highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-color), var(--success-color));
}

.salary-summary-grid .metric-val {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.salary-summary-grid .metric-card.highlight .metric-val {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .salary-summary-grid .metric-card.highlight .metric-val {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#salary-total-fot span {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: currentColor;
    color: var(--text-primary);
}

.salary-summary-grid .metric-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Budget Stacked Bar chart */
.budget-share-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-slow), border-color var(--transition-normal);
}

.budget-share-card h3 {
    margin-bottom: 1.2rem;
    font-size: 1.15rem;
}

.budget-share-bar {
    height: 14px;
    border-radius: 7px;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

[data-theme="light"] .budget-share-bar {
    background-color: rgba(0, 0, 0, 0.05);
}

.budget-share-segment {
    height: 100%;
    transition: width var(--transition-normal) ease;
    position: relative;
}

.budget-share-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.legend-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
    display: inline-block;
}

.legend-percent {
    margin-left: 0.4rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Performers Accordion list */
.salary-performers-section h3 {
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
}

.salary-performers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.salary-accordion {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.salary-accordion:hover {
    border-color: var(--border-hover);
}

.salary-accordion.open {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

.salary-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}

.salary-accordion-header:hover {
    background-color: var(--bg-card-hover);
}

.accordion-info-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.performer-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.performer-tasks-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

[data-theme="light"] .performer-tasks-badge {
    background-color: rgba(0, 0, 0, 0.03);
}

.accordion-info-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.performer-salary-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--success-color);
}

.accordion-chevron {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}

.salary-accordion.open .accordion-chevron {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.salary-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
}

.salary-accordion.open .salary-accordion-body {
    max-height: 800px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}

.accordion-table-container {
    padding: 1.2rem 1.5rem;
}

.salary-details-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.salary-details-table th,
.salary-details-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.salary-details-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.salary-details-table tr:last-child td {
    border-bottom: none;
}

.salary-details-table .col-date { width: 10%; }
.salary-details-table .col-firm { width: 15%; }
.salary-details-table .col-format { width: 15%; }
.salary-details-table .col-platform { width: 15%; }
.salary-details-table .col-comment { width: 30%; }
.salary-details-table .col-cost { width: 15%; font-weight: 700; text-align: right; }

.salary-details-table th.col-cost { text-align: right; }

.salary-empty-state {
    padding: 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Custom Cost Input Styling */
.report-cost-input, .salary-cost-input {
    font-weight: 600;
    text-align: right;
    border-bottom: 1px dashed var(--border-color) !important;
    border-radius: 0 !important;
    padding: 0.25rem 0.4rem !important;
    width: 100%;
    transition: all var(--transition-fast);
    background: transparent;
    color: inherit;
}

.report-cost-input:hover, .salary-cost-input:hover {
    border-bottom-color: var(--accent-color) !important;
}

.report-cost-input:focus, .salary-cost-input:focus {
    background-color: rgba(0, 0, 0, 0.15) !important;
    border-bottom: 1px solid var(--accent-color) !important;
    outline: none;
}

[data-theme="light"] .report-cost-input:focus, 
[data-theme="light"] .salary-cost-input:focus {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Multiselect Dropdown Styling */
.multiselect-container {
    position: relative;
    display: inline-block;
    min-width: 220px;
    user-select: none;
}

.multiselect-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.multiselect-trigger:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.multiselect-value {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.multiselect-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 120;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    max-height: 250px;
    overflow-y: auto;
}

.multiselect-dropdown.show {
    display: flex;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    border-radius: 6px;
}

.multiselect-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .multiselect-option:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.multiselect-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.3rem 0;
}

.multiselect-option .custom-checkbox {
    margin-right: 0;
}

.multiselect-option:hover .checkmark {
    border-color: var(--accent-color);
}

.multiselect-option .option-text {
    font-size: 0.88rem;
}

/* ==========================================
   CURRENCY STYLES
   ========================================== */
.rate-currency-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    padding-right: 0.5rem;
    font-size: 0.95rem;
    outline: none;
}

[data-theme="light"] .rate-currency-select {
    color: var(--text-primary);
}

.rate-currency-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Cost Column Currency Selects in Tables */
.table-cost-wrapper select {
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    padding: 2px;
    outline: none;
}

.table-cost-wrapper select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Chart Currency Toggle */
.chart-currency-toggle {
    border: 1px solid var(--border-color);
}

.currency-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.currency-toggle-btn:hover {
    color: var(--text-primary);
}

.currency-toggle-btn.active {
    background-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 2px 6px var(--accent-glow);
}

/* Hide spin-buttons for clean inline inputs in table */
.table-cost-wrapper input[type="number"]::-webkit-outer-spin-button,
.table-cost-wrapper input[type="number"]::-webkit-inner-spin-button,
.rate-inputs-row input[type="number"]::-webkit-outer-spin-button,
.rate-inputs-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.table-cost-wrapper input[type="number"],
.rate-inputs-row input[type="number"] {
    -moz-appearance: textfield;
}

/* Make inputs look like clean interactive dash-underlined elements */
.table-cost-wrapper input[type="number"] {
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--border-color);
    color: inherit;
    font-weight: 600;
    transition: all var(--transition-fast);
    outline: none;
    border-radius: 0;
    padding: 0.1rem 0.2rem;
}

.table-cost-wrapper input[type="number"]:hover {
    border-bottom-color: var(--accent-color);
}

.table-cost-wrapper input[type="number"]:focus {
    background-color: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--accent-color);
}

[data-theme="light"] .table-cost-wrapper input[type="number"]:focus {
    background-color: rgba(0, 0, 0, 0.03);
}

/* ==========================================
   LOGIN PAGE
   ========================================== */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
    font-family: var(--font-body);
}

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

.password-input-wrap input {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.password-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.password-toggle-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.password-toggle-icon[hidden] {
    display: none;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.login-error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.login-submit {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 10px;
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.login-submit:hover {
    background: var(--accent-hover);
}

.login-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ==========================================
   USER SESSION & ADMIN
   ========================================== */
.user-session {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 0.75rem;
}

.user-session-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.admin-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    flex-wrap: wrap;
}

.admin-tab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all var(--transition-fast);
}

.admin-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.admin-tab.active {
    background: var(--accent-glow);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--accent-color);
}

.admin-tab-panel:not(.active) {
    display: none;
}

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.admin-section h2 {
    margin: 0 0 1.25rem 0;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.admin-create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
    min-width: 180px;
}

.form-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-create-form input[type="text"],
.admin-create-form input[type="password"],
.admin-create-form select {
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary, rgba(0, 0, 0, 0.2));
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
}

.admin-create-form .password-input-wrap input,
.password-input-wrap .filter-input {
    width: 100%;
    padding-right: 2.75rem;
}

.password-input-wrap .filter-input {
    box-sizing: border-box;
}

.admin-create-form button[type="submit"] {
    height: 40px;
    white-space: nowrap;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.1);
}

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

.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.9rem;
}

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

.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.15);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-role-select {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.admin-role-select.role-admin {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #c084fc !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    font-weight: 600;
}

.admin-role-select.role-manager {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    font-weight: 600;
}

.admin-role-select.role-task_editor {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24; !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    font-weight: 600;
}

.admin-role-select.role-user {
    background: rgba(156, 163, 175, 0.15) !important;
    color: #d1d5db !important;
    border-color: rgba(156, 163, 175, 0.3) !important;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-action-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.admin-action-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-glow);
}

.admin-action-btn.danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.admin-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}

.admin-help {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
}

.admin-subheading {
    font-size: 1.05rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
    font-weight: 700;
    border-left: 3px solid var(--accent-color);
    padding-left: 0.65rem;
}

.admin-ingest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.telegram-status-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.status-indicator-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.info-banner {
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.info-banner.warn {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.12);
}

.info-banner p {
    margin-bottom: 0.75rem;
}

.info-banner.warn p {
    margin-bottom: 0;
}

.code-snippet-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.85rem;
    gap: 0.75rem;
}

.code-snippet-wrap code {
    color: #818cf8;
    word-break: break-all;
}

.copy-code-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.copy-code-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-color);
    background: var(--accent-glow);
}

.ingest-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ingest-header-row h2 {
    margin: 0;
}

.admin-ingest-filters {
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.admin-ingest-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-ingest-filters label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.search-input-wrap {
    position: relative;
    width: 100%;
}

.ingest-review-layout {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    height: calc(100vh - 240px);
    min-height: 520px;
}

.ingest-review-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.ingest-review-column::-webkit-scrollbar,
.ingest-review-detail::-webkit-scrollbar {
    width: 6px;
}

.ingest-review-column::-webkit-scrollbar-thumb,
.ingest-review-detail::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 999px;
}

.ingest-review-column::-webkit-scrollbar-track,
.ingest-review-detail::-webkit-scrollbar-track {
    background: transparent;
}

.ingest-review-group {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.ingest-review-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.ingest-review-group-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.group-header-actions {
    display: flex;
    align-items: center;
}

.ingest-review-count {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
}

.ingest-review-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ingest-list-card {
    width: 100%;
    min-height: 126px;
    height: 126px;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0.85rem 1rem 0.85rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-primary);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.ingest-list-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.2s;
}

.ingest-list-card[data-confidence-level="high"]::before {
    background: #10b981;
}

.ingest-list-card[data-confidence-level="medium"]::before {
    background: #f59e0b;
}

.ingest-list-card[data-confidence-level="low"]::before {
    background: #ef4444;
}

.ingest-list-card:hover,
.ingest-list-card.selected {
    border-color: var(--accent-color);
    background: var(--accent-glow);
    transform: translateY(-1px);
}

.ingest-list-card.selected::before {
    width: 5px;
}

.ingest-list-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
    flex-shrink: 0;
}

.ingest-list-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ingest-list-channel {
    font-size: 0.84rem;
    font-weight: 700;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ingest-list-preview {
    font-size: 0.84rem;
    line-height: 1.45;
    margin-bottom: 0.55rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    color: var(--text-muted);
}

.ingest-list-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
    max-height: 1.8rem;
    overflow: hidden;
    flex-shrink: 0;
}

.ingest-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.ingest-card-badge.warn {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.03);
}

.ingest-review-detail {
    height: 100%;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.01);
}

.ingest-detail-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
}

.ingest-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.ingest-detail-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ingest-detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ingest-detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.ingest-detail-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    font-size: 0.92rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.ingest-draft-form-box {
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.25rem;
}

.ingest-duplicate-warning {
    margin-bottom: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(234, 179, 8, 0.45);
    background: rgba(234, 179, 8, 0.12);
    padding: 0.85rem 1rem;
}

.ingest-duplicate-warning-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.ingest-duplicate-warning-text {
    flex: 1;
    min-width: 0;
}

.ingest-duplicate-score {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(234, 179, 8, 0.25);
    color: var(--text-primary);
}

.ingest-duplicate-preview {
    margin-top: 0.35rem;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}

.ingest-duplicate-reasons,
.ingest-duplicate-team {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ingest-duplicate-modal-content {
    max-width: 560px;
    width: 92%;
}

.ingest-duplicate-modal-lead {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ingest-duplicate-candidates-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 50vh;
    overflow-y: auto;
}

.ingest-duplicate-candidate {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.ingest-duplicate-candidate.selected {
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(99, 102, 241, 0.08);
}

.ingest-duplicate-candidate input {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.ingest-duplicate-candidate-body {
    flex: 1;
    min-width: 0;
}

.ingest-duplicate-candidate-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ingest-duplicate-candidate-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ingest-proposal-fields {
    display: grid;
    grid-template-columns: 140px 180px 1fr;
    gap: 0.75rem;
    align-items: flex-start;
}

.ingest-proposal-date,
.ingest-proposal-format {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.82rem;
    width: 100%;
}

.ingest-proposal-comment {
    width: 100%;
    min-height: 2.3rem;
    height: 2.3rem;
    resize: vertical;
    font-size: 0.82rem;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.ingest-detail-actions {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.ingest-detail-actions button {
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
}

.ingest-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 2rem;
    text-align: center;
}

@media (max-width: 1024px) {
    .ingest-review-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .ingest-review-column {
        height: 400px;
    }
    
    .ingest-proposal-fields {
        grid-template-columns: 1fr;
    }
    
    .ingest-proposal-comment {
        height: auto;
    }
}

/* ==========================================
   QoL ENHANCEMENTS
   ========================================== */
.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-primary);
    transition: opacity 0.3s;
}

.app-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.app-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.calendar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.today-btn {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    margin-left: 0.25rem;
}

.calendar-summary-bar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.summary-stat {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.summary-val {
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 0.25rem;
}

.summary-progress-wrap {
    flex: 1;
    min-width: 120px;
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.summary-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color));
    border-radius: 999px;
    transition: width 0.3s;
    width: 0%;
}

.calendar-view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 2px;
}

.view-toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

.view-toggle-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.day-card-header .day-event-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.35rem;
}

.event-item[draggable="true"] {
    cursor: grab;
}

.event-item.dragging {
    opacity: 0.65;
    transform: scale(0.98);
    cursor: grabbing;
}

.event-item.drag-source {
    opacity: 0.25;
    border-style: dashed;
    background: transparent;
}

.event-item.empty-event {
    border: 1px dashed var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.event-card-badge.colored {
    color: #fff;
    border: none;
}

.event-card-link-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.event-card-menu-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 1rem;
    line-height: 1;
}

.event-card-menu-btn:hover {
    color: var(--accent-color);
}

.event-item.completed-flash {
    animation: completedFlash 0.5s ease;
}

@keyframes completedFlash {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
}

.event-context-menu {
    position: fixed;
    z-index: 500;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
}

.event-context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.event-context-menu button:hover {
    background: rgba(99, 102, 241, 0.12);
}

.event-context-menu button.danger {
    color: #ef4444;
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toast-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    margin-left: auto;
}

.salary-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.salary-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
}

.salary-tab.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.salary-tab-panel:not(.active) {
    display: none;
}

.salary-rates-tab-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.salary-rates-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.salary-rates-tab-header h3 {
    margin-bottom: 0.35rem;
}

.salary-rates-tab-header .section-desc {
    margin-bottom: 0;
}

.salary-rates-firm-select {
    min-width: 260px;
    margin-bottom: 0 !important;
}

.salary-rates-full {
    max-width: none;
    width: 100%;
    max-height: none;
    overflow: visible;
}

.salary-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.salary-presets-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-top: 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.salary-presets-card .section-desc {
    margin-bottom: 1rem;
}

#format-presets-form,
#platform-presets-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.salary-main-full {
    width: 100%;
}

.salary-layout-calc {
    grid-template-columns: 1fr;
}

@media (max-width: 960px) {
    .salary-presets-grid {
        grid-template-columns: 1fr;
    }

    .salary-rates-form {
        grid-template-columns: 1fr;
    }
}

.guide-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 320px;
}

.guide-search-input {
    max-width: none;
    flex: 1;
    margin-top: 0;
}

.guide-search-input:-webkit-autofill {
    animation-name: guideSearchAutofill;
    animation-duration: 0.01s;
}

@keyframes guideSearchAutofill {
    from { opacity: 1; }
    to { opacity: 1; }
}

.guide-search-clear {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.guide-search-clear:hover {
    color: var(--text-main);
    border-color: var(--accent-color);
}

.guide-details-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.reports-table tbody tr.clickable-row {
    cursor: pointer;
}

.reports-table tbody tr.clickable-row:hover {
    background: rgba(99, 102, 241, 0.06);
}

.report-edit-icon {
    opacity: 0.5;
    margin-right: 0.25rem;
}

.event-editor-footer {
    justify-content: space-between;
}

.event-editor-footer-left {
    display: flex;
    gap: 0.5rem;
}

.calendar-list-day {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.calendar-list-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

[data-theme="cyberpunk"] .reports-table td,
[data-theme="cyberpunk"] .prompt-textarea,
[data-theme="cyberpunk"] .event-editor-textarea {
    border-color: rgba(255, 0, 127, 0.25);
}

@media (max-width: 1024px) {
    .nav-tabs {
        max-width: calc(100vw - 200px);
        overflow-x: auto;
    }
    .salary-layout-grid {
        grid-template-columns: 1fr;
    }
    .days-grid:not(.list-view) {
        grid-auto-rows: minmax(230px, auto);
    }
    .calendar-month-days:not(.list-view) {
        grid-auto-rows: minmax(230px, auto);
    }
    .day-card {
        min-height: 230px;
    }
}

@media (max-width: 768px) {
    .app-screen {
        padding: 0.65rem 0.65rem 5rem;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .calendar-view-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.4rem;
        position: static;
        top: auto;
        z-index: auto;
        background: var(--bg-app);
        padding: 0.25rem 0 0.4rem;
        margin-bottom: 0.35rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        box-sizing: border-box;
    }

    .calendar-navigation {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0.25rem;
        flex-wrap: nowrap;
        box-sizing: border-box;
    }

    .current-month-label {
        font-size: clamp(1rem, 4.2vw, 1.25rem);
        font-weight: 700;
        text-align: center;
        flex: 1 1 auto;
        margin: 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .calendar-navigation .month-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .today-btn {
        margin-left: 0;
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .calendar-header-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0.35rem;
        box-sizing: border-box;
    }

    .calendar-header-actions .export-btn {
        flex: 0 0 auto;
        justify-content: center;
        min-width: 0;
        padding: 0.3rem 0.55rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .weekdays-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
        text-align: center;
        font-size: 0.72rem;
        font-weight: 700;
        padding: 0.25rem 0;
        color: var(--text-muted);
        background: var(--bg-app);
    }

    .weekdays-grid[hidden] {
        display: none !important;
    }

    .calendar-month-section {
        scroll-margin-top: 0;
    }

    .calendar-month-section-title {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    /* Сетка на телефоне: 7 колонок для полноценного вида календаря */
    .days-grid:not(.list-view),
    .days-grid.calendar-feed:not(.list-view) .calendar-month-days {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        grid-auto-rows: minmax(58px, auto) !important;
        gap: 2px !important;
    }

    .days-grid:not(.list-view) .day-card,
    .calendar-month-days:not(.list-view) .day-card {
        min-height: 58px;
        padding: 0.2rem 0.15rem;
        border-radius: 6px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: hidden;
        box-sizing: border-box;
    }

    .days-grid:not(.list-view) .day-card.other-month,
    .calendar-month-days:not(.list-view) .day-card.other-month {
        display: flex !important;
        opacity: 0.3;
        background: transparent;
    }

    .days-grid:not(.list-view) .day-card-header,
    .calendar-month-days:not(.list-view) .day-card-header {
        padding: 0 0.1rem 0.1rem;
        margin-bottom: 0.1rem;
        font-size: 0.72rem;
        justify-content: space-between;
        align-items: center;
    }

    .days-grid:not(.list-view) .day-card-header .day-week {
        display: none;
    }

    .days-grid:not(.list-view) .day-card-header .day-number {
        font-size: 0.8rem;
        font-weight: 700;
    }

    .days-grid:not(.list-view) .day-card-header .day-events-carousel-nav,
    .calendar-month-days:not(.list-view) .day-card-header .day-events-carousel-nav {
        display: none !important;
    }

    .days-grid:not(.list-view) .day-events-list,
    .calendar-month-days:not(.list-view) .day-events-list {
        max-height: none;
        overflow: hidden;
        gap: 0.25rem;
    }

    .days-grid:not(.list-view) .add-event-card-btn,
    .calendar-month-days:not(.list-view) .add-event-card-btn {
        display: none;
    }

/* ==========================================
   OPTION 1: EVENT DOTS & QUICKVIEW POPOVER
   ========================================== */
.day-event-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    padding: 2px 5px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    width: fit-content;
    cursor: pointer;
}

.event-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.event-dot.completed {
    background-color: var(--success-color, #10b981);
}

.event-dot.curwa {
    background-color: #c084fc;
}

.event-dot.planned {
    background-color: #f59e0b;
}

.day-event-dots-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 2px;
}

.day-quickview-popover {
    position: fixed;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    padding: 0.85rem;
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    pointer-events: auto;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.quickview-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 0.6rem;
}

.quickview-popover-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.quickview-popover-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    font-weight: 700;
}

.quickview-popover-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    .days-grid:not(.list-view) .event-item,
    .calendar-month-days:not(.list-view) .event-item {
        padding: 0.15rem 0.2rem;
        font-size: 0.65rem;
        border-radius: 4px;
        line-height: 1.15;
    }

    .days-grid.list-view {
        gap: 0.4rem;
    }

    .days-grid.calendar-feed {
        gap: 0;
    }

    .calendar-list-day {
        padding: 0.5rem 0.65rem;
        margin-bottom: 0;
    }

    .calendar-list-day-header {
        font-size: 0.88rem;
        gap: 0.5rem;
    }

    .calendar-list-day-header span:last-child {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .calendar-summary-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.35rem;
        padding: 0.35rem 0.6rem;
        border-radius: 8px;
        margin-bottom: 0.4rem;
    }

    .summary-progress-wrap {
        width: auto;
        min-width: 0;
    }

    .summary-stat {
        font-size: 0.75rem;
    }

    .day-number {
        font-size: 1.1rem;
    }

    .day-week {
        font-size: 0.72rem;
    }

    .event-item {
        padding: 0.5rem 0.55rem;
    }

    .event-card-comment {
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .today-btn {
        margin-left: 0;
    }

    .event-editor-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    .event-editor-footer-left,
    .event-editor-footer-right {
        width: 100%;
        justify-content: stretch;
    }
}

@media (max-width: 480px) {
    .calendar-navigation .month-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .today-btn {
        font-size: 0.72rem;
        padding: 0.3rem 0.55rem;
    }

    .view-toggle-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.72rem;
    }

    .add-event-card-btn {
        font-size: 0.75rem;
        padding: 0.35rem;
    }
}

/* ==========================================
   QoL UI AUDIT — GLOBAL
   ========================================== */
:root {
    --header-height: 64px;
}

body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.export-btn-label-short {
    display: none;
}

@media (max-width: 768px) {
    .export-btn-label-full {
        display: none;
    }
    .export-btn-label-short {
        display: inline;
    }
}

.nav-tab .nav-tab-label {
    display: inline;
}

@media (max-width: 768px) {
    .main-header {
        padding: 0.5rem 0.6rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.35rem;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .header-left {
        gap: 0.35rem;
        flex: 0 1 auto;
        min-width: 0;
    }
    .header-nav,
    .nav-tabs {
        display: none !important;
    }
    .logo {
        display: none !important;
    }
    .header-right {
        gap: 0.35rem;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        min-width: 0;
    }
    .user-session {
        display: none !important;
    }
    .firm-selector-wrapper {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 105px;
    }
    .firm-select {
        min-width: 0;
        max-width: 105px;
        font-size: 0.78rem;
        padding: 0.35rem 1.4rem 0.35rem 0.5rem;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }
    .firm-selector-wrapper::after {
        right: 0.4rem;
        font-size: 0.55rem;
    }
    .settings-btn {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    .settings-btn svg {
        width: 16px;
        height: 16px;
    }
    .mobile-nav-toggle-btn,
    .admin-drawer-toggle-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.78rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .app-screen {
        padding: 0.65rem 0.65rem 5rem;
        max-width: 100vw;
        box-sizing: border-box;
    }
}

.summary-progress-pct {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 2.5rem;
    text-align: right;
}

.calendar-list-filter {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    flex-shrink: 0;
}

#calendar-list-filter-wrap[hidden] {
    display: none !important;
}

.calendar-view-header {
    top: var(--header-height);
}

.reports-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.reports-count {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.reports-cards {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem;
    cursor: pointer;
}

.report-card-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.report-card-row .label {
    color: var(--text-muted);
}

.report-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .filters-panel .filter-group {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }

    .filters-panel .filter-group:last-of-type {
        flex: 1 1 100%;
    }

    .filters-panel-actions {
        flex: 1 1 100%;
        width: 100%;
    }

    .filters-panel-actions .export-btn,
    .filters-panel-actions .clear-filters-btn {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
    }

    .reports-cards {
        display: flex;
    }
    .table-container.reports-table-wrap {
        display: none;
    }
}

.guides-layout {
    gap: 1rem;
}

@media (max-width: 768px) {
    .guides-layout {
        grid-template-columns: 1fr;
    }
    .guides-sidebar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.35rem;
        padding-bottom: 0.25rem;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0.5rem;
    }
    .guides-sidebar .guide-menu-item {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .guides-content-panel {
        min-width: 0;
    }
}

.salary-header-row {
    position: sticky;
    top: var(--header-height);
    z-index: 25;
    background: var(--bg-app);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.salary-performers-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.salary-performer-filter {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.salary-accordion-body {
    max-height: none !important;
}

.confirm-dialog-content {
    max-width: 420px;
}

.save-failure-banner {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: #ef4444;
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
}

.save-failure-banner[hidden] {
    display: none !important;
}

.init-failure-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #fff;
}

.init-failure-overlay[hidden] {
    display: none !important;
}

.toast-notification {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.toast-icon-error {
    color: #fff;
}

.toast-notification.error .toast-icon-success {
    display: none;
}

.toast-notification.error .toast-icon-error {
    display: block !important;
}

.modal-overlay.event-editor-sheet .modal-content {
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .modal-overlay.event-editor-sheet {
        align-items: flex-end;
        padding: 0;
    }
    .modal-overlay.event-editor-sheet .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
        margin: 0;
    }
    .event-editor-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

.nav-tab:focus-visible,
.month-nav-btn:focus-visible,
.view-toggle-btn:focus-visible,
.modal-btn:focus-visible,
.modal-close-btn:focus-visible,
.export-btn:focus-visible,
.logout-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.guides-empty-state,
.prompts-empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.guide-platforms-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.prompt-vars-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.prompt-textarea {
    min-height: 140px;
    resize: vertical;
}

.salary-accordion-header {
    cursor: pointer;
}

.salary-accordion-header[aria-expanded="true"] .accordion-chevron svg {
    transform: rotate(180deg);
}

.table-cost-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.salary-cost-field {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.salary-cost-rub,
.salary-cost-bonus {
    text-align: right;
    padding: 0.1rem 0.2rem;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.salary-cost-rub {
    width: 48px;
}

.salary-cost-bonus {
    width: 42px;
    color: var(--success-color);
}

.salary-cost-suffix {
    position: static;
    font-size: 0.8rem;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
    margin-left: 1px;
}

.salary-cost-suffix-rub {
    color: var(--text-muted);
}

.salary-cost-suffix-bonus {
    color: var(--success-color);
}

/* ==========================================
   CALENDAR UX ENHANCEMENTS
   ========================================== */
.save-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.save-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    flex-shrink: 0;
}

.save-indicator[data-status="idle"] .save-indicator-label,
.save-indicator[data-status="saved"] .save-indicator-label {
    opacity: 0.7;
}

.save-indicator[data-status="pending"] .save-indicator-dot,
.save-indicator[data-status="saving"] .save-indicator-dot {
    background: var(--accent-color);
    animation: savePulse 1s ease infinite;
}

.save-indicator[data-status="saving"] .save-indicator-label::after {
    content: '…';
}

.save-indicator[data-status="error"] {
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.save-indicator[data-status="error"] .save-indicator-dot {
    background: #ef4444;
}

@keyframes savePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.calendar-shortcuts-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calendar-shortcuts-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.days-grid {
    touch-action: pan-y;
}

.days-grid.calendar-transition-out.cal-nav-next {
    animation: calSlideOutLeft 0.22s ease forwards;
}

.days-grid.calendar-transition-out.cal-nav-prev {
    animation: calSlideOutRight 0.22s ease forwards;
}

.days-grid.calendar-transition-in.cal-nav-next {
    animation: calSlideInRight 0.22s ease forwards;
}

.days-grid.calendar-transition-in.cal-nav-prev {
    animation: calSlideInLeft 0.22s ease forwards;
}

@keyframes calSlideOutLeft {
    to { opacity: 0; transform: translateX(-24px); }
}

@keyframes calSlideOutRight {
    to { opacity: 0; transform: translateX(24px); }
}

@keyframes calSlideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes calSlideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}

.calendar-summary-bar.summary-updated .summary-val {
    animation: summaryValPop 0.45s ease;
}

@keyframes summaryValPop {
    0%, 100% { color: var(--text-primary); }
    40% { color: var(--accent-color); transform: scale(1.08); }
}

.day-card.today-highlight {
    animation: todayHighlightPulse 1.5s ease;
}

@keyframes todayHighlightPulse {
    0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
    50% { box-shadow: 0 0 28px var(--accent-color), 0 0 0 3px rgba(99, 102, 241, 0.35); }
}

.calendar-list-day.today-highlight {
    animation: todayHighlightPulse 1.5s ease;
}

.day-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.day-progress-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 2rem;
}

.day-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.day-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color));
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}

.day-card.day-completed .day-progress-fill {
    background: var(--success-color);
}

.day-overflow-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-color);
    background: var(--accent-glow);
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    margin-left: auto;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.day-overflow-badge:hover {
    filter: brightness(1.08);
}

.day-card.has-overflow .day-events-list {
    mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}

.day-card.has-overflow.day-list-scrolled-end .day-events-list {
    mask-image: none;
    -webkit-mask-image: none;
}

.day-empty-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    padding: 0.75rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    opacity: 0.75;
}

.day-empty-icon {
    font-size: 1.25rem;
    opacity: 0.5;
}

.calendar-empty-month-banner {
    margin-bottom: 1rem;
}

.calendar-empty-month-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.calendar-empty-month-icon {
    font-size: 1.75rem;
    opacity: 0.6;
}

.calendar-empty-month-inner p {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.calendar-empty-month-cta {
    margin-left: auto;
    flex-shrink: 0;
}

.day-card.drop-success,
.calendar-list-day.drop-success {
    animation: dropSuccessFlash 0.4s ease;
}

@keyframes dropSuccessFlash {
    0%, 100% { box-shadow: var(--shadow-sm); }
    50% { box-shadow: 0 0 20px var(--accent-color); border-color: var(--accent-color); }
}

.event-item-compact .event-card-meta {
    display: none;
}

.event-item-compact .event-card-top,
.event-item-compact .event-card-comment,
.event-item-compact .event-card-control-badges {
    flex-shrink: 0;
}

.event-item-compact .event-card-comment {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.long-press-ring {
    position: absolute;
    inset: -3px;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    border: 2px solid transparent;
    z-index: 5;
}

.long-press-ring.active {
    opacity: 1;
    border-color: var(--accent-color);
    animation: longPressRing 0.48s linear forwards;
}

@keyframes longPressRing {
    from { clip-path: inset(0 100% 0 0); opacity: 0.9; }
    to { clip-path: inset(0 0 0 0); opacity: 1; }
}

.long-press-ring.complete {
    opacity: 0;
    transition: opacity 0.15s;
}

.today-btn.is-current-month {
    opacity: 0.45;
    pointer-events: none;
}

@media (max-width: 768px) {
    .save-indicator-label {
        display: none;
    }

    .calendar-empty-month-inner {
        flex-wrap: wrap;
    }

    .calendar-empty-month-cta {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-spinner,
    .toast-notification,
    .event-item.completed-flash,
    .checkmark,
    .days-grid.calendar-transition-out,
    .days-grid.calendar-transition-in,
    .day-card.drop-target,
    .calendar-list-day.drop-target,
    .day-card.today-highlight,
    .calendar-list-day.today-highlight,
    .day-card.drop-success,
    .calendar-list-day.drop-success,
    .save-indicator[data-status="pending"] .save-indicator-dot,
    .save-indicator[data-status="saving"] .save-indicator-dot,
    .long-press-ring.active,
    .calendar-summary-bar.summary-updated .summary-val {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================
   CURWA SPLIT LAYOUT IN MODAL
   ========================================== */
.modal-content-wide {
    max-width: 960px !important;
}

.event-editor-curwa-chat[hidden],
.curwa-submission-section[hidden] {
    display: none !important;
}

.event-editor-layout-wrapper {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

.event-editor-grid {
    flex: 1;
    min-width: 0;
}

.event-editor-curwa-chat {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    padding-left: 1.5rem;
    max-height: 70vh;
}

.curwa-chat-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.curwa-chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
    min-height: 250px;
}

.curwa-message {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    position: relative;
    max-width: 90%;
    align-self: flex-start;
}

.curwa-message.performer-msg {
    background-color: rgba(99, 102, 241, 0.05);
}

.curwa-message.manager-msg {
    background-color: rgba(16, 185, 129, 0.05);
    align-self: flex-end;
}

.curwa-message.question-msg {
    border-left: 3px solid #f59e0b;
    background-color: rgba(245, 158, 11, 0.05);
}

.curwa-message.question-msg.approved {
    border-left-color: var(--success-border, #10b981) !important;
    background-color: rgba(16, 185, 129, 0.03);
}

.curwa-message.question-msg.rejected {
    border-left-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.03);
}

.curwa-message-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    gap: 1rem;
}

.curwa-message-sender {
    font-weight: 600;
}

.curwa-message-body {
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.curwa-message-reply {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 0.4rem;
}

.curwa-message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.curwa-q-badge {
    display: inline-block;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.curwa-q-badge.pending {
    background-color: #7c2d12;
    color: #fdba74;
}

.curwa-q-badge.approved {
    background-color: #064e3b;
    color: #6ee7b7;
}

.curwa-q-badge.rejected {
    background-color: #7f1d1d;
    color: #fca5a5;
}

.curwa-chat-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#curwa-chat-input {
    width: 100%;
    min-height: 50px;
    max-height: 120px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    padding: 0.5rem;
    font-size: 0.85rem;
    resize: vertical;
}

.curwa-chat-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.curwa-question-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* CURWA Tab Buttons */
.curwa-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.curwa-tab-btn:hover {
    color: var(--text-normal);
}

.curwa-tab-btn.active {
    color: var(--accent-color) !important;
    font-weight: 600 !important;
    border-bottom-color: var(--accent-color) !important;
}



.curwa-submission-section {
    border: 1px solid rgba(192, 132, 252, 0.25) !important;
    background-color: rgba(192, 132, 252, 0.03) !important;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.curwa-status-row {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.curwa-status-val {
    font-weight: 700;
    color: #f59e0b;
}

.curwa-status-val.approved {
    color: #10b981;
}

.curwa-status-val.rejected {
    color: #ef4444;
}

.curwa-submission-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .event-editor-layout-wrapper {
        flex-direction: column;
    }
    .event-editor-curwa-chat {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
}

/* Event card chat indicator and animation */
.event-card-lock-badge {
    font-size: 0.68rem;
    margin-left: 0.25rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.45);
    white-space: nowrap;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-item-locked {
    opacity: 0.92;
    border-color: rgba(245, 158, 11, 0.45);
}

.event-card-chat-indicator {
    font-size: 0.9rem;
    margin-left: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color, #c084fc);
    vertical-align: middle;
}

.event-card-chat-indicator.blinking {
    animation: chat-pulse 2s infinite ease-in-out;
}

@keyframes chat-pulse {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
        filter: drop-shadow(0 0 3px var(--accent-color, #c084fc));
    }
    100% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

/* Chat bubble enhancements for standard message feed */
.curwa-message.own-msg {
    background-color: rgba(192, 132, 252, 0.08);
    border-color: rgba(192, 132, 252, 0.3);
    align-self: flex-end;
}

@media (min-width: 901px) {
    .modal-overlay.event-editor-sheet .modal-content {
        max-height: 85vh;
        height: 650px;
    }
    
    .event-editor-content .modal-body {
        height: 520px;
        max-height: 520px;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
        padding-bottom: 1.5rem;
    }
    
    .event-editor-layout-wrapper {
        display: flex;
        flex: 1;
        min-height: 0;
        height: 100%;
        overflow: hidden;
        gap: 1.5rem;
    }
    
    .event-editor-grid {
        flex: 1;
        overflow-y: auto;
        max-height: 100%;
        padding-right: 0.5rem;
    }
    
    .event-editor-curwa-chat {
        width: 380px;
        flex-shrink: 0;
        height: 100%;
        max-height: 100%;
        border-left: 1px solid var(--border-color);
        padding-left: 1.5rem;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .curwa-chat-messages {
        flex: 1;
        overflow-y: auto;
        margin-bottom: 0.75rem;
        min-height: 0;
    }
}

/* Emoji Picker Popover */
.curwa-chat-textarea-container {
    position: relative;
    width: 100%;
}

#curwa-chat-input {
    width: 100%;
    padding-right: 2.5rem !important; /* Make room for the emoji button inside the textarea */
    resize: none;
}

.chat-emoji-trigger {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
    padding: 0.2rem;
    line-height: 1;
}

.chat-emoji-trigger:hover {
    opacity: 1;
    transform: scale(1.1);
}

.chat-emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 270px;
    height: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.chat-emoji-picker[hidden] {
    display: none !important;
}

.emoji-picker-header {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.emoji-picker-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    padding: 0.4rem;
    gap: 0.3rem;
}

.emoji-picker-grid span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 6px;
    transition: background 0.15s, transform 0.15s;
    user-select: none;
}

.emoji-picker-grid span:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.15);
}

/* Read Receipts */
.read-receipt {
    font-size: 0.8rem;
    margin-left: 0.25rem;
    font-weight: bold;
}
.read-receipt.read {
    color: #38bdf8; /* Telegram blue */
}
.read-receipt.unread {
    color: var(--text-muted);
}

/* Reactions */
.curwa-message {
    position: relative;
    padding-bottom: 0.5rem;
}

.curwa-message:hover .message-react-trigger {
    opacity: 1;
}

.message-react-trigger {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--text-muted);
    padding: 0.1rem 0.2rem;
    border-radius: 4px;
}

.message-react-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .message-react-trigger {
        opacity: 0.6;
    }
}

.message-reactions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.4rem;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    padding: 0.15rem 0.35rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    user-select: none;
}

.reaction-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.reaction-pill.my-reaction {
    background: rgba(192, 132, 252, 0.15);
    border-color: rgba(192, 132, 252, 0.4);
    color: var(--accent-color, #c084fc);
}

.reaction-picker-popover {
    position: absolute;
    top: -2.2rem;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.2rem 0.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    display: flex;
    gap: 0.3rem;
    animation: popover-bounce 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reaction-picker-popover.position-below {
    top: 100% !important;
    margin-top: 0.35rem;
}

@keyframes popover-bounce {
    from { transform: scale(0.7) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.reaction-picker-popover span {
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.1rem;
    border-radius: 50%;
    transition: transform 0.15s;
    user-select: none;
}

.reaction-picker-popover span:hover {
    transform: scale(1.3);
}

/* Fullscreen Modal Override */
.modal-fullscreen-btn:hover {
    color: var(--text-primary) !important;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen .modal-body {
    flex: 1;
    height: calc(100vh - 120px) !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen .event-editor-layout-wrapper {
    height: 100%;
    min-height: 0;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen .event-editor-grid {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen #event-editor-content-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100%;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen .curwa-results-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen #event-editor-curwa-results {
    flex: 1 !important;
    min-height: 320px !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

.modal-overlay.event-editor-sheet .modal-content.fullscreen .event-editor-curwa-chat {
    width: 450px;
    height: 100%;
    max-height: 100%;
}

/* ==========================================
   ADMIN PANEL: STATISTICS TAB STYLES
   ========================================== */

/* Summary Grid and Cards */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stats-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stats-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.stats-card.highlight {
    border-color: rgba(168, 85, 247, 0.4);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(168, 85, 247, 0.06) 100%);
}

.stats-card-val {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.stats-card.highlight .stats-card-val {
    color: #c084fc;
}

.stats-card-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Heatmap Grid */
.stats-heatmap-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card-header {
    margin-bottom: 1.25rem;
}

.stats-card-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.stats-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stats-heatmap-scroll {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.stats-heatmap-wrap {
    display: flex;
    gap: 6px;
    min-width: max-content;
}

.heatmap-cell {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-block;
    transition: transform var(--transition-fast), outline var(--transition-fast);
}

.heatmap-cell:hover {
    transform: scale(1.15);
    outline: 2px solid var(--text-primary);
    z-index: 10;
}

.heatmap-cell.level-0 { background-color: rgba(255, 255, 255, 0.05); }
.heatmap-cell.level-1 { background-color: rgba(99, 102, 241, 0.2); }
.heatmap-cell.level-2 { background-color: rgba(99, 102, 241, 0.45); }
.heatmap-cell.level-3 { background-color: rgba(99, 102, 241, 0.7); }
.heatmap-cell.level-4 { background-color: rgba(99, 102, 241, 0.95); box-shadow: 0 0 8px rgba(99, 102, 241, 0.6); }

/* Light Theme overrides for heatmap */
[data-theme="light"] .heatmap-cell.level-0 { background-color: rgba(0, 0, 0, 0.05); }
[data-theme="light"] .heatmap-cell.level-1 { background-color: rgba(99, 102, 241, 0.15); }
[data-theme="light"] .heatmap-cell.level-2 { background-color: rgba(99, 102, 241, 0.35); }
[data-theme="light"] .heatmap-cell.level-3 { background-color: rgba(99, 102, 241, 0.6); }
[data-theme="light"] .heatmap-cell.level-4 { background-color: rgba(99, 102, 241, 0.85); }

.stats-heatmap-legend {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-cells {
    display: flex;
    gap: 4px;
}

.legend-cells .heatmap-cell {
    width: 14px;
    height: 14px;
    cursor: default;
}

/* User Details Grid Layout */
.stats-user-details-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .stats-user-details-layout {
        grid-template-columns: 1fr;
    }
}

.stats-user-selector-card,
.stats-user-chart-card,
.stats-logs-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.stats-logs-card {
    margin-bottom: 2rem;
}

/* User Profile Info */
.stats-user-profile {
    margin-top: 1rem;
}

.user-profile-row {
    font-size: 0.95rem;
}

.profile-label {
    font-weight: 500;
}

.profile-value {
    font-weight: 600;
}

/* SVG Chart Flex and styling */
.stats-chart-flex {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 100%;
}

@media (max-width: 992px) {
    .stats-chart-flex {
        flex-direction: column;
        gap: 1.5rem;
    }
}

.stats-donut-pane {
    flex-shrink: 0;
}

.stats-bars-pane {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.stats-chart-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stats-bar-label-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}

.stats-bar-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.4rem;
}

.stats-bar-name {
    color: var(--text-primary);
    margin-right: auto;
}

.stats-bar-count {
    color: var(--text-muted);
}

.stats-bar-track-cell {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

[data-theme="light"] .stats-bar-track-cell {
    background-color: rgba(0, 0, 0, 0.05);
}

.stats-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Action Donut Chart SVG text coloring */
.donut-center-text {
    fill: var(--text-primary);
}

/* Action Log Table and Badge chips */
.action-chip {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
}

.action-chip.action-login {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.action-chip.action-logout {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.action-chip.action-view {
    background-color: rgba(59, 82, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 82, 246, 0.3);
}

.action-chip.action-write {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.action-chip.action-default {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* ==========================================
   ADMIN PANEL: ROLE CONFIGURATION STYLES
   ========================================== */

.roles-editor-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .roles-editor-layout {
        grid-template-columns: 1fr;
    }
}

.roles-sidebar-card,
.roles-settings-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.roles-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.role-menu-btn {
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.role-menu-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.role-menu-btn.active {
    background-color: var(--accent-glow);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent-color);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.form-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.logo-selector-options {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

/* ==========================================
   HEADER SUMMARY BUTTON & STARTUP MODAL
   ========================================== */

.summary-trigger-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-color);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all var(--transition-fast);
    margin-right: 0.75rem;
    font-family: var(--font-main);
}

.summary-trigger-btn:hover {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.summary-modal-content {
    width: 92vw;
    max-width: 600px !important;
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
    background: var(--bg-card) !important;
    color: var(--text-primary);
    border-radius: 16px;
}

.summary-modal-header {
    background: var(--accent-glow);
    border-bottom: 1px solid var(--border-color);
    padding: 1.1rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.summary-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1.25rem 1.4rem;
}

.summary-header-welcome {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.summary-header-welcome h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.ai-stars-icon {
    font-size: 1.3rem;
    animation: pulse-stars 2s infinite ease-in-out;
}

@keyframes pulse-stars {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

.summary-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 576px) {
    .summary-metrics-grid {
        grid-template-columns: 1fr;
    }
}

.summary-metric-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.summary-metric-card:hover {
    transform: translateY(-2px);
    background: var(--border-color);
}

.metric-icon {
    font-size: 1.75rem;
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

#metric-card-tasks {
    border-left: 3px solid #3b82f6;
}

#metric-card-queue {
    border-left: 3px solid #f59e0b;
}

#metric-card-chats {
    border-left: 3px solid #10b981;
}

.summary-ai-block {
    background: var(--accent-glow);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.summary-ai-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-color) 0%, #c084fc 100%);
}

.ai-block-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ai-block-title h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-brain-icon {
    font-size: 1.1rem;
}

.ai-block-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-line;
}

.summary-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-hover);
    flex-shrink: 0;
}

.summary-dont-show-again {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
}

.summary-dont-show-again input {
    width: 15px !important;
    height: 15px !important;
}

/* Tasks Quick Access Section */
.summary-tasks-section {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.summary-tasks-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.summary-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.summary-task-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}

.summary-task-item:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
}

.summary-task-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.summary-task-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-task-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.summary-task-firm-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-color);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.summary-task-action-btn {
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 0.3rem 0.65rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.summary-task-action-btn:hover {
    background: #4f46e5;
}

.summary-task-item.completed {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.05);
}

.summary-task-item.completed .summary-task-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.summary-task-item.completed .summary-task-action-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.summary-task-item.completed .summary-task-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ==========================================
   EVENT CONTROL BADGES & BACKUP UI
   ========================================== */
.event-card-control-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.control-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.badge-missing-media {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.badge-missing-text {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-missing-team {
    background: rgba(168, 85, 247, 0.14);
    color: #9333ea;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-pending-approval {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-ready {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================
   MOBILE UX DESIGN SYSTEM (SMARTPHONES)
   ========================================== */
button, input, select, textarea, .nav-tab, .mobile-nav-btn, .chip-preset-btn, .event-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.admin-drawer-toggle-btn {
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--accent-color, #6366f1);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-color, #6366f1);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .admin-drawer-toggle-btn {
        display: inline-flex !important;
    }
}

.admin-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.admin-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.admin-side-drawer {
    width: 290px;
    max-width: 85vw;
    height: 100%;
    background: var(--bg-card, #1a202c);
    border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.admin-drawer-overlay.active .admin-side-drawer {
    transform: translateX(0);
}
.admin-drawer-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-drawer-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
}
.admin-drawer-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}
.admin-drawer-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}
.admin-drawer-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.admin-drawer-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #94a3b8);
}
.admin-drawer-user-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}
.drawer-action-btn {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--accent-color, #6366f1);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-color, #6366f1);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    margin-bottom: 0.4rem;
}
.drawer-action-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    color: var(--text-primary, #f3f4f6);
}

.mobile-nav-toggle-btn {
    display: none !important;
}

.mobile-nav-highlighted {
    animation: pulseBottomNav 0.6s ease 3 !important;
    outline: 3px solid #6366f1 !important;
    box-shadow: 0 0 35px rgba(99, 102, 241, 0.95) !important;
}

@keyframes pulseBottomNav {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

.mobile-top-nav-menu {
    display: none !important;
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .mobile-nav-toggle-btn {
        display: none !important;
    }

    .mobile-top-nav-menu {
        display: none !important;
    }

    /* Safe Area & Font Size Zoom Prevention */
    select, input[type="text"], input[type="search"], textarea, .filter-select, .prompt-textarea {
        font-size: 16px !important;
    }

    .app-screen {
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }

    #screen-calendar.app-screen {
        padding: 0.25rem 0.5rem 0 !important;
        height: calc(100vh - 56px) !important;
        height: calc(100dvh - 56px) !important;
        max-height: calc(100vh - 56px) !important;
        max-height: calc(100dvh - 56px) !important;
    }

    /* Mobile Bottom Navigation Bar — Fixed at Screen Bottom via CSS */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        top: auto !important;
        left: 12px !important;
        right: 12px !important;
        z-index: 999999 !important;
        height: 60px !important;
        background: var(--bg-card, #1e2433) !important;
        border-radius: 16px !important;
        border: 2px solid var(--accent-color, #6366f1) !important;
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.75) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        align-items: center !important;
        justify-content: space-around !important;
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
    }

    .mobile-bottom-nav.nav-hidden {
        transform: translateY(calc(100% + 30px)) !important;
    }

    .mobile-nav-drag-handle {
        position: absolute;
        top: -14px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 8px;
        border-radius: 4px;
        background: var(--accent-color, #6366f1);
        box-shadow: 0 2px 10px rgba(99, 102, 241, 0.6);
        cursor: pointer;
    }

    .mobile-fab-btn {
        display: flex !important;
        position: fixed !important;
        bottom: 85px !important;
        right: 18px !important;
        z-index: 999990 !important;
    }

    .toast-notification {
        top: 75px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) translateY(-20px) !important;
        z-index: 9999999 !important;
        max-width: 90vw !important;
    }

    .toast-notification.show {
        transform: translateX(-50%) translateY(0) !important;
        opacity: 1 !important;
    }

    .mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 0.68rem;
        font-weight: 600;
        color: var(--text-muted);
        background: transparent;
        border: none;
        padding: 6px 0;
        cursor: pointer;
        transition: color 0.15s ease, transform 0.15s ease;
    }

    .mobile-nav-btn svg {
        transition: stroke 0.15s ease, transform 0.15s ease;
    }

    .mobile-nav-btn.active {
        color: var(--accent-color);
        font-weight: 700;
    }

    .mobile-nav-btn.active svg {
        stroke: var(--accent-color);
        transform: translateY(-1px);
    }

    /* Mobile Floating Action Button (FAB) */
    .mobile-fab-btn {
        display: flex;
        position: fixed;
        bottom: calc(68px + env(safe-area-inset-bottom));
        right: 16px;
        z-index: 1400;
        width: 56px;
        height: 56px;
        border-radius: 28px;
        background: linear-gradient(135deg, var(--accent-color), #4f46e5);
        color: #ffffff;
        border: none;
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45), 0 3px 8px rgba(0, 0, 0, 0.3);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.15s ease, background-color 0.15s ease;
    }

    .mobile-fab-btn:active {
        transform: scale(0.92);
    }

    /* Hide desktop header nav tabs on mobile since we have bottom nav */
    .header-nav,
    .nav-tabs {
        display: none !important;
    }

    /* Mobile Calendar Day Grid Ergonomics (Spacious & Readable) */
    .calendar-month-days {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        grid-auto-rows: minmax(100px, auto) !important;
        gap: 0.5rem !important;
    }

    .calendar-month-days.list-view,
    .days-grid.list-view .calendar-month-days {
        grid-template-columns: 1fr !important;
        grid-auto-rows: auto !important;
    }

    .day-card {
        min-height: 95px;
        padding: 0.6rem;
        box-sizing: border-box;
    }

    .day-card-header {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    .day-number {
        font-size: 1.15rem !important;
        font-weight: 800;
    }

    .day-week {
        font-size: 0.78rem !important;
        opacity: 0.8;
    }

    .day-empty-placeholder {
        padding: 0.4rem 0.2rem;
        font-size: 0.78rem;
        color: var(--text-muted);
    }

    /* Mobile Bottom Sheet for Event Editor Modal */
    .modal-overlay.event-editor-sheet {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .sheet-drag-handle {
        display: block;
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.3);
        margin: 8px auto 4px;
        flex-shrink: 0;
    }

    .modal-overlay.event-editor-sheet .modal-content.event-editor-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 90vh !important;
        max-height: 90vh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-overlay.event-editor-sheet .modal-header {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .modal-overlay.event-editor-sheet .event-editor-body {
        padding: 1rem 1rem 1.5rem;
        overflow-y: auto;
        flex: 1;
    }

    .modal-overlay.event-editor-sheet .event-editor-footer {
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        position: sticky;
        bottom: 0;
        z-index: 10;
    }

    @keyframes slideUpSheet {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* Prevent body scrolling when a modal overlay is open */
body.modal-open {
    overflow: hidden !important;
    touch-action: none;
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.75rem;
        box-sizing: border-box;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .summary-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        max-height: 85dvh !important;
        margin: auto !important;
    }

    .summary-modal-header {
        padding: 0.85rem 1rem !important;
    }

    .summary-modal-content .modal-body {
        padding: 0.9rem 1rem !important;
    }

    .summary-modal-footer {
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom)) !important;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .summary-dont-show-again {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    #summary-modal-ok-btn {
        width: 100%;
        justify-content: center;
    }
}



