/* ==========================================================================
   Little Hermitage POS — design system
   Every page uses this shared stylesheet; page-level <style> blocks only
   add small, page-specific rules on top of it.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root{
  --bg:            #f6f7fb;
  --surface:       #ffffff;
  --surface-2:     #f4f5fa;
  --border:        #e7e9f2;
  --text:          #14162b;
  --text-muted:    #6b7086;

  --primary:       #6d5ef8;
  --primary-dark:  #5a47f0;
  --primary-light: #efecff;

  --success:       #16a679;
  --success-light: #e2f7ef;
  --warning:       #f5a524;
  --warning-light: #fef3e0;
  --danger:        #f0426b;
  --danger-light:  #fde5ec;
  --info:          #2e9bf0;
  --info-light:    #e6f4fe;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(20,22,43,.05), 0 1px 1px rgba(20,22,43,.04);
  --shadow:    0 8px 24px rgba(20,22,43,.08);
  --shadow-lg: 0 20px 48px rgba(20,22,43,.16);

  --header-h: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
::selection{ background: var(--primary-light); color: var(--primary-dark); }

/* ---------- layout ---------- */
.page{ max-width:1200px; margin:0 auto; padding:24px 20px 60px; }
.page--narrow{ max-width:820px; }
.page--wide{ max-width:1440px; }

.topbar{
  height: var(--header-h);
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:0 22px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom:1px solid var(--border);
  position: sticky; top:0; z-index: 500;
}
.topbar__title{ font-size:17px; font-weight:800; letter-spacing:-.01em; display:flex; align-items:center; gap:9px; }
.topbar__actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

.card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card{ margin-top:16px; }

.grid{ display:grid; gap:16px; }
.grid--cards{ grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }

h1,h2,h3{ margin:0 0 12px; letter-spacing:-.015em; }
h1{ font-size:25px; font-weight:800; }
h2{ font-size:19px; font-weight:800; }
h3{ font-size:13px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; }
p{ margin:0 0 10px; line-height:1.55; }

.muted{ color:var(--text-muted); }
.text-right{ text-align:right; }
.text-center{ text-align:center; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 18px; border:none; border-radius: var(--radius-sm);
  font-family:inherit; font-size:14.5px; font-weight:700;
  cursor:pointer; transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, background .15s ease;
  background: var(--surface-2); color: var(--text); line-height:1.2;
}
.btn:hover{ opacity:.94; }
.btn:active{ transform: scale(.96); }
.btn:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.btn--primary{ background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color:#fff; box-shadow: 0 6px 16px rgba(109,94,248,.35); }
.btn--primary:hover{ box-shadow: 0 8px 20px rgba(109,94,248,.45); }
.btn--success{ background: var(--success); color:#fff; }
.btn--warning{ background: var(--warning); color:#fff; }
.btn--danger{ background: var(--danger); color:#fff; }
.btn--info{ background: var(--info); color:#fff; }
.btn--ghost{ background:transparent; border:1px solid var(--border); }
.btn--ghost:hover{ background: var(--surface-2); }
.btn--dark{ background:#14162b; color:#fff; }
.btn--sm{ padding:8px 13px; font-size:13px; border-radius:9px; }
.btn--block{ width:100%; }
.btn--icon{ padding:9px; width:38px; height:38px; }

/* ---------- forms ---------- */
label{ display:block; font-size:12.5px; font-weight:700; color:var(--text-muted); margin:0 0 6px; text-transform:uppercase; letter-spacing:.03em; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=email], input[type=search], select, textarea{
  width:100%; padding:12px 14px; font-size:15px; font-family:inherit;
  border:1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color:var(--text); outline:none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.field{ margin-bottom:14px; }
.form-row{ display:flex; gap:12px; flex-wrap:wrap; }
.form-row > *{ flex:1 1 160px; }
form.inline{ display:inline-flex; gap:8px; align-items:center; }

/* ---------- table ---------- */
.table-wrap{ overflow-x:auto; border-radius: var(--radius); border:1px solid var(--border); }
table{ width:100%; border-collapse:collapse; background: var(--surface); font-size:14.5px; }
thead th{
  text-align:left; padding:13px 15px; font-size:11.5px; font-weight:800;
  text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted);
  background:var(--surface-2); white-space:nowrap; border-bottom:1px solid var(--border);
}
tbody td{ padding:13px 15px; border-top:1px solid var(--border); vertical-align:middle; }
tbody tr:hover{ background: var(--surface-2); }

@media (max-width:720px){
  .table-wrap{ border:none; }
  table, thead, tbody, th, td, tr{ display:block; }
  thead{ display:none; }
  tbody tr{
    background:var(--surface); border:1px solid var(--border);
    border-radius: var(--radius); padding:12px 16px; margin-bottom:12px; box-shadow:var(--shadow-sm);
  }
  tbody td{ border:none; padding:7px 0; display:flex; justify-content:space-between; gap:10px; }
  tbody td::before{ content:attr(data-label); font-weight:700; color:var(--text-muted); font-size:11.5px; text-transform:uppercase; letter-spacing:.03em; }
}

/* ---------- badges / alerts ---------- */
.badge{ display:inline-block; padding:4px 11px; border-radius:999px; font-size:11.5px; font-weight:800; letter-spacing:.02em; }
.badge--primary{ background:var(--primary-light); color:var(--primary-dark); }
.badge--success{ background:var(--success-light); color:#0d7a5a; }
.badge--warning{ background:var(--warning-light); color:#9a6510; }
.badge--danger{ background:var(--danger-light); color:#b41f49; }

.alert{ padding:14px 17px; border-radius: var(--radius-sm); margin-bottom:16px; font-weight:600; font-size:14.5px; }
.alert--success{ background:var(--success-light); color:#0d7a5a; }
.alert--danger{ background:var(--danger-light); color:#b41f49; }

/* ---------- misc ---------- */
.top-actions{ display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.hr{ height:1px; background:var(--border); margin:18px 0; border:none; }
.scroll-x{ display:flex; gap:10px; overflow-x:auto; padding-bottom:4px; }
.scroll-x::-webkit-scrollbar{ height:6px; }
.scroll-x::-webkit-scrollbar-thumb{ background:var(--border); border-radius:99px; }

.modal-backdrop{
  display:none; position:fixed; inset:0; background:rgba(20,22,43,.55);
  align-items:center; justify-content:center; z-index:2000; padding:16px;
  backdrop-filter: blur(3px);
}
.modal-backdrop.open{ display:flex; }
.modal{ background:var(--surface); border-radius: var(--radius-lg); padding:24px; width:100%; max-width:420px; box-shadow:var(--shadow-lg); }
.modal h3{ font-size:17px; font-weight:800; color:var(--text); text-transform:none; letter-spacing:normal; margin-bottom:16px; }

@media (max-width:600px){
  .page{ padding:16px 14px 50px; }
  .card{ padding:17px; border-radius: var(--radius-sm); }
  .topbar{ padding:0 14px; }
}
