/* ===== باربر برو - ثيم إدارة صالونات الحلاقة ===== */
:root {
    --gold: #c9a227;
    --gold-dark: #a8871d;
    --gold-light: #f3e2a3;
    --sidebar-bg: #14141a;
    --sidebar-hover: #1f1f28;
    --body-bg: #f4f5f7;
    --card-bg: #ffffff;
    --text-main: #1c1e26;
    --text-muted: #7a7f8c;
    --border: #e7e9ee;
    --danger: #e5484d;
    --success: #30a46c;
    --radius: 14px;
    --sidebar-w: 264px;
}

* { font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; }

html, body { background: var(--body-bg); color: var(--text-main); }

a { text-decoration: none; }

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

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #14141a 0%, #0d0d12 100%);
    color: #cfd2dc;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}

.sidebar .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar .brand .logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--gold) 0%, #7d6310 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #14141a;
    box-shadow: 0 6px 18px rgba(201,162,39,.35);
}

.sidebar .brand b { color: #fff; font-size: 17px; display: block; line-height: 1.2; }
.sidebar .brand span { font-size: 11px; color: var(--gold); letter-spacing: .5px; }

.sidebar .menu { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar .menu-label { font-size: 11px; color: #666c7c; padding: 12px 12px 6px; letter-spacing: .5px; }

.sidebar .menu a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px; margin-bottom: 3px;
    border-radius: 10px; color: #b9bdc9;
    font-size: 14.5px; font-weight: 500;
    transition: all .15s;
}
.sidebar .menu a i { font-size: 17px; width: 20px; text-align: center; opacity: .85; }
.sidebar .menu a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .menu a.active {
    background: linear-gradient(90deg, rgba(201,162,39,.22), rgba(201,162,39,.06));
    color: var(--gold);
    border-right: 3px solid var(--gold);
    font-weight: 700;
}
.sidebar .menu a.active i { opacity: 1; }
.sidebar .sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #666c7c; }

.main-area { flex: 1; margin-right: var(--sidebar-w); min-width: 0; }

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 26px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1030;
    gap: 14px;
}
.topbar .page-title { font-size: 18px; font-weight: 800; margin: 0; }
.topbar .page-title small { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 26px; }

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(16,20,30,.04);
}
.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 800;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card .card-body { padding: 20px; }

/* ---------- Stat cards ---------- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex; align-items: center; gap: 15px;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16,20,30,.07); }
.stat-card .icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 23px; flex-shrink: 0;
}
.stat-card .num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card .lbl { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; font-size: 14px; padding: 8px 16px; }
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #14141a; border: none;
    box-shadow: 0 4px 12px rgba(201,162,39,.3);
}
.btn-gold:hover { filter: brightness(1.06); color: #000; box-shadow: 0 6px 16px rgba(201,162,39,.42); }
.btn-dark-soft { background: #1c1e26; color: #fff; border: none; }
.btn-dark-soft:hover { background: #2a2d38; color: #fff; }
.btn-outline-soft { border: 1px solid var(--border); background: #fff; color: var(--text-main); }
.btn-outline-soft:hover { background: #f7f8fa; }

/* ---------- Tables ---------- */
.table { margin: 0; }
.table thead th {
    background: #fafbfc;
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid #f1f2f5; vertical-align: middle; font-size: 14px; }
.table tbody tr:hover { background: #fcfcfd; }
.table td .sub { font-size: 12px; color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge-status { font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.badge-warning { background: #fff3d6; color: #9a6b00; }
.badge-info { background: #dff1ff; color: #0b6bb8; }
.badge-primary { background: #e6e9ff; color: #3b4cca; }
.badge-success { background: #dcf5e7; color: #16794a; }
.badge-secondary { background: #eceef2; color: #5c6270; }
.badge-danger { background: #fde5e6; color: #b3261e; }

/* ---------- Forms ---------- */
.form-label { font-size: 13.5px; font-weight: 700; color: #444a57; margin-bottom: 6px; }
.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid var(--border);
    padding: 9px 14px;
    font-size: 14px;
    background: #fff;
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 .18rem rgba(201,162,39,.18);
}
.input-group-text { border-radius: 10px; background: #f7f8fa; border: 1.5px solid var(--border); font-size: 14px; }

/* ---------- Calendar ---------- */
.calendar-grid {
    display: grid;
    gap: 6px;
    min-width: 760px;
}
.calendar-head {
    display: grid; gap: 6px;
    position: sticky; top: 62px; background: var(--body-bg);
    z-index: 5; padding-bottom: 4px;
}
.cal-time-col { text-align: center; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.cal-barber-head {
    background: #fff; border: 1px solid var(--border);
    border-radius: 10px; padding: 9px; text-align: center;
    font-weight: 800; font-size: 13.5px;
}
.cal-barber-head .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; }
.cal-row { display: grid; gap: 6px; }
.cal-cell {
    background: #fff;
    border: 1px dashed #e9ebf0;
    border-radius: 8px;
    min-height: 34px;
    cursor: pointer;
    transition: background .12s;
}
.cal-cell:hover { background: #fbf7e8; border-color: var(--gold); }
.cal-time {
    font-size: 11.5px; color: var(--text-muted);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 6px; font-weight: 700;
}
.cal-appt {
    border-radius: 9px;
    padding: 7px 9px;
    font-size: 12.5px;
    color: #fff;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.14);
    position: relative;
}
.cal-appt b { display: block; font-size: 13px; }
.cal-appt span { opacity: .9; font-size: 11.5px; }
.cal-appt.st-pending { background: #d99a06; }
.cal-appt.st-confirmed { background: #1f7ac4; }
.cal-appt.st-in_progress { background: #5b4dd1; }
.cal-appt.st-completed { background: #178f57; }
.cal-appt.st-cancelled { background: #9aa0ac; text-decoration: line-through; }
.cal-appt.st-no_show { background: #d33b40; }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.catalog-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.catalog-tabs .tab {
    padding: 8px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
    background: #f0f1f4; color: #5c6270; cursor: pointer; border: none;
}
.catalog-tabs .tab.active { background: #1c1e26; color: #fff; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.catalog-item {
    background: #fff; border: 1.5px solid var(--border); border-radius: 12px;
    padding: 13px; cursor: pointer; transition: all .13s; text-align: center;
}
.catalog-item:hover { border-color: var(--gold); background: #fffdf5; transform: translateY(-2px); }
.catalog-item .name { font-weight: 700; font-size: 13.5px; }
.catalog-item .price { color: var(--gold-dark); font-weight: 800; font-size: 14px; margin-top: 4px; }
.catalog-item .meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.cart-line { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.cart-line .info { flex: 1; }
.cart-line .info b { font-size: 13.5px; display: block; }
.cart-line .info small { color: var(--text-muted); font-size: 12px; }
.cart-qty { width: 76px; }
.cart-qty input { text-align: center; }
.cart-totals { background: #fafbfc; border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.cart-totals .row-t { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; color: #444a57; }
.cart-totals .row-t.total { font-size: 19px; font-weight: 800; color: var(--text-main); border-top: 2px dashed var(--border); margin-top: 6px; padding-top: 10px; }

/* ---------- Auth ---------- */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(201,162,39,.14), transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(201,162,39,.1), transparent 55%),
        #0d0d12;
    padding: 20px;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: #16161d;
    border: 1px solid #26262f;
    border-radius: 20px;
    padding: 38px 34px;
    color: #e8eaf0;
    box-shadow: 0 30px 70px rgba(0,0,0,.5);
}
.auth-card .logo-lg {
    width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--gold), #7d6310);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #14141a;
    box-shadow: 0 10px 26px rgba(201,162,39,.4);
}
.auth-card h1 { font-size: 22px; text-align: center; margin: 0 0 4px; color: #fff; }
.auth-card .sub { text-align: center; color: #8a8fa0; font-size: 13.5px; margin-bottom: 26px; }
.auth-card .form-label { color: #b9bdc9; }
.auth-card .form-control {
    background: #1e1e27; border-color: #2e2e3a; color: #fff;
}
.auth-card .form-control:focus { background: #1e1e27; color: #fff; border-color: var(--gold); }
.pole {
    width: 100%; height: 7px; border-radius: 99px; margin-bottom: 22px;
    background: repeating-linear-gradient(-45deg, #e5484d 0 12px, #fff 12px 24px, #1f7ac4 24px 36px, #fff 36px 48px);
    opacity: .85;
}

/* ---------- Misc ---------- */
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; color: #fff; background: var(--gold);
    flex-shrink: 0;
}
.alert { border-radius: 12px; font-size: 14px; border: none; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--gold); }
.text-muted-2 { color: var(--text-muted); font-size: 13px; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty-state i { font-size: 42px; opacity: .35; display: block; margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.kv:last-child { border: none; }
.kv .k { color: var(--text-muted); }
.kv .v { font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.legend .l { display: flex; align-items: center; gap: 6px; }
.legend .l i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.modal-content { border-radius: 16px; border: none; }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-title { font-weight: 800; font-size: 17px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

.pagination { gap: 6px; }
.pagination .page-link { border-radius: 9px; margin: 0 3px; border: 1px solid var(--border); color: #444a57; font-size: 13.5px; }
.pagination .page-item.active .page-link { background: #1c1e26; border-color: #1c1e26; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.show { transform: translateX(0); }
    .main-area { margin-right: 0; }
    .pos-layout { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1035; }
    .sidebar-backdrop.show { display: block; }
}

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-area { margin: 0 !important; }
    .content { padding: 0 !important; }
    .card { border: none; box-shadow: none; }
    body { background: #fff; }
}
