/* ── Appointzy - Professional Salon Management UI ─────────────────────────── */
:root {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --accent: #db2777;
    --accent-light: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --sidebar-bg: #0f0f1a;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;

    --bg-main: #f4f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e1b4b;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.12);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Sora', sans-serif;

    --navbar-height: 60px;
    --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app-body { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 1;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.brand-tag { font-size: 10px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.5);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}
.sidebar-close:hover { color: #fff; background: rgba(255,255,255,.1); }

.sidebar-tenant {
    padding-top: 12px;
}
.tenant-card {
    background: rgba(124,58,237,.2);
    border: 1px solid rgba(124,58,237,.3);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,.8);
    font-size: 12px;
    font-weight: 600;
}
.tenant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.menu-section { margin-bottom: 8px; }
.menu-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,.25);
    padding: 12px 8px 6px;
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}
.menu-item i { font-size: 16px; min-width: 20px; text-align: center; }
.menu-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.menu-item.active {
    background: linear-gradient(135deg, rgba(124,58,237,.3), rgba(219,39,119,.2));
    color: #fff;
    font-weight: 600;
}
.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background: linear-gradient(180deg, var(--primary-light), var(--accent));
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info { flex: 1; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name-text { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-badge { font-size: 10px; color: var(--primary-light); font-weight: 500; }

.logout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,.15); }

/* ── Main Wrapper ────────────────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

/* ── Top Navbar ──────────────────────────────────────────────────────────── */
.top-navbar {
    height: var(--navbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.navbar-left, .navbar-right { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
    background: none; border: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}
.menu-toggle:hover { background: var(--bg-main); color: var(--primary); }

.breadcrumb { font-size: 13px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }

.nav-icon-btn {
    background: none; border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.nav-icon-btn:hover { background: var(--bg-main); color: var(--primary); }

.notif-badge {
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.user-avatar-btn {
    background: none; border: none; cursor: pointer; padding: 0;
    border-radius: 50%;
}
.top-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}

/* ── Notifications Dropdown ──────────────────────────────────────────────── */
.notif-dropdown { width: 320px; padding: 0; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.mark-all-read { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 500; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.notif-empty i { font-size: 24px; color: var(--success); }

/* ── Page Content ────────────────────────────────────────────────────────── */
.page-content { flex: 1; padding: 20px; }
.page-footer { padding: 12px 20px; text-align: center; color: var(--text-muted); border-top: 1px solid var(--border); font-size: 12px; background: var(--bg-card); }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-info h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.page-header-info p { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
}
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; background: transparent; border-top: 1px solid var(--border); }

/* ── KPI Cards ───────────────────────────────────────────────────────────── */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}
.kpi-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: .06;
    transform: translate(20px, -20px);
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.kpi-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.kpi-icon.purple { background: linear-gradient(135deg, #7c3aed22, #8b5cf633); color: var(--primary); }
.kpi-icon.pink { background: linear-gradient(135deg, #db277722, #ec489933); color: var(--accent); }
.kpi-icon.green { background: linear-gradient(135deg, #10b98122, #059669 33%); color: var(--success); }
.kpi-icon.amber { background: linear-gradient(135deg, #f59e0b22, #d9770633); color: var(--warning); }
.kpi-icon.cyan { background: linear-gradient(135deg, #06b6d422, #0891b233); color: var(--info); }

.kpi-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.kpi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 4px; }
.kpi-change { font-size: 11px; font-weight: 600; margin-top: 4px; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: white; box-shadow: 0 4px 12px rgba(124,58,237,.35); transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: white; }
.btn-accent:hover { box-shadow: 0 4px 12px rgba(219,39,119,.35); transform: translateY(-1px); }
.btn-outline-primary { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius-sm); background: var(--bg-main); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-icon:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 13px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,.12);
    outline: none;
}
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-text { font-size: 12px; color: var(--text-muted); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrapper { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.table { margin-bottom: 0; }
.table th {
    background: #f8f9fc;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 13px 16px; vertical-align: middle; border-bottom: 1px solid #f3f4f6; font-size: 13.5px; }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-completed { background: #e5e7eb; color: #374151; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-noshow { background: #fed7aa; color: #9a3412; }
.badge-inprogress { background: #dbeafe; color: #1e40af; }
.badge-rescheduled { background: #cffafe; color: #155e75; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-unpaid { background: #fef3c7; color: #92400e; }

/* ── Status indicator ────────────────────────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.green { background: var(--success); }
.status-dot.red { background: var(--danger); }
.status-dot.amber { background: var(--warning); }
.status-dot.gray { background: var(--text-muted); }

/* ── Login / Auth pages ──────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 50%, #1a0a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-container { width: 100%; max-width: 440px; }
.auth-card {
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-mark {
    width: 60px; height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: white;
}
.auth-logo h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text-primary); }
.auth-logo p { color: var(--text-secondary); font-size: 13px; }
.auth-divider { text-align: center; margin: 16px 0; position: relative; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { background: white; padding: 0 12px; color: var(--text-muted); font-size: 12px; position: relative; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state h4 { font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.empty-state p { font-size: 13px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .main-wrapper { margin-left: 0; }
    .page-content { padding: 16px; }
    .kpi-card { padding: 16px; }
    .kpi-value { font-size: 22px; }
    .auth-card { padding: 28px 24px; }
}

@media (max-width: 576px) {
    .page-header { flex-direction: column; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1; justify-content: center; }
    .top-navbar { padding: 0 12px; }
    .table-responsive { font-size: 12px; }
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }

.fade-in { animation: fadeInUp 0.35s ease both; }
.fade-in-1 { animation-delay: .05s; }
.fade-in-2 { animation-delay: .1s; }
.fade-in-3 { animation-delay: .15s; }
.fade-in-4 { animation-delay: .2s; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-primary-custom { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.bg-gradient-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.rounded-custom { border-radius: var(--radius); }
.shadow-custom { box-shadow: var(--shadow); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Search & Filter bar ─────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar .form-control, .filter-bar .form-select { max-width: 200px; }
.search-input-wrap { position: relative; }
.search-input-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; }
.search-input-wrap .form-control { padding-left: 34px; }

/* ── Stat ring ───────────────────────────────────────────────────────────── */
.stat-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }

/* ── Data loading skeleton ───────────────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-wave 1.4s infinite; border-radius: 4px; }
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
