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

:root {
  /* Stocky-exact accent (lite-purple theme) */
  --navy: #322740;
  --accent: #663399;
  --accent-dark: #52297a;
  --accent-soft: rgba(102,51,153,0.08);
  --accent-soft-strong: rgba(102,51,153,0.1);

  /* Stocky lite-purple light admin palette (1:1 from _variables/_colors) */
  --bg: #ffffff;
  --card: #ffffff;
  --border: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --text: #1f2937;
  --text-dim: #6b7280;
  --text-faint: #9ca3af;

  --green: #10b981;
  --green-bg: #dcfce7;
  --amber: #f59e0b;
  --amber-bg: #fef3c7;
  --red: #ef4444;
  --red-bg: #fee2e2;

  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 260px;
  --topbar-h: 70px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.1px;
}

.shell {
  min-height: 100vh;
}

/* ---------- Sidebar (fixed, white, Stocky-style) ---------- */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
  color: #47404f;
  display: flex;
  flex-direction: column;
  padding: 0 0 20px 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.sidebar .brand img.logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.sidebar .brand .brandtext .name {
  color: var(--navy);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.1px;
  line-height: 1.25;
}

.sidebar .brand .brandtext .tag {
  color: var(--text-faint);
  font-size: 10.5px;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px 0 10px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #47404f;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar nav a:hover {
  background: #f7f7f7;
  color: var(--accent);
}

.sidebar nav a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(102,51,153,0.35);
}

.sidebar nav a .icon {
  width: 18px;
  text-align: center;
  opacity: 0.9;
  font-size: 15px;
}

/* ---------- Topbar (fixed, white, shadowed) ---------- */
.topheader {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: #fff;
  box-shadow: 0 1px 15px rgba(0,0,0,0.04), 0 1px 6px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  z-index: 90;
}

/* ---------- Main ---------- */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-width: 0;
}

.main-inner {
  padding: 26px 34px;
}

.page-hero {
  background: linear-gradient(120deg, #7c4dc4 0%, #663399 60%, #52297a 100%);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  margin-bottom: 22px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(102,51,153,0.25);
}

.page-hero h1 {
  font-size: 21px;
  margin: 0;
  font-weight: 700;
  color: #fff;
}

.page-hero .hero-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 12.5px;
  margin-top: 6px;
}

.crumbs {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.crumbs a { color: var(--accent); text-decoration: none; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}

.card h2, .card h3 {
  margin-top: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
}

.card .card-sub {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: -8px;
  margin-bottom: 14px;
}

/* ---------- Table ---------- */
table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.grid th {
  text-align: left;
  color: var(--text-dim);
  background: var(--gray-100);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}

table.grid td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: var(--gray-100); }

table.grid a { color: var(--accent); text-decoration: none; font-weight: 600; }
table.grid a:hover { text-decoration: underline; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-approved { background: var(--green-bg); color: var(--green); }
.badge-pending  { background: var(--amber-bg); color: var(--amber); }
.badge-rejected { background: var(--red-bg); color: var(--red); }
.badge-active   { background: var(--green-bg); color: var(--green); }
.badge-inactive { background: #eef1f6; color: var(--text-dim); }

/* ---------- Buttons ---------- */
button, .btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover { background: #f9fafb; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover { background: var(--accent-dark); }

button.approve {
  background: var(--green-bg);
  border-color: var(--green-bg);
  color: var(--green);
}
button.approve:hover { background: #bbf7d0; }

button.reject {
  background: var(--red-bg);
  border-color: var(--red-bg);
  color: var(--red);
}
button.reject:hover { background: #f6c1cb; }

button.small { padding: 4px 9px; font-size: 11px; }

/* ---------- Forms ---------- */
label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 4px; margin-top: 10px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input:not([type]), select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

select.inline-select {
  width: auto;
  padding: 5px 8px;
  font-size: 12px;
}

.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 180px; }

pre.result-out {
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--text-dim);
}

.empty-state {
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

.stat-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
  flex: 1;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 1px 15px 1px rgba(0,0,0,0.04), 0 1px 6px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  color: #fff;
}
.stat-icon.c-purple { background: #663399; }
.stat-icon.c-green  { background: #10b981; }
.stat-icon.c-amber  { background: #f59e0b; }
.stat-icon.c-red    { background: #ef4444; }
.stat-icon.c-blue   { background: #3b82f6; }
.stat-icon.c-orange { background: #f97316; }

.stat-text { display: flex; flex-direction: column; }
.stat-card .num { font-size: 19px; font-weight: 700; color: var(--text); order: 2; }
.stat-card .label { color: var(--text-dim); font-size: 12.5px; margin-bottom: 2px; order: 1; }

/* ---------- Login (split screen, Stocky-style) ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
}

.login-panel-left {
  flex: 1 1 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a78bfa 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 70px;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 26px;
}
.login-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.login-panel-left h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 18px 0;
  letter-spacing: 0.5px;
}

.login-panel-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.88);
  max-width: 420px;
  line-height: 1.55;
  margin-bottom: 34px;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}
.login-features .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.login-panel-right {
  flex: 1 1 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-panel-right { background: #f4f5fb; }

.login-card {
  width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 10px 40px rgba(17,24,39,0.06);
  padding: 40px 34px;
}
.login-card .login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.login-card .login-logo img {
  height: 56px;
  width: auto;
}
.login-card .brand-name { color: var(--text); font-weight: 800; font-size: 22px; text-align: center; }
.login-card .brand-tag { color: var(--text-dim); font-size: 13px; margin-top: 8px; margin-bottom: 22px; text-align: center; line-height: 1.5; }
.login-error { background: var(--red-bg); color: var(--red); border-radius: var(--radius); padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }
.login-hint { color: var(--text-dim); font-size: 11px; margin-top: 18px; line-height: 1.5; text-align: center; }
.login-footer { color: var(--text-faint); font-size: 11px; margin-top: 22px; text-align: center; }

.login-card label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 14px;
}

.input-icon-wrap { position: relative; }
.input-icon-wrap .field-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 14px;
  pointer-events: none;
}
.input-icon-wrap input {
  padding-left: 42px;
  padding-right: 40px;
  background: #eef1fb;
  border: 1px solid transparent;
}
.input-icon-wrap input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-icon-wrap .toggle-eye {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  padding: 4px 6px;
  cursor: pointer;
}
.input-icon-wrap .toggle-eye:hover { color: var(--text-dim); }

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 22px 0;
  font-size: 12.5px;
}
.login-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
}
.login-row input[type=checkbox] { width: auto; }
.login-row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.login-row a:hover { text-decoration: underline; }

.login-card .primary {
  background: linear-gradient(135deg, #6366f1 0%, #663399 100%);
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
}
.login-card .primary:hover { background: linear-gradient(135deg, #575adf 0%, #52297a 100%); }

@media (max-width: 900px) {
  .login-panel-left { display: none; }
  .login-panel-right { flex: 1 1 100%; }
}

/* ---------- Topbar user / header ---------- */
.header-user {
  display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-dim);
}
.header-user .company-tag { color: var(--text); font-weight: 700; }
.header-user a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  transition: all 0.2s;
}
.header-user a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.role-pill {
  display: inline-block; background: var(--accent-soft-strong); color: var(--accent);
  font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.3px;
}
