/* =====================================================================
   TIMORA — Watch Store Dashboard
   Theme: white-forward monochrome, futuristic type
   ===================================================================== */

:root{
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --surface-2: #fafafb;
  --ink:       #0a0a0b;   /* near-black */
  --ink-2:     #3a3a3f;
  --muted:     #8b8d94;
  --line:      #e7e8ec;
  --line-2:    #d9dade;
  --accent:    #0a0a0b;   /* monochrome accent = black */
  --accent-ink:#ffffff;
  --good:      #0f7a3d;
  --good-bg:   #e7f6ec;
  --bad:       #b3261e;
  --bad-bg:    #fbeceb;
  --warn:      #8a6d1a;
  --warn-bg:   #fbf3df;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(10,10,11,.04), 0 8px 24px rgba(10,10,11,.05);
  --shadow-lg: 0 24px 60px rgba(10,10,11,.14);
  --font:      'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display:   'Chakra Petch', var(--font);
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--ink);
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{ color:inherit; text-decoration:none; }
h1,h2,h3,h4{ margin:0; font-weight:600; letter-spacing:-.01em; }

/* ---------- Brand ---------- */
.brand-lockup{ display:flex; align-items:center; gap:12px; }
.brand-mark{
  width:42px; height:42px; border-radius:12px;
  background:var(--ink); color:#fff;
  display:grid; place-items:center;
  font-family:var(--display); font-weight:700; font-size:20px;
  letter-spacing:1px; overflow:hidden; flex:0 0 auto;
}
.brand-mark.has-logo{ background:#fff; border:1px solid var(--line); }
.brand-mark.has-logo img{ width:100%; height:100%; object-fit:contain; }
.brand-name{ font-family:var(--display); font-weight:700; font-size:18px; letter-spacing:2px; text-transform:uppercase; }
.brand-sub{ font-size:11px; color:var(--muted); letter-spacing:2px; text-transform:uppercase; }

/* =====================================================================
   LOGIN
   ===================================================================== */
.login-body{
  min-height:100vh; display:grid; place-items:center;
  background:
    radial-gradient(1200px 600px at 100% -10%, #eceef3 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #e9ebf0 0%, transparent 55%),
    var(--bg);
  padding:24px;
}
.login-card{
  width:100%; max-width:400px; background:var(--surface);
  border:1px solid var(--line); border-radius:22px;
  box-shadow:var(--shadow-lg); padding:34px 30px;
}
.brand-lockup.sidebar-brand{ margin-bottom:22px; }
.login-card .brand-lockup{ margin-bottom:26px; }
.login-form{ display:flex; flex-direction:column; gap:16px; margin-top:8px; }
.login-foot{ text-align:center; margin-top:22px; color:var(--muted); font-size:12px; letter-spacing:1px; }

.field{ display:flex; flex-direction:column; gap:7px; }
.field > span{ font-size:12px; color:var(--ink-2); font-weight:500; letter-spacing:.02em; }
input, select, textarea{
  width:100%; font-family:var(--font); font-size:14.5px; color:var(--ink);
  background:var(--surface-2); border:1px solid var(--line-2);
  border-radius:var(--radius-sm); padding:11px 13px; outline:none;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus{
  border-color:var(--ink); background:#fff; box-shadow:0 0 0 3px rgba(10,10,11,.07);
}
textarea{ resize:vertical; min-height:70px; }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn{
  display:inline-flex; align-items:center; gap:8px; justify-content:center;
  font-family:var(--font); font-size:13.5px; font-weight:600; letter-spacing:.01em;
  border:1px solid var(--line-2); background:var(--surface); color:var(--ink);
  border-radius:var(--radius-sm); padding:10px 16px; cursor:pointer;
  transition:transform .06s, box-shadow .15s, background .15s, border-color .15s;
  white-space:nowrap;
}
.btn:hover{ box-shadow:var(--shadow); }
.btn:active{ transform:translateY(1px); }
.btn svg{ width:16px; height:16px; }
.btn-primary{ background:var(--ink); color:#fff; border-color:var(--ink); }
.btn-primary:hover{ background:#000; }
.btn-ghost{ background:transparent; border-color:transparent; color:var(--ink-2); }
.btn-danger{ color:var(--bad); border-color:#f0d3d1; background:#fff; }
.btn-danger:hover{ background:var(--bad-bg); }
.btn-sm{ padding:7px 11px; font-size:12.5px; }
.btn-block{ width:100%; }
.btn-icon{ padding:8px; }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.layout{ display:flex; min-height:100vh; }
.sidebar{
  width:248px; flex:0 0 248px; background:var(--surface);
  border-right:1px solid var(--line); padding:22px 16px;
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
}
.nav{ display:flex; flex-direction:column; gap:3px; margin-top:26px; flex:1; }
.nav-item{
  display:flex; align-items:center; gap:12px; padding:10px 12px;
  border-radius:11px; color:var(--ink-2); font-weight:500; font-size:14px;
  transition:background .14s, color .14s;
}
.nav-item svg{ width:19px; height:19px; opacity:.85; }
.nav-item:hover{ background:var(--surface-2); color:var(--ink); }
.nav-item.is-active{ background:var(--ink); color:#fff; }
.nav-item.is-active svg{ opacity:1; }
.nav-logout{ margin-top:8px; border-top:1px solid var(--line); padding-top:16px; color:var(--muted); }
.nav-logout:hover{ color:var(--bad); }

.main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  position:sticky; top:0; z-index:20; display:flex; align-items:center; gap:16px;
  background:rgba(255,255,255,.82); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line); padding:14px 26px;
}
.page-title{ font-size:20px; font-weight:600; letter-spacing:-.02em; flex:1; }
.topbar-right{ display:flex; align-items:center; gap:14px; }
.cur-toggle{ display:flex; background:var(--surface-2); border:1px solid var(--line-2); border-radius:10px; overflow:hidden; }
.cur-toggle a{ padding:7px 12px; font-size:12.5px; font-weight:600; color:var(--muted); }
.cur-toggle a.is-on{ background:var(--ink); color:#fff; }
.user-chip{
  padding:7px 14px; border-radius:20px; background:var(--surface-2);
  border:1px solid var(--line-2); font-size:13px; font-weight:600; text-transform:capitalize;
}
.menu-toggle{ display:none; background:none; border:none; cursor:pointer; color:var(--ink); padding:4px; }
.menu-toggle svg{ width:24px; height:24px; }

.content{ padding:26px; flex:1; max-width:1320px; width:100%; }
.app-foot{
  display:flex; justify-content:space-between; padding:18px 26px;
  color:var(--muted); font-size:12px; border-top:1px solid var(--line); letter-spacing:.03em;
}

/* =====================================================================
   ALERTS
   ===================================================================== */
.alert{ padding:12px 15px; border-radius:var(--radius-sm); font-size:13.5px; margin-bottom:18px; border:1px solid transparent; }
.alert-success{ background:var(--good-bg); color:var(--good); border-color:#cfe9d8; }
.alert-error,.alert-danger{ background:var(--bad-bg); color:var(--bad); border-color:#f0d3d1; }
.alert-warn{ background:var(--warn-bg); color:var(--warn); border-color:#eeddb4; }

/* =====================================================================
   STAT CARDS
   ===================================================================== */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:22px; }
.stat-grid.cols-3{ grid-template-columns:repeat(3,1fr); }
.stat{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:18px 18px 16px; box-shadow:var(--shadow); position:relative; overflow:hidden;
}
.stat::after{ content:""; position:absolute; right:-30px; top:-30px; width:90px; height:90px; border-radius:50%; background:var(--surface-2); }
.stat-label{ font-size:11.5px; text-transform:uppercase; letter-spacing:.14em; color:var(--muted); font-weight:600; position:relative; }
.stat-value{ font-family:var(--display); font-size:23px; font-weight:600; margin-top:10px; letter-spacing:.01em; position:relative; }
.stat-sub{ font-size:12px; color:var(--muted); margin-top:6px; position:relative; }
.stat .ico{ position:absolute; top:16px; right:16px; width:20px; height:20px; color:var(--ink); opacity:.28; }
.trend-up{ color:var(--good); font-weight:600; }
.trend-down{ color:var(--bad); font-weight:600; }

/* =====================================================================
   PANELS / CARDS
   ===================================================================== */
.panel{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:22px; overflow:hidden; }
.panel-head{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 20px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.panel-head h2{ font-size:15.5px; letter-spacing:.01em; }
.panel-head .sub{ font-size:12.5px; color:var(--muted); }
.panel-body{ padding:20px; }
.panel-body.flush{ padding:0; }

.grid-2{ display:grid; grid-template-columns:1.6fr 1fr; gap:22px; }

/* =====================================================================
   TABLES
   ===================================================================== */
.table-wrap{ overflow-x:auto; }
table.data{ width:100%; border-collapse:collapse; font-size:13.5px; }
table.data th, table.data td{ text-align:left; padding:12px 16px; border-bottom:1px solid var(--line); white-space:nowrap; }
table.data th{ font-size:11px; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); font-weight:600; background:var(--surface-2); position:sticky; top:0; }
table.data tbody tr:hover{ background:var(--surface-2); }
table.data td.num, table.data th.num{ text-align:right; font-variant-numeric:tabular-nums; }
table.data .row-actions{ display:flex; gap:6px; justify-content:flex-end; }
.empty{ padding:40px 20px; text-align:center; color:var(--muted); }
.empty svg{ width:40px; height:40px; opacity:.35; margin-bottom:10px; }

.pill{ display:inline-block; padding:3px 10px; border-radius:20px; font-size:11.5px; font-weight:600; letter-spacing:.02em; }
.pill-good{ background:var(--good-bg); color:var(--good); }
.pill-bad{ background:var(--bad-bg); color:var(--bad); }
.pill-warn{ background:var(--warn-bg); color:var(--warn); }
.pill-mut{ background:var(--surface-2); color:var(--ink-2); border:1px solid var(--line-2); }

/* toolbar above tables */
.toolbar{ display:flex; align-items:center; gap:12px; margin-bottom:18px; flex-wrap:wrap; }
.toolbar .search{ flex:1; min-width:220px; position:relative; }
.toolbar .search input{ padding-left:38px; }
.toolbar .search svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--muted); }
.toolbar .spacer{ flex:1; }

/* =====================================================================
   FORMS / MODAL
   ===================================================================== */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-grid .full{ grid-column:1 / -1; }

.modal-backdrop{ position:fixed; inset:0; background:rgba(10,10,11,.42); backdrop-filter:blur(2px); display:none; z-index:60; }
.modal-backdrop.open{ display:block; }
.modal{
  position:fixed; z-index:70; top:50%; left:50%; transform:translate(-50%,-50%) scale(.97);
  width:min(620px,calc(100vw - 32px)); max-height:90vh; overflow:auto;
  background:var(--surface); border:1px solid var(--line); border-radius:20px;
  box-shadow:var(--shadow-lg); opacity:0; pointer-events:none; transition:opacity .16s, transform .16s;
}
.modal.open{ opacity:1; pointer-events:auto; transform:translate(-50%,-50%) scale(1); }
.modal-head{ display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); }
.modal-head h3{ font-size:16px; }
.modal-body{ padding:22px; }
.modal-foot{ display:flex; justify-content:flex-end; gap:10px; padding:16px 22px; border-top:1px solid var(--line); }
.modal-close{ background:none; border:none; cursor:pointer; color:var(--muted); padding:6px; border-radius:8px; }
.modal-close:hover{ background:var(--surface-2); color:var(--ink); }
.modal-close svg{ width:20px; height:20px; }

/* =====================================================================
   MINI BAR CHART (inline)
   ===================================================================== */
.bars{ display:flex; align-items:flex-end; gap:10px; height:180px; padding:10px 4px 0; }
.bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; height:100%; justify-content:flex-end; }
.bar{ width:100%; max-width:34px; background:var(--ink); border-radius:6px 6px 3px 3px; min-height:3px; transition:height .3s; }
.bar.alt{ background:var(--line-2); }
.bar-label{ font-size:10.5px; color:var(--muted); letter-spacing:.03em; }
.bar-legend{ display:flex; gap:16px; font-size:12px; color:var(--muted); margin-top:6px; }
.bar-legend i{ width:10px; height:10px; border-radius:3px; display:inline-block; margin-right:6px; vertical-align:-1px; }

.progress{ height:9px; background:var(--surface-2); border:1px solid var(--line-2); border-radius:20px; overflow:hidden; }
.progress > i{ display:block; height:100%; background:var(--ink); border-radius:20px; }

.kv{ display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px dashed var(--line); font-size:13.5px; }
.kv:last-child{ border-bottom:none; }
.kv .k{ color:var(--muted); }
.kv .v{ font-weight:600; font-variant-numeric:tabular-nums; }

.hint{ font-size:12.5px; color:var(--muted); margin-top:6px; }
.muted{ color:var(--muted); }
.right{ text-align:right; }
.mono{ font-variant-numeric:tabular-nums; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width:1024px){
  .stat-grid{ grid-template-columns:repeat(2,1fr); }
  .grid-2{ grid-template-columns:1fr; }
}
@media (max-width:820px){
  .sidebar{ position:fixed; z-index:80; left:0; top:0; transform:translateX(-100%); transition:transform .2s; box-shadow:var(--shadow-lg); }
  .sidebar.open{ transform:translateX(0); }
  .menu-toggle{ display:inline-flex; }
  .form-grid{ grid-template-columns:1fr; }
  .content{ padding:18px; }
}
@media (max-width:520px){
  .stat-grid{ grid-template-columns:1fr; }
  .cur-toggle a{ padding:7px 9px; }
  .user-chip{ display:none; }
}
