/* ============================================================
   XCOMIC EMAIL MARKETER - ELEGANT PREMIUM DESIGN SYSTEM
   Minimalist · Clean Typography · Sophisticated
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Brand Colors - Sophisticated and Restrained */
    --primary:       #0f172a; /* Deep Slate */
    --primary-light: #334155;
    --accent:        #4f46e5; /* Indigo for primary actions */
    --accent-hover:  #4338ca;
    --p:             #4f46e5;
    --p-light:       rgba(79, 70, 229, 0.1);
    
    /* Semantic */
    --success:       #059669;
    --success-bg:    #ecfdf5;
    --warning:       #d97706;
    --warning-bg:    #fffbeb;
    --danger:        #dc2626;
    --danger-bg:     #fef2f2;

    /* Surfaces - Clean Light Mode */
    --bg:            #f8fafc;
    --surface-0:     #ffffff;
    --surface-1:     #f1f5f9;
    --surface-hover: #f8fafc;

    /* Borders */
    --border:        #e2e8f0;
    --border-hover:  #cbd5e1;

    /* Text */
    --text:          #0f172a;
    --text-muted:    #64748b;
    --text-dim:      #94a3b8;

    /* Shadows - Soft and Refined */
    --shadow-sm:     0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md:     0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg:     0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -2px rgba(15, 23, 42, 0.025);
    --shadow-float:  0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 10px 10px -5px rgba(15, 23, 42, 0.02);

    /* Transitions */
    --ease:          cubic-bezier(0.4, 0, 0.2, 1);
    --duration:      0.25s;
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     24px;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg:            #0f172a;
    --surface-0:     #1e293b;
    --surface-1:     #273549;
    --surface-hover: #334155;
    --border:        #334155;
    --border-hover:  #475569;
    --text:          #f1f5f9;
    --text-muted:    #94a3b8;
    --text-dim:      #64748b;
    --shadow-sm:     0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.3);
    --shadow-float:  0 20px 25px -5px rgba(0,0,0,0.4);
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

::selection { background: rgba(79, 70, 229, 0.15); color: var(--accent); }

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app-page {
    display: none;
    width: 100%;
    flex: 1;
    background: var(--bg);
    position: relative;
}
#app-page.on { display: flex; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: 260px;
    min-height: 100vh;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    background: var(--surface-0);
    border-right: 1px solid var(--border);
    position: sticky; top: 0; height: 100vh;
    z-index: 100;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 12px;
    margin-bottom: 48px;
}
.logo i {
    width: 32px; height: 32px;
    background: var(--text);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #fff;
}
.logo h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: var(--radius-md);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
}
.nav-item i { font-size: 16px; opacity: 0.8; transition: transform var(--duration) var(--ease); }
.nav-item:hover {
    color: var(--text);
    background: var(--surface-1);
}
.nav-item:hover i { transform: translateX(2px); opacity: 1; }
.nav-item.active {
    color: var(--accent);
    background: rgba(79, 70, 229, 0.08);
}
.nav-item.active i { opacity: 1; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    padding: 48px 56px;
    overflow-y: auto;
    position: relative; z-index: 1;
    min-height: 100vh;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    margin-bottom: 40px;
}
.page-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 8px;
}
.page-subtitle { font-size: 15px; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   VIEWS
   ============================================================ */
.view { display: none; animation: fadeIn 0.4s var(--ease); }
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--surface-0);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all var(--duration) var(--ease);
}
.stat-card:hover { 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-lg); 
    border-color: var(--border-hover);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: var(--surface-1);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--text);
    flex-shrink: 0;
}
.stat-content {
    display: flex;
    flex-direction: column;
}
.stat-label { 
    font-size: 13px; 
    color: var(--text-muted); 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    margin-bottom: 8px;
}
.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1;
}

/* ============================================================
   TABLES
   ============================================================ */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead tr th {
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--surface-0);
}
thead tr th:first-child { border-top-left-radius: var(--radius-lg); }
thead tr th:last-child { border-top-right-radius: var(--radius-lg); }
tbody tr td {
    padding: 20px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: var(--surface-0);
    transition: background var(--duration) var(--ease);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-lg); }
tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-lg); }
tbody tr:hover td { background: var(--surface-1); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    background: var(--surface-0);
    color: var(--text);
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-1); border-color: var(--border-hover); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3); }
.btn.primary:active { transform: translateY(0); }

.btn.danger {
    background: var(--surface-0);
    border-color: #fca5a5;
    color: var(--danger);
}
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group { margin-bottom: 24px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    outline: none;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-sm);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.form-group select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 16px; padding-right: 40px; }
.form-group textarea { resize: vertical; line-height: 1.6; }

/* ============================================================
   CARDS & CONTAINERS
   ============================================================ */
.glass {
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}
.status-badge.sent, .status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.pending, .status-badge.draft { background: var(--warning-bg); color: var(--warning); }
.status-badge.failed, .status-badge.error { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    display: none;
}
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; display: block; }
.alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; display: block; }

/* ============================================================
   TABS
   ============================================================ */
.tabs-bar {
    display: inline-flex;
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    padding: 6px;
    margin-bottom: 32px;
    gap: 4px;
}
.tab-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    background: var(--surface-0);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   EMAIL BUILDER (Refined)
   ============================================================ */
.builder-layout {
    display: flex;
    gap: 32px;
    height: calc(100vh - 280px);
    min-height: 600px;
}

.builder-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.builder-canvas-wrapper {
    flex: 1;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow-y: auto;
    padding: 48px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

#builder-canvas {
    width: 100%;
    max-width: 600px;
    min-height: 500px;
    background: #fff;
    border-radius: 0;
    box-shadow: var(--shadow-float);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.canvas-placeholder {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
}

.email-block {
    position: relative;
    border: 2px solid transparent;
    cursor: default;
    transition: border-color 0.2s;
}
.email-block:hover { border: 2px dashed rgba(79, 70, 229, 0.4); }
.email-block.selected { border: 2px solid var(--accent); }

.block-actions {
    position: absolute;
    top: -36px; right: -2px;
    background: var(--accent);
    color: #fff;
    display: none;
    align-items: center;
    z-index: 10;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.email-block:hover .block-actions,
.email-block.selected .block-actions { display: flex; }

.action-btn {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}
.action-btn:hover { background: var(--accent-hover); }
.action-btn.delete:hover { background: var(--danger); }

.drop-indicator {
    height: 3px;
    background: var(--accent);
    width: 100%;
    z-index: 20;
    pointer-events: none;
    display: none;
    margin: 2px 0;
}

.draggable-block {
    padding: 14px 16px;
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    cursor: grab;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-sm);
}
.draggable-block:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.draggable-block:active { cursor: grabbing; transform: scale(0.98); }

.property-editor-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   TOAST NOTIFICATIONS (V2)
   ============================================================ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-item {
    min-width: 280px;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    pointer-events: auto;
    font-family: 'Plus Jakarta Sans', sans-serif;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    overflow: hidden;
}

.toast-item.hide {
    animation: toastSlideOut 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 18px;
}

.toast-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.7;
    transition: 0.2s;
}

.toast-close:hover {
    opacity: 1;
    color: var(--text);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--p);
    width: 100%;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================================
   ANALYTICS DASHBOARD
   ============================================================ */
.clean-tabs-bar {
    display: flex; gap: 32px; border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.clean-tab {
    padding: 16px 0; font-size: 15px; font-weight: 600; color: var(--text-muted);
    cursor: pointer; position: relative; transition: color var(--duration);
}
.clean-tab:hover { color: var(--text); }
.clean-tab.active { color: var(--accent); }
.clean-tab.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; width: 100%;
    height: 3px; background: var(--accent); border-radius: 3px 3px 0 0;
}
.metric-card {
    background: var(--surface-0); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 32px 24px; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); flex: 1; text-align: center;
}
.metric-card-title {
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    display: flex; align-items: center; gap: 6px; margin-bottom: 20px;
}
.metric-card-title i { font-size: 12px; color: var(--text-dim); }
.metric-card-value {
    font-size: 32px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 12px; line-height: 1;
}
.metric-card-sub { font-size: 20px; color: var(--text-muted); font-weight: 500; border-left: 1px solid var(--border); padding-left: 12px; }
.status-pill {
    background: #333; color: #fff; padding: 6px 14px; border-radius: 99px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
}
.progress-bar-container {
    height: 4px; background: var(--border); border-radius: 4px; width: 100px;
    overflow: hidden; display: inline-block; vertical-align: middle;
}
.progress-bar-fill { height: 100%; background: var(--text-muted); width: 0%; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 24px 12px; }
    .sidebar .logo h2, .nav-item span { display: none; }
    .logo { justify-content: center; padding: 0; margin-bottom: 40px; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item i { font-size: 20px; }
    .main-content { padding: 32px; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: -100%; top: 0; bottom: 0; z-index: 1000;
        width: 260px !important; transition: left 0.3s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .sidebar.open { left: 0; }
    .sidebar .logo h2, .nav-item span { display: block !important; }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
        z-index: 999; backdrop-filter: blur(2px);
    }
    .sidebar-overlay.show { display: block; }
    .mobile-menu-btn {
        display: flex !important; position: fixed; top: 16px; left: 16px;
        z-index: 998; width: 44px; height: 44px;
        background: var(--surface-0); border: 1px solid var(--border);
        border-radius: 10px; align-items: center; justify-content: center;
        cursor: pointer; box-shadow: var(--shadow-md); font-size: 18px; color: var(--text);
    }
    .main-content { padding: 16px; padding-top: 72px; }
    .builder-layout { flex-direction: column; height: auto; }
    .builder-sidebar { width: 100%; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start !important; }
    table { font-size: 13px; }
    .glass { padding: 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .main-content { padding: 12px; padding-top: 68px; }
}

/* ============================================================
   ANIMATIONS & UX ENHANCEMENTS
   ============================================================ */

/* Shimmer loading skeleton */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 6px;
    display: inline-block;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

[data-theme="dark"] [data-tooltip]::after {
    background: #e2e8f0;
    color: #0f172a;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: #0f172a;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

[data-theme="dark"] [data-tooltip]::before {
    border-top-color: #e2e8f0;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Pulse animation for notification badge */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

/* Page view entrance animation */
.view { animation: fadeSlideIn 0.25s ease; }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input focus glow */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Button loading state */
.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading::after {
    content: '';
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }



/* Empty state */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 64px 24px; gap: 16px; text-align: center;
}
.empty-state-icon {
    width: 72px; height: 72px;
    background: var(--surface-1); border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
}
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.empty-state p { font-size: 13px; color: var(--text-muted); margin: 0; max-width: 280px; }

/* Admin badge */
.nav-item { position: relative; }
.admin-badge {
    background: #ef4444; color: #fff; border-radius: 50%;
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; margin-left: auto;
    animation: pulse 1.5s infinite;
}

/* Smooth nav transitions */
.nav-item { transition: background 0.15s ease, color 0.15s ease; }
.nav-item:hover { background: var(--surface-1); }

/* Table row hover */
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: var(--surface-1) !important; }

/* Approve button pulse on admin panel */
button[onclick*="approveUser"] {
    animation: approvalPulse 2s infinite;
}
@keyframes approvalPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
}

/* Mobile menu button hidden by default */
.mobile-menu-btn { display: none; }

/* Command Palette */
.cmd-item { display:flex; align-items:center; gap:12px; padding:12px 24px; cursor:pointer; text-decoration:none; color:var(--text); transition:background 0.1s; }
.cmd-item:hover, .cmd-item.active { background:var(--surface-1); }
.cmd-item .cmd-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; }
.cmd-item .cmd-title { font-weight:600; font-size:14px; }
.cmd-item .cmd-desc { font-size:12px; color:var(--text-muted); }

