:root {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 20px rgba(15, 23, 42, 0.05);
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #0ea5a4;
  --brand-dark: #0d8c8b;
  --brand-soft: #ccfbf1;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f1f5f9;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #0b1120 100%);
  color: #e2e8f0;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1rem;
}

.brand .logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, #22d3ee 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0b1120;
  font-size: 1.05rem;
}

.brand .title {
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2px;
}
.brand .subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav a .ic {
  width: 18px; height: 18px; display: inline-block; flex-shrink: 0;
  opacity: 0.9;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav a.active {
  background: rgba(14, 165, 164, 0.18);
  color: #5eead4;
}
.nav .section {
  color: #64748b;
  font-size: 0.68rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0.75rem 0.75rem 0.25rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar .search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.topbar .search input {
  width: 100%;
  padding: 0.5rem 0.8rem 0.5rem 2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 14px;
}
.topbar .search::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat center;
}

.topbar .user {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-weight: 500;
}
.topbar .user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #22d3ee);
  color: #0b1120;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.content {
  padding: 1.5rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-head h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.page-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  border-color: var(--border);
  font-size: 14px;
  transition: background .15s, transform .05s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: #d97706; border-color: #d97706; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 0.3rem 0.65rem; font-size: 12.5px; border-radius: 8px; }

.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
}
.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kpi {
  position: relative;
  overflow: hidden;
}
.kpi .label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.5rem;
}
.kpi .value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.kpi .trend {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.kpi .trend.up { color: var(--success); }
.kpi .trend.down { color: var(--danger); }
.kpi .badge-icon {
  position: absolute;
  right: 1rem; top: 1rem;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}
.kpi.accent .badge-icon { background: #fde68a; color: #92400e; }
.kpi.danger .badge-icon { background: #fecaca; color: #991b1b; }
.kpi.success .badge-icon { background: #bbf7d0; color: #065f46; }
.kpi.info .badge-icon { background: #bfdbfe; color: #1e3a8a; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.table th, table.table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.table th {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
table.table tbody tr:hover { background: #f8fafc; }
table.table td.right, table.table th.right { text-align: right; }
table.table td.center, table.table th.center { text-align: center; }
table.table .muted { color: var(--muted); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e3a8a; }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge.muted { background: #e2e8f0; color: #475569; }
.badge.lg { font-size: 0.8rem; padding: 3px 10px; }

.chip-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 0.78rem;
  color: #334155;
}
.chip-cat .dot {
  width: 8px; height: 8px; border-radius: 50%;
}

.form-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 780px) {
  .form-row, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.field label {
  font-size: 0.8rem;
  color: #334155;
  font-weight: 500;
}
.field input[type=text],
.field input[type=email],
.field input[type=number],
.field input[type=date],
.field input[type=password],
.field select,
.field textarea {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
}
.field textarea { min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.messages .msg {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #f1f5f9;
  border-left: 4px solid #94a3b8;
  font-size: 14px;
}
.messages .msg.success { background: #ecfdf5; border-color: var(--success); color: #065f46; }
.messages .msg.warning { background: #fffbeb; border-color: var(--warning); color: #92400e; }
.messages .msg.danger  { background: #fef2f2; border-color: var(--danger); color: #991b1b; }
.messages .msg.info    { background: #eff6ff; border-color: var(--info); color: #1e3a8a; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(1000px 600px at 10% -20%, rgba(14,165,164,0.25), transparent),
    radial-gradient(800px 500px at 110% 20%, rgba(34,211,238,0.18), transparent),
    linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
}
.login-card {
  background: #fff;
  border-radius: 18px;
  max-width: 420px;
  width: 100%;
  padding: 2rem 1.75rem;
  box-shadow: 0 30px 80px rgba(2,6,23,0.35);
}
.login-card h1 {
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
  font-size: 1.6rem;
}
.login-card p.sub {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}
.login-hint {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

.posten-table input,
.posten-table select {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 100%;
  font-size: 14px;
}

.dl-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.93rem;
}
.dl-list dt { color: var(--muted); }
.dl-list dd { margin: 0; font-weight: 500; }

.hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.ws-nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; }
.fw-600 { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }

.chart-wrap { position: relative; height: 260px; }

.empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
