/* ============================================
   HR INTELLIGENCE PLATFORM - BambooHR-Inspired Design
   Green-branded, warm, airy, friendly, professional
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   DESIGN TOKENS - Light Theme (BambooHR)
   ============================================ */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 0.9375rem;

    /* BambooHR Brand Green */
    --primary: #73C41D;
    --primary-hover: #65AD19;
    --primary-light: #D5FE81;
    --primary-bg: #F0FAE5;

    /* Accent - same green family */
    --accent: #73C41D;
    --accent-light: #F0FAE5;
    --accent-bg: #F0FAE5;

    /* Status Colors (softer, friendlier) */
    --success: #4CAF50;
    --success-bg: #E8F5E9;
    --warning: #FF9800;
    --warning-bg: #FFF3E0;
    --danger: #F44336;
    --danger-bg: #FFEBEE;
    --info: #2196F3;
    --info-bg: #E3F2FD;

    /* Backgrounds — white dominant, airy */
    --bg-primary: #F7F8FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-light: #F5F5F5;
    --bg-white: #FFFFFF;
    --bg-hover: #FAFAFA;
    --bg-active: #F0FAE5;

    /* Text — warm hierarchy */
    --text-primary: #333333;
    --text-secondary: #55575A;
    --text-tertiary: #9E9E9E;
    --text-inverse: #FFFFFF;

    /* Sidebar — white, clean */
    --sidebar-bg: #FFFFFF;
    --sidebar-text: #55575A;
    --sidebar-text-hover: #333333;
    --sidebar-border: #E8E8E8;
    --sidebar-active-bg: #F0FAE5;
    --sidebar-active-text: #73C41D;
    --sidebar-width: 240px;

    /* Header */
    --header-bg: #FFFFFF;
    --header-text: #333333;
    --header-border: #E8E8E8;

    /* Borders — subtle, warm */
    --border-color: #E8E8E8;
    --border-light: #F0F0F0;
    --border-focus: #73C41D;

    /* Shadows — minimal, barely there */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.1);

    /* Radii — rounded, friendly (BambooHR) */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Transitions */
    --transition-fast: all 0.15s ease;
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] {
    --bg-primary: #1A1C1E;
    --bg-secondary: #242628;
    --bg-card: #242628;
    --bg-light: #2C2E32;
    --bg-white: #242628;
    --bg-hover: #2C2E32;
    --bg-active: rgba(115,196,29,0.12);
    --text-primary: #E8E8E8;
    --text-secondary: #A0A0A0;
    --text-tertiary: #6B7280;
    --sidebar-bg: #1A1C1E;
    --sidebar-text: #A0A0A0;
    --sidebar-text-hover: #E8E8E8;
    --sidebar-border: #2C2E32;
    --sidebar-active-bg: rgba(115,196,29,0.12);
    --sidebar-active-text: #73C41D;
    --header-bg: #242628;
    --header-text: #E8E8E8;
    --header-border: #2C2E32;
    --border-color: rgba(255,255,255,0.08);
    --border-light: #2C2E32;
    --primary-bg: rgba(115,196,29,0.12);
    --accent-light: rgba(115,196,29,0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============================================
   LAYOUT - Dashboard Container
   ============================================ */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-primary);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    padding-top: 20px;
    z-index: 100;
    transition: var(--transition);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.content-area {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

/* ============================================
   SIDEBAR - Logo & Navigation (BambooHR Style)
   ============================================ */
.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.app-logo::before {
    content: '👥';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--primary-bg);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background-color: var(--bg-hover);
    color: var(--sidebar-text-hover);
}

.sidebar-nav a.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    border-left-color: var(--primary);
}

.sidebar-nav svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================
   HEADER / TOPBAR
   ============================================ */
.topbar {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-primary);
    font-size: 20px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.hamburger-btn:hover {
    background-color: var(--bg-light);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-secondary);
    font-size: 18px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.notification-bell {
    position: relative;
}

.bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-secondary);
    font-size: 18px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    width: 40px;
    min-width: 44px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bell-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background-color: var(--danger, #E74C3C);
    border-radius: 8px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.role-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background-color: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-text {
    font-weight: 700;
}

.profile-chevron {
    color: var(--text-tertiary);
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.card-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */
.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* KPI Cards */
.kpi-grid,
.kpi-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
    min-width: 0;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}

.kpi-change {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-tertiary);
}

.kpi-change.positive {
    color: var(--success);
}

.kpi-change.negative {
    color: var(--danger);
}

/* Quick Actions */
.quick-actions {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.quick-actions h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

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

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.action-btn:hover {
    background-color: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Activity Feed */
.activity-feed {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.activity-feed h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    font-size: 0.875rem;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   CHAT PAGE
   ============================================ */
.chat-page {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chat-wrapper {
    display: flex;
    height: calc(100vh - 84px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chat-sidebar {
    width: 280px;
    background-color: var(--bg-light);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.new-chat-btn {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.new-chat-btn:hover {
    background-color: var(--primary-hover);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 12px;
    margin: 4px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
}

.conversation-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.conversation-item.active {
    background-color: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-wrapper {
    animation: slideIn 0.3s ease;
}

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

/* Agent (bot) messages — distinct card style */
.agent-message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 75%;
}

.agent-message {
    display: flex;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    border-radius: 4px var(--radius-lg) var(--radius-lg) 4px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.65;
    word-wrap: break-word;
    box-shadow: var(--shadow-xs);
}

.agent-avatar {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    border-radius: 50%;
    flex-shrink: 0;
}

.agent-message-body {
    flex: 1;
    min-width: 0;
}

.agent-message p {
    margin: 0 0 6px 0;
}

.agent-message p:last-child {
    margin-bottom: 0;
}

/* Chat list styling (bullets / numbered) */
.chat-list {
    margin: 6px 0 8px 18px;
    padding: 0;
}

.chat-list li {
    margin-bottom: 4px;
    line-height: 1.55;
}

/* Chat key-value cards grid */
.chat-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.chat-kv-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    transition: var(--transition-fast);
}

.chat-kv-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.chat-kv-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.chat-kv-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.chat-kv-value {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Chat section header */
.chat-section-header {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0 6px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--primary-bg, rgba(115,196,29,0.15));
}

/* Chat info callout */
.chat-info-callout {
    background: var(--primary-bg, rgba(115,196,29,0.08));
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 8px 0;
    line-height: 1.5;
}

/* User messages — right-aligned, green bubble */
.user-message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 70%;
    margin-left: auto;
}

.user-message {
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
    padding: 12px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: var(--shadow-xs);
}

.user-message p {
    margin: 0;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding: 0 4px;
}

/* Legacy bubble class (for fallback) */
.message-bubble {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-timestamp {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    margin: 4px 0;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.chat-suggestions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.suggested-btn {
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.suggested-btn:hover {
    background-color: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-light);
    transition: var(--transition-fast);
    resize: none;
    max-height: 100px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.send-btn:hover {
    background-color: var(--primary-hover);
}

.send-btn:active {
    transform: scale(0.95);
}

/* ============================================
   LEAVE PAGE
   ============================================ */
.leave-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.leave-balance-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.leave-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition-fast);
}

.leave-card:hover {
    box-shadow: var(--shadow-md);
}

.leave-type {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}

.leave-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.leave-bar {
    height: 6px;
    background-color: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.leave-bar-fill,
.leave-used {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

.leave-status {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.leave-request-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.leave-request-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-control,
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.form-control:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-control::placeholder,
.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input[readonly] {
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: default;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
}

.btn-danger {
    background-color: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger-bg);
}

/* Leave History */
.leave-history-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow-x: auto;
}

.leave-history-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Tables */
.table,
.leave-table,
.documents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead,
.leave-table thead,
.documents-table thead {
    background-color: var(--bg-light);
}

.table th,
.leave-table th,
.documents-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td,
.leave-table td,
.documents-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table tbody tr:hover,
.leave-table tbody tr:hover,
.documents-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table tbody tr:last-child td,
.leave-table tbody tr:last-child td,
.documents-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge,
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
}

.status-approved {
    background-color: var(--success-bg);
    color: #2E7D32;
}

.status-pending {
    background-color: var(--warning-bg);
    color: #E65100;
}

.status-rejected {
    background-color: var(--danger-bg);
    color: var(--danger);
}

[data-theme="dark"] .status-approved { color: var(--success); }
[data-theme="dark"] .status-pending { color: var(--warning); }
[data-theme="dark"] .status-rejected { color: var(--danger); }

/* ============================================
   WORKFLOWS PAGE
   ============================================ */
.workflows-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Pending Approvals */
.pending-approvals-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.approval-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.approval-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition-fast);
}

.approval-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.approval-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.approval-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.priority-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.priority-high {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.priority-medium {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.priority-low {
    background-color: var(--info-bg);
    color: var(--info);
}

.approval-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.approval-requested {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.approval-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-approve {
    flex: 1;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-approve:hover {
    background-color: var(--primary-hover);
}

.btn-reject {
    flex: 1;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-reject:hover {
    background-color: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* Active Workflows */
.active-workflows-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.workflow-cards {
    display: grid;
    gap: 16px;
}

.workflow-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition-fast);
}

.workflow-card:hover {
    box-shadow: var(--shadow-md);
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.workflow-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.workflow-status {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.workflow-status.in-progress {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.workflow-status.pending {
    background-color: var(--bg-light);
    color: var(--text-secondary);
}

.workflow-status.completed {
    background-color: var(--success-bg);
    color: var(--success);
}

/* Workflow Timeline */
.workflow-timeline {
    padding-left: 20px;
    border-left: 2px solid var(--primary);
}

.timeline-step {
    position: relative;
    padding: 0 0 20px 20px;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.step-indicator {
    position: absolute;
    left: -31px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    color: var(--text-tertiary);
    font-weight: 600;
}

.timeline-step.completed .step-indicator {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.timeline-step.in-progress .step-indicator {
    background-color: var(--warning);
    border-color: var(--warning);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 152, 0, 0);
    }
}

.step-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.step-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ============================================
   ANALYTICS PAGE
   ============================================ */
.analytics-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Filters bar */
.filters-section {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
    min-width: 140px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(115, 196, 29, 0.15);
}

.filter-separator {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    padding: 8px 0;
}

/* Charts 2x2 Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-fast);
}

.chart-wrapper:hover {
    box-shadow: var(--shadow-md);
}

.chart-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 400px;
}

.chart-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.analytics-chart {
    width: 100% !important;
    max-height: 280px;
}

/* Summary Stats */
.summary-stats-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.summary-stats-section .section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 0 8px 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 6px 0;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--success);
    margin: 0;
}

.export-btn {
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.export-btn:hover {
    background-color: var(--primary-hover);
}

/* Analytics responsive */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-input {
        min-width: unset;
        width: 100%;
    }
}

/* ============================================
   DOCUMENTS PAGE
   ============================================ */
.documents-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.file-upload-section,
.templates-section,
.generate-form-section,
.uploaded-documents-section,
.recent-documents-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.template-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.template-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.template-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 8px 0 4px;
}

.template-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.template-icon {
    font-size: 2rem;
}

.action-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.action-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.documents-table-wrapper,
.table-wrapper {
    overflow-x: auto;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
}

.settings-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-description {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color, #ccc);
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary, #4CAF50);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-switch.active {
    background-color: var(--primary);
}

.toggle-switch.active::after {
    left: 22px;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color, #eee);
}

.toggle-item:last-child {
    border-bottom: none;
}

.toggle-info {
    flex: 1;
    margin-right: 16px;
}

.toggle-label {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 2px 0;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.toggle-list {
    padding: 0 4px;
}

/* ============================================
   NOTIFICATIONS & MODALS
   ============================================ */
.notification-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1001;
}

.notification-backdrop.show {
    display: block;
}

.notification-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 360px;
    height: 100vh;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 1002;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s ease;
}

.notification-panel.show {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

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

.notification-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    padding: 4px;
}

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

.notification-list {
    padding: 16px;
    overflow-y: auto;
    height: calc(100vh - 76px);
}

.notification-item {
    padding: 12px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 0.875rem;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item.unread {
    background-color: var(--primary-bg);
    border-color: var(--primary);
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* Command Palette */
.command-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 1003;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.command-palette-overlay.show {
    display: flex;
}

.command-palette {
    width: 90%;
    max-width: 500px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.command-input {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.command-palette input,
#command-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

.command-palette input:focus,
#command-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.command-list {
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.command-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.command-item:hover {
    background-color: var(--bg-light);
}

.command-item.selected {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.command-hint {
    padding: 10px 16px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-color);
}

.command-hint kbd {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.7rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1004;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
}

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

.toast.success {
    border-left-color: var(--success);
}

.toast.danger {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-light) 0%,
        var(--bg-hover) 50%,
        var(--bg-light) 100%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    height: 200px;
}

.skeleton-text {
    height: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.skeleton-text.title {
    height: 20px;
    width: 60%;
}

/* ============================================
   MOBILE & RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: var(--sidebar-width);
        z-index: 1001;
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
        transition: var(--transition);
    }

    .sidebar-overlay.show,
    .sidebar-overlay.active {
        display: block;
    }

    .content-area {
        padding: 16px;
    }

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

    .approval-cards {
        grid-template-columns: 1fr;
    }

    .chat-wrapper {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 84px);
    }

    .chat-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .chat-main {
        min-height: 400px;
    }

    .message-bubble {
        max-width: 85%;
    }

    .search-bar {
        display: none;
    }

    .bell-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .notification-panel {
        width: 100%;
    }

    .command-palette {
        width: 95%;
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: var(--sidebar-width);
        z-index: 1001;
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
        transition: var(--transition);
    }

    .sidebar-overlay.show,
    .sidebar-overlay.active {
        display: block;
    }

    .chat-wrapper {
        height: auto;
        min-height: calc(100vh - 84px);
    }

    .approval-cards {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* ============================================
   UTILITIES & HELPERS
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.mt-0 { margin-top: 0; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.rounded { border-radius: var(--radius-lg); }
.border { border: 1px solid var(--border-color); }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.hidden { display: none; }
.visible { display: block; }

/* ============================================
   MODAL / OVERLAY
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0 4px;
    line-height: 1;
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 8px 24px 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 24px 20px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .hamburger-btn,
    .bell-btn,
    .theme-toggle-btn,
    .sidebar,
    .sidebar-overlay {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .chat-input-area,
    .approval-actions {
        display: none;
    }
}
