/* ============================================
   AT MEDIA — Premium Design System
   Modern SaaS HR & Attendance Platform
   ============================================ */

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

:root {
    /* Core palette */
    --brand-primary: #f97316;
    --brand-primary-hover: #ea580c;
    --brand-primary-light: rgba(249, 115, 22, 0.12);
    --brand-primary-glow: rgba(249, 115, 22, 0.4);
    
    --brand-dark: #0f172a;
    --brand-dark-soft: #1e293b;
    --brand-dark-muted: #334155;
    
    --surface-1: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --surface-elevated: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-premium: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    --shadow-glow: 0 0 40px rgba(249, 115, 22, 0.15);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body, html {
    overflow-x: hidden !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

body.login-page {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden !important;
}
body.login-page .main-wrapper {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

/* ==================== TOAST NOTIFICATIONS (side slide-in, auto-dismiss) ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-notification {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    opacity: 0;
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
    pointer-events: auto;
    max-width: 320px;
}

.toast-notification.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.toast-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.toast-notification.toast-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ==================== LOGIN PAGE — Premium (full-width, sphere background) ==================== */
.login-shell {
    position: relative;
    width: 100vw;
    min-width: 100%;
    height: 100vh !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f4f2;
    margin: 0;
    padding: 0;
}

.login-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 5% 15%, rgba(255, 200, 180, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 70% 45% at 95% 85%, rgba(255, 190, 170, 0.4) 0%, transparent 55%);
    pointer-events: none;
}

.login-orbit-layer,
.login-particle-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orbit-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.9;
    transition: transform 0.5s ease-out;
}

/* Large pale orange sphere - top-left */
.orbit-circle--lg {
    width: 520px;
    height: 520px;
    top: -160px;
    left: -140px;
    background: radial-gradient(circle at 35% 35%, rgba(255, 210, 190, 0.65), rgba(249, 150, 100, 0.3) 45%, transparent 70%);
}

/* Pale orange sphere - bottom-right */
.orbit-circle--md {
    width: 450px;
    height: 450px;
    bottom: -140px;
    right: -100px;
    background: radial-gradient(circle at 35% 35%, rgba(255, 205, 185, 0.6), rgba(249, 140, 90, 0.25) 45%, transparent 70%);
}

/* Light grey/silver sphere - right side mid-height */
.orbit-circle--sm {
    width: 220px;
    height: 220px;
    top: 45%;
    right: 12%;
    filter: blur(35px);
    background: radial-gradient(circle at 35% 35%, rgba(230, 228, 225, 0.95), rgba(200, 198, 195, 0.55) 50%, transparent 70%);
}

.particle-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.35);
    animation: floatDot 15s ease-in-out infinite;
}

.particle-dot.orange { background: rgba(249, 115, 22, 0.45); }
.particle-dot.white { background: rgba(255, 255, 255, 0.7); }

@keyframes floatDot {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.6; }
    50% { transform: translateY(-60px) translateX(20px); opacity: 1; }
}

.login-card {
    width: 420px;
    padding: 48px 40px 40px;
    border-radius: var(--radius-2xl);
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 10;
    animation: loginPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginPop {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-box {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-lg);
}

.login-logo-box img {
    max-height: 48px;
    max-width: 48px;
    object-fit: contain;
}

.login-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-card .text-muted {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.input-field {
    background: var(--surface-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 14px 16px;
    font-size: 0.95rem;
    transition: var(--transition-base);
}

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

.btn-login {
    width: 100%;
    border-radius: var(--radius-full);
    padding: 14px 20px;
    border: none;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px var(--brand-primary-glow);
    transition: var(--transition-base);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--brand-primary-glow);
}

/* ==================== TOPBAR — Premium ==================== */
.topbar {
    height: 64px;
    background: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar .brand-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.topbar .brand-accent {
    color: var(--brand-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.topbar-right .fw-bold {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.logout-btn:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

/* Profile avatar in topbar */
.profile-icon-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    overflow: hidden;
    transition: opacity 0.2s;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.profile-icon-btn:hover {
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}
.profile-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}
.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: #fff !important;
    font-size: 1.25rem;
}
.profile-dropdown {
    min-width: 220px;
    padding: 0.5rem 0;
    transform: translateY(-1px);
    z-index: 9999;
}

#sidebarToggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 8px;
}

/* ==================== SIDEBAR — Premium (Collapsible on Hover) ==================== */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 72px;
    height: calc(100vh - 64px);
    background: #000;
    padding: 24px 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1100;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: width var(--transition-smooth);
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar:hover {
    width: 260px;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0 12px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: var(--transition-base);
}

.sidebar-menu li a i {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    font-size: 1.15rem;
}

.sidebar:not(:hover) .sidebar-menu li a {
    justify-content: center;
    padding: 12px;
}

.sidebar .sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    width: 0;
    transition: opacity var(--transition-base), width var(--transition-smooth);
}

.sidebar:hover .sidebar-label {
    opacity: 1;
    width: auto;
}

.sidebar-menu li a:hover {
    background: rgba(249, 115, 22, 0.15);
    color: #fff;
    padding-left: 20px;
}

.sidebar-menu li a.active {
    background: var(--brand-primary);
    color: #fff;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--brand-primary);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 2px #000;
}

.notif-badge-topbar {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}
.notification-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}
.notification-dropdown {
    z-index: 9999;
    min-width: 340px;
}

.sidebar-mobile-footer {
    margin-top: auto;
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar dropdown */
.sidebar-dropdown .sidebar-dropdown-toggle {
    display: flex;
    align-items: center;
    width: 100%;
}
.sidebar-dropdown .sidebar-chevron {
    font-size: 0.75rem;
    transition: transform var(--transition-base);
}
.sidebar:not(:hover) .sidebar-chevron {
    display: none;
}
.sidebar-dropdown.open .sidebar-chevron {
    transform: rotate(180deg);
}
.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 4px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-smooth);
}
.sidebar-dropdown.open .sidebar-submenu {
    max-height: 400px;
}
.sidebar-submenu li a {
    padding-left: 44px;
    font-size: 0.85rem;
}
.sidebar-submenu li a i {
    font-size: 1rem;
}
.sidebar:not(:hover) .sidebar-dropdown .sidebar-submenu {
    max-height: 0 !important;
}

/* ==================== MAIN CONTENT ==================== */
.main-wrapper {
    margin-left: 72px;
    padding: 32px;
    padding-top: 96px;
    min-height: 100vh;
    transition: margin-left var(--transition-smooth);
}

.sidebar:hover ~ .main-wrapper {
    margin-left: 260px;
}

/* ==================== PAGE HEADERS ==================== */
.page-header {
    margin-bottom: 28px;
}

.page-header h1,
.page-header h2,
.page-header h4 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.page-header .page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==================== PREMIUM CARDS ==================== */
.card-premium {
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-smooth);
}

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

.card-premium .card-header {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    color: #fff;
    padding: 16px 24px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
}

.card-premium .card-body {
    padding: 24px;
}

/* Stat cards — Premium */
.stat-card {
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    background: var(--surface-elevated);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition-smooth);
}

.stat-card:hover,
.stat-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.stat-card-hover {
    cursor: pointer;
}

.stat-icon {
    height: 56px;
    width: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand-primary-light) 0%, rgba(249, 115, 22, 0.08) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.stat-content-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-content-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ==================== BUTTONS ==================== */
.btn-brand {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: #fff !important;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 4px 12px var(--brand-primary-glow);
    transition: var(--transition-base);
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--brand-primary-glow);
}

.btn-outline-dark {
    border: 2px solid #000;
    color: #000;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.btn-outline-dark:hover {
    background: #000;
    color: #fff;
}

.btn-outline-danger {
    border: 2px solid #ef4444;
    color: #ef4444;
    font-weight: 600;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: #fff;
}

/* ==================== TABLES — Premium ==================== */
.table-premium {
    margin: 0;
}

.table-premium thead th {
    background: var(--surface-3);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.table-premium tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.table-premium tbody tr:hover {
    background: var(--surface-2);
}

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

/* Assign dropdown: checkbox list, compact display */
.assign-dropdown {
    position: relative;
}
.assign-dropdown .assign-dropdown-btn {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.assign-dropdown .assign-dropdown-menu {
    min-width: 200px;
    z-index: 1060;
}
.assign-dropdown .assign-checkboxes .form-check {
    white-space: nowrap;
}

.table-wrapper {
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
}
/* Table with dropdowns: allow overflow so dropdown menu is visible (must override .table-wrapper) */
.table-wrapper.table-wrapper-dropdowns {
    overflow: visible;
}

/* ==================== FORMS — Premium ==================== */
.form-control-premium,
.form-control {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: var(--transition-base);
}

.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.form-select {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* ==================== BADGES ==================== */
.badge-premium {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.badge-approved {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

/* ==================== CHAT UI ==================== */
.floating-chat-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    height: 60px;
    width: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--brand-primary-glow);
    z-index: 9998;
    transition: var(--transition-base);
    pointer-events: auto;
}

.floating-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 32px var(--brand-primary-glow);
}

.chat-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
}

/* Chat panel backdrop */
.chat-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.chat-panel-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Chat side panel - slides in from right */
.chat-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    min-width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0,0,0,0.12);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-light);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: none;
}
.chat-side-panel.open {
    transform: translateX(0);
    pointer-events: auto;
}

.chat-panel-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
    z-index: 2;
    background: transparent;
    transition: background 0.15s;
}
.chat-panel-resize-handle::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 40px;
    background: var(--border-medium);
    border-radius: 1px;
    opacity: 0.6;
}
.chat-panel-resize-handle:hover,
.chat-panel-resize-handle:active {
    background: rgba(0,0,0,0.06);
}
.chat-panel-resize-handle:hover::after,
.chat-panel-resize-handle:active::after {
    opacity: 1;
    background: var(--text-muted);
}

.chat-panel-header {
    background: #000;
    color: #fff;
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-panel-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.chat-panel-contacts {
    width: 33%;
    min-width: 140px;
    padding: 12px;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel-contact-list {
    flex: 1;
    overflow-y: auto;
}

.chat-panel-divider {
    width: 1px;
    background: var(--border-light);
}

.chat-panel-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.chat-panel-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.chat-panel-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--surface-2);
}

.chat-panel-input-wrap {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 8px;
}

.chat-panel-input-wrap input {
    flex: 1;
}

.chat-contact-row {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    border-right: 3px solid transparent;
    margin-bottom: 2px;
}

.chat-contact-row:hover {
    background: var(--surface-2);
}

.chat-contact-row.selected {
    background: rgba(0,0,0,0.04);
    border-right-color: var(--brand-primary);
}

.chat-contact-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.chat-contact-email,
.chat-contact-phone {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chat-date-separator {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 12px 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #15803d;
    border-radius: var(--radius-md);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
    border-radius: var(--radius-md);
}

.close-btn, .close-chat {
    cursor: pointer;
    opacity: 0.8;
    transition: var(--transition-fast);
}

.close-btn:hover, .close-chat:hover {
    opacity: 1;
}

.chat-window-shell {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.chat-window-shell .chat-header {
    background: #000;
    color: #fff;
    padding: 14px 20px;
}

.msg-sent {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    color: #fff;
    max-width: 75%;
    margin-left: auto;
    box-shadow: var(--shadow-md);
}

.msg-received {
    background: var(--surface-3);
    padding: 12px 18px;
    border-radius: 18px 18px 18px 4px;
    color: var(--text-primary);
    max-width: 75%;
    border: 1px solid var(--border-light);
}


/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991.98px) {
    .sidebar {
        width: 280px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar:hover {
        width: 280px !important;
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    
    .sidebar .sidebar-label {
        opacity: 1 !important;
        width: auto !important;
    }
    
    .sidebar .sidebar-menu li a {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    
    .sidebar:hover ~ .main-wrapper {
        margin-left: 0 !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        padding: 88px 16px 24px !important;
    }
    
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-content-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .login-card {
        width: 95%;
        max-width: 380px;
        padding: 32px 24px;
    }
    
    .chat-window-shell {
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }
}

/* ==================== CONTENT CALENDAR — Spreadsheet Grid ==================== */
.content-calendar-fullpage {
    min-height: calc(100vh - 64px - 140px);
    display: flex;
    flex-direction: column;
    margin: 16px -32px -32px -32px;
}
.content-calendar-fullpage .calendar-spreadsheet-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
}
.calendar-table-header-row .calendar-table-title-cell {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    color: #fff;
    padding: 12px 20px;
    vertical-align: middle;
    border-bottom: none;
}
.calendar-table-header-row .calendar-table-title-cell .form-select {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.calendar-table-header-row .calendar-table-title-cell .form-select option {
    background: #000;
    color: #fff;
}
.calendar-spreadsheet-wrapper {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow-x: auto;
    background: #fff;
}
.calendar-spreadsheet-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
}
.calendar-spreadsheet-table .resizable-col {
    position: relative;
    overflow: visible;
}
.calendar-spreadsheet-table .resizable-col .th-content {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.calendar-spreadsheet-table .col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 2;
}
.calendar-spreadsheet-table .col-resize-handle:hover,
.calendar-spreadsheet-table .col-resize-handle.resizing {
    background: var(--brand-primary);
    opacity: 0.3;
}
.calendar-spreadsheet-table .col-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 3px;
    transform: translateY(-50%);
    width: 2px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 1px;
    opacity: 0.6;
}
.calendar-spreadsheet-table .col-resize-handle:hover::after,
.calendar-spreadsheet-table .col-resize-handle.resizing::after {
    background: var(--brand-primary);
    opacity: 1;
}
.calendar-spreadsheet-table thead {
    background: var(--surface-3);
    color: var(--text-secondary);
}
.calendar-spreadsheet-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid var(--border-light);
    border-top: none;
}
.calendar-spreadsheet-table thead tr:first-child th {
    border-top: 1px solid var(--border-light);
}
.calendar-spreadsheet-table tbody tr {
    border-bottom: 1px solid var(--border-light);
}
.calendar-spreadsheet-table tbody tr:hover {
    background: #f8fafc;
}
.calendar-spreadsheet-table tbody td {
    padding: 8px 12px;
    vertical-align: middle;
    border-right: 1px solid var(--border-light);
}
.calendar-spreadsheet-table tbody td:last-child {
    border-right: none;
}
.calendar-spreadsheet-table .content-copy-cell {
    min-width: 140px;
}
.calendar-spreadsheet-table .content-copy-cell textarea {
    background: var(--brand-primary-light);
    resize: both;
    min-height: 48px;
}
.calendar-spreadsheet-table .caption-cell {
    min-width: 200px;
}
.calendar-spreadsheet-table .caption-cell textarea {
    resize: both;
    min-height: 48px;
}
.calendar-spreadsheet-table .cell-form {
    margin: 0;
}
.calendar-spreadsheet-table .cell-form .form-control,
.calendar-spreadsheet-table .cell-form .form-select {
    background: transparent;
    min-height: 32px;
}
.calendar-spreadsheet-table .cell-form .form-control:focus,
.calendar-spreadsheet-table .cell-form .form-select:focus {
    background: #fff;
    box-shadow: 0 0 0 1px var(--brand-primary);
}

/* Calendar month picker - theme colors */
.btn-calendar-picker {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-weight: 500;
    color: #fff;
}
.btn-calendar-picker:hover {
    background: rgba(255,255,255,0.2) !important;
    border-color: var(--brand-primary);
    color: #fff;
}
.calendar-month-grid-dropdown {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.calendar-month-btn {
    padding: 10px 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.calendar-month-btn:hover {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary-hover);
}
.calendar-month-btn.active {
    background: #000;
    border-color: #000;
    color: #fff;
}
.calendar-nav-year {
    color: #000 !important;
    border-color: var(--border-medium) !important;
}
.calendar-nav-year:hover {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

/* Narrow modal style - Add/Edit/Upload forms (width-wise, single column) */
.modal-dialog-narrow {
    max-width: 420px !important;
    width: 100%;
}
.modal-dialog-narrow .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
.modal-dialog-narrow .form-label {
    font-weight: 600;
}
.modal-dialog-narrow .alert-danger {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #f9a8d4;
    border-radius: var(--radius-md);
}
@media (max-width: 576px) {
    .modal-dialog-narrow {
        max-width: 95%;
        margin: 0.5rem auto;
    }
}

/* Content Calendar modals - use narrow style */
#addPostModal .modal-dialog,
#addCredentialModal .modal-dialog,
#addAssetModal .modal-dialog {
    max-width: 420px !important;
}
#addPostModal .modal-body,
#addCredentialModal .modal-body,
#addAssetModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
@media (max-width: 576px) {
    #addPostModal .modal-dialog,
    #addCredentialModal .modal-dialog,
    #addAssetModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }
}

/* Utility */
.d-none { display: none !important; }
.bg-brand { background: var(--brand-primary) !important; }
