/* ===========================
   SalonFlow – Main Stylesheet
   =========================== */

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

:root {
    --primary:    #7C3AED;
    --primary-lt: #EDE9FE;
    --primary-dk: #5B21B6;
    --accent:     #F59E0B;
    --success:    #10B981;
    --danger:     #EF4444;
    --bg:         #F8F7FF;
    --surface:    #FFFFFF;
    --border:     #E5E7EB;
    --text:       #1F2937;
    --text-muted: #6B7280;
    --sidebar-w:  240px;
    --radius:     12px;
    --shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(124,58,237,.06);
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--primary-dk);
    display: flex; flex-direction: column;
    z-index: 100; overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 20px; font-size: 1.2rem; font-weight: 700;
    color: #fff; border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-icon { font-size: 1.5rem; }
.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 8px; margin-bottom: 2px;
    color: rgba(255,255,255,.75); text-decoration: none;
    font-size: .9rem; font-weight: 500; transition: all .15s;
    border: none; background: none; width: 100%; cursor: pointer;
    text-align: left;
}
.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,.12); color: #fff;
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.1); }
.logout-btn { color: rgba(255,255,255,.6); }
.logout-btn:hover { background: rgba(239,68,68,.2); color: #fca5a5; }

/* ---- MAIN CONTENT ---- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.page-header {
    background: var(--surface); padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.page-content { padding: 28px 32px; }

/* ---- CARDS ---- */
.card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
.card-header {
    padding: 18px 22px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: .95rem; display: flex;
    align-items: center; justify-content: space-between;
}
.card-body { padding: 22px; }

/* ---- STAT CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius);
    padding: 20px 22px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 700; margin-top: 6px; color: var(--primary); }
.stat-icon { font-size: 1.8rem; margin-bottom: 8px; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th { padding: 10px 16px; text-align: left; font-size: .78rem; font-weight: 600;
           text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
           background: var(--bg); border-bottom: 1px solid var(--border); }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-control {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: .9rem; font-family: inherit;
    background: var(--surface); color: var(--text); transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-lt); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: 8px; font-size: .9rem;
    font-weight: 500; border: none; cursor: pointer; transition: all .15s;
    text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.92); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-lt); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.92); }

/* ---- ALERTS ---- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: .9rem; margin-bottom: 18px; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-info    { background: var(--primary-lt); color: var(--primary-dk); border: 1px solid #C4B5FD; }

/* ---- BADGES ---- */
.badge { padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-primary { background: var(--primary-lt); color: var(--primary-dk); }

/* ====================================
   AUTH PAGES (login/register)
   ==================================== */
.auth-page {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; background: linear-gradient(135deg, var(--primary-dk) 0%, #4C1D95 100%);
    padding: 24px;
}
.auth-box {
    background: var(--surface); border-radius: 20px; padding: 40px;
    width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon { font-size: 3rem; }
.auth-logo-title { font-size: 1.6rem; font-weight: 700; color: var(--primary); margin-top: 8px; }
.auth-logo-sub { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.auth-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 22px; }

/* ====================================
   POS SCREEN
   ==================================== */
.pos-layout { display: grid; grid-template-columns: 1fr 340px; height: 100vh; overflow: hidden; }
.pos-services { overflow-y: auto; padding: 20px; background: var(--bg); }
.pos-sidebar { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.pos-header {
    padding: 16px 20px; background: var(--primary-dk); color: #fff;
    display: flex; align-items: center; justify-content: space-between;
}
.pos-header h1 { font-size: 1.1rem; font-weight: 700; }
.pos-employee { font-size: .85rem; opacity: .8; }
.pos-cart-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .95rem; }
.pos-cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.cart-item:last-child { border-bottom: none; }
.cart-item-name { color: var(--text); font-weight: 500; }
.cart-item-price { color: var(--primary); font-weight: 600; }
.cart-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; padding: 2px 6px; }
.pos-cart-footer { padding: 20px; border-top: 2px solid var(--border); }
.pos-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pos-total-label { font-size: 1rem; font-weight: 600; }
.pos-total-amount { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.pos-empty { text-align: center; color: var(--text-muted); padding: 32px 0; font-size: .9rem; }

/* Service Grid */
.category-section { margin-bottom: 24px; }
.category-title { font-size: .8rem; font-weight: 700; text-transform: uppercase;
                  letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; }
.service-btn {
    background: var(--surface); border: 2px solid var(--border); border-radius: 10px;
    padding: 16px 12px; text-align: center; cursor: pointer; transition: all .15s;
    font-family: inherit;
}
.service-btn:hover { border-color: var(--primary); background: var(--primary-lt); }
.service-btn.selected { border-color: var(--primary); background: var(--primary-lt); }
.service-btn-name { font-weight: 600; font-size: .9rem; display: block; color: var(--text); }
.service-btn-price { font-size: .85rem; color: var(--primary); font-weight: 700; margin-top: 4px; display: block; }

/* ====================================
   PIN PAD
   ==================================== */
.pin-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.pin-box { background: var(--surface); border-radius: 20px; padding: 36px; width: 340px; box-shadow: var(--shadow); text-align: center; }
.pin-display { font-size: 2rem; letter-spacing: .5rem; color: var(--primary); font-weight: 800; margin: 16px 0; min-height: 48px; }
.pin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 20px; }
.pin-key {
    padding: 18px; border-radius: 10px; border: 1.5px solid var(--border);
    font-size: 1.2rem; font-weight: 700; cursor: pointer; background: var(--surface);
    transition: all .1s; color: var(--text);
}
.pin-key:hover { background: var(--primary-lt); border-color: var(--primary); }
.pin-key.clear { color: var(--danger); }
.pin-key.submit { background: var(--primary); color: #fff; border-color: var(--primary); }
.pin-key.submit:hover { background: var(--primary-dk); }

/* ====================================
   Responsive tweaks
   ==================================== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; }
}

/* ====================================
   Utility
   ==================================== */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; }
.gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
