/* Shared look for every GoDisai tool: the site's tokens, fonts, header and house buttons (see static/css/base.css),
   plus menus, dialogs and the toast. Flat, no gradients. */
:root {
  --bg: #f6f9fe;
  --fg: #0d1626;
  --muted: #596475;
  --line: #d5dfeb;
  --card: #ffffff;
  --blue-900: #0b2654;
  --blue-700: #0048b0;
  --blue-600: #0056d2;
  --blue-400: #5ea8f9;
  --sky: #8cc3ff;
  --blue-50: #f0f6ff;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --ok: #15803d;
  --low: #15803d;
  --medium: #b45309;
  --high: #b91c1c;
  --display: "Baloo Thambi 2", "Noto Sans Tamil", Inter, system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(13, 22, 38, .06);
  --shadow-lg: 4px 4px 0 var(--fg);   /* the house offset shadow, for menus and dialogs */
}
html.embed .topbar { display: none; }   /* inside the admin panel the panel's own header is enough */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); display: flex; flex-direction: column;
  font: 15px/1.55 Inter, "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; }
a { color: var(--blue-600); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Top bar: the same GoDisai header as the site */
.topbar { background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 64px; max-width: 1600px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--fg); flex: none; }
.brand .logo-mark { width: 36px; height: 36px; color: var(--blue-600); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-ta { font: 800 1.3rem/1.05 var(--display); color: var(--fg); white-space: nowrap; }
.brand-ta b { color: var(--blue-600); font-weight: 800; }
.brand-en { margin-top: .2rem; font: 600 .55rem/1 Inter, system-ui, sans-serif; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.crumb { color: var(--muted); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--blue-600); }
.topbar .spacer { flex: 1; }

/* Buttons: the house button, an ink outline with a hard offset shadow that presses down */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 12px; font: 800 .92rem/1.2 var(--display);
  border: 2px solid var(--fg); background: var(--card); color: var(--fg); box-shadow: 3px 3px 0 var(--fg); cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--fg); background: var(--blue-50); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--fg); }
.btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--fg); }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-text { background: none; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-text:hover { color: var(--danger); background: none; box-shadow: none; transform: none; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; }
.icon-btn:hover { background: color-mix(in srgb, var(--blue-600) 12%, transparent); color: var(--fg); }
.icon-btn:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

/* Toolbar under the top bar */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 16px 10px; max-width: 1600px; width: 100%; margin: 0 auto; }
.note { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.note .saved { color: var(--ok); font-weight: 600; margin-left: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { padding: .55rem .8rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); width: 220px; max-width: 100%; }
.search:focus { outline: 2px solid color-mix(in srgb, var(--blue-600) 40%, transparent); outline-offset: 1px; }
.warning { margin: 0 16px 10px; padding: 10px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: .9rem; font-weight: 600; }

/* Dropdown menus */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--card); border: 2px solid var(--fg); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 30; }
.dropdown.open > .menu { display: block; }
.menu button { display: block; width: 100%; text-align: left; padding: .55rem .75rem; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: .9rem; font-weight: 600; }
.menu button:hover, .menu button:focus-visible { background: var(--blue-50); outline: none; }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }
.menu button:disabled { opacity: .45; cursor: not-allowed; background: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu .label { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .4rem .75rem .2rem; }

/* Tags */
.tag { font-size: .7rem; font-weight: 800; padding: .15rem .5rem; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); white-space: nowrap; }
.tag.low { color: var(--low); background: color-mix(in srgb, var(--low) 14%, transparent); }
.tag.medium { color: var(--medium); background: color-mix(in srgb, var(--medium) 16%, transparent); }
.tag.high { color: var(--high); background: color-mix(in srgb, var(--high) 14%, transparent); }

/* Dialogs */
dialog { border: 2px solid var(--fg); border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--fg); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(7, 17, 42, .45); backdrop-filter: blur(2px); }
dialog form { padding: 22px; display: grid; gap: 14px; }
dialog h2 { margin: 0; font-size: 1.3rem; }
dialog p { margin: 0; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field label { font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; padding: .6rem .75rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid color-mix(in srgb, var(--blue-600) 40%, transparent); outline-offset: 0; border-color: var(--blue-400); }
.field textarea { min-height: 110px; resize: vertical; }
.dialog-actions { display: flex; gap: 8px; align-items: center; }
.dialog-actions .spacer { flex: 1; }

/* Toast with optional Undo */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); background: var(--fg); color: var(--bg); padding: 10px 12px 10px 16px; border-radius: 12px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-lg); transition: transform .25s ease, visibility .25s; visibility: hidden; z-index: 50; font-weight: 600; font-size: .9rem; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast button { background: none; border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); color: var(--bg); border-radius: 8px; padding: .3rem .7rem; font-weight: 800; cursor: pointer; }

@media (max-width: 640px) {
  .crumb { display: none; }
  .topbar-in { height: 58px; }
  .brand .logo-mark { width: 30px; height: 30px; }
  .brand-ta { font-size: 1.15rem; }
  .toolbar { padding-top: 14px; }
  .actions { width: 100%; }
  .search { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
