/* ============================================================
   BARBERPRO - Premium SaaS Design System
   Dark Mode | Glassmorphism | Gradients | Animations
   Inspired by: Stripe, Notion, Booksy, Fresha
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-border: rgba(255, 255, 255, 0.08);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: #b2b2c8;
    --text-tertiary: #7c7c9a;
    --text-muted: #5a5a7a;

    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5541d7;
    --primary-glow: rgba(108, 92, 231, 0.3);
    --secondary: #00cec9;
    --secondary-light: #55efc4;
    --accent: #fd79a8;
    --accent-light: #fab1a0;

    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --info: #0984e3;

    --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --gradient-accent: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    --gradient-success: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    --gradient-warning: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
    --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px var(--primary-glow);
    --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

/* --- Glassmorphism --- */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}
.glass-card:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-main);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(108, 92, 231, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--bg-glass-border);
}
.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255,255,255,0.15);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}
.btn-success:hover { box-shadow: 0 6px 25px rgba(0, 184, 148, 0.5); transform: translateY(-1px); }

.btn-danger {
    background: var(--gradient-warning);
    color: #fff;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-glass); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-full); width: 36px; height: 36px; }
.btn-block { width: 100%; }

/* --- Forms --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-secondary);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b2b2c8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-error { color: var(--danger); font-size: 0.8rem; }
.form-input.error { border-color: var(--danger); }

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}
.card:hover { border-color: rgba(255,255,255,0.1); }

.card-gradient {
    background: var(--gradient-glass);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* --- Stats Cards --- */
.stat-card {
    background: var(--gradient-glass);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255,255,255,0.1);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.purple::before { background: var(--gradient-primary); }
.stat-card.teal::before { background: var(--gradient-success); }
.stat-card.pink::before { background: var(--gradient-accent); }
.stat-card.orange::before { background: var(--gradient-warning); }

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    margin-bottom: 16px;
}
.stat-card.purple .stat-icon { background: rgba(108, 92, 231, 0.15); color: var(--primary-light); }
.stat-card.teal .stat-icon { background: rgba(0, 206, 201, 0.15); color: var(--secondary); }
.stat-card.pink .stat-icon { background: rgba(253, 121, 168, 0.15); color: var(--accent); }
.stat-card.orange .stat-icon { background: rgba(225, 112, 85, 0.15); color: var(--danger); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
}
.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    height: var(--header-height);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo img { height: 36px; width: 36px; border-radius: var(--radius-sm); }
.sidebar-logo span {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 24px;
}
.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}
.sidebar-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}
.sidebar-item.active {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-light);
}
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}
.sidebar-item .icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}
.sidebar-item .badge {
    margin-left: auto;
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.sidebar-user:hover { background: var(--bg-glass); }
.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.sidebar-user-info { flex: 1; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; }
.sidebar-user-role { font-size: 0.75rem; color: var(--text-tertiary); }

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    transition: var(--transition);
}

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

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

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    width: 320px;
    transition: var(--transition);
}
.header-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.header-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
    font-family: var(--font-main);
}
.header-search input::placeholder { color: var(--text-muted); }

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 32px;
    min-height: calc(100vh - var(--header-height));
    transition: var(--transition);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.page-description {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* --- Grid --- */
.grid {
    display: grid;
    gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-sidebar { grid-template-columns: 1fr 380px; }

/* --- Tables --- */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.06);
}

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

thead th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody td {
    padding: 12px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

tbody tr {
    transition: var(--transition);
}
tbody tr:hover {
    background: var(--bg-glass);
}
tbody tr:last-child td { border-bottom: none; }

/* --- Status Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(0, 184, 148, 0.15); color: var(--success); }
.badge-warning { background: rgba(253, 203, 110, 0.15); color: var(--warning); }
.badge-danger { background: rgba(225, 112, 85, 0.15); color: var(--danger); }
.badge-info { background: rgba(9, 132, 227, 0.15); color: var(--info); }
.badge-purple { background: rgba(108, 92, 231, 0.15); color: var(--primary-light); }
.badge-neutral { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* --- Alert / Toast --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(20px);
}
.toast.success { border-color: rgba(0, 184, 148, 0.3); }
.toast.error { border-color: rgba(225, 112, 85, 0.3); }
.toast.warning { border-color: rgba(253, 203, 110, 0.3); }
.toast-icon { font-size: 1.2rem; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast-message { flex: 1; font-size: 0.9rem; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

/* --- Avatar --- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-tertiary);
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }
.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
}

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, 
        var(--bg-tertiary) 25%, 
        rgba(255,255,255,0.05) 50%, 
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}
.tab {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    font-family: var(--font-main);
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide-up { animation: slideUp 0.4s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce { animation: bounce 2s ease-in-out infinite; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* --- Responsive --- */
@media (max-width: 1400px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1200px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-sidebar { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .sidebar { 
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .sidebar.open { transform: translateX(0); }
    .header { left: 0; }
    .main-content { margin-left: 0; }
    .header-search { width: 200px; }
}

@media (max-width: 768px) {
    .main-content { padding: 16px; }
    .page-header { flex-direction: column; gap: 16px; align-items: flex-start; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .header-search { display: none; }
    .mobile-search { display: flex !important; }
    .modal { margin: 16px; padding: 24px; }
    .tabs { overflow-x: auto; }
}

/* --- Calendar Specific --- */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.calendar-title { font-size: 1.1rem; font-weight: 700; }
.calendar-nav {
    display: flex;
    gap: 6px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.calendar-day-header {
    padding: 6px 8px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    background: var(--bg-secondary);
}
.calendar-day {
    min-height: 60px;
    padding: 4px 6px;
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
}
.calendar-day:hover { background: var(--bg-glass); }
.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today { 
    border: 1px solid var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.calendar-day-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.calendar-day.today .calendar-day-number {
    color: var(--primary-light);
}
.calendar-event {
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* --- Charts --- */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* --- Timeline / Agenda --- */
.timeline {
    position: relative;
    padding-left: 60px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.06);
}
.timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.timeline-item:hover { background: var(--bg-glass); }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -46px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--primary);
    border: 3px solid var(--bg-primary);
}
.timeline-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

/* --- Login / Auth Pages --- */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}
.auth-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108,92,231,0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: pulse 4s ease-in-out infinite;
}
.auth-screen::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,206,201,0.1) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: pulse 5s ease-in-out infinite;
}
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: rgba(18, 18, 26, 0.9);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo img { height: 48px; margin-bottom: 12px; }
.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
}
.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* --- Mobile Bottom Nav --- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}
.mobile-nav-item.active { color: var(--primary-light); }
.mobile-nav-item .icon { font-size: 1.2rem; }

@media (max-width: 992px) {
    .mobile-bottom-nav { display: flex; justify-content: space-between; padding: 8px 4px; }
    .mobile-nav-item { padding: 8px 4px; min-width: 0; flex-shrink: 1; }
    .main-content { padding-bottom: 80px; }
}

@media (max-width: 480px) {
    .mobile-nav-item { font-size: 0.55rem; padding: 6px 2px; }
    .mobile-nav-item .icon { font-size: 1rem; }
}

/* --- Dark Mode Toggle --- */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}
.theme-toggle:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

/* --- Notification Bell --- */
.notification-bell {
    position: relative;
}
.notification-bell .badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--accent);
    border: 2px solid var(--bg-primary);
}

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}
.progress-bar-fill.primary { background: var(--gradient-primary); }
.progress-bar-fill.success { background: var(--gradient-success); }
.progress-bar-fill.warning { background: var(--gradient-warning); }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* --- Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    z-index: 150;
    animation: scaleIn 0.15s ease;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-main);
}
.dropdown-item:hover { background: var(--bg-glass); color: var(--text-primary); }
.dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 4px 0;
}

/* --- Tooltip --- */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    margin-bottom: 6px;
}
[data-tooltip]:hover::after { opacity: 1; }

/* --- Page Loading Progress --- */
.nprogress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* --- POS / PDV Specific --- */
.pdv-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    min-height: calc(100vh - var(--header-height) - 64px);
}
.pdv-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.pdv-cart {
    position: sticky;
    top: calc(var(--header-height) + 32px);
    height: fit-content;
}
.pdv-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

@media (max-width: 1200px) {
    .pdv-container { grid-template-columns: 1fr; }
}

/* --- QR Code Scanner --- */
.scanner-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}
.scanner-container video {
    width: 100%;
    border-radius: var(--radius-lg);
}

/* --- Print Styles --- */
@media print {
    .sidebar, .header, .mobile-bottom-nav, .btn { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    body { background: #fff; color: #000; }
}

/* --- Utility --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* --- Ad Slots --- */
.ad-slot-sidebar {
    padding: 8px 12px;
    margin: 4px 0;
    font-size: 0.75rem;
    text-align: center;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.ad-slot-sidebar ins,
.ad-slot-sidebar iframe {
    max-width: 100%;
}
.ad-slot-footer {
    padding: 16px;
    margin: 0 auto;
    max-width: 728px;
    text-align: center;
    overflow: hidden;
}
.ad-slot-between {
    text-align: center;
    overflow: hidden;
    padding: 8px 0;
}
