/* ZANK POS Enterprise — Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────── */
:root {
  --c-900: #021E26;
  --c-800: #04363F;
  --c-600: #537A79;
  --c-400: #7FA9A3;
  --c-200: #BFC9C9;

  --text-primary: #E8EEEE;
  --text-secondary: var(--c-200);
  --text-muted: var(--c-400);

  --bg-base:   var(--c-900);
  --bg-surface: var(--c-800);
  --bg-elevated: #06424C;

  --border: rgba(83, 122, 121, 0.35);
  --border-active: var(--c-400);

  --accent: var(--c-400);
  --accent-hover: #96C2BB;

  --danger: #E05C5C;
  --success: #5BAB8E;
  --warning: #D4A853;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(2,30,38,.5);
  --shadow-md: 0 4px 16px rgba(2,30,38,.6);
  --shadow-lg: 0 8px 32px rgba(2,30,38,.7);

  --font: 'Inter', system-ui, sans-serif;
  --transition: 180ms ease;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ── Typography ─────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--text-secondary); }

/* ── Layout helpers ─────────────────────────────────── */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container--sm { max-width: 480px; }
.container--md { max-width: 720px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }
.grid { display: grid; }
.text-center { text-align: center; }

/* ── Card ───────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}
.card--sm { padding: 20px 24px; }
.card--elevated { background: var(--bg-elevated); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition), opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--c-900);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--c-900); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: rgba(127,169,163,.12); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--c-400); color: var(--text-primary); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #c94f4f; }

.btn--full { width: 100%; }
.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--sm { padding: 7px 14px; font-size: 0.8125rem; }

/* ── Form elements ──────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.form-input, .form-select {
  width: 100%;
  padding: 11px 14px;
  background: var(--c-900);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input::placeholder { color: var(--c-600); }
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127,169,163,.18);
}
.form-input.error { border-color: var(--danger); }
.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  min-height: 18px;
}
.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ── Badge / Status ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-success  { background: rgba(91,171,142,.18); color: #6DD3AD; }
.badge-danger   { background: rgba(224, 92, 92,.18); color: #F08080; }
.badge-warning  { background: rgba(212,168,83,.18);  color: #E4B860; }
.badge-neutral  { background: rgba(127,169,163,.12); color: var(--c-400); }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2,30,38,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.navbar__logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}
.navbar__logo span { color: var(--accent); }
.navbar__links { display: flex; align-items: center; gap: 8px; }
.navbar__link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}
.navbar__link:hover { color: var(--text-primary); background: rgba(127,169,163,.08); }
.navbar__mobile-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px;
}

/* ── Sidebar (app layout) ───────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
}
.sidebar__logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  padding: 0 8px;
  margin-bottom: 32px;
}
.sidebar__logo span { color: var(--accent); }
.sidebar__nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.sidebar__link:hover { background: rgba(127,169,163,.1); color: var(--text-primary); }
.sidebar__link.active { background: rgba(127,169,163,.15); color: var(--accent); }
.sidebar__link svg { flex-shrink: 0; opacity: 0.7; }
.sidebar__link.active svg { opacity: 1; }
.sidebar__divider { height: 1px; background: var(--border); margin: 12px 0; }
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--c-900);
  flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 0.75rem; color: var(--text-muted); }
.app-main { margin-left: 240px; flex: 1; padding: 32px; min-height: 100vh; }

/* ── Section headings ───────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Divider ────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Alert ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(224,92,92,.12); color: var(--danger); border: 1px solid rgba(224,92,92,.25); }
.alert-success { background: rgba(91,171,142,.12); color: #6DD3AD; border: 1px solid rgba(91,171,142,.25); }

/* ── Loading spinner ────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Stat card ──────────────────────────────────────── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.stat-label { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.stat-sub   { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }

/* ── Table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(83,122,121,.12);
  color: var(--text-secondary);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(127,169,163,.04); }
.table td:first-child, .table th:first-child { padding-left: 24px; }

/* ── Auth page layout ───────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(83,122,121,.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  position: relative;
  z-index: 1;
}
.auth-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo span { color: var(--accent); }
.auth-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

/* ── Utilities ──────────────────────────────────────── */
.mt-4  { margin-top:  4px; }
.mt-8  { margin-top:  8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-4  { margin-bottom:  4px; }
.mb-8  { margin-bottom:  8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar__links { display: none; }
  .navbar__mobile-btn { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; padding: 20px 16px; }
  .auth-card { padding: 28px 20px; }
  .container { padding: 0 16px; }
}
