/* ==========================================================================
   Aurora Appointments — Global Styles
   ========================================================================== */

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

:root {
    --violet: #6d5bd0;
    --violet-dark: #4c3aad;
    --violet-light: #8b7ef0;
    --pink: #ee6fa8;
    --teal: #2dd4bf;
    --bg-deep: #0f0c1d;
    --ink: #1a1533;
    --ink-soft: #574f78;
    --paper: #ffffff;
    --paper-soft: #f7f6fb;
    --border: #e7e3f4;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warn: #b45309;
    --warn-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #2563eb;
    --info-bg: #dbeafe;
    --shadow-soft: 0 10px 30px -12px rgba(76, 58, 173, 0.25);
    --shadow-lift: 0 20px 45px -15px rgba(76, 58, 173, 0.35);
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
    background: var(--paper-soft);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand, .logo-mark {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--violet-light); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d6d0ec; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet-light); }

/* ==========================================================================
   Animated aurora background (used on auth pages)
   ========================================================================== */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 15% 20%, #7c5cf0 0%, transparent 45%),
                radial-gradient(circle at 85% 15%, #ee6fa8 0%, transparent 40%),
                radial-gradient(circle at 50% 90%, #2dd4bf 0%, transparent 45%),
                var(--bg-deep);
    overflow: hidden;
}
.aurora-bg span {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    background: rgba(255, 255, 255, 0.5);
    animation: float 14s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: .5; }
    50% { transform: translateY(-40px) translateX(20px); opacity: 1; }
}

/* ==========================================================================
   Auth pages (login / register)
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    width: 100%;
    max-width: 980px;
    min-height: 620px;
    background: var(--paper);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.45);
    animation: rise .7s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise {
    from { opacity: 0; transform: translateY(24px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-showcase {
    position: relative;
    background: linear-gradient(160deg, var(--violet) 0%, var(--violet-dark) 55%, #2c1f6b 100%);
    color: #fff;
    padding: 48px 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth-showcase::before,
.auth-showcase::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.auth-showcase::before { width: 320px; height: 320px; top: -120px; right: -100px; }
.auth-showcase::after { width: 220px; height: 220px; bottom: -80px; left: -60px; background: rgba(238,111,168,0.25); }

.auth-showcase .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    position: relative;
    z-index: 1;
}
.logo-mark {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--teal), var(--violet-light));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(45, 212, 191, 0.4);
}

.auth-showcase .headline {
    position: relative;
    z-index: 1;
}
.auth-showcase .headline h1 {
    font-size: 2.1rem;
    line-height: 1.25;
    font-weight: 800;
    margin: 0 0 14px;
}
.auth-showcase .headline p {
    color: rgba(255,255,255,0.78);
    line-height: 1.6;
    max-width: 380px;
}

.showcase-stats {
    display: flex;
    gap: 28px;
    position: relative;
    z-index: 1;
}
.showcase-stats div strong { display: block; font-size: 1.4rem; font-weight: 800; }
.showcase-stats div span { font-size: .8rem; color: rgba(255,255,255,0.7); }

.auth-form-side {
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-form-side h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 6px;
}
.auth-form-side .subtitle {
    color: var(--ink-soft);
    margin-bottom: 30px;
    font-size: .95rem;
}

.field {
    margin-bottom: 18px;
}
.field label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.field .input-wrap {
    position: relative;
}
.field input, .field select, .field textarea {
    width: 100%;
    padding: 13px 16px 13px 42px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--paper-soft);
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { padding-left: 16px; resize: vertical; min-height: 90px; }
.field select { padding-left: 16px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--violet-light);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(139, 126, 240, 0.15);
}
.field .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .55;
    font-size: 1rem;
    pointer-events: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: .95rem;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
    background: linear-gradient(135deg, var(--violet), var(--violet-dark));
    color: #fff;
    box-shadow: var(--shadow-soft);
    width: 100%;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--shadow-lift); }
.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--ink);
}
.btn-ghost:hover { border-color: var(--violet-light); color: var(--violet-dark); }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: 9px; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn-danger-soft:hover { background: var(--danger); color: #fff; }
.btn-success-soft { background: var(--success-bg); color: var(--success); }
.btn-success-soft:hover { background: var(--success); color: #fff; }
.btn-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border); background: #fff;
}
.btn-icon:hover { border-color: var(--violet-light); background: var(--paper-soft); }

.auth-footer-link {
    text-align: center;
    margin-top: 22px;
    font-size: .88rem;
    color: var(--ink-soft);
}
.auth-footer-link a { color: var(--violet-dark); font-weight: 700; }

.divider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--ink-soft);
    font-size: .78rem;
}
.divider-row::before, .divider-row::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.demo-box {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--paper-soft);
    border: 1px dashed var(--border);
    font-size: .8rem;
    color: var(--ink-soft);
    line-height: 1.6;
}
.demo-box strong { color: var(--ink); }

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: .87rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: rise .4s ease;
}
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-info { background: var(--info-bg); color: var(--info); }

/* ==========================================================================
   App shell (dashboards)
   ========================================================================== */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--ink) 0%, #241d47 100%);
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 36px;
    padding: 0 4px;
}
.sidebar nav { flex: 1; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 4px;
    transition: background .2s, color .2s, transform .15s;
}
.sidebar nav a .ico { font-size: 1.05rem; width: 22px; text-align: center; }
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active {
    background: linear-gradient(135deg, rgba(139,126,240,0.35), rgba(238,111,168,0.25));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.sidebar .user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 14px;
}
.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--violet-light));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    font-size: .9rem;
}
.user-chip .meta strong { display: block; font-size: .85rem; }
.user-chip .meta span { font-size: .72rem; color: rgba(255,255,255,0.55); text-transform: capitalize; }

.sidebar .logout-link {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 12px;
    color: rgba(255,255,255,0.65);
    font-weight: 600; font-size: .9rem;
    border: 1px solid rgba(255,255,255,0.1);
}
.sidebar .logout-link:hover { background: rgba(220,38,38,0.2); color: #fff; border-color: transparent; }

.main-content {
    padding: 34px 40px 60px;
    max-width: 1400px;
    width: 100%;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.topbar h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; }
.topbar p { color: var(--ink-soft); margin: 0; font-size: .92rem; }

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 14px;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { color: var(--ink-soft); font-size: .85rem; margin-top: 6px; }
.stat-card.violet .stat-icon { background: #ece9fb; color: var(--violet); }
.stat-card.teal .stat-icon { background: #d7f9f4; color: #0d9488; }
.stat-card.pink .stat-icon { background: #fde3ee; color: #db2777; }
.stat-card.amber .stat-icon { background: var(--warn-bg); color: var(--warn); }

/* Panel / card */
.panel {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}
.panel-header h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.panel-body { padding: 10px 0; }

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.search-box {
    position: relative;
}
.search-box input {
    padding: 10px 14px 10px 36px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--paper-soft);
    font-size: .88rem;
    width: 220px;
}
.search-box input:focus { outline: none; border-color: var(--violet-light); background: #fff; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .5; font-size: .85rem; }

.filter-pill {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink-soft);
}
.filter-pill:focus { outline: none; border-color: var(--violet-light); }

/* Table */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
table.data-table th {
    text-align: left;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-soft);
    padding: 12px 26px;
    background: var(--paper-soft);
    font-weight: 700;
}
table.data-table td {
    padding: 16px 26px;
    border-top: 1px solid var(--border);
    font-size: .9rem;
    vertical-align: middle;
}
table.data-table tbody tr { transition: background .15s ease; }
table.data-table tbody tr:hover { background: #faf9ff; }

.person-cell { display: flex; align-items: center; gap: 12px; }
.person-cell .avatar { width: 34px; height: 34px; font-size: .78rem; }
.person-cell strong { display: block; font-size: .88rem; }
.person-cell span { font-size: .76rem; color: var(--ink-soft); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    text-transform: capitalize;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.confirmed { background: var(--info-bg); color: var(--info); }
.badge.completed { background: var(--success-bg); color: var(--success); }
.badge.cancelled { background: var(--danger-bg); color: var(--danger); }

.row-actions { display: flex; gap: 8px; }

.status-select {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: .78rem;
    font-weight: 700;
    background: #fff;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-soft);
}
.empty-state .emoji { font-size: 2.6rem; margin-bottom: 12px; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 29, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: #fff;
    border-radius: 22px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 40px 90px -20px rgba(0,0,0,0.5);
    animation: rise .3s cubic-bezier(.2,.8,.2,1);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 9px;
    border: none;
    background: var(--paper-soft);
    font-size: 1rem;
    color: var(--ink-soft);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 24px 26px; }
.modal-footer {
    padding: 18px 26px 26px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* Toast */
.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: var(--shadow-lift);
    font-size: .87rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    border-left: 4px solid var(--success);
    animation: slideIn .3s ease;
}
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Cards grid (client booking / my appointments) */
.appt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.appt-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease;
}
.appt-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.appt-card .service-name { font-weight: 800; font-size: 1.02rem; margin-bottom: 6px; }
.appt-card .datetime { color: var(--ink-soft); font-size: .87rem; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.appt-card .notes { font-size: .85rem; color: var(--ink-soft); margin-bottom: 14px; line-height: 1.5; }
.appt-card .card-footer { display: flex; align-items: center; justify-content: space-between; }

/* Responsive */
@media (max-width: 980px) {
    .auth-card { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
    .sidebar .brand, .sidebar .user-chip, .sidebar .logout-link { display: none; }
    .sidebar nav { display: flex; flex: none; }
    .sidebar nav a { flex-direction: column; font-size: .68rem; padding: 8px 12px; }
    .main-content { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

/* Utility */
.text-muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.fade-in { animation: rise .5s ease; }
