/* ==========================================================================
   GoldVault Logistics — Admin panel styles
   ========================================================================== */

:root {
  --ink: #0d1f2e;
  --text: #24384c;
  --muted: #5e7183;
  --faint: #8a99a9;

  --primary: #0f4c81;
  --primary-600: #0c3f6b;
  --navy: #0b2239;
  --navy-2: #102c49;

  --accent: #c9962e;
  --accent-600: #b3811f;
  --accent-soft: #fbf3df;

  --bg: #ffffff;
  --bg-alt: #f4f6fa;
  --line: #e4e9f0;

  --success: #177e4e;  --success-bg: #e8f5ee;
  --warning: #b27513;  --warning-bg: #fcf3e2;
  --danger:  #be3b30;  --danger-bg:  #fbeae8;
  --info:    #2563eb;  --info-bg:    #eaf1fd;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;

  --shadow-s: 0 1px 2px rgba(13,31,46,.05), 0 2px 10px rgba(13,31,46,.05);
  --shadow-m: 0 4px 14px rgba(13,31,46,.07), 0 12px 34px rgba(13,31,46,.08);

  --font-display: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --sidebar-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-alt);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 {
  font-family: var(--font-display); color: var(--ink);
  line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 800;
}
p { margin: 0 0 1em; }
.ic { width: 19px; height: 19px; flex: none; vertical-align: -4px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  font-family: var(--font-display); font-weight: 700; font-size: .88rem; line-height: 1.25;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(15,76,129,.25); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-accent { background: var(--accent); color: #23180a; }
.btn-accent:hover { background: var(--accent-600); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: #ccd7e2; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a33227; color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #eef3f8; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(13,31,46,.06); color: var(--ink); }

.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1.5px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; transition: all .15s ease;
}
.icon-btn:hover { background: rgba(13,31,46,.07); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- Forms --------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field label {
  display: block; font-weight: 600; font-size: .82rem; color: var(--ink);
  margin-bottom: 6px; font-family: var(--font-display);
}
.field .req { color: var(--danger); }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font: inherit; font-size: .92rem; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3.5px rgba(15,76,129,.12); }
textarea.input { resize: vertical; min-height: 88px; }
select.input { appearance: auto; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 20px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }

.checkbox-line { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; padding: 6px 0; cursor: pointer; }
.checkbox-line input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.checkbox-line small { display: block; color: var(--muted); font-size: .78rem; }

.radio-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-pill span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: .84rem; font-weight: 600; color: var(--muted);
  transition: all .15s ease; cursor: pointer;
}
.radio-pill input:checked + span {
  border-color: var(--primary); background: #e3edf7; color: var(--primary);
}

/* ---------- Badges & alerts --------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; font-family: var(--font-display);
  letter-spacing: .04em; text-transform: uppercase; line-height: 1.5;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-primary { background: #e3edf7;           color: var(--primary); }
.badge-accent  { background: var(--accent-soft);color: var(--accent-600); }
.badge-neutral { background: #edf1f5;           color: var(--muted); }

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--radius);
  font-size: .89rem; border: 1px solid transparent; margin-bottom: 18px;
}
.alert .ic { width: 18px; height: 18px; margin-top: 2px; }
.alert-success { background: var(--success-bg); color: #116039; border-color: #cdebd9; }
.alert-info    { background: var(--info-bg);    color: #1d4fa8; border-color: #d4e3fb; }
.alert-warning { background: var(--warning-bg); color: #8a5c10; border-color: #f3e2bb; }
.alert-danger  { background: var(--danger-bg);  color: #973026; border-color: #f2cfca; }

/* ---------- Login screen ------------------------------------------------------------------ */

.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 85% -10%, rgba(21,91,152,.55), transparent 60%),
    linear-gradient(160deg, #0d3054, var(--navy) 60%, #081a2c);
}
.login-card {
  width: min(430px, 100%);
  background: #fff; border-radius: var(--radius-l);
  box-shadow: 0 30px 70px rgba(4, 14, 26, .45);
  padding: 38px 36px 32px;
}
.login-card .brand { justify-content: center; margin-bottom: 22px; }
.login-card h1 { font-size: 1.35rem; text-align: center; margin-bottom: 6px; }
.login-card .login-sub { text-align: center; color: var(--muted); font-size: .87rem; margin-bottom: 26px; }
.login-foot { margin-top: 22px; text-align: center; font-size: .8rem; color: var(--faint); }
.login-foot a { color: var(--muted); }
.login-foot a:hover { color: var(--primary); }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img, .brand svg { height: 38px; width: auto; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--ink); line-height: 1.1; }
.brand-name small { display: block; font-size: .58rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-600); }

/* ---------- App shell ------------------------------------------------------------------------ */

.admin-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--navy) 0%, #081a2c 100%);
  color: #9db2c6;
  display: flex; flex-direction: column;
  z-index: 50;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img, .sidebar-brand svg { height: 34px; }
.sidebar-brand .brand-name { color: #fff; font-size: 1rem; }
.sidebar-brand .brand-name small { color: #ffc95e; }

.side-nav { padding: 16px 14px; display: grid; gap: 3px; flex: 1; }
.side-label {
  font-size: .66rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: #55708c; padding: 14px 12px 6px;
}
.side-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px;
  color: #9db2c6; font-weight: 600; font-size: .89rem;
  transition: background-color .14s ease, color .14s ease;
}
.side-link .ic { width: 18px; height: 18px; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.is-active { background: rgba(201,150,46,.14); color: #ffd98a; }
.side-link.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3.5px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.side-link .count {
  margin-left: auto;
  background: rgba(255,255,255,.1); color: #cfdcea;
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}

.sidebar-user {
  margin: 12px; padding: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px;
}
.avatar-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #23180a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: var(--font-display); font-size: .85rem;
  flex: none;
}
.sidebar-user .su-meta { min-width: 0; }
.sidebar-user strong { display: block; color: #fff; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { color: #7d93a9; font-size: .72rem; text-transform: capitalize; }
.sidebar-user form { margin-left: auto; }
.sidebar-user .icon-btn { color: #9db2c6; }
.sidebar-user .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.main-area { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(18px, 3vw, 32px);
  display: flex; align-items: center; gap: 16px;
}
.topbar-title h1 { font-size: 1.15rem; margin: 0; }
.topbar-title p { margin: 0; font-size: .78rem; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.menu-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: 9px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer;
}

.content { padding: clamp(18px, 3vw, 30px); max-width: 1280px; width: 100%; }

@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 60px rgba(4,14,26,.4);
  }
  body.side-open .sidebar { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .side-backdrop {
    position: fixed; inset: 0; background: rgba(8,20,33,.5); z-index: 45;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  body.side-open .side-backdrop { opacity: 1; pointer-events: auto; }
}

/* ---------- Panels & cards ---------------------------------------------------------------------- */

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  margin-bottom: 22px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 9px; }
.panel-head h2 .ic { color: var(--primary); }
.panel-head .panel-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 22px; }
.panel-body.flush { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 15px;
  transition: transform .16s ease, box-shadow .16s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon .ic { width: 21px; height: 21px; }
.stat-icon.blue   { background: #e3edf7; color: var(--primary); }
.stat-icon.green  { background: var(--success-bg); color: var(--success); }
.stat-icon.amber  { background: var(--warning-bg); color: var(--warning); }
.stat-icon.gold   { background: var(--accent-soft); color: var(--accent-600); }
.stat-icon.red    { background: var(--danger-bg); color: var(--danger); }
.stat-icon.violet { background: #efeafd; color: #6d4fc4; }
.stat-meta { min-width: 0; }
.stat-n { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--ink); line-height: 1.15; letter-spacing: -.02em; }
.stat-l { font-size: .78rem; color: var(--muted); font-weight: 600; }

/* ---------- Tables ------------------------------------------------------------------------------------ */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #fafbfd; white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s ease; }
.table tbody tr:hover { background: #f8fafc; }
.table .tn-cell { font-weight: 700; color: var(--ink); font-family: var(--font-display); letter-spacing: .02em; white-space: nowrap; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .actions-cell .btn { margin-left: 6px; }

.row-empty td { text-align: center; color: var(--muted); padding: 42px 16px !important; }
.row-empty .ic { width: 30px; height: 30px; color: #c3cedb; display: block; margin: 0 auto 10px; }

@media (max-width: 760px) {
  table.table, .table thead, .table tbody, .table tr, .table td { display: block; }
  .table thead { display: none; }
  .table tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 12px; padding: 6px 0; background: #fff;
  }
  .table td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    border-bottom: 1px dashed #edf1f6; padding: 10px 16px; text-align: right;
  }
  .table td:last-child { border-bottom: 0; }
  .table td::before {
    content: attr(data-label);
    font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); text-align: left;
  }
  .table .tn-cell { white-space: normal; word-break: break-all; }
  .table .actions-cell { justify-content: flex-end; }
  .table .actions-cell::before { content: ""; }
}

/* ---------- Filter chips / toolbar --------------------------------------------------------------------------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-box .input { padding-left: 40px; }
.search-box .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: .8rem; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: all .14s ease;
  font-family: var(--font-display);
}
.chip:hover { border-color: #b9c8d8; color: var(--ink); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .chip-count { background: rgba(13,31,46,.08); border-radius: 999px; padding: 1px 7px; font-size: .68rem; }
.chip.is-active .chip-count { background: rgba(255,255,255,.2); }

/* ---------- Segmented tabs (messages) ------------------------------------------------------------------------- */

.seg-tabs { display: inline-flex; gap: 4px; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 4px; }
.seg-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 7px;
  font-size: .82rem; font-weight: 700; color: var(--muted);
}
.seg-tab:hover { color: var(--ink); }
.seg-tab.is-active { background: var(--navy); color: #fff; }
.seg-tab .count { background: var(--gold); color: #3d2c05; border-radius: 999px; padding: 1px 8px; font-size: .72rem; }
.seg-tab.is-active .count { background: var(--gold); color: #3d2c05; }

/* ---------- Message viewer ------------------------------------------------------------------------------------ */

.msg-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.msg-body {
  font-size: .95rem; line-height: 1.75; color: var(--text);
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: 10px; padding: 20px 22px; overflow-wrap: anywhere;
}
.msg-link { font-weight: 700; color: var(--navy); }
.msg-link:hover { text-decoration: underline; }
tr.is-unread td { background: #fdfaf2; }
.dot-unread {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px rgba(201,150,46,.18);
}

.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 18px 0 4px; flex-wrap: wrap; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1.5px solid var(--line); background: #fff;
  font-weight: 700; font-size: .84rem; color: var(--muted);
  transition: all .14s ease;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn[disabled] { opacity: .45; cursor: default; }
.page-info { font-size: .8rem; color: var(--muted); margin: 0 8px; }

/* ---------- Detail / view pages ----------------------------------------------------------------------------------- */

.detail-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .detail-cols { grid-template-columns: 1fr; } }

.kv-list { margin: 0; }
.kv-list > div {
  display: grid; grid-template-columns: 160px 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #eef2f6; font-size: .89rem;
}
.kv-list > div:last-child { border-bottom: 0; }
.kv-list dt { color: var(--muted); font-weight: 600; }
.kv-list dd { margin: 0; color: var(--ink); font-weight: 600; word-break: break-word; }
.kv-list dd.pre { white-space: pre-line; font-weight: 400; }
@media (max-width: 520px) { .kv-list > div { grid-template-columns: 1fr; gap: 1px; } }

.tn-hero {
  display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between;
  padding: 20px 22px;
  background: linear-gradient(140deg, #10345a, var(--navy));
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  color: #fff;
}
.tn-hero .t { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #8ba3ba; font-weight: 700; }
.tn-hero .v { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 1.45rem); letter-spacing: .02em; }
.tn-hero .badge { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(4px); }
.tn-hero .badge.b-success { background: rgba(111,211,154,.2); color: #a9ecc6; }
.tn-hero .badge.b-warning { background: rgba(255,201,94,.2); color: #ffe1a1; }
.tn-hero .badge.b-danger { background: rgba(240,130,120,.22); color: #ffc0ba; }
.tn-hero .badge.b-info { background: rgba(120,170,230,.22); color: #bcd8fa; }
.tn-hero .badge.b-accent { background: rgba(255,201,94,.2); color: #ffe1a1; }
.tn-hero .badge.b-neutral { background: rgba(255,255,255,.14); color: #dce6f0; }
.tn-hero .badge.b-primary { background: rgba(120,170,230,.22); color: #bcd8fa; }

.action-bar { display: flex; flex-wrap: wrap; gap: 9px; }

/* Timeline (admin variant reuses public look) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px;
  width: 2px; background: #e2e8ef;
}
.tl-item { position: relative; padding: 0 0 22px 46px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-dot {
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid #dbe2ea; color: #b6c2cf; z-index: 1;
}
.tl-dot .ic { width: 14px; height: 14px; }
.tl-item.done .tl-dot { background: var(--success); border-color: var(--success); color: #fff; }
.tl-item.current .tl-dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(15,76,129,.13); }
.tl-label { font-weight: 700; color: var(--ink); font-family: var(--font-display); font-size: .93rem; }
.tl-item.upcoming .tl-label { color: #9aa8b6; font-weight: 600; }
.tl-time { font-size: .79rem; color: var(--muted); margin-top: 1px; }
.tl-by { font-size: .75rem; color: var(--faint); }
.tl-note { font-size: .83rem; color: var(--muted); margin-top: 4px; background: var(--bg-alt); border-radius: 8px; padding: 7px 11px; display: inline-block; }

/* ---------- Charts ----------------------------------------------------------------------------------------------------- */

.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar-chart .bc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-chart .bc-bar {
  width: 100%; max-width: 34px;
  background: linear-gradient(180deg, #2f7cc0, var(--primary));
  border-radius: 6px 6px 3px 3px;
  min-height: 3px;
  transition: height .5s cubic-bezier(.2,.7,.3,1);
  position: relative;
}
.bar-chart .bc-bar:hover { filter: brightness(1.12); }
.bar-chart .bc-val {
  font-size: .66rem; font-weight: 700; color: var(--muted);
  opacity: 0; transition: opacity .15s ease;
}
.bar-chart .bc-col:hover .bc-val { opacity: 1; }
.bar-chart .bc-day { font-size: .64rem; color: var(--faint); font-weight: 600; }

.legend-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.status-donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 148px; height: 148px; flex: none; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.donut-center strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); line-height: 1; }
.donut-center small { font-size: .68rem; color: var(--muted); font-weight: 600; }

/* ---------- Modal ------------------------------------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8, 20, 33, .55);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .18s ease both; }
.modal {
  width: min(560px, 100%);
  background: #fff; border-radius: var(--radius-l);
  box-shadow: 0 30px 80px rgba(4,14,26,.4);
  max-height: calc(100vh - 48px); overflow-y: auto;
  animation: popIn .2s cubic-bezier(.2,.7,.3,1.1) both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 1.02rem; }
.modal-body { padding: 22px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--line);
  background: #fafbfd; border-radius: 0 0 var(--radius-l) var(--radius-l);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Toasts -------------------------------------------------------------------------------------------------------- */

.toast-zone { position: fixed; bottom: 22px; right: 22px; z-index: 120; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 44px)); }
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--navy); color: #eaf1f8;
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 14px 40px rgba(4,14,26,.35);
  font-size: .87rem;
  animation: toastIn .25s cubic-bezier(.2,.7,.3,1.1) both;
}
.toast.leaving { animation: toastOut .25s ease both; }
.toast .ic { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.toast.success .ic { color: #6fd39a; }
.toast.error .ic { color: #ff9d94; }
.toast.info .ic { color: #8ec2ff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Success / created panel ------------------------------------------------------------------------------------------ */

.created-panel { text-align: center; padding: clamp(28px, 5vw, 48px) 24px; }
.created-check {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--success-bg); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  animation: popIn .35s cubic-bezier(.2,.7,.3,1.2) both;
}
.created-check .ic { width: 34px; height: 34px; }
.tn-reveal {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--bg-alt); border: 1.5px dashed #c3d2e0;
  border-radius: var(--radius); padding: 14px 22px;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--ink); letter-spacing: .04em;
  margin: 6px 0 4px;
}
.tn-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }

/* ---------- Photo upload -------------------------------------------------------------------------------------------------------- */

.photo-upload { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.photo-preview {
  width: 132px; height: 156px; border-radius: var(--radius);
  border: 1.5px dashed #c3d2e0; background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--faint); flex: none;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .ph-hint { text-align: center; font-size: .72rem; padding: 10px; }
.photo-preview .ph-hint .ic { width: 24px; height: 24px; margin: 0 auto 6px; display: block; }

/* ---------- Settings tabs ---------------------------------------------------------------------------------------------------------- */

.tab-nav { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab-btn {
  padding: 11px 16px; border: 0; background: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: .87rem; color: var(--muted);
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
  white-space: nowrap; transition: color .14s ease, border-color .14s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.is-active { color: var(--primary); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; animation: fadeIn .2s ease both; }

/* ---------- Audit log ---------------------------------------------------------------------------------------------------------------- */

.audit-action { font-weight: 700; color: var(--ink); font-size: .85rem; }
.audit-details { color: var(--muted); font-size: .8rem; }

/* ---------- Print document (shipment-print.php) ---------------------------------------------------------------------------------------- */

.print-page { background: #eef1f5; min-height: 100vh; padding: 28px 16px 60px; }
.print-toolbar {
  max-width: 820px; margin: 0 auto 18px;
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}
.print-doc {
  max-width: 820px; margin-inline: auto;
  background: #fff; border-radius: 6px;
  box-shadow: 0 10px 40px rgba(13,31,46,.14);
  padding: 46px 52px;
  color: #1b2a3a;
}
.print-doc-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  border-bottom: 3px solid var(--navy); padding-bottom: 20px; margin-bottom: 26px;
}
.print-doc-head .pd-company { display: flex; gap: 14px; align-items: center; }
.print-doc-head img, .print-doc-head svg.pd-logo { height: 54px; width: auto; }
.print-doc-head .pd-co-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--navy); line-height: 1.15; }
.print-doc-head .pd-co-sub { font-size: .74rem; color: #5e7183; margin-top: 3px; line-height: 1.5; }
.print-doc-head .pd-doc-type { text-align: right; }
.print-doc-head .pd-doc-type strong {
  display: block; font-family: var(--font-display); font-size: .95rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--navy);
}
.print-doc-head .pd-doc-type span { font-size: .74rem; color: #5e7183; }

.pd-tn-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 26px;
}
.pd-tn-banner .lbl { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #5e7183; font-weight: 700; }
.pd-tn-banner .val { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; color: var(--navy); letter-spacing: .03em; }
.pd-qr { text-align: center; }
.pd-qr canvas, .pd-qr img { width: 108px; height: 108px; image-rendering: pixelated; }
.pd-qr small { display: block; font-size: .62rem; color: #8a99a9; margin-top: 4px; }

.pd-section-title {
  font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--primary); margin: 26px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.pd-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.pd-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.pd-table th, .pd-table td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; vertical-align: top; }
.pd-table th { background: #f7f9fc; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #5e7183; width: 190px; }

.pd-status-strip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid currentColor; border-radius: 999px;
  padding: 6px 16px; font-weight: 800; font-family: var(--font-display);
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
}

.pd-timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.pd-timeline li { display: flex; gap: 12px; padding: 7px 0; font-size: .86rem; border-bottom: 1px dashed #eef2f6; align-items: baseline; }
.pd-timeline li:last-child { border-bottom: 0; }
.pd-timeline .pt-state { width: 150px; flex: none; font-weight: 700; color: var(--navy); }
.pd-timeline .pt-time { color: #5e7183; }
.pd-timeline .pt-note { color: #8a99a9; font-style: italic; }

.pd-footer {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  font-size: .74rem; color: #5e7183;
}
.pd-sign { text-align: center; min-width: 200px; }
.pd-sign .line { border-top: 1.5px solid #9db2c6; margin-top: 44px; padding-top: 6px; font-size: .72rem; color: #5e7183; }

@media print {
  body { background: #fff; }
  .print-page { padding: 0; background: #fff; }
  .print-toolbar { display: none !important; }
  .print-doc { box-shadow: none; border-radius: 0; max-width: 100%; padding: 10mm 8mm; }
  .no-print { display: none !important; }
  @page { size: A4; margin: 12mm; }
}

/* ---------- Utility ---------------------------------------------------------------------------------------------------------------------- */

.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.flex-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.w-auto { width: auto; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
