/* ============================================================
   SwiftShip — Main Stylesheet
   ============================================================ */

:root {
  --bg:          #0a0c10;
  --surface:     #111318;
  --surface2:    #181c24;
  --border:      #1f2530;
  --accent:      #ff5c1a;
  --accent2:     #ff8c55;
  --accent-glow: rgba(255,92,26,.18);
  --green:       #22c55e;
  --yellow:      #f59e0b;
  --blue:        #3b82f6;
  --red:         #ef4444;
  --orange:      #f97316;
  --text:        #f0f2f5;
  --text2:       #8b95a8;
  --text3:       #4a5568;
  --font-head:   'Syne', sans-serif;
  --font-body:   'DM Sans', sans-serif;
  --radius:      12px;
  --sidebar-w:   240px;
  --topbar-h:    64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-body); background: var(--bg); color: var(--text); font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; overflow: hidden;
}
.sidebar-logo {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.logo-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.logo-text { font-family: var(--font-head); font-weight: 800; font-size: 18px; }
.logo-text span { color: var(--accent); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { padding: 8px 16px 4px; font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; margin: 1px 8px; border-radius: 8px;
  color: var(--text2); font-size: 13.5px; font-weight: 500;
  transition: all .15s; position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-item.active::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.sidebar-bottom { padding: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #ff9f6a); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 11px; color: var(--accent); }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: fixed; left: var(--sidebar-w); right: 0; top: 0; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; z-index: 90;
}
.topbar-search { flex: 1; max-width: 400px; display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; height: 38px; }
.topbar-search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; font-family: var(--font-body); flex: 1; }
.topbar-search input::placeholder { color: var(--text3); }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 16px; transition: all .15s; position: relative; }
.topbar-btn:hover { border-color: var(--accent); color: var(--accent); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; border: 2px solid var(--surface); }
.cta-btn { height: 36px; padding: 0 16px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-family: var(--font-body); font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all .15s; }
.cta-btn:hover { background: var(--accent2); }

/* ── Layout ──────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
.page-wrap { padding: 28px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--text2); margin-top: 3px; }
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.col-7-5   { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; }
.card-body { padding: 20px; }
.card-action { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 500; }
.card-action:hover { text-decoration: underline; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; position: relative; overflow: hidden; transition: border-color .2s; }
.stat-card:hover { border-color: var(--accent); }
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--card-color, var(--accent)); }
.stat-label { font-size: 12px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin: 6px 0; }
.stat-change { font-size: 12px; display: flex; align-items: center; gap: 4px; color: var(--text2); }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }
.stat-icon { position: absolute; top: 18px; right: 18px; font-size: 26px; opacity: .15; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 16px; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 12px 16px; font-size: 13px; vertical-align: middle; }
.order-id { font-family: monospace; font-size: 12px; color: var(--accent); font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge::before { content: '●'; font-size: 7px; }
.badge-green  { background: rgba(34,197,94,.12);   color: var(--green); }
.badge-yellow { background: rgba(245,158,11,.12);  color: var(--yellow); }
.badge-blue   { background: rgba(59,130,246,.12);  color: var(--blue); }
.badge-red    { background: rgba(239,68,68,.12);   color: var(--red); }
.badge-gray   { background: rgba(139,149,168,.12); color: var(--text2); }
.badge-orange { background: rgba(255,92,26,.12);   color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary { padding: 8px 16px; border-radius: 8px; border: none; background: var(--accent); color: #fff; font-family: var(--font-body); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-outline  { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: none; color: var(--text2); font-family: var(--font-body); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-danger { background: var(--red); color: #fff; border: none; }

/* ── Forms ───────────────────────────────────────────────── */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text2); }
.form-input, .form-select, textarea.form-input {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: 8px; font-family: var(--font-body); font-size: 13px;
  outline: none; transition: border-color .15s; width: 100%;
}
.form-input:focus, .form-select:focus, textarea.form-input:focus { border-color: var(--accent); }
.form-input::placeholder, textarea.form-input::placeholder { color: var(--text3); }
.form-input.error { border-color: var(--red); }
.form-error { font-size: 11px; color: var(--red); }

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-select { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 7px 12px; border-radius: 7px; font-family: var(--font-body); font-size: 12.5px; cursor: pointer; outline: none; }
.filter-select:focus { border-color: var(--accent); }
.search-input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 7px 14px; border-radius: 7px; font-family: var(--font-body); font-size: 12.5px; outline: none; }
.search-input::placeholder { color: var(--text3); }
.search-input:focus { border-color: var(--accent); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn { padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; margin-bottom: -1px; background: none; border-left: none; border-right: none; border-top: none; font-family: var(--font-body); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); }
.pagination-info { font-size: 12px; color: var(--text2); }
.pagination-links { display: flex; gap: 6px; }
.page-link { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); font-size: 12px; cursor: pointer; transition: all .15s; }
.page-link:hover, .page-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── Flash ───────────────────────────────────────────────── */
.flash { position: fixed; top: 80px; right: 24px; z-index: 999; padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: slideIn .3s ease; }
.flash-success { background: rgba(34,197,94,.15); border: 1px solid var(--green); color: var(--green); }
.flash-error   { background: rgba(239,68,68,.15);  border: 1px solid var(--red);   color: var(--red); }
.flash-info    { background: rgba(59,130,246,.15); border: 1px solid var(--blue);  color: var(--blue); }
.flash-warning { background: rgba(245,158,11,.15); border: 1px solid var(--yellow);color: var(--yellow); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Tracking Timeline ───────────────────────────────────── */
.timeline { padding: 8px 0; }
.tl-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface2); flex-shrink: 0; margin-top: 4px; z-index: 1; }
.tl-dot.done   { background: var(--green); border-color: var(--green); }
.tl-dot.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,92,26,.2); animation: pulse 1.5s infinite; }
.tl-item:not(:last-child) .tl-dot::after { content: ''; position: absolute; left: 5px; top: 16px; width: 1px; height: calc(100% - 12px); background: var(--border); }
.tl-title { font-size: 13px; font-weight: 600; }
.tl-desc  { font-size: 12px; color: var(--text2); margin-top: 2px; }
.tl-time  { font-size: 11px; color: var(--text3); margin-top: 2px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(255,92,26,.2); } 50% { box-shadow: 0 0 0 8px rgba(255,92,26,.05); } }

/* ── Rate Cards ──────────────────────────────────────────── */
.rate-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 10px; transition: all .15s; cursor: pointer; background: var(--surface); }
.rate-card:hover, .rate-card.selected { border-color: var(--accent); background: var(--accent-glow); }
.courier-badge { width: 48px; height: 48px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.rate-price { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--accent); }

/* ── Wallet Card ─────────────────────────────────────────── */
.wallet-card { background: linear-gradient(135deg,#1a0d00,#2d1500); border: 1px solid rgba(255,92,26,.3); border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; margin-bottom: 16px; }
.wallet-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 160px; height: 160px; background: radial-gradient(circle,rgba(255,92,26,.2),transparent); border-radius: 50%; }
.wallet-bal { font-family: var(--font-head); font-size: 36px; font-weight: 800; }
.wallet-label { font-size: 13px; color: var(--text2); margin-bottom: 8px; }

/* ── Misc ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: 12px; color: var(--text2); }
.progress-bar  { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.empty { text-align: center; padding: 48px; color: var(--text3); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.notif-item { display: flex; gap: 12px; padding: 12px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; transition: background .12s; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(255,92,26,.05); }
.notif-dot-sm { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-msg { font-size: 13px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 3px; }
input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

/* ── Login Page ──────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 32px; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Responsive */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .two-col, .three-col, .col-7-5 { grid-template-columns: 1fr; }
}
