:root {
  --navy: #123f52;
  --navy-2: #0d5c73;
  --aqua: #17bca2;
  --sky: #28a8db;
  --sky-2: #5ab8e5;
  --coral: #ff6474;
  --amber: #f4a53b;
  --danger: #e95464;
  --ink: #17384a;
  --muted: #718598;
  --line: #dce7ed;
  --panel: #f4f8fa;
  --panel-blue: #e8f6fb;
  --white: #fff;
  --shadow: 0 10px 30px rgba(17, 63, 82, .08);
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; min-height:100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color:var(--ink); background:#f8fbfc; }
button, input, select, textarea { font: inherit; }
button { cursor:pointer; }
a { color:inherit; text-decoration:none; }
.hidden { display:none !important; }
.muted { color:var(--muted); }
.small { font-size:.82rem; }
.micro { font-size:.72rem; }
.wrap { overflow-wrap:anywhere; }

.beta-strip { background:#fff1cf; color:#7a5a13; text-align:center; padding:9px 14px; font-size:.78rem; letter-spacing:.01em; }
.brand { display:flex; align-items:center; gap:10px; font-weight:900; letter-spacing:-.03em; font-size:1.45rem; }
.brand-mark { width:34px; height:34px; border-radius:11px; display:grid; place-items:center; color:white; background:linear-gradient(135deg,var(--aqua),var(--sky)); box-shadow:var(--shadow); }
.brand small { display:block; font-weight:700; font-size:.65rem; letter-spacing:.08em; color:var(--muted); text-transform:uppercase; }

.topbar { height:72px; padding:0 28px; display:flex; align-items:center; justify-content:space-between; background:white; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.top-actions { display:flex; align-items:center; gap:10px; }
.role-pill, .icon-btn, .ghost-btn, .primary-btn, .secondary-btn, .danger-btn { border:0; border-radius:14px; padding:11px 16px; font-weight:750; }
.role-pill { background:#eef3f6; display:flex; align-items:center; gap:9px; }
.avatar { width:32px; height:32px; border-radius:50%; display:grid; place-items:center; background:var(--sky); color:white; font-weight:800; }
.icon-btn { background:#edf4f7; width:42px; height:42px; padding:0; display:grid; place-items:center; }
.primary-btn { background:var(--sky); color:#fff; box-shadow:0 8px 18px rgba(40,168,219,.22); }
.secondary-btn { background:#e9f8f5; color:#087c6c; }
.ghost-btn { background:#eff4f6; color:var(--ink); }
.danger-btn { background:#fff0f2; color:var(--danger); }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover { filter:brightness(.98); }

.customer-shell { min-height:100vh; }
.customer-grid { max-width:1260px; margin:0 auto; display:grid; grid-template-columns:320px 1fr; min-height:calc(100vh - 105px); }
.address-rail { background:var(--panel-blue); padding:28px 18px; }
.address-card { background:white; border-radius:22px; padding:20px; box-shadow:var(--shadow); position:sticky; top:108px; }
.address-card h4 { margin:0 0 12px; color:#8698aa; font-size:.75rem; text-transform:uppercase; letter-spacing:.06em; }
.suite-badge { display:flex; align-items:center; justify-content:space-between; border-radius:14px; background:var(--coral); color:white; padding:15px 16px; font-weight:900; font-size:1.22rem; margin-bottom:16px; }
.address-row { display:grid; grid-template-columns:78px 1fr 28px; gap:6px; align-items:center; min-height:46px; border-bottom:1px solid #e7eef2; }
.address-row:last-of-type { border-bottom:0; }
.address-label { color:#98a5b5; font-size:.7rem; text-transform:uppercase; font-weight:800; }
.address-value { text-align:right; font-size:.85rem; font-weight:750; }
.copy-btn { border:0; background:transparent; color:var(--sky); padding:5px; font-size:1rem; }
.address-tip { margin-top:14px; background:#fff0de; border-left:3px solid var(--amber); border-radius:12px; padding:12px; font-size:.78rem; line-height:1.5; color:#805314; }
.customer-main { padding:36px 42px 80px; background:white; }
.hello-row { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:28px; }
.hello-row h1 { margin:0; letter-spacing:-.04em; font-size:2rem; }
.hello-row p { margin:8px 0 0; color:var(--muted); }

.kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px; }
.kpi { border-radius:17px; padding:18px; color:white; min-height:112px; display:flex; flex-direction:column; justify-content:space-between; }
.kpi.primary { background:var(--sky); grid-column:span 2; }
.kpi.green { background:var(--aqua); grid-column:span 2; }
.kpi.soft { background:var(--sky-2); }
.kpi .value { font-size:1.55rem; font-weight:900; }
.kpi .label { font-size:.83rem; font-weight:750; opacity:.98; }

.hero-card { border-radius:20px; min-height:170px; background:linear-gradient(135deg,#60b4e8,#47a2dc); color:white; padding:24px; position:relative; overflow:hidden; margin-bottom:22px; }
.hero-card:after { content:"📦"; position:absolute; right:28px; bottom:-20px; font-size:8rem; opacity:.18; transform:rotate(-10deg); }
.hero-card h3 { margin:0 0 6px; font-size:1.4rem; }
.hero-card p { max-width:510px; margin:0 0 20px; line-height:1.5; opacity:.96; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.hero-card .primary-btn { background:white; color:var(--navy); box-shadow:none; }
.hero-card .ghost-btn { background:rgba(255,255,255,.18); color:white; }

.alert-card { background:#fff5f5; border:1px solid #ffd9de; border-radius:17px; padding:16px 18px; display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:22px; }
.alert-card strong { color:#b52d42; }
.section-head { display:flex; justify-content:space-between; align-items:end; gap:12px; margin:28px 0 12px; }
.section-head h2 { margin:0; font-size:1.12rem; }
.section-head a, .link-btn { color:var(--sky); font-size:.84rem; font-weight:750; border:0; background:none; padding:0; }

.package-list { display:grid; gap:10px; }
.package-card { border:1px solid var(--line); border-radius:17px; padding:15px 16px; display:grid; grid-template-columns:44px 1fr auto; gap:12px; align-items:center; background:white; transition:.18s ease; }
.package-card:hover { transform:translateY(-1px); box-shadow:var(--shadow); }
.store-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:13px; background:#eef7fb; font-size:1.15rem; }
.package-title { font-weight:850; margin-bottom:3px; }
.package-meta { font-size:.78rem; color:var(--muted); }
.status-pill { display:inline-flex; align-items:center; white-space:nowrap; border-radius:999px; padding:7px 10px; font-size:.7rem; font-weight:850; }
.status-prealerted { background:#f1efff; color:#6852bd; }
.status-miami_received { background:#e5f4ff; color:#1979ac; }
.status-departed { background:#e9f7ff; color:#0d719f; }
.status-curacao_arrived { background:#fff3dd; color:#a36a06; }
.status-customs { background:#fff0e9; color:#b45320; }
.status-ready { background:#e6fbf5; color:#007c66; }
.status-delivered { background:#e7f8ed; color:#197345; }
.invoice-missing { color:var(--danger); font-weight:800; }

.quick-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.quick-tile { border-radius:18px; background:#f3f6f8; min-height:104px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; font-weight:750; font-size:.84rem; text-align:center; padding:14px; border:1px solid transparent; }
.quick-tile:hover { border-color:#d9e8ee; }
.quick-icon { font-size:1.5rem; }

.mobile-bottom { display:none; }

/* Admin */
.admin-shell { min-height:100vh; background:#f4f8fa; }
.admin-grid { display:grid; grid-template-columns:240px 1fr; min-height:calc(100vh - 105px); }
.admin-side { background:var(--navy); color:white; padding:24px 16px; }
.admin-side .brand { margin:0 8px 26px; }
.nav-item { display:flex; gap:11px; align-items:center; padding:12px 13px; margin:4px 0; border-radius:12px; color:#d8e8ef; font-size:.86rem; font-weight:700; border:0; background:transparent; width:100%; text-align:left; }
.nav-item.active, .nav-item:hover { background:rgba(255,255,255,.1); color:white; }
.side-spacer { height:20px; }
.side-caption { color:#86a7b6; text-transform:uppercase; letter-spacing:.08em; font-weight:800; font-size:.64rem; margin:10px 13px 6px; }
.admin-main { padding:28px 32px 60px; overflow:hidden; }
.admin-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; }
.admin-title-row h1 { margin:0; font-size:1.75rem; letter-spacing:-.04em; }
.admin-title-row p { margin:7px 0 0; color:var(--muted); }
.admin-actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-end; }
.admin-kpis { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:20px; }
.admin-kpi { background:white; border-radius:16px; padding:16px; box-shadow:0 5px 18px rgba(17,63,82,.05); border:1px solid #e9f0f3; }
.admin-kpi .k-label { font-size:.72rem; color:var(--muted); font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.admin-kpi .k-value { margin-top:8px; font-size:1.45rem; font-weight:900; }
.admin-kpi.warn .k-value { color:var(--danger); }

.panel { background:white; border:1px solid #e4edf1; border-radius:18px; box-shadow:0 6px 22px rgba(17,63,82,.045); overflow:hidden; }
.panel + .panel { margin-top:16px; }
.panel-head { padding:16px 18px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid #e8eef1; }
.panel-head h2 { margin:0; font-size:1rem; }
.panel-body { padding:18px; }
.filter-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.filter-chip { border:1px solid #d9e5ea; border-radius:999px; padding:7px 11px; background:white; color:#64798a; font-size:.73rem; font-weight:800; }
.filter-chip.active { background:var(--navy); color:white; border-color:var(--navy); }
.search { border:1px solid #dbe6ea; border-radius:12px; padding:10px 12px; min-width:220px; outline:none; }
.search:focus { border-color:#7bc6e6; box-shadow:0 0 0 3px #e7f6fc; }
.table-wrap { overflow:auto; }
.data-table { width:100%; border-collapse:collapse; min-width:920px; }
.data-table th { text-align:left; padding:11px 12px; color:#7f91a0; font-size:.67rem; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid #e7eef2; background:#fbfcfd; }
.data-table td { padding:12px; border-bottom:1px solid #edf2f4; font-size:.8rem; vertical-align:middle; }
.data-table tr:hover td { background:#fbfdfe; }
.data-table .customer-name { font-weight:800; }
.data-table .tracking { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:.73rem; }
.row-action { border:0; background:#edf5f8; border-radius:10px; padding:7px 10px; font-size:.72rem; font-weight:800; }

.two-col { display:grid; grid-template-columns:1.2fr .8fr; gap:16px; }
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.field { display:grid; gap:6px; }
.field.full { grid-column:1 / -1; }
.field label { font-size:.72rem; font-weight:800; color:#6f8392; }
.field input, .field select, .field textarea { width:100%; border:1px solid #d8e5ea; border-radius:11px; padding:10px 11px; outline:none; background:white; }
.field input:focus, .field select:focus, .field textarea:focus { border-color:#6dbce0; box-shadow:0 0 0 3px #e9f7fc; }
.helper { font-size:.7rem; color:var(--muted); }
.summary-box { background:#f4f8fa; border-radius:14px; padding:14px; display:grid; gap:9px; }
.summary-row { display:flex; justify-content:space-between; gap:12px; font-size:.8rem; }
.summary-row.total { border-top:1px solid #d9e4e9; padding-top:10px; font-size:.92rem; font-weight:900; }

/* Modal / sheet */
.modal-backdrop { position:fixed; inset:0; background:rgba(5,29,41,.48); z-index:90; display:grid; place-items:center; padding:18px; }
.modal { width:min(760px,100%); max-height:90vh; overflow:auto; background:white; border-radius:22px; box-shadow:0 30px 70px rgba(0,0,0,.2); }
.modal.small { width:min(520px,100%); }
.modal-head { display:flex; justify-content:space-between; gap:15px; align-items:center; padding:18px 20px; border-bottom:1px solid #e8eef1; position:sticky; top:0; background:white; z-index:2; }
.modal-head h2 { margin:0; font-size:1.08rem; }
.modal-body { padding:20px; }
.modal-foot { padding:15px 20px; border-top:1px solid #e8eef1; display:flex; justify-content:flex-end; gap:9px; position:sticky; bottom:0; background:white; }
.close-btn { border:0; width:36px; height:36px; border-radius:10px; background:#eef4f6; }
.timeline { display:grid; gap:0; margin:18px 0; }
.timeline-item { display:grid; grid-template-columns:24px 1fr; gap:10px; min-height:54px; }
.timeline-item .dot { width:13px; height:13px; border-radius:50%; background:#b9c8d0; margin:3px auto 0; position:relative; }
.timeline-item:not(:last-child) .dot:after { content:""; position:absolute; width:2px; height:43px; background:#d9e3e8; left:5px; top:12px; }
.timeline-item.done .dot { background:var(--aqua); }
.timeline-item.current .dot { background:var(--amber); box-shadow:0 0 0 4px #fff3dd; }
.timeline-item strong { display:block; font-size:.84rem; }
.timeline-item span { display:block; color:var(--muted); font-size:.73rem; margin-top:3px; }

/* Import */
.drop-zone { border:2px dashed #b9d3de; border-radius:18px; background:#f8fcfd; min-height:180px; display:grid; place-items:center; text-align:center; padding:24px; }
.drop-zone.drag { border-color:var(--sky); background:#effaff; }
.drop-zone .big { font-size:2.2rem; }
.import-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:14px 0; }
.import-stat { border-radius:13px; padding:12px; background:#f4f8fa; }
.import-stat strong { display:block; font-size:1.25rem; }
.match-exact { color:#11835f; font-weight:800; }
.match-suite { color:#1c78aa; font-weight:800; }
.match-unmatched { color:#bd3b50; font-weight:800; }

.toast { position:fixed; right:20px; bottom:20px; z-index:120; background:var(--navy); color:white; padding:11px 15px; border-radius:12px; box-shadow:var(--shadow); font-size:.8rem; font-weight:700; transform:translateY(20px); opacity:0; pointer-events:none; transition:.22s; }
.toast.show { transform:translateY(0); opacity:1; }

@media (max-width: 980px) {
  .customer-grid { grid-template-columns:1fr; }
  .address-rail { padding:16px; }
  .address-card { position:relative; top:auto; }
  .customer-main { padding:24px 18px 88px; }
  .admin-grid { grid-template-columns:1fr; }
  .admin-side { display:none; }
  .admin-main { padding:20px 16px 90px; }
  .admin-kpis { grid-template-columns:repeat(2,1fr); }
  .two-col { grid-template-columns:1fr; }
  .topbar { padding:0 16px; }
  .desktop-only { display:none !important; }
  .mobile-bottom { display:grid; grid-template-columns:repeat(4,1fr); position:fixed; z-index:50; bottom:0; left:0; right:0; background:white; border-top:1px solid #dce7ed; padding:7px 6px calc(7px + env(safe-area-inset-bottom)); }
  .mobile-bottom button, .mobile-bottom a { border:0; background:none; display:grid; place-items:center; gap:3px; font-size:.63rem; color:#6f8290; font-weight:750; padding:6px; }
  .mobile-bottom .active { color:var(--sky); }
}
@media (max-width: 640px) {
  .beta-strip { font-size:.68rem; }
  .topbar { height:62px; }
  .brand { font-size:1.18rem; }
  .brand-mark { width:31px; height:31px; }
  .hello-row h1 { font-size:1.55rem; }
  .hello-row { margin-bottom:18px; }
  .kpi-grid { grid-template-columns:repeat(2,1fr); gap:9px; }
  .kpi.primary, .kpi.green { grid-column:span 1; }
  .kpi { min-height:92px; padding:14px; }
  .kpi .value { font-size:1.25rem; }
  .kpi .label { font-size:.7rem; }
  .quick-grid { grid-template-columns:repeat(2,1fr); }
  .quick-grid .quick-tile:last-child { grid-column:1 / -1; }
  .package-card { grid-template-columns:40px 1fr; }
  .package-card .status-pill { grid-column:2; justify-self:start; }
  .store-icon { width:40px; height:40px; }
  .alert-card { align-items:flex-start; flex-direction:column; }
  .admin-title-row { flex-direction:column; }
  .admin-actions { justify-content:flex-start; }
  .admin-kpis { grid-template-columns:repeat(2,1fr); }
  .admin-kpis .admin-kpi:first-child { grid-column:1/-1; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .import-stats { grid-template-columns:1fr; }
}
