/* =========================================================================
   Sticker Order System - Admin UI
   ========================================================================= */

:root {
  --sos-primary: #4f46e5;
  --sos-primary-dark: #4338ca;
  --sos-bg: #f5f6fb;
  --sos-sidebar-bg: #1e1b3a;
  --sos-sidebar-text: #c7c4e6;
  --sos-sidebar-active: #4f46e5;
  --sos-card-radius: 14px;
  --sos-border: #e6e6f0;
}

* { box-sizing: border-box; }

body {
  background: var(--sos-bg);
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #24243a;
}

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

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sos-sidebar-bg);
  color: var(--sos-sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.35rem 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { color: #a5b4fc; font-size: 1.4rem; }

.sidebar-nav {
  flex: 1;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .9rem;
  border-radius: 10px;
  color: var(--sos-sidebar-text);
  text-decoration: none;
  font-size: .93rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--sos-sidebar-active); color: #fff; }

.sidebar-footer { padding: .9rem; border-top: 1px solid rgba(255,255,255,.08); }
.logout-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem; border-radius: 10px;
  color: #fca5a5; text-decoration: none; font-weight: 500; font-size: .93rem;
}
.logout-link:hover { background: rgba(248,113,113,.12); color: #fecaca; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.75rem;
  background: #fff;
  border-bottom: 1px solid var(--sos-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 1.25rem; font-weight: 700; margin: 0; flex: 1; }
.topbar-admin { display: flex; align-items: center; gap: .5rem; color: #55536e; font-weight: 500; font-size: .92rem; }
.topbar-admin i { font-size: 1.4rem; color: var(--sos-primary); }

.page-content { padding: 1.75rem; flex: 1; }
.page-footer { text-align: center; padding: 1rem; font-size: .8rem; color: #9997ad; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--sos-border);
  border-radius: var(--sos-card-radius);
  box-shadow: 0 1px 2px rgba(20,20,50,.03);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--sos-border);
  font-weight: 700;
  border-top-left-radius: var(--sos-card-radius) !important;
  border-top-right-radius: var(--sos-card-radius) !important;
}

.stat-card {
  border-radius: var(--sos-card-radius);
  border: 1px solid var(--sos-border);
  background: #fff;
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}
.stat-card .stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { font-size: .82rem; color: #74738a; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.bg-icon-indigo { background: #4f46e5; }
.bg-icon-amber  { background: #d97706; }
.bg-icon-green  { background: #059669; }
.bg-icon-red    { background: #dc2626; }
.bg-icon-blue   { background: #2563eb; }
.bg-icon-purple { background: #7c3aed; }

/* ---------- Badges ---------- */
.badge-status {
  display: inline-block;
  padding: .32rem .68rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: capitalize;
}
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-completed  { background: #d1fae5; color: #065f46; }
.badge-cancelled  { background: #fee2e2; color: #991b1b; }

/* ---------- Misc ---------- */
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6b6a80; border-bottom-width: 1px; }
.table td, .table th { vertical-align: middle; }
a { color: var(--sos-primary); }
.btn-primary { background: var(--sos-primary); border-color: var(--sos-primary); }
.btn-primary:hover { background: var(--sos-primary-dark); border-color: var(--sos-primary-dark); }
.btn-outline-primary { color: var(--sos-primary); border-color: var(--sos-primary); }
.btn-outline-primary:hover { background: var(--sos-primary); border-color: var(--sos-primary); }
.form-label { font-weight: 600; font-size: .88rem; }
.required::after { content: " *"; color: #dc2626; }

.customer-search-result {
  border: 1px solid var(--sos-border);
  border-radius: 10px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
}
.customer-search-result .item {
  padding: .6rem .9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--sos-border);
}
.customer-search-result .item:last-child { border-bottom: none; }
.customer-search-result .item:hover { background: #f0f0fb; }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b3a 0%, #4f46e5 100%);
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 50px rgba(20,20,60,.25);
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand i { font-size: 2.4rem; color: var(--sos-primary); }
.login-brand h1 { font-size: 1.25rem; font-weight: 800; margin: .5rem 0 0; }

/* Receipt */
.receipt-box {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: 1px dashed #c7c4e6;
  border-radius: 12px;
  padding: 1.75rem;
  font-family: "Courier New", monospace;
}
.receipt-box h2 { font-size: 1.1rem; font-weight: 800; text-align: center; margin-bottom: .1rem; }
.receipt-box .receipt-sub { text-align: center; font-size: .78rem; color: #666; margin-bottom: 1rem; }
.receipt-box table { width: 100%; font-size: .85rem; }
.receipt-box hr { border-top: 1px dashed #999; }

@media print {
  .sidebar, .topbar, .page-footer, .no-print { display: none !important; }
  .page-content { padding: 0; }
  body { background: #fff; }
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    z-index: 1050;
    transition: left .2s ease;
  }
  .sidebar.show { left: 0; }
}
