/* Sylwork design system */
:root {
  --bg: #070b14;
  --bg-soft: #0f172a;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-soft: #eef2ff;
  --accent: #06b6d4;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --err: #e11d48;
  --err-bg: #fff1f2;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(15, 23, 42, .08);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, .25);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #f1f5f9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Auth */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(79,70,229,.5), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6,182,212,.3), transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(99,102,241,.2), transparent),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.6);
  animation: rise .4s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.4rem; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin: 0 0 20px; line-height: 1.5; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); color: #4338ca;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
label { display: block; font-size: .8rem; font-weight: 600; color: #334155; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
.code-input { text-align: center; letter-spacing: .4em; font-size: 1.35rem; font-weight: 800; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 11px 18px;
  font-weight: 700; font: inherit; cursor: pointer;
  background: #e2e8f0; color: #0f172a;
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: scale(.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  box-shadow: 0 8px 20px rgba(79,70,229,.35);
}
.btn.primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn.block { width: 100%; margin-top: 16px; }
.btn.small { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: .9rem; margin-bottom: 14px; line-height: 1.45; }
.alert.ok { background: var(--ok-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert.err { background: var(--err-bg); color: #9f1239; border: 1px solid #fecdd3; }
.meta { font-size: .85rem; color: var(--muted); margin-top: 18px; line-height: 1.55; }

/* App shell */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar.dark {
  background: linear-gradient(180deg, #0f172a, #020617);
  color: #e2e8f0; border-right: none;
}
.sidebar.dark a { color: #cbd5e1; text-decoration: none; }
.sidebar.dark a.active { background: rgba(99,102,241,.2); color: #c7d2fe; }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px; }
.side-brand .logo {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5 60%, #06b6d4);
  color: #fff; display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 8px 16px rgba(79,70,229,.4);
}
.side-brand strong { display: block; font-size: .95rem; letter-spacing: -.01em; }
.side-brand small, .side-user small { color: var(--muted); font-size: .75rem; }
.sidebar.dark .side-brand small { color: #94a3b8; }
.side-user {
  display: flex; gap: 10px; align-items: center; padding: 12px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff); border-radius: 14px;
  border: 1px solid var(--line);
}
.sidebar.dark .side-user { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.06); }
.avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #3730a3;
  display: grid; place-items: center; font-weight: 800;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a {
  padding: 11px 14px; border-radius: 12px; color: #334155;
  font-weight: 600; font-size: .9rem; text-decoration: none;
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: #f1f5f9; text-decoration: none; }
.side-nav a.active { background: var(--primary-soft); color: #4338ca; }
.side-foot { padding: 8px 10px; font-size: .85rem; }

.main { padding: 28px 32px 48px; max-width: 1100px; }
.main-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.main-top h1 { margin: 0 0 4px; font-size: 1.45rem; letter-spacing: -.02em; }
.main-top p { margin: 0; color: var(--muted); font-size: .9rem; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field label { margin-top: 0; }
.form-grid h3.full { margin: 10px 0 0; font-size: 1rem; color: #334155; }
.actions { margin-top: 8px; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: #4338ca;
  font-size: .72rem; font-weight: 700; text-transform: capitalize;
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; font-size: .85rem; color: var(--muted);
  box-shadow: var(--shadow);
}
.stat span { display: block; font-size: 1.55rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
table.data tr:hover td { background: #f8fafc; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.doc-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: var(--card-soft); display: flex; flex-direction: column; gap: 6px; font-size: .85rem;
}
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.kv span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.inline-form { display: flex; gap: 8px; align-items: center; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-grid, .kv { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 40px; }
}
