:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --blue: #1f6feb;
  --blue-d: #1559c4;
  --ink: #1b2430;
  --muted: #5b6776;
  --line: #dde2e8;
  --bg: #f4f6f9;
  --ok: #1a7f37;
  --ok-bg: #e6f4ea;
  --warn: #9a6700;
  --warn-bg: #fff4d6;
  --info-bg: #e8f0fe;
  --err: #b42318;
  --err-bg: #fdecea;
}
* { box-sizing: border-box; }
body { margin: 0; font: 13px/1.45 "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; font-weight: 600; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }

/* top bar */
.topbar { height: 52px; background: var(--navy); color: #fff; display: flex; align-items: center; padding: 0 20px; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: #fff; }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; }
.env { font-size: 10px; font-weight: 700; letter-spacing: .06em; background: #f2c94c; color: #3d2e00; border-radius: 3px; padding: 2px 6px; }
.topbar .spacer { flex: 1; }
.topsearch { background: var(--navy-2); border: 1px solid #2c4a73; color: #c9d6e8; border-radius: 4px; padding: 6px 10px; width: 280px; }
.topbtn { color: #d9e3f1; font-size: 13px; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 4px; }
.topbtn:hover { background: var(--navy-2); text-decoration: none; }
.bell { position: relative; }
.bell b { position: absolute; top: 0; right: 0; background: #e5484d; color: #fff; font-size: 10px; border-radius: 8px; padding: 0 4px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #4c6fa5; display: grid; place-items: center; font-size: 11px; font-weight: 700; }

/* nav */
.nav { background: #fff; border-bottom: 1px solid var(--line); display: flex; gap: 2px; padding: 0 20px; }
.nav a { color: var(--ink); padding: 12px 14px; border-bottom: 3px solid transparent; font-weight: 500; }
.nav a:hover { background: #f1f4f8; text-decoration: none; }
.nav a.active { border-bottom-color: var(--blue); color: var(--blue); }
.subnav { background: #fff; border-bottom: 1px solid var(--line); padding: 0 20px; display: flex; gap: 18px; font-size: 12px; }
.subnav a { color: var(--muted); padding: 8px 0; }
.subnav a.active { color: var(--ink); font-weight: 600; }

main { padding: 18px 20px 40px; max-width: 1360px; margin: 0 auto; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.pagehead .meta { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.card-body { padding: 16px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.tiles { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.tile { padding: 14px 16px; }
.tile .n { font-size: 26px; font-weight: 600; }
.tile .l { color: var(--muted); }
.two { grid-template-columns: 2fr 1fr; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: 4px; padding: 6px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--blue-d); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--blue); }
.btn.secondary:hover { background: #f1f6ff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: 12px; }
.req::after { content: " *"; color: var(--err); }
input[type=text], input[type=password], input:not([type]), select, textarea { font: inherit; border: 1px solid #b8c2cf; border-radius: 4px; padding: 6px 8px; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0ff; border-color: var(--blue); }
.hint { color: var(--muted); font-size: 11px; margin-top: 3px; }
.filters { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filters > div { min-width: 160px; }
.filters label { margin-top: 0; }

table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #f8fafc; border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; }
td { border-bottom: 1px solid #edf0f3; padding: 8px 10px; vertical-align: middle; }
tr:hover td { background: #fafcff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: var(--muted); }
.pager a, .pager span.cur { padding: 3px 9px; border: 1px solid var(--line); border-radius: 3px; margin-left: 4px; }
.pager span.cur { background: var(--blue); color: #fff; border-color: var(--blue); }

.badge { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.b-new { background: var(--info-bg); color: #174ea6; }
.b-confirmed { background: var(--ok-bg); color: var(--ok); }
.b-partial { background: var(--warn-bg); color: var(--warn); }
.b-shipped { background: #eceff3; color: #3b4652; }

.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 14px; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a[aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
address { font-style: normal; }

.menu-wrap { position: relative; display: inline-block; }
[role=menu] { position: absolute; right: 0; top: 30px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(16, 24, 40, .14); list-style: none; padding: 4px; margin: 0; min-width: 200px; z-index: 20; }
[role=menuitem] { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; font: inherit; color: var(--ink); border-radius: 4px; cursor: pointer; }
[role=menuitem]:hover { background: #f1f6ff; text-decoration: none; }

dialog { border: 0; border-radius: 8px; padding: 0; width: 460px; box-shadow: 0 20px 50px rgba(16, 24, 40, .3); }
dialog::backdrop { background: rgba(11, 37, 69, .45); }
dialog header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
dialog .body { padding: 6px 18px 16px; }
dialog footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #f8fafc; border-radius: 0 0 8px 8px; }
#cookie-consent { width: 640px; }

.toast { position: fixed; top: 116px; right: 24px; z-index: 50; min-width: 320px; max-width: 460px; padding: 12px 16px; border-radius: 6px; box-shadow: 0 8px 24px rgba(16, 24, 40, .18); font-weight: 500; transition: opacity .4s; border-left: 4px solid; }
.toast.ok { background: #fff; border-color: var(--ok); }
.toast.err { background: #fff; border-color: var(--err); color: var(--err); }
.toast-hide { opacity: 0; pointer-events: none; }
.alert { padding: 10px 12px; border-radius: 4px; margin-bottom: 12px; }
.alert.err { background: var(--err-bg); color: var(--err); }
.notice { background: var(--info-bg); border: 1px solid #c6dafc; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid #edf0f3; }
ul.plain li:last-child { border-bottom: 0; }
.muted { color: var(--muted); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login .hero { background: linear-gradient(135deg, #0b2545, #1d4e89); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login .hero h1 { font-size: 30px; line-height: 1.25; max-width: 440px; }
.login .hero p { color: #c9d8ee; max-width: 440px; }
.login .panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login form { width: 340px; }
.login .row { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 18px; font-size: 12px; }
.login .row label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; }
.login .btn { width: 100%; justify-content: center; padding: 9px; }
footer.legal { color: var(--muted); font-size: 11px; padding: 18px 20px; text-align: center; }
footer.legal a { color: var(--muted); margin: 0 6px; }
.topbar .topsearch { width: 340px; flex: 0 1 340px; }
.brand, .topbtn { white-space: nowrap; }
.grid > .card { margin-top: 0; }
.b-declined { background: #fdecea; color: #b42318; }
.btn.danger { background: #d92d20; border-color: #d92d20; }
.btn.danger:hover { background: #b42318; }
