/* ═══════════════════════════════════════════
   Samsung Stok — Tailwind Dark Design Port
   Inspired by index.html (zinc palette, yellow accent)
   ═══════════════════════════════════════════ */

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

:root {
  --zinc-950: #09090b;
  --zinc-900: #18181b;
  --zinc-800: #27272a;
  --zinc-700: #3f3f46;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;
  --zinc-300: #d4d4d8;
  --zinc-100: #f4f4f5;
  --yellow-400: #eab308;
  --yellow-300: #facc15;
  --emerald-400: #34d399;
  --emerald-900: #064e3b;
  --red-400: #f87171;
  --red-900: #7f1d1d;
  --rose-400: #fb7185;
  --sky-400: #38bdf8;
  --violet-400: #a78bfa;
  --orange-400: #fb923c;

  --sidebar-w: 260px;
  --radius-card: 16px;
  --radius-sm: 6px;
  --radius-full: 999px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--zinc-950);
  color: var(--zinc-300);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

a { color: var(--yellow-400); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─── */
.layout-wrap { display: flex; width: 100%; min-height: 100vh; }
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.main-content {
  flex: 1;
  overflow: auto;
  background: var(--zinc-950);
  padding: 24px 32px;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--zinc-900);
  border-right: 1px solid var(--zinc-800);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: transform 0.3s;
  z-index: 50;
}

.sidebar-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--zinc-800);
}

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

.sidebar-brand-box {
  width: 36px;
  height: 36px;
  background: var(--yellow-400);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.sidebar-brand-box span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--zinc-900);
  line-height: 1;
  margin-top: 1px;
}

.sidebar-brand-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.5px;
}

.sidebar-brand-sub {
  font-size: 10px;
  color: var(--zinc-500);
  letter-spacing: 2px;
  margin-left: 4px;
  margin-top: 1px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--zinc-400);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav a:hover {
  color: #fff;
  transform: translateX(6px);
}

.sidebar-nav a.active {
  background: var(--yellow-400);
  color: #000;
}

.sidebar-nav a.active svg { stroke: #000; }

.sidebar-nav .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-nav .nav-icon svg { 
  width: 100%; 
  height: 100%; 
}

.sidebar-nav a.logout {
  margin-top: auto;
  color: var(--red-400);
}

.sidebar-nav a.logout:hover {
  background: var(--red-900);
  color: #fecaca;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--zinc-800);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: var(--yellow-400);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--yellow-300);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Landing Page ─── */
.landing-page { display: block; }
.landing {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
}
.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.landing-logo {
  width: 36px;
  height: 36px;
  background: var(--yellow-400);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-logo span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--zinc-900);
}
.login-btn {
  background: var(--yellow-400);
  color: #000 !important;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--yellow-300); text-decoration: none; }
.landing-content .card { background: var(--zinc-900); }

/* ─── Landing: hide code column ─── */
.report-landing thead th:nth-child(3),
.report-landing tbody td:nth-child(3) { display: none; }

/* ─── Landing: mobile compact ─── */
@media (max-width: 768px) {
  .landing { max-width: 100%; padding: 8px 0; overflow: hidden; }
  .landing-topbar { padding: 18px 8px 0; }
  .login-btn { flex-shrink: 0; padding: 8px 14px; }
  .report-landing .card { padding: 18px 6px; overflow: hidden; }
  .report-landing .card h3 { margin-bottom: 14px; }
  .report-landing .table-wrap { overflow: visible; }
  .report-landing table,
  .report-landing tbody { display: block; width: 100%; }
  .report-landing thead { display: none; }
  .report-landing tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px 52px;
    gap: 0 16px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--zinc-800);
  }
  .report-landing tbody tr:last-child { border-bottom: 0; }
  .report-landing tbody td {
    display: block;
    padding: 0;
    border: 0;
    font-size: 11.5px;
    line-height: 1.3;
  }
  .report-landing tbody td:nth-child(1) { display: none; }
  .report-landing tbody td:nth-child(2) {
    color: var(--zinc-100);
    font-weight: 500;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .report-landing tbody td:nth-child(2)::before { content: none; }
  .report-landing tbody td:nth-child(4) { display: none; }
  .report-landing tbody td:nth-child(5),
  .report-landing tbody td:nth-child(6) {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--zinc-300);
  }
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-info { flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: #fff; }
.sidebar-user-role { font-size: 11px; color: var(--zinc-500); }

/* ─── Top Header Bar ─── */
.topbar {
  height: 52px;
  background: var(--zinc-900);
  border-bottom: 1px solid var(--zinc-800);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

#menu-btn {
  display: none;
  background: transparent;
  border: 0;
  color: var(--zinc-400);
  font-size: 24px;
  padding: 4px 8px;
  cursor: pointer;
}

/* ─── Cards ─── */
.card {
  background: var(--zinc-900);
  border: 1px solid var(--zinc-800);
  border-radius: var(--radius-card);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--zinc-400);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--zinc-900);
  border: 1px solid var(--zinc-800);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.stat-card:hover { transform: translateY(-6px); }

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--zinc-400);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-header svg { width: 14px; height: 14px; }

.stat-card-value {
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  margin-top: 8px;
}

.stat-card-value.small { font-size: 15px; font-weight: 500; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  padding: 16px 16px 12px 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--zinc-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--zinc-800);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--zinc-800);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: 0; }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-yellow { background: rgba(234,179,8,0.15); color: var(--yellow-300); }
.badge-emerald { background: rgba(52,211,153,0.15); color: var(--emerald-400); }
.badge-gray { background: var(--zinc-800); color: var(--zinc-400); }
.badge-red { background: rgba(248,113,113,0.15); color: var(--red-400); }

/* ─── Forms ─── */
input, select, textarea {
  padding: 10px 14px;
  background: var(--zinc-800);
  color: var(--zinc-100);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus { border-color: var(--yellow-400); }
input::placeholder { color: var(--zinc-500); }

.input-sm { width: 140px; }
.input-md { width: 200px; }

button, .btn {
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--yellow-400);
  color: #000;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button:hover { background: var(--yellow-300); }
button.danger { background: var(--red-400); color: #fff; }
button.danger:hover { background: #ef4444; }
button.outline {
  background: transparent;
  border: 1px solid var(--zinc-700);
  color: var(--zinc-300);
}
button.outline:hover { background: var(--zinc-800); }
button.sm { padding: 6px 12px; font-size: 12px; }

.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── Login ─── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: var(--zinc-950);
}

.login-card {
  background: var(--zinc-900);
  border: 1px solid var(--zinc-800);
  border-radius: var(--radius-card);
  padding: 40px;
  width: 380px;
  max-width: 94vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 2px;
  color: #fff;
}

.login-card .sub {
  color: var(--zinc-500);
  margin-bottom: 24px;
  font-size: 14px;
}

.login-card input { width: 100%; margin-bottom: 12px; }
.login-card button { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

.login-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--red-400);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
}

/* ─── Utilities ─── */
.muted { color: var(--zinc-500); font-size: 13px; }
small { color: var(--zinc-500); font-size: 12px; }
code {
  background: var(--zinc-800);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--zinc-100);
}
.text-right { text-align: right; }
.flex { display: flex; gap: 8px; align-items: center; }
.gap-4 { gap: 16px; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Notice toast ─── */
#notice {
  display: none;
  padding: 12px 16px;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--emerald-400);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .main-content { padding: 20px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }
  .sidebar.open { left: 0; }

  #menu-btn { display: block; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-overlay.open { display: block; }

  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }

  table thead { display: none; }
  table tbody tr { 
    display: block; 
    padding: 12px 0; 
    border-bottom: 1px solid var(--zinc-800);
  }
  table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border: 0;
    font-size: 13px;
  }
  table tbody td:before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--zinc-500);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.3px;
    margin-right: 12px;
  }
  .inline-form { flex-wrap: wrap; }
  .input-sm { width: 100px; }
  .input-md { width: 100%; }
}

@media (max-width: 400px) {
  .main-content { padding: 12px; }
  .login-card { padding: 24px; }
}
