:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #152335;
  --muted: #64748b;
  --line: #dbe3ea;
  --navy: #0d1b2a;
  --navy-2: #17324f;
  --accent: #f59e0b;
  --accent-2: #fbbf24;
  --success: #149c6a;
  --warning: #d97706;
  --danger: #dc3848;
  --info: #2563eb;
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr);
  background: var(--navy);
}
.login-visual {
  position: relative;
  overflow: hidden;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 15% 20%, rgba(245,158,11,.25), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(37,99,235,.2), transparent 34%),
    linear-gradient(145deg, #0b1724, #132d46 60%, #0d1b2a);
}
.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.08);
  transform: rotate(-12deg);
}
.login-visual::before { width: 620px; height: 220px; right: -130px; top: 25%; }
.login-visual::after { width: 780px; height: 320px; left: -240px; bottom: 5%; }
.brand-mark { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.brand-badge { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: var(--accent); color: var(--navy); font-weight: 900; letter-spacing: -1px; box-shadow: 0 12px 32px rgba(245,158,11,.22); }
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: .08em; }
.brand-subtitle { font-size: 12px; opacity: .6; margin-top: 4px; letter-spacing: .11em; }
.hero-copy { position: relative; z-index: 1; max-width: 680px; }
.hero-copy h1 { font-size: clamp(46px, 5vw, 76px); line-height: .98; margin: 0 0 24px; letter-spacing: -.05em; }
.hero-copy h1 span { color: var(--accent-2); }
.hero-copy p { font-size: 18px; line-height: 1.75; color: rgba(255,255,255,.68); max-width: 590px; }
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.hero-pill { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); padding: 9px 13px; border-radius: 999px; font-size: 12px; color: rgba(255,255,255,.78); }
.login-footer { position: relative; z-index: 1; display: flex; justify-content: space-between; color: rgba(255,255,255,.4); font-size: 12px; }
.login-panel { background: #fff; display: grid; place-items: center; padding: 54px; }
.login-card { width: min(440px, 100%); }
.login-card h2 { font-size: 34px; margin: 0 0 8px; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 34px; color: var(--muted); line-height: 1.6; }
.demo-note { background: #fff8e8; border: 1px solid #f7db94; border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; color: #865a00; font-size: 13px; line-height: 1.55; }
.demo-note strong { color: #5f4100; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; font-weight: 700; color: #334155; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: #8aa4bd; box-shadow: 0 0 0 4px rgba(37,99,235,.08); }
.textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent; font-weight: 800; font-size: 13px;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 7px 18px rgba(13,27,42,.16); }
.btn-accent { background: var(--accent); color: #2a1a00; box-shadow: 0 7px 18px rgba(245,158,11,.2); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-danger { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-block { width: 100%; min-height: 48px; }
.btn-icon { width: 40px; min-width: 40px; padding: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #fff; padding: 22px 16px; position: fixed; inset: 0 auto 0 0; width: 250px; overflow: auto; z-index: 20; }
.sidebar .brand-mark { padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand-badge { width: 44px; height: 44px; border-radius: 12px; font-size: 13px; }
.sidebar .brand-title { font-size: 15px; }
.nav-section { margin-top: 24px; }
.nav-label { padding: 0 12px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.33); font-weight: 800; margin-bottom: 8px; }
.nav-item { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.66); display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 11px; margin: 4px 0; text-align: left; font-weight: 700; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(245,158,11,.14); color: #ffc84f; }
.nav-icon { width: 22px; text-align: center; font-size: 16px; }
.sidebar-bottom { margin-top: 32px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 18px; }
.user-mini { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(145deg, var(--accent), #ffd369); color: #2c1c00; display: grid; place-items: center; font-weight: 900; }
.user-mini strong { display: block; font-size: 13px; }
.user-mini span { font-size: 10px; color: rgba(255,255,255,.45); }

.main { grid-column: 2; min-width: 0; }
.topbar { height: 76px; background: rgba(255,255,255,.93); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 15; }
.topbar-title h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.mode-badge { padding: 7px 10px; border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .05em; background: #fff4d7; color: #845800; border: 1px solid #f4d685; }
.live-badge { background: #eafaf3; color: #08794f; border-color: #b9efd7; }
.content { padding: 26px 28px 48px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 5px 18px rgba(15,23,42,.035); }
.metric-top { display: flex; justify-content: space-between; align-items: flex-start; }
.metric-icon { width: 38px; height: 38px; border-radius: 12px; background: #eef3f7; display: grid; place-items: center; }
.metric-card strong { display: block; font-size: 30px; margin-top: 14px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-weight: 700; }
.metric-trend { font-size: 10px; font-weight: 800; border-radius: 999px; padding: 4px 7px; background: #eefaf5; color: var(--success); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 20px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 18px rgba(15,23,42,.035); overflow: hidden; }
.panel-head { padding: 17px 19px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.panel-body { padding: 18px; }
.map-panel { min-height: 370px; background: linear-gradient(180deg, #e8f1f5 0%, #dfeaf0 100%); position: relative; overflow: hidden; }
.map-panel::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(13,27,42,.12) .8px, transparent .8px); background-size: 22px 22px; opacity: .35; pointer-events: none; }
.world-map { width: 100%; height: 100%; min-height: 370px; display: block; position: relative; z-index: 1; }
.map-land { fill: #b8cbd3; stroke: #a8bec8; stroke-width: 1; }
.route-line { fill: none; stroke: #f59e0b; stroke-width: 3; stroke-dasharray: 8 7; filter: drop-shadow(0 2px 2px rgba(13,27,42,.12)); }
.route-line-done { fill: none; stroke: #12324f; stroke-width: 3.5; }
.map-marker { filter: drop-shadow(0 4px 5px rgba(15,23,42,.25)); }
.map-label { fill: #0d1b2a; font-size: 11px; font-weight: 800; paint-order: stroke; stroke: #f0f5f7; stroke-width: 4px; }
.vessel-card { position: absolute; left: 18px; bottom: 18px; z-index: 3; width: min(310px, calc(100% - 36px)); background: rgba(255,255,255,.93); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.8); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; }
.vessel-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.vessel-card h4 { margin: 0 0 4px; font-size: 14px; }
.vessel-card p { margin: 0; font-size: 11px; color: var(--muted); }
.vessel-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.vessel-meta div { background: #f4f7f9; border-radius: 9px; padding: 8px; }
.vessel-meta span { display: block; color: var(--muted); font-size: 9px; }
.vessel-meta strong { font-size: 11px; }

.alert-list, .activity-list { display: grid; gap: 10px; }
.alert-item { display: grid; grid-template-columns: 34px 1fr; gap: 11px; padding: 12px; border-radius: 12px; background: var(--panel-soft); border: 1px solid #edf1f4; }
.alert-dot { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #fff4e5; color: var(--warning); }
.alert-item strong { font-size: 12px; display: block; margin-bottom: 4px; }
.alert-item p { margin: 0; font-size: 11px; line-height: 1.45; color: var(--muted); }

.toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1 1 260px; }
.search-wrap .input { padding-left: 38px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filter-select { min-width: 150px; }
.table-shell { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 18px rgba(15,23,42,.035); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { text-align: left; padding: 12px 16px; background: #f8fafb; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid #edf1f4; font-size: 12px; vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbfcfd; }
tbody tr:last-child td { border-bottom: 0; }
.container-id { font-weight: 900; letter-spacing: .03em; }
.cell-main { font-weight: 800; }
.cell-sub { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-in_transit { background: #eaf2ff; color: #1d5bc5; }
.status-arriving { background: #fff4d9; color: #a46600; }
.status-delayed { background: #fff0f0; color: #c43145; }
.status-discharged { background: #eafaf3; color: #078258; }
.status-ready_pickup { background: #ede9fe; color: #6d28d9; }
.status-completed { background: #eff2f4; color: #64748b; }
.status-tracking { background: #ecfeff; color: #0e7490; }
.status-draft { background: #f1f5f9; color: #64748b; }
.row-actions { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: #475569; }
.icon-btn:hover { background: #f8fafc; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.person-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 17px; }
.person-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.person-card .avatar { width: 44px; height: 44px; }
.person-card h3 { margin: 12px 0 3px; font-size: 15px; }
.person-card p { margin: 0; color: var(--muted); font-size: 11px; }
.role-tag { font-size: 9px; font-weight: 900; padding: 5px 7px; border-radius: 999px; background: #eef2f6; color: #475569; }
.role-admin { background: #fff2cf; color: #845800; }
.person-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.person-meta div { padding: 10px; background: #f8fafb; border-radius: 10px; }
.person-meta span { display: block; color: var(--muted); font-size: 9px; }
.person-meta strong { font-size: 11px; }

.log-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; display: grid; grid-template-columns: 40px 1fr auto; align-items: start; gap: 12px; }
.log-icon { width: 40px; height: 40px; border-radius: 12px; background: #eef3f7; display: grid; place-items: center; }
.log-item strong { font-size: 12px; }
.log-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.log-time { color: var(--muted); font-size: 10px; white-space: nowrap; }

.overlay { position: fixed; inset: 0; background: rgba(7,17,29,.52); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 100; padding: 18px; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 25px 80px rgba(4,13,23,.32); }
.modal-wide { width: min(980px, 100%); }
.modal-head { padding: 20px 22px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-head p { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: #fff; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr); gap: 18px; }
.detail-section { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.detail-section h4 { margin: 0; padding: 12px 14px; background: #f8fafb; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.detail-grid div { padding: 12px 14px; border-bottom: 1px solid #edf1f4; }
.detail-grid div:nth-child(odd) { border-right: 1px solid #edf1f4; }
.detail-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-grid span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 4px; }
.detail-grid strong { font-size: 11px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: #dbe3ea; }
.timeline-item { position: relative; padding: 0 0 18px 10px; }
.timeline-item::before { content: ""; position: absolute; left: -19px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid #9fb1bf; }
.timeline-item.current::before { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.timeline-item strong { display: block; font-size: 11px; }
.timeline-item span { color: var(--muted); font-size: 9px; }

.empty { padding: 52px 20px; text-align: center; color: var(--muted); }
.empty-icon { font-size: 34px; margin-bottom: 10px; }
.mobile-menu { display: none; }

#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; }
.toast { min-width: 270px; max-width: 380px; background: #0d1b2a; color: #fff; border-radius: 13px; padding: 13px 15px; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .25s ease both; }
.toast.success { border-left: 4px solid #21c489; }
.toast.error { border-left: 4px solid #fb7185; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 30px 20px; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .22s; width: 270px; box-shadow: 20px 0 40px rgba(5,15,25,.2); }
  .sidebar.open { transform: translateX(0); }
  .main { display: block; }
  .topbar { height: 66px; padding: 0 16px; }
  .mobile-menu { display: inline-flex; }
  .topbar-title p { display: none; }
  .content { padding: 18px 14px 40px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .mode-badge { display: none; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card small { font-size: 10px; }
  .topbar-actions .btn span { display: none; }
  .modal-body { padding: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid div:nth-child(odd) { border-right: 0; }
  .detail-grid div:nth-last-child(-n+2) { border-bottom: 1px solid #edf1f4; }
  .detail-grid div:last-child { border-bottom: 0; }
}

/* Authentication and registration */
.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 5px; margin: 0 0 22px; border-radius: 13px; background: #f1f5f9; }
.auth-tab { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 800; }
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(15,23,42,.08); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 17px; color: #94a3b8; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.google-auth { display: grid; justify-items: center; gap: 8px; }
#google-signin-button { width: 100%; min-height: 44px; display: grid; place-items: center; }
.google-auth small { color: var(--muted); font-size: 10px; }
.google-unconfigured { margin-top: 18px; padding: 11px 13px; border: 1px dashed #cbd5e1; border-radius: 11px; color: var(--muted); background: #f8fafc; font-size: 11px; line-height: 1.55; }
.pending-note { margin: 0 0 18px; padding: 13px 15px; border: 1px solid #f5d27f; border-radius: 12px; background: #fff8e7; color: #825400; font-size: 12px; line-height: 1.55; }

/* User approval */
.pending-card { border-color: #f3c869; box-shadow: 0 7px 22px rgba(245,158,11,.10); }
.user-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.role-tag.status-pending { background: #fff4d6; color: #946200; }
.role-tag.status-approved { background: #eafaf3; color: #08794f; }
.role-tag.status-rejected { background: #fff0f1; color: #be123c; }
.provider-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.provider-line span { padding: 4px 7px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 9px; font-weight: 800; }
.avatar-img { object-fit: cover; background: #e2e8f0; }
.approval-summary { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; padding: 14px; margin-bottom: 18px; border-radius: 12px; background: #f8fafc; font-size: 12px; }
.approval-summary strong { color: #475569; }

@media (max-width: 480px) {
  .login-card h2 { font-size: 28px; }
  .approval-summary { grid-template-columns: 1fr; gap: 4px; }
}

/* Public vessel tracking */
.vessel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vessel-track-card { background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 18px; box-shadow: 0 8px 24px rgba(15,23,42,.04); display: grid; gap: 14px; }
.vessel-track-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vessel-track-head h3 { margin: 4px 0 3px; font-size: 18px; }
.vessel-track-head p, .vessel-summary { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.eyebrow { color: #64748b; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.vessel-track-location { padding: 13px 14px; border-radius: 13px; background: linear-gradient(135deg,#0d1b2a,#17324d); color: #fff; }
.vessel-track-location strong { display: block; font-size: 15px; }
.vessel-track-location span { display: block; margin-top: 4px; color: #b8c8d8; font-size: 10px; }
.vessel-track-meta { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.vessel-track-meta div { padding: 10px; border-radius: 11px; background: #f8fafc; min-width: 0; }
.vessel-track-meta span { display: block; color: var(--muted); font-size: 8px; }
.vessel-track-meta strong { display: block; margin-top: 4px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confidence { flex: 0 0 auto; padding: 6px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; }
.confidence-high { color: #08794f; background: #e7f9f1; }
.confidence-medium { color: #7c5700; background: #fff4d6; }
.confidence-low { color: #be123c; background: #fff0f1; }
.confidence-unknown { color: #475569; background: #eef2f6; }
.vessel-source-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 9px; }
.vessel-source-row > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.vessel-source-row a, .source-links a { color: #075f9d; text-decoration: none; font-weight: 800; }
.vessel-source-row a:hover, .source-links a:hover { text-decoration: underline; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 10px; }
.source-links span { color: var(--muted); font-weight: 800; margin-right: 4px; }

@media (max-width: 980px) {
  .vessel-grid { grid-template-columns: 1fr; }
  .vessel-track-meta { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 560px) {
  .vessel-track-card { padding: 14px; }
  .vessel-track-meta { grid-template-columns: 1fr 1fr; }
  .vessel-source-row { display: grid; }
  .vessel-source-row > div { justify-content: flex-start; }
}

/* V0.4 Excel manifest import */
.modal-manifest{width:min(1180px,96vw);max-height:95vh}
.manifest-upload{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;padding:16px 18px;border:1px dashed #b9c8da;border-radius:16px;background:#f8fbff;margin-bottom:18px}
.manifest-upload-copy{display:flex;flex-direction:column;gap:4px}.manifest-upload-copy strong{font-size:14px;color:#142235}.manifest-upload-copy span{font-size:12px;color:#64748b}
.manifest-imported{grid-column:1/-1;display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:10px;background:#ecfdf5;color:#166534;font-size:12px}.manifest-imported strong{font-size:12px}
.cargo-editor{margin-top:22px;border-top:1px solid #e2e8f0;padding-top:18px}.cargo-editor-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.cargo-editor-head h4{margin:0;color:#172437}.cargo-editor-head p{margin:4px 0 0;font-size:12px;color:#64748b}
.cargo-table-wrap{overflow:auto;border:1px solid #e2e8f0;border-radius:14px;background:#fff}.cargo-table{min-width:1180px;width:100%;border-collapse:separate;border-spacing:0}.cargo-table th{position:sticky;top:0;background:#f1f5f9;color:#475569;font-size:11px;white-space:nowrap;padding:10px;border-bottom:1px solid #dbe4ee}.cargo-table td{padding:7px;border-bottom:1px solid #edf2f7;vertical-align:middle}.cargo-table tbody tr:last-child td{border-bottom:0}.cargo-table td:first-child,.cargo-table th:first-child{text-align:center;width:38px}.cargo-table td:last-child,.cargo-table th:last-child{width:42px;text-align:center}
.cargo-input{width:100%;min-width:92px;border:1px solid #d7e0ea;border-radius:8px;padding:8px 9px;font:inherit;font-size:12px;color:#142235;background:#fff}.cargo-input:focus{outline:2px solid rgba(245,158,11,.22);border-color:#f59e0b}.cargo-table td:nth-child(2) .cargo-input{min-width:132px}.cargo-table td:nth-child(7) .cargo-input{min-width:145px}.cargo-table td:nth-child(10) .cargo-input{min-width:120px}.cargo-total{display:flex;justify-content:flex-end;gap:5px;padding:10px 4px 0;font-size:12px;color:#64748b}.cargo-total strong{color:#172437}.icon-btn.danger{color:#b91c1c;background:#fff1f2}
.cargo-table-read{min-width:980px}.cargo-table-read td{font-size:12px;color:#334155;white-space:nowrap}
@media (max-width:720px){.manifest-upload{grid-template-columns:1fr}.manifest-upload .btn{width:100%}.manifest-imported{align-items:flex-start;flex-direction:column}.cargo-editor-head{align-items:flex-start;flex-direction:column}.cargo-editor-head .btn{width:100%}.modal-manifest{width:100vw;max-height:100vh;border-radius:0}.cargo-table-wrap{margin-left:-4px;margin-right:-4px}}

/* =========================================================
   AC STONE GROUP UI SYSTEM - V0.6.0
   White / blue corporate interface based on the AC Stone
   internal state portal design supplied by the business.
   ========================================================= */
:root {
  --bg: #f3f8fd;
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --ink: #16324a;
  --muted: #68829c;
  --line: #d9e7f5;
  --navy: #0f4c81;
  --navy-2: #1f6fb2;
  --accent: #0f4c81;
  --accent-2: #1f6fb2;
  --blue: #16324a;
  --blue-soft: #1f6fb2;
  --blue-light: #eaf4ff;
  --success: #12805c;
  --warning: #b66b00;
  --danger: #c33b50;
  --info: #1f6fb2;
  --shadow: 0 20px 60px rgba(15, 76, 129, 0.11);
  --shadow-soft: 0 10px 32px rgba(15, 76, 129, 0.07);
  --radius: 22px;
}

html, body {
  background:
    radial-gradient(circle at 92% 2%, rgba(31, 111, 178, 0.10), transparent 24%),
    linear-gradient(180deg, #f9fcff 0%, #eef6fd 100%);
  color: var(--ink);
}

body::selection { background: #cde5fb; color: #0f3d67; }
button, input, select, textarea { font-family: inherit; }

/* Brand system */
.brand-mark { gap: 14px; min-width: 0; }
.brand-logo { display: block; object-fit: contain; flex: 0 0 auto; }
.brand-copy { min-width: 0; }
.brand-title { color: #17344e; font-size: 14px; font-weight: 800; letter-spacing: .075em; white-space: normal; line-height: 1.15; }
.brand-subtitle { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em; white-space: normal; line-height: 1.25; }
.brand-caption { color: #8aa0b6; font-size: 10px; font-weight: 700; letter-spacing: .06em; margin-top: 5px; white-space: normal; line-height: 1.25; }
.brand-badge { display: none; }

/* Login */
.login-shell {
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  background: #fff;
}
.login-visual {
  color: var(--ink);
  padding: clamp(34px, 5vw, 70px);
  background:
    radial-gradient(circle at 88% 8%, rgba(31, 111, 178, .17), transparent 28%),
    radial-gradient(circle at 2% 88%, rgba(15, 76, 129, .09), transparent 32%),
    linear-gradient(145deg, #f9fcff 0%, #eaf4ff 55%, #f5faff 100%);
  border-right: 1px solid var(--line);
}
.login-visual::before {
  width: 520px;
  height: 520px;
  border-radius: 50%;
  right: -260px;
  top: -250px;
  border: 1px solid rgba(31, 111, 178, .12);
  transform: none;
}
.login-visual::after {
  width: 680px;
  height: 260px;
  left: -230px;
  bottom: -120px;
  border-radius: 50%;
  border: 1px solid rgba(31, 111, 178, .10);
  transform: rotate(-8deg);
}
.brand-mark-login { position: relative; z-index: 2; align-items: center; gap: 10px; max-width: 100%; }
.brand-logo-login { width: 92px; height: 58px; object-position: left center; }
.brand-mark-login .brand-copy { flex: 1; min-width: 0; padding-left: 12px; border-left: 1px solid rgba(15, 76, 129, .18); }
.brand-mark-login .brand-title { font-size: 14px; letter-spacing: .12em; }
.brand-mark-login .brand-subtitle { font-size: 9px; letter-spacing: .16em; margin-top: 4px; }
.brand-mark-login .brand-caption { font-size: 9px; letter-spacing: .05em; margin-top: 6px; }
.hero-copy { max-width: 720px; }
.hero-copy .eyebrow,
.auth-kicker,
.page-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--blue-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero-copy .eyebrow {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(15, 76, 129, .08);
  margin-bottom: 18px;
}
.hero-copy h1 {
  color: var(--ink);
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -.055em;
  margin-bottom: 22px;
}
.hero-copy h1 span { color: #76b7e8; }
.hero-copy p { color: var(--muted); font-size: 17px; line-height: 1.78; max-width: 720px; }
.login-footer { color: var(--muted); font-size: 11px; }
.login-panel {
  position: relative;
  padding: clamp(32px, 5vw, 72px);
  background: rgba(255,255,255,.96);
}
.login-panel::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(217,231,245,.55);
  border-radius: 34px;
  pointer-events: none;
}
.login-panel-brand { display: none; }
.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.auth-kicker { margin-bottom: 13px; }
.login-card h2 { color: var(--ink); font-size: 34px; margin-bottom: 8px; }
.login-card > p { margin-bottom: 26px; color: var(--muted); }
.auth-security-note { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: #89a0b7; font-size: 9px; text-align: center; }
.demo-note { color: #6b5200; background: #fff9e9; border-color: #f0dda4; }
.pending-note { color: #654c00; background: #fff9e9; border-color: #efd99a; }
.auth-tabs { background: #edf5fc; border: 1px solid #e0edf8; }
.auth-tab { color: var(--muted); }
.auth-tab.active { color: var(--blue); box-shadow: 0 5px 16px rgba(15,76,129,.08); }
.google-auth {
  gap: 10px;
  margin-top: 2px;
}
.google-company-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid #d5e5f2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 76, 129, .07);
  text-align: left;
  cursor: pointer;
}
.google-company-btn:hover {
  border-color: #b7d3e9;
  background: #f8fbff;
}
.google-company-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dce9f8;
  color: #2d5f9a;
  font-weight: 800;
  flex: 0 0 auto;
}
.google-company-copy {
  display: grid;
  gap: 3px;
}
.google-company-copy strong {
  color: var(--ink);
  font-size: 14px;
}
.google-company-copy small {
  color: var(--muted);
  font-size: 11px;
}
.google-signin-button {
  width: 100%;
}
.google-signin-button.is-hidden,
.google-company-btn.is-hidden {
  display: none;
}
.google-unconfigured { border-color: #bfd7ec; background: #f5faff; }

/* Inputs and buttons */
.field { gap: 7px; }
.field label { color: #36536d; font-size: 12px; }
.input, .select, .textarea, .cargo-input {
  border-color: #cfdfed;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}
.input:hover, .select:hover, .textarea:hover, .cargo-input:hover { border-color: #a9c6df; }
.input:focus, .select:focus, .textarea:focus, .cargo-input:focus {
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 4px rgba(31,111,178,.10);
  outline: none;
}
.btn { border-radius: 12px; letter-spacing: .005em; }
.btn-accent, .btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  color: #fff;
  box-shadow: 0 9px 22px rgba(15,76,129,.18);
}
.btn-accent:hover, .btn-primary:hover { box-shadow: 0 12px 28px rgba(15,76,129,.24); }
.btn-outline { color: #31516c; border-color: #cfe0ee; background: #fff; }
.btn-outline:hover { color: var(--blue); border-color: #9fc0dc; background: #f7fbff; }
.btn-ghost { color: var(--muted); }

/* Main application */
.app-shell { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar {
  width: 272px;
  padding: 18px 14px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,251,255,.98));
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 40px rgba(15,76,129,.045);
}
.brand-mark-sidebar {
  display: block;
  min-height: auto;
  padding: 5px 10px 18px;
  border-bottom: 1px solid var(--line) !important;
}
.brand-logo-sidebar { display: block; width: 84px; height: 46px; object-position: left center; margin-bottom: 10px; }
.brand-mark-sidebar .brand-copy { padding-left: 0; border-left: 0; }
.brand-mark-sidebar .brand-title { font-size: 13px; letter-spacing: .1em; }
.brand-mark-sidebar .brand-subtitle { margin-top: 5px; font-size: 9px; white-space: normal; letter-spacing: .12em; }
.brand-mark-sidebar .brand-caption { margin-top: 5px; font-size: 9px; white-space: normal; }
.nav-section { margin-top: 20px; }
.nav-label { color: #91a7ba; padding: 0 13px; font-size: 9px; }
.nav-item {
  min-height: 46px;
  color: #58738b;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 13px;
}
.nav-item:hover { color: var(--blue); background: #f0f7fd; }
.nav-item.active {
  color: var(--blue);
  background: linear-gradient(135deg, #eaf4ff, #f5faff);
  border-color: #cfe4f5;
  box-shadow: 0 7px 18px rgba(15,76,129,.075);
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #eef5fb;
  color: #5e7b94;
}
.nav-item.active .nav-icon { color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-soft)); }
.sidebar-support {
  display: grid;
  gap: 5px;
  margin: 24px 8px 0;
  padding: 13px;
  border: 1px solid #d7e8f6;
  border-radius: 14px;
  background: #f2f8fd;
}
.sidebar-support span { color: var(--blue-soft); font-size: 8px; font-weight: 900; letter-spacing: .10em; }
.sidebar-support strong { color: var(--muted); font-size: 9px; font-weight: 700; }
.sidebar-bottom { margin-top: 18px; padding-top: 15px; border-top-color: var(--line); }
.user-mini { border-radius: 15px; }
.user-mini:hover { background: #f0f7fd; }
.avatar {
  color: #fff;
  background: linear-gradient(145deg, var(--blue), var(--blue-soft));
  border-radius: 12px;
  box-shadow: 0 7px 18px rgba(15,76,129,.16);
}
.user-mini strong { color: var(--ink); }
.user-mini span { color: var(--muted); }
.user-mini .btn-ghost { color: #7a93aa; }

.main { grid-column: 2; }
.topbar {
  height: 84px;
  padding: 0 30px;
  background: rgba(255,255,255,.88);
  border-bottom-color: rgba(207,224,238,.86);
  box-shadow: 0 8px 26px rgba(15,76,129,.035);
}
.topbar-left { display: flex; align-items: center; gap: 13px; }
.page-kicker { display: block; margin-bottom: 2px; font-size: 8px; }
.topbar-title h1 { color: var(--ink); font-size: 20px; }
.topbar-title p { color: var(--muted); }
.warehouse-badge, .mode-badge {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #cfe3f4;
  background: #f3f9fe;
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
}
.mode-badge { background: #f2f6f9; color: #6d8295; border-color: #dce7ef; }
.live-badge { background: #eaf9f3; color: #08794f; border-color: #b9ead6; }
.content { max-width: 1680px; padding: 30px 32px 54px; }
.page-head { margin-bottom: 24px; }
.page-head h2 { color: var(--ink); font-size: 29px; }
.page-head p { color: var(--muted); line-height: 1.6; }

/* Cards, panels and metrics */
.metric-grid { gap: 17px; }
.metric-card, .panel, .toolbar, .table-shell, .person-card, .log-item, .vessel-track-card {
  border-color: rgba(209,226,240,.95);
  box-shadow: var(--shadow-soft);
}
.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fcff 100%);
}
.metric-card::after {
  content: "";
  position: absolute;
  width: 95px;
  height: 95px;
  right: -42px;
  bottom: -45px;
  border-radius: 50%;
  background: rgba(31,111,178,.055);
}
.metric-icon { color: var(--blue); background: #eaf4ff; border: 1px solid #d7eafb; }
.metric-card strong { color: var(--ink); }
.metric-trend { color: var(--blue); background: #edf7ff; }
.panel { background: rgba(255,255,255,.96); }
.panel-head { padding: 18px 20px; background: linear-gradient(180deg,#fff,#fbfdff); }
.panel-head h3 { color: var(--ink); }
.map-panel { background: linear-gradient(180deg, #edf7fd 0%, #dcecf6 100%); }
.map-panel::after { background-image: radial-gradient(rgba(15,76,129,.14) .8px, transparent .8px); }
.map-land { fill: #bfd5e2; stroke: #a9c7d8; }
.route-line { stroke: #1f6fb2; }
.route-line-done { stroke: #0f4c81; }
.map-label { fill: #0f4c81; stroke: #f5fbff; }
.vessel-card { border-color: rgba(207,228,244,.95); box-shadow: 0 18px 46px rgba(15,76,129,.15); }
.vessel-meta div { background: #f1f8fd; }
.alert-item { background: #f8fbfe; border-color: #e2edf6; }
.alert-dot { color: var(--blue); background: #eaf4ff; }
.vessel-track-location { background: linear-gradient(135deg, var(--blue), var(--blue-soft)); }
.vessel-track-location span { color: #d7eafa; }

/* Tables and list controls */
.toolbar { padding: 13px; border-radius: 18px; background: rgba(255,255,255,.92); }
.table-shell { border-radius: 20px; }
th { color: #69849b; background: #f3f8fc; border-bottom-color: #dbe8f3; }
td { border-bottom-color: #eaf1f7; }
tbody tr:hover { background: #f7fbff; }
.container-id { color: #153f65; }
.icon-btn { color: var(--blue); border-color: #d0e2f0; border-radius: 10px; }
.icon-btn:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.icon-btn.danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.table-foot { border-top-color: #deebf4; background: #fbfdff; }
.status-in_transit { background: #e8f3ff; color: #1761a0; }
.status-arriving { background: #fff6dc; color: #9d6400; }
.status-delayed { background: #fff0f2; color: #b82f46; }
.status-discharged { background: #e9f9f2; color: #087752; }
.status-ready_pickup { background: #eef0ff; color: #4c50a6; }
.status-completed { background: #eef4f7; color: #647d91; }
.status-tracking { background: #eaf8fb; color: #14748a; }

/* People and activity */
.person-card { border-radius: 20px; background: linear-gradient(145deg,#fff,#fafdff); }
.person-meta div { background: #f2f8fc; }
.role-admin { color: #165c91; background: #e8f3ff; }
.log-icon { color: var(--blue); background: #eaf4ff; }
.provider-line span { color: #58758e; background: #eef6fc; }
.approval-summary { background: #f1f8fd; }
.pending-card { border-color: #c8dff2; box-shadow: 0 12px 32px rgba(15,76,129,.08); }

/* Modals and details */
.overlay { background: rgba(20,49,73,.42); backdrop-filter: blur(9px); }
.modal { border: 1px solid rgba(212,229,242,.95); border-radius: 24px; box-shadow: 0 28px 90px rgba(15,49,75,.24); }
.modal-head, .modal-foot { background: rgba(255,255,255,.96); border-color: var(--line); backdrop-filter: blur(14px); }
.modal-head h3 { color: var(--ink); }
.detail-section { border-color: #d9e8f3; border-radius: 16px; }
.detail-section h4 { color: #234762; background: #f1f8fd; border-color: #dae8f3; }
.detail-grid div { border-color: #e4eef6 !important; }
.timeline::before { background: #cddfeb; }
.timeline-item::before { border-color: #8fb6d2; }
.timeline-item.current::before { border-color: var(--blue-soft); box-shadow: 0 0 0 4px rgba(31,111,178,.14); }
.source-links { border-color: var(--line); }
.source-links a, .vessel-source-row a { color: var(--blue-soft); }

/* Excel loading list */
.manifest-upload {
  border-color: #a9cce5;
  background: linear-gradient(135deg,#f5faff,#edf7ff);
  border-radius: 18px;
}
.manifest-upload-copy strong, .cargo-editor-head h4, .cargo-total strong { color: var(--ink); }
.manifest-imported { color: #0b6c4b; background: #e9f9f2; }
.cargo-editor { border-top-color: var(--line); }
.cargo-table-wrap { border-color: #d5e5f1; border-radius: 15px; }
.cargo-table th { color: #526f88; background: #edf5fb; border-color: #d5e5f1; }
.cargo-table td { border-color: #e7eff6; }
.cargo-input:focus { border-color: var(--blue-soft); outline: none; box-shadow: 0 0 0 3px rgba(31,111,178,.10); }

/* Toast */
.toast { background: #173b59; box-shadow: 0 18px 48px rgba(15,76,129,.20); }

/* Responsive refinements */
@media (max-width: 1100px) {
  .login-shell { grid-template-columns: minmax(0, 1fr) minmax(390px, .86fr); }
  .login-visual { padding: 44px; }
}

@media (max-width: 800px) {
  .login-shell { display: block; min-height: 100vh; background: linear-gradient(180deg,#eef7ff,#fff 42%); }
  .login-visual { display: block; min-height: auto; padding: 25px 20px 18px; background: transparent; border: 0; }
  .brand-mark-login { justify-content: center; }
  .brand-logo-login { width: 92px; height: 58px; }
  .brand-mark-login .brand-copy { display: none; }
  .hero-copy { display: block; margin-top: 18px; }
  .hero-copy .eyebrow { margin-bottom: 14px; }
  .hero-copy h1 { font-size: 40px; }
  .hero-copy p { font-size: 15px; line-height: 1.65; }
  .login-footer { display: none; }
  .login-panel { min-height: auto; padding: 12px 16px 34px; background: transparent; }
  .login-panel::before { display: none; }
  .login-card { margin: 0 auto; padding: 26px 22px; border-radius: 24px; }
  .app-shell { display: block; }
  .sidebar {
    width: 280px;
    box-shadow: 18px 0 52px rgba(15,76,129,.18);
    transform: translateX(-102%);
  }
  .sidebar.open { transform: translateX(0); }
  .main { display: block; }
  .topbar { height: 70px; padding: 0 15px; }
  .mobile-menu { display: inline-flex; }
  .page-kicker, .topbar-title p, .warehouse-badge { display: none; }
  .topbar-title h1 { font-size: 17px; }
  .content { padding: 20px 14px 42px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h2 { font-size: 25px; }
  .mode-badge { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .topbar-actions { gap: 7px; }
  .topbar-actions .btn span { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 15px; }
  .metric-card strong { font-size: 25px; }
  .metric-card small { font-size: 10px; }
  .login-card h2 { font-size: 28px; }
  .modal { border-radius: 18px; }
  .modal-body { padding: 16px; }
}


/* V0.5.8 bilingual application interface */
.brand-title,
.brand-title-cn,
.brand-subtitle {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}
.brand-title span,
.brand-subtitle span {
  display: block;
}
.brand-title-cn {
  margin-top: 6px;
  color: #17344e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.25;
}
.brand-mark-login .brand-title-cn {
  font-size: 12px;
}
.brand-mark-sidebar {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start !important;
  gap: 0 !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 4px 10px 18px !important;
}
.brand-mark-sidebar .brand-logo-sidebar {
  display: block !important;
  width: 86px !important;
  height: 44px !important;
  margin: 0 0 12px 0 !important;
  object-position: left center !important;
}
.brand-mark-sidebar .brand-copy {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 12px 0 0 !important;
  border-left: 0 !important;
  border-top: 1px solid #d3e3f1 !important;
}
.brand-mark-sidebar .brand-title {
  color: #17344e !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .11em !important;
  line-height: 1.28 !important;
}
.brand-mark-sidebar .brand-title-cn {
  margin-top: 7px !important;
  color: #31516c !important;
  font-size: 12px !important;
  letter-spacing: .08em !important;
}
.brand-mark-sidebar .brand-subtitle {
  margin-top: 9px !important;
  color: #8aa0b6 !important;
  font-size: 8px !important;
  font-weight: 700 !important;
  letter-spacing: .10em !important;
  line-height: 1.45 !important;
}
.brand-mark-sidebar .brand-subtitle span + span {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: .06em;
}

/* V0.5.8 bilingual interface */
.login-language-row {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 18px;
}
.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d4e4f1;
  border-radius: 999px;
  background: #eef6fc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}
.language-option {
  min-width: 48px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b849a;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.language-option:hover {
  color: #0f4c81;
}
.language-option.active {
  background: #fff;
  color: #0f4c81;
  box-shadow: 0 4px 12px rgba(15,76,129,.12);
}
.language-switch-compact {
  flex: 0 0 auto;
}
.language-switch-compact .language-option {
  min-width: 38px;
  height: 28px;
  padding: 0 9px;
  font-size: 10px;
}
@media (max-width: 800px) {
  .login-language-row { margin-bottom: 14px; }
  .topbar .language-switch { display: inline-flex; }
}
@media (max-width: 520px) {
  .language-switch-compact .language-option { min-width: 34px; padding: 0 7px; }
}


/* V0.6.0 real AIS map, supervisor-only sync, and shared IMO vessel updates */
.osm-map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 370px;
  border: 0;
  z-index: 1;
  background: #dcecf6;
}
.map-panel-compact {
  min-height: 230px;
  margin: 14px 0;
  border: 1px solid #d9e8f3;
  border-radius: 16px;
}
.map-panel-compact .osm-map-frame { min-height: 230px; }
.map-panel-compact .map-coordinate-badge { top: 10px; left: 10px; }
.map-panel-compact .map-open-link { right: 10px; top: 10px; }
.map-panel-compact .map-attribution { font-size: 8px; }
.map-coordinate-badge {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 16px;
  display: grid;
  gap: 3px;
  max-width: calc(100% - 180px);
  padding: 10px 12px;
  border: 1px solid rgba(207,228,244,.95);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 28px rgba(15,76,129,.16);
  backdrop-filter: blur(8px);
}
.map-coordinate-badge strong { color: var(--ink); font-size: 12px; }
.map-coordinate-badge > span { color: var(--muted); font-size: 10px; }
.position-age { font-weight: 800; }
.position-age-recent { color: #0b8757 !important; }
.position-age-delayed { color: #ad6b00 !important; }
.position-age-stale { color: #c33c54 !important; }
.position-age-unknown { color: #6b7f90 !important; }
.map-open-link {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 16px;
  padding: 9px 11px;
  border: 1px solid #d0e2f0;
  border-radius: 10px;
  color: var(--blue);
  background: rgba(255,255,255,.95);
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(15,76,129,.12);
}
.map-attribution {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  color: #4c6578;
  background: rgba(255,255,255,.84);
  font-size: 9px;
}
.map-no-position {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 34px;
  text-align: center;
  color: var(--muted);
}
.map-no-position strong { color: var(--ink); font-size: 14px; }
.map-no-position span { max-width: 620px; font-size: 11px; line-height: 1.6; }
.map-no-position-icon { font-size: 38px; color: var(--blue); }
.map-freshness-line { margin-top: 10px; font-size: 10px; font-weight: 800; }
.sync-policy-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d9e8f3;
  border-radius: 11px;
  background: #f5faff;
  color: #5d7890;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}
.modal-policy-text { margin-right: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
@media (max-width: 680px) {
  .map-coordinate-badge { max-width: calc(100% - 32px); right: 16px; }
  .map-open-link { top: auto; bottom: 30px; }
  .vessel-card { bottom: 58px; }
  .map-panel-compact .map-open-link { top: auto; bottom: 28px; }
}

/* V0.6.2 IMO auto-fill and archive workspace */
.input-action-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.btn-small { padding: 9px 11px; min-height: 40px; white-space: nowrap; font-size: 11px; }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.45; }
.imo-lookup-empty { margin: 2px 0 18px; padding: 12px 14px; border: 1px dashed #c9dcea; border-radius: 12px; color: var(--muted); background: #f8fbfe; font-size: 11px; }
.imo-lookup-card { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 2px 0 18px; padding: 14px; border: 1px solid #cfe1ee; border-radius: 14px; background: linear-gradient(180deg,#f8fcff,#f1f8fd); }
.imo-lookup-card div { min-width: 0; display: grid; gap: 5px; }
.imo-lookup-card span { color: var(--muted); font-size: 10px; font-weight: 750; }
.imo-lookup-card strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.status-awaiting_vessel { color: #78580a; background: #fff7d6; border-color: #f2d984; }
@media (max-width: 900px) { .imo-lookup-card { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) { .input-action-row { grid-template-columns: 1fr; } .btn-small { width: 100%; } .imo-lookup-card { grid-template-columns: 1fr; } }

/* V0.6.3 responsive cargo detail layout */
.cargo-edit-list,
.cargo-read-list {
  display: grid;
  gap: 12px;
}
.cargo-edit-card,
.cargo-read-card {
  overflow: hidden;
  border: 1px solid #d7e6f2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(15,76,129,.045);
}
.cargo-item-head {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 11px 13px;
  border-bottom: 1px solid #dfebf4;
  background: linear-gradient(180deg,#f8fcff,#f1f8fd);
}
.cargo-item-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg,var(--blue),var(--blue-soft));
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(15,76,129,.15);
}
.cargo-item-kicker,
.cargo-read-title span,
.cargo-read-quantity span,
.cargo-edit-field > span,
.cargo-read-field > span {
  display: block;
  margin-bottom: 5px;
  color: #6d879e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}
.cargo-item-head strong,
.cargo-read-title strong {
  display: block;
  overflow-wrap: anywhere;
  color: #173b59;
  font-size: 13px;
  line-height: 1.35;
}
.cargo-remove { justify-self: end; }
.cargo-edit-grid,
.cargo-read-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px 12px;
  padding: 13px;
}
.cargo-edit-field { display: block; min-width: 0; }
.cargo-edit-field .cargo-input {
  min-width: 0 !important;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.cargo-span-2 { grid-column: span 2; }
.cargo-read-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #d9e8f3;
  color: #69839a;
  background: #fbfdff;
  font-size: 10px;
  font-weight: 700;
}
.cargo-read-summary strong {
  color: #173b59;
  font-size: 11px;
}
.cargo-read-list { padding: 13px; }
.cargo-read-card { box-shadow: none; }
.cargo-read-quantity {
  min-width: 72px;
  padding: 8px 12px;
  border: 1px solid #cfe3f2;
  border-radius: 12px;
  background: #fff;
  text-align: right;
}
.cargo-read-quantity strong {
  color: var(--blue-soft);
  font-size: 18px;
  line-height: 1;
}
.cargo-read-field {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #e1ebf3;
  border-radius: 11px;
  background: #f8fbfe;
}
.cargo-read-field strong {
  display: block;
  overflow-wrap: anywhere;
  color: #334d64;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .cargo-edit-grid,
  .cargo-read-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .cargo-edit-grid,
  .cargo-read-grid { grid-template-columns: 1fr; }
  .cargo-span-2 { grid-column: span 1; }
  .cargo-item-head { grid-template-columns: auto minmax(0,1fr) auto; padding: 10px; }
  .cargo-read-quantity { min-width: 62px; padding: 7px 9px; }
  .cargo-read-list { padding: 10px; }
  .cargo-read-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
}


/* V0.6.4 dashboard vessel summary and map height correction */
.dashboard-vessel-list { display: grid; gap: 10px; }
.dashboard-vessel-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(150px,.8fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.dashboard-vessel-item:hover { transform: translateY(-1px); border-color: #b9d7ec; box-shadow: 0 8px 22px rgba(15,76,129,.08); }
.dashboard-vessel-main, .dashboard-vessel-eta { min-width: 0; display: grid; gap: 4px; }
.dashboard-vessel-main strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-vessel-main span, .dashboard-vessel-eta span { color: var(--muted); font-size: 10px; font-weight: 750; }
.dashboard-vessel-eta { justify-items: end; text-align: right; }
.dashboard-vessel-eta strong { color: var(--ink); font-size: 11px; line-height: 1.4; }
.dashboard-vessel-arrow { color: var(--blue); font-size: 18px; font-weight: 900; }
@media (max-width: 620px) {
  .dashboard-vessel-item { grid-template-columns: minmax(0,1fr) auto; }
  .dashboard-vessel-eta { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .dashboard-vessel-arrow { grid-column: 2; grid-row: 1; }
}

/* V0.6.6 password reset, multi-region access and dashboard filtering */
.auth-form-links { display:flex; justify-content:flex-end; margin:-4px 0 14px; }
.auth-text-link { border:0; background:transparent; color:var(--blue); cursor:pointer; font:inherit; font-size:12px; font-weight:800; padding:8px 0; }
.auth-text-link:hover { text-decoration:underline; }
.dashboard-region-select { min-width:150px; background:#fff; }
.warehouse-check-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:8px; }
.warehouse-check { position:relative; cursor:pointer; }
.warehouse-check input { position:absolute; opacity:0; pointer-events:none; }
.warehouse-check span { display:flex; align-items:center; justify-content:center; min-height:44px; border:1px solid var(--line); border-radius:12px; background:#f8fbfe; color:var(--muted); font-size:12px; font-weight:900; transition:.18s ease; }
.warehouse-check input:checked + span { border-color:#73acd3; background:#e8f4fc; color:var(--blue); box-shadow:0 0 0 2px rgba(15,76,129,.08); }
.field label small { color:var(--muted); font-size:10px; font-weight:700; margin-left:6px; }
.person-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.person-actions .btn { padding-left:10px; padding-right:10px; }
@media (max-width:560px) {
  .warehouse-check-grid { grid-template-columns:1fr; }
  .dashboard-region-select { width:100%; }
  .person-actions { grid-template-columns:1fr; }
}
