@font-face {
  font-family: "Inter";
  src: url("/static/vendor/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.129 0.042 264.695);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.129 0.042 264.695);
  --primary: oklch(0.208 0.042 265.755);
  --primary-foreground: oklch(0.984 0.003 247.858);
  --secondary: oklch(0.968 0.007 247.896);
  --secondary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.554 0.046 257.417);
  --accent: oklch(0.968 0.007 247.896);
  --accent-foreground: oklch(0.208 0.042 265.755);
  --destructive: oklch(0.577 0.245 27.325);
  --success: oklch(0.596 0.145 163.225);
  --warning: oklch(0.705 0.163 70.08);
  --info: oklch(0.588 0.158 254.624);
  --border: oklch(0.929 0.013 255.508);
  --input: oklch(0.929 0.013 255.508);
  --ring: oklch(0.704 0.04 256.788);
  --sidebar: #131D34;
  --sidebar-foreground: oklch(0.984 0.003 247.858);
  --sidebar-hover: oklch(1 0 0 / 10%);
  color-scheme: light;
}

.dark {
  --background: #0F1729;
  --foreground: oklch(0.984 0.003 247.858);
  --card: oklch(0.208 0.042 265.755);
  --card-foreground: oklch(0.984 0.003 247.858);
  --primary: oklch(0.929 0.013 255.508);
  --primary-foreground: oklch(0.208 0.042 265.755);
  --secondary: oklch(0.279 0.041 260.031);
  --secondary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --accent: oklch(0.279 0.041 260.031);
  --accent-foreground: oklch(0.984 0.003 247.858);
  --destructive: oklch(0.704 0.191 22.216);
  --success: oklch(0.723 0.14 163.225);
  --warning: oklch(0.804 0.15 70.08);
  --info: oklch(0.712 0.14 254.624);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.551 0.027 264.364);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--background);
  color: var(--foreground);
}
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
a { color: inherit; }
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.muted { color: var(--muted-foreground); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* layout: dark sidebar like ris-frontend */
.shell { display: flex; min-height: 100vh; }
/* one screen tall and pinned, so logout never scrolls out of reach */
.sidebar {
  width: 256px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--sidebar); color: var(--sidebar-foreground);
  position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px; font-weight: 600; border-bottom: 1px solid var(--sidebar-hover); }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; flex: 1; }
.nav-bottom { flex: 0 0 auto; padding-top: 0; }
.nav-heading { padding: 4px 12px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: oklch(0.984 0.003 247.858 / 55%); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: calc(var(--radius) - 2px); text-decoration: none; color: oklch(0.984 0.003 247.858 / 75%); }
.nav-link:hover, .nav-link.active { background: var(--sidebar-hover); color: #fff; }
.sidebar-foot { padding: 12px 8px; border-top: 1px solid var(--sidebar-hover); display: flex; flex-direction: column; gap: 4px; }
.who { display: flex; flex-direction: column; padding: 4px 12px 8px; }
.who small { color: oklch(0.984 0.003 247.858 / 60%); }
.btn.sidebar-btn { width: 100%; justify-content: flex-start; color: inherit; }
.btn.sidebar-btn:hover { background: var(--sidebar-hover); color: #fff; }
.btn.logout-btn { width: 100%; margin-top: 4px; }
.content { flex: 1; min-width: 0; padding: 24px; max-width: 960px; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
@media (max-width: 768px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; position: static; height: auto; overflow-y: visible; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 16px; }
}

/* card */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%); margin-bottom: 16px; }
.card-narrow { width: 100%; max-width: 384px; margin: 0; }
.card-header { padding: 24px 24px 0; }
.card-title { font-size: 1.125rem; font-weight: 600; margin: 0; }
.card-desc { color: var(--muted-foreground); margin: 4px 0 0; }
.card-body { padding: 24px; }
.brand-mark { display: inline-flex; padding: 8px; border-radius: var(--radius); background: var(--sidebar); color: #fff; margin-bottom: 12px; }
.brand-mark .icon { width: 20px; height: 20px; }

/* button (shadcn variants) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 36px; padding: 0 16px; border-radius: calc(var(--radius) - 2px); border: 1px solid transparent;
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; transition: background-color .15s, color .15s;
  background: transparent; color: inherit;
}
.btn:focus-visible, .input:focus-visible, .select:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-default { background: var(--primary); color: var(--primary-foreground); }
.btn-default:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); }
.btn-destructive { background: var(--destructive); color: #fff; }
.btn-destructive:hover { background: color-mix(in oklch, var(--destructive) 90%, transparent); }
.btn-outline { border-color: var(--border); background: var(--background); }
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: color-mix(in oklch, var(--secondary) 80%, transparent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-sm { height: 32px; padding: 0 12px; gap: 6px; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-block { width: 100%; }

/* form controls */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 500; }
.input, .select {
  height: 36px; width: 100%; padding: 4px 12px; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px);
  background: transparent; color: inherit; font: inherit;
}
.dark .input, .dark .select { background: color-mix(in oklch, var(--input) 30%, transparent); }
.select option { background: var(--card); color: var(--card-foreground); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; min-width: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* alert */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; }
.alert-destructive { color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 40%, transparent); }
.alert-warning { color: var(--warning); border-color: color-mix(in oklch, var(--warning) 40%, transparent); }
.alert-info { color: var(--info); border-color: color-mix(in oklch, var(--info) 40%, transparent); }

/* pick lists */
.pick { list-style: none; padding: 0; margin: 8px 0 0; border: 1px solid var(--border); border-radius: var(--radius); }
.pick-row { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.pick-row:last-child { border-bottom: 0; }
.pick-row.fixed { color: var(--muted-foreground); }
.badge { display: inline-flex; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--secondary); color: var(--secondary-foreground); }

/* table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted-foreground); padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr.inactive td { color: var(--muted-foreground); }

[hidden] { display: none !important; }

/* search + pagination */
.paginate-bar { justify-content: space-between; margin-bottom: 8px; }
.paginate-bar .input { max-width: 320px; }
.pagination { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; margin-top: 12px; }
.pagination .btn { min-width: 32px; padding: 0 8px; }
.pagination-gap { padding: 0 4px; color: var(--muted-foreground); }

/* page bits */
.page-head { margin-bottom: 16px; }
.grow { flex: 1; min-width: 200px; }
.w-sm { width: 120px; }
.mt { margin-top: 24px; }
.add-row { margin-top: 12px; }
.footer-row { margin: 8px 0 4px; }
.actions { display: flex; gap: 4px; justify-content: flex-end; }

/* sweetalert2 themed with the same tokens */
.swal2-popup.swal-card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); font-family: inherit; }
.swal2-popup.swal-card .swal2-html-container { color: var(--card-foreground); }
.swal-actions { gap: 8px; }
.section-head { justify-content: space-between; }
.section-head h2 { margin: 0; }
.dialog-fields { text-align: left; }

pre { overflow-x: auto; margin: 0; padding: 8px 12px; border-radius: var(--radius); background: var(--muted); }
code { font-size: .875em; }
.badge-warn { background: var(--warning); color: var(--foreground); }

/* tatacara pages */
.badge-danger { background: var(--destructive); color: #fff; }
.manual h2 { font-size: 1.125rem; margin-bottom: 12px; }
.manual h3 { font-size: 1rem; font-weight: 600; margin: 20px 0 8px; }
.manual p, .manual li, .manual dd { line-height: 1.6; }
.manual section { scroll-margin-top: 16px; }
.content:has(.manual-layout) { max-width: 1240px; }
.manual-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
/* contents on the right, pinned while the page scrolls, like the bootstrap docs */
.toc-side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; font-size: 0.875rem; }
.toc-title { font-weight: 600; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.toc, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul { padding-left: 12px; }
.toc a { display: block; padding: 3px 0 3px 12px; border-left: 2px solid transparent; color: var(--muted-foreground); text-decoration: none; }
.toc ul a { font-size: 0.8125rem; }
.toc a:hover { color: var(--foreground); }
.toc a.active { color: var(--foreground); font-weight: 600; border-left-color: var(--foreground); }
.steps li { margin-bottom: 4px; }
.ui-name { white-space: nowrap; }
.shot { margin: 12px 0 16px; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.shot figcaption { margin-top: 4px; font-size: 0.8125rem; color: var(--muted-foreground); }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.shot-grid .shot { margin: 0; }
.faq dt { font-weight: 600; margin-top: 12px; }
.faq dd { margin: 4px 0 0; }
@media (max-width: 1100px) {
  .manual-layout { grid-template-columns: minmax(0, 1fr); }
  .toc-side { position: static; order: -1; max-height: none; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); }
}
@media print {
  .sidebar, .toc-side { display: none; }
  .manual-layout { display: block; }
  .shell { display: block; }
  .content { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .shot img { max-height: 120mm; width: auto; }
}
