/* ════════════════════════════════════════════════════════════════════
   SalonOS — app.css
   Professional ERP stylesheet — Bootstrap 5 base
   ════════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────────── */
:root {
  --sidebar-width: 248px;
  --header-height: 60px;

  --color-primary:       #7C3AED;
  --color-primary-hover: #6D28D9;
  --color-primary-light: #EDE9FE;
  --color-success:       #059669;
  --color-warning:       #D97706;
  --color-danger:        #DC2626;

  --sidebar-bg:          #16112B;
  --sidebar-border:      rgba(255,255,255,0.06);
  --sidebar-text:        #A89BC8;
  --sidebar-text-hover:  #E9E3FF;
  --sidebar-active-bg:   rgba(124,58,237,0.18);
  --sidebar-active-text: #C4B5FD;

  --surface:             #F5F3FF;
  --card-bg:             #FFFFFF;
  --border:              #E5E7EB;
  --text-primary:        #111827;
  --text-muted:          #6B7280;

  --radius:              12px;
  --radius-sm:           8px;
  --shadow-sm:           0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:           0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-hover); }

/* ══════════════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════════════ */

body.erp-body { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.erp-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform 0.25s ease, width 0.25s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}
.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--color-primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-branch-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--sidebar-border);
  margin: 0;
}
.branch-icon {
  width: 32px; height: 32px;
  background: rgba(124,58,237,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #C4B5FD; font-size: 15px; flex-shrink: 0;
}
.branch-icon.super { background: rgba(245,158,11,0.2); color: #FCD34D; }
.branch-label { font-size: 13px; font-weight: 600; color: #E9E3FF; line-height: 1.2; }
.branch-role  { font-size: 11px; color: var(--sidebar-text); }

.sidebar-nav {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 10px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav li { margin-bottom: 2px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}
.sidebar-link i { font-size: 16px; min-width: 20px; }
.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: var(--sidebar-text-hover);
}
.sidebar-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}
.active-dot {
  width: 6px; height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  position: absolute; right: 12px;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--color-primary), #A855F7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; color: #E9E3FF; line-height: 1.2; }
.logout-link { font-size: 11px; color: var(--sidebar-text); text-decoration: none; }
.logout-link:hover { color: #FCA5A5; }

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

.erp-content {
  flex: 1;
  padding: 24px 28px;
}

.erp-footer {
  padding: 12px 28px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

/* ── Header ─────────────────────────────────────────────────────────── */
.erp-header {
  height: var(--header-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
  gap: 16px;
}
.header-left, .header-right {
  display: flex; align-items: center; gap: 12px;
}
.sidebar-toggle {
  border: none; background: transparent;
  font-size: 20px; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: all 0.15s;
}
.sidebar-toggle:hover { background: var(--surface); color: var(--text-primary); }

.header-date {
  font-size: 12.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.header-alert {
  position: relative;
  color: var(--color-warning);
  font-size: 18px;
  text-decoration: none;
  display: flex; align-items: center;
}
.alert-count {
  position: absolute; top: -6px; right: -7px;
  background: var(--color-danger);
  color: #fff; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.header-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.header-user-btn:hover { background: var(--surface); }
.header-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--color-primary), #A855F7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.breadcrumb { font-size: 13px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════════
   PAGE ELEMENTS
   ══════════════════════════════════════════════════════════════════════ */

/* ── Page Header ────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title  { font-size: 20px; font-weight: 700; margin: 0; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

/* ── Card Box ───────────────────────────────────────────────────────── */
.card-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.card-box-header h6 {
  font-size: 14px; font-weight: 600; margin: 0;
  color: var(--text-primary);
}
.card-box-body { padding: 20px; }
.card-box-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #FAFAFA;
}

/* ── Stat Cards ─────────────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.stat-sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.table.erp-table { margin: 0; }
.table.erp-table thead th {
  background: #F9FAFB;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  white-space: nowrap;
}
.table.erp-table tbody td {
  padding: 11px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #F3F4F6;
  font-size: 13.5px;
}
.table.erp-table tbody tr:last-child td { border-bottom: none; }
.table.erp-table tbody tr:hover td { background: #FAFAFF; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 500;
}
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 6px;
  line-height: 1.5;
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 5px; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: 0.2px; }

/* ── Info rows ──────────────────────────────────────────────────────── */
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 13px;
  gap: 8px;
}
.info-row:last-child { border-bottom: none; }
.info-row > span:first-child { color: var(--text-muted); flex-shrink: 0; }

/* ── Notes block ────────────────────────────────────────────────────── */
.notes-block {
  background: #F9FAFB;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Avatars ────────────────────────────────────────────────────────── */
.table-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #7C3AED22, #A855F744);
  border: 1px solid var(--color-primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}
.profile-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--color-primary), #A855F7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
}

/* ── Pager ──────────────────────────────────────────────────────────── */
.pagination { margin: 0; }
.pagination .page-link {
  font-size: 13px; padding: 6px 12px;
  color: var(--color-primary);
  border-color: var(--border);
}
.pagination .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* ══════════════════════════════════════════════════════════════════════
   AUTH PAGE
   ══════════════════════════════════════════════════════════════════════ */
body.auth-body {
  background: linear-gradient(135deg, #16112B 0%, #1E1340 50%, #2D1B5E 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.auth-wrapper { width: 100%; max-width: 420px; padding: 24px; }
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--color-primary), #A855F7);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  margin: 0 auto 12px;
}
.auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--text-primary); margin: 0 0 4px; }
.auth-logo p  { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ══════════════════════════════════════════════════════════════════════
   BILLING / POS
   ══════════════════════════════════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.product-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--card-bg);
}
.product-chip:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.product-chip.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.product-chip-icon { font-size: 18px; flex-shrink: 0; }

.pos-search-wrap input { border-radius: 10px; }

.payment-method-btn {
  flex: 1;
  text-align: center;
  cursor: pointer;
}
.payment-method-btn input { display: none; }
.payment-method-btn span {
  display: block;
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}
.payment-method-btn input:checked + span {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ── Invoice ─────────────────────────────────────────────────────────── */
.invoice-brand { font-size: 20px; font-weight: 700; color: var(--color-primary); }
.invoice-header { background: #FAFAFF; }

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  .erp-sidebar { transform: translateX(-100%); }
  .erp-sidebar.open { transform: translateX(0); }
  .erp-main { margin-left: 0; }
  .erp-content { padding: 16px; }
  .erp-header { padding: 0 16px; }
}

@media (max-width: 576px) {
  .stat-card { padding: 14px; }
  .stat-value { font-size: 18px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Utility ─────────────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.font-monospace { font-family: 'Courier New', monospace; }
.letter-spacing  { letter-spacing: 1px; }

/* ─── Append this to the bottom of your existing public/assets/css/app.css ─── */

/* Sidebar section label */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-text);
  opacity: 0.5;
  padding: 8px 12px 4px;
  margin-top: 4px;
}

/* Attendance status badges in tables */
.att-P { background:#D1FAE5; color:#065F46; }
.att-A { background:#FEE2E2; color:#991B1B; }
.att-L { background:#FEF3C7; color:#92400E; }
.att-H { background:#DBEAFE; color:#1E3A8A; }

/* ── Add this to the bottom of public/assets/css/app.css ── */

/* Sidebar sub-links (report sub-items) */
.sidebar-link.sidebar-sub {
  padding-left: 28px;
  font-size: 12.5px;
  opacity: 0.85;
}
.sidebar-link.sidebar-sub.active {
  opacity: 1;
  background: rgba(124,58,237,0.12);
}
.sidebar-link.sidebar-sub i {
  font-size: 14px;
}
