/* ============================================
   BOOTSY - Glass Premium Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Palette */
    --accent: #7c5cfc;
    --accent-light: #a78bfa;
    --accent-dark: #6344e0;
    --accent-glow: rgba(124,92,252,0.35);
    --green: #34d399;
    --green-dark: #059669;
    --red: #f87171;
    --orange: #fb923c;
    --blue: #60a5fa;

    /* Surfaces */
    --bg-body: #0f1117;
    --bg-base: #181a24;
    --bg-raised: #1f2231;
    --bg-glass: rgba(31,34,49,0.72);
    --bg-glass-light: rgba(255,255,255,0.04);
    --bg-hover: rgba(255,255,255,0.06);
    --bg-active: rgba(124,92,252,0.12);
    --bg-input: rgba(255,255,255,0.06);
    --bg-bubble-out: #7c5cfc;
    --bg-bubble-in: #1f2231;
    --bg-bubble-bot: linear-gradient(135deg, #1f2231 0%, #252840 100%);

    /* Text */
    --text-primary: #f1f3f8;
    --text-secondary: #8b8fa7;
    --text-muted: #565a70;
    --text-on-accent: #ffffff;
    --text-link: var(--accent-light);

    /* Borders */
    --border: rgba(255,255,255,0.06);
    --border-accent: rgba(124,92,252,0.3);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 24px var(--accent-glow);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.2s;
    --duration-slow: 0.35s;

    /* Layout */
    --nav-width: 64px;
    --sidebar-width: 360px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-body);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Ambient gradient on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 10% 0%, rgba(124,92,252,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 90% 100%, rgba(52,211,153,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

::selection {
    background: var(--accent);
    color: white;
}

/* ============================================
   LAYOUT
   ============================================ */
.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   NAV RAIL
   ============================================ */
.nav-rail {
    width: var(--nav-width);
    background: var(--bg-base);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 16px;
    gap: 4px;
    z-index: 100;
    flex-shrink: 0;
}

.nav-rail .nav-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 17px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow);
    letter-spacing: -0.5px;
}

.nav-rail .nav-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
    position: relative;
}

.nav-rail .nav-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.nav-rail .nav-btn.active {
    color: var(--accent-light);
    background: var(--bg-active);
}

/* Active indicator pill */
.nav-rail .nav-btn.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px var(--accent-glow);
}

.nav-rail .nav-btn .badge {
    position: absolute;
    top: 4px;
    right: 2px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    min-width: 16px;
    text-align: center;
    animation: pulse-badge 2s ease infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(248,113,113,0); }
}

.nav-rail .nav-spacer { flex: 1; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 20px 16px;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: all var(--duration) var(--ease);
    font-family: inherit;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box input:focus {
    border-color: var(--border-accent);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(124,92,252,0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
}

/* ============================================
   CONTACT LIST
   ============================================ */
.contact-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    gap: 14px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.contact-item:hover {
    background: var(--bg-hover);
}

.contact-item.active {
    background: var(--bg-active);
}

.contact-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.contact-avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-info .name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info .name .time {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.contact-info .last-msg {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
}

.contact-info .last-msg .unread-badge {
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 8px;
}

/* ============================================
   MAIN PANEL
   ============================================ */
.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-body);
    position: relative;
    min-width: 0;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    gap: 16px;
    animation: fade-in var(--duration-slow) var(--ease);
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    animation: float 4s ease-in-out infinite;
}

.empty-state .empty-icon svg { color: white; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.empty-state p {
    font-size: 14px;
    max-width: 360px;
    text-align: center;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ============================================
   CHAT HEADER
   ============================================ */
.chat-header {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    gap: 14px;
    min-height: 64px;
}

.chat-header .contact-avatar {
    width: 38px;
    height: 38px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

.chat-header .header-info { flex: 1; }

.chat-header .header-info .name {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.2px;
}

.chat-header .header-info .status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.chat-header .header-info .status .bot-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--bg-active);
    color: var(--accent-light);
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}

.chat-header .header-actions {
    display: flex;
    gap: 4px;
}

.chat-header .header-actions button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}

.chat-header .header-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ============================================
   MESSAGES AREA
   ============================================ */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 48px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
}

.message-bubble {
    max-width: 60%;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    margin-bottom: 6px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.5;
    animation: msg-in var(--duration) var(--ease);
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-bubble.outgoing {
    background: var(--accent);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(124,92,252,0.25);
}

.message-bubble.incoming {
    background: var(--bg-raised);
    color: var(--text-primary);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.message-bubble.bot {
    background: var(--bg-bubble-bot);
    color: var(--text-primary);
    margin-left: auto;
    border-bottom-right-radius: 4px;
    border: 1px solid var(--border-accent);
}

.message-bubble .msg-text {
    white-space: pre-wrap;
    font-size: 14px;
}

.message-bubble .msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 4px;
}

.message-bubble .msg-time {
    font-size: 11px;
    opacity: 0.6;
}

.message-bubble.outgoing .msg-time { color: rgba(255,255,255,0.7); }

.message-bubble .msg-status {
    font-size: 13px;
    opacity: 0.6;
}

.message-bubble .msg-status.read {
    opacity: 1;
    color: #60a5fa;
}

.message-bubble .bot-badge {
    font-size: 10px;
    font-weight: 600;
    background: rgba(124,92,252,0.2);
    color: var(--accent-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.message-date-divider {
    text-align: center;
    margin: 20px 0;
}

.message-date-divider span {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ============================================
   MESSAGE INPUT
   ============================================ */
.message-input-area {
    display: flex;
    align-items: flex-end;
    padding: 12px 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid var(--border);
    gap: 10px;
}

.message-input-area textarea {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 44px;
    line-height: 1.4;
    transition: all var(--duration) var(--ease);
}

.message-input-area textarea::placeholder { color: var(--text-muted); }

.message-input-area textarea:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(124,92,252,0.1);
}

.send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
    flex-shrink: 0;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.send-btn:active { transform: scale(0.95); }

.send-btn:disabled {
    background: var(--bg-raised);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-view {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    animation: fade-in var(--duration-slow) var(--ease);
}

.dashboard-view > h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:nth-child(1)::before { background: var(--accent); }
.stat-card:nth-child(2)::before { background: var(--blue); }
.stat-card:nth-child(3)::before { background: var(--green); }
.stat-card:nth-child(4)::before { background: var(--orange); }
.stat-card:nth-child(5)::before { background: var(--red); }

.stat-card:hover {
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
}

.stat-card:nth-child(1) .stat-icon { background: rgba(124,92,252,0.2); color: var(--accent-light); }
.stat-card:nth-child(2) .stat-icon { background: rgba(96,165,250,0.2); color: var(--blue); }
.stat-card:nth-child(3) .stat-icon { background: rgba(52,211,153,0.2); color: var(--green); }
.stat-card:nth-child(4) .stat-icon { background: rgba(251,146,60,0.2); color: var(--orange); }
.stat-card:nth-child(5) .stat-icon { background: rgba(248,113,113,0.2); color: var(--red); }

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   CALENDAR
   ============================================ */
.calendar-view {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    animation: fade-in var(--duration-slow) var(--ease);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.calendar-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.calendar-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.calendar-nav button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
}

.calendar-nav button:hover {
    background: var(--bg-hover);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.calendar-day-header {
    background: var(--bg-raised);
    color: var(--text-muted);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: var(--bg-base);
    padding: 8px;
    min-height: 100px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.today {
    background: rgba(124,92,252,0.06);
}

.calendar-day.other-month {
    opacity: 0.35;
}

.calendar-day .day-number {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.calendar-day.today .day-number {
    background: var(--accent);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.calendar-event {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event.confirmed { background: rgba(52,211,153,0.15); color: var(--green); }
.calendar-event.pending { background: rgba(251,146,60,0.15); color: var(--orange); }
.calendar-event.cancelled { background: rgba(248,113,113,0.15); color: var(--red); text-decoration: line-through; }
.calendar-event.completed { background: rgba(96,165,250,0.15); color: var(--blue); }

/* ============================================
   SETTINGS
   ============================================ */
.settings-view {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    animation: fade-in var(--duration-slow) var(--ease);
}

.settings-view > h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}

.settings-section {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.settings-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h3 svg {
    color: var(--accent-light);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }

.setting-row .setting-label {
    font-weight: 500;
    font-size: 14px;
}

.setting-row .setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.setting-row input[type="text"],
.setting-row input[type="time"],
.setting-row select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    min-width: 200px;
    transition: all var(--duration) var(--ease);
}

.setting-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    min-height: 80px;
    margin-top: 8px;
    transition: all var(--duration) var(--ease);
}

.setting-row input:focus,
.setting-row select:focus,
.setting-row textarea:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(124,92,252,0.1);
}

/* Toggle */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: all var(--duration) var(--ease);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 2px;
    left: 2px;
    transition: all var(--duration) var(--ease);
}

.toggle input:checked + .slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle input:checked + .slider::before {
    background: white;
    transform: translateX(20px);
}

/* Schedule grid */
.schedule-grid { display: grid; gap: 6px; }

.schedule-row {
    display: grid;
    grid-template-columns: 100px repeat(4, 1fr) 80px;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-glass-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.schedule-row .day-name {
    font-weight: 600;
    font-size: 13px;
}

.schedule-row input[type="time"] {
    padding: 5px 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    min-width: 0;
    outline: none;
}

.schedule-row input[type="time"]:focus {
    border-color: var(--border-accent);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
}

.btn-accent:hover {
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(248,113,113,0.15);
    color: var(--red);
    border: 1px solid rgba(248,113,113,0.2);
}

.btn-danger:hover {
    background: rgba(248,113,113,0.25);
}

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-slow) var(--ease);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: all var(--duration-slow) var(--ease);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all var(--duration) var(--ease);
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(124,92,252,0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in var(--duration-slow) var(--ease);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    max-width: 360px;
}

.toast.success {
    background: rgba(52,211,153,0.15);
    color: var(--green);
    border-color: rgba(52,211,153,0.2);
}

.toast.error {
    background: rgba(248,113,113,0.15);
    color: var(--red);
    border-color: rgba(248,113,113,0.2);
}

.toast.info {
    background: rgba(124,92,252,0.15);
    color: var(--accent-light);
    border-color: rgba(124,92,252,0.2);
}

@keyframes toast-in {
    from { transform: translateY(16px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ============================================
   DETAIL PANEL
   ============================================ */
.detail-panel {
    width: 0;
    overflow: hidden;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-left: 1px solid var(--border);
    transition: width var(--duration-slow) var(--ease);
}

.detail-panel.open { width: 340px; }

.detail-panel-content {
    width: 340px;
    padding: 24px;
}

.detail-panel-content .detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.detail-panel-content .detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 600;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SPINNER
   ============================================ */
.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: absolute; z-index: 50; }
    .sidebar.hidden { display: none; }
    .messages-area { padding: 16px; }
    .message-bubble { max-width: 85%; }
    .detail-panel { position: absolute; right: 0; z-index: 50; }
}
