/* ── Allway Cargo Frontend Portal ──────────────────────────────────────────── */
:root {
  --aw-primary: #FF6B00;
  --aw-accent:  #1A1A2E;
  --aw-green:   #16a34a;
  --aw-blue:    #2563eb;
  --aw-yellow:  #d97706;
  --aw-red:     #dc2626;
  --aw-border:  #e5e7eb;
  --aw-bg:      #f8f9fb;
  --aw-radius:  12px;
  --aw-shadow:  0 1px 4px rgba(0,0,0,.08);
  --aw-shadow-lg: 0 12px 40px rgba(0,0,0,.14);
}

.aw-fe-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #111827; max-width: 1200px; margin: 0 auto; }

/* ── Auth Card ──────────────────────────────────────────────────────────────── */
.aw-fe-auth-card { max-width: 440px; margin: 40px auto; background: #fff; border-radius: 20px; box-shadow: var(--aw-shadow-lg); overflow: hidden; }
.aw-fe-auth-brand { background: linear-gradient(135deg, var(--aw-accent), #16213E); padding: 32px 32px 24px; text-align: center; }
.aw-fe-auth-logo { max-height: 50px; max-width: 150px; object-fit: contain; filter: brightness(0) invert(1); margin-bottom: 10px; }
.aw-fe-auth-brand-name { font-size: 22px; font-weight: 800; color: var(--aw-primary); margin-bottom: 8px; }
.aw-fe-auth-title { color: #fff; font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.aw-fe-auth-sub { color: rgba(255,255,255,.55); font-size: 13px; margin: 0; }

/* Tabs */
.aw-fe-tabs { display: flex; border-bottom: 2px solid var(--aw-border); padding: 0 24px; background: #fafafa; }
.aw-fe-tab { flex: 1; padding: 14px 0; background: none; border: none; font-size: 14px; font-weight: 600; color: #9ca3af; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.aw-fe-tab.active { color: var(--aw-primary); border-bottom-color: var(--aw-primary); }

/* Tab content */
.aw-fe-tab-content { display: none; padding: 24px; }
.aw-fe-tab-content.active { display: block; }

/* Auth Alert */
.aw-fe-auth-alert { margin: 0 24px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.aw-fe-auth-alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.aw-fe-auth-alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Eye toggle */
.aw-fe-input-eye { position: relative; }
.aw-fe-input-eye input { width: 100%; box-sizing: border-box; padding-right: 42px; }
.aw-fe-eye-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; padding: 0; line-height: 1; }

/* ── Top Bar ────────────────────────────────────────────────────────────────── */
.aw-fe-topbar { display: flex; align-items: center; justify-content: space-between; background: var(--aw-accent); padding: 14px 24px; border-radius: var(--aw-radius) var(--aw-radius) 0 0; margin-bottom: 24px; }
.aw-fe-topbar-brand { display: flex; align-items: center; gap: 12px; }
.aw-fe-topbar-logo { max-height: 36px; max-width: 120px; object-fit: contain; filter: brightness(0) invert(1); }
.aw-fe-topbar-name { color: var(--aw-primary); font-size: 18px; font-weight: 800; }
.aw-fe-admin-badge { background: var(--aw-primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: .05em; }
.aw-fe-topbar-user { display: flex; align-items: center; gap: 12px; }
.aw-fe-topbar-greeting { color: rgba(255,255,255,.75); font-size: 13px; }
.aw-fe-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--aw-primary); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.aw-fe-avatar.admin { background: var(--aw-green); }

/* ── Stats ──────────────────────────────────────────────────────────────────── */
.aw-fe-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.aw-fe-stat-card { background: #fff; border-radius: var(--aw-radius); padding: 18px 20px; box-shadow: var(--aw-shadow); border-left: 4px solid var(--aw-primary); }
.aw-fe-stat-card.green  { border-color: var(--aw-green); }
.aw-fe-stat-card.blue   { border-color: var(--aw-blue); }
.aw-fe-stat-card.yellow { border-color: var(--aw-yellow); }
.aw-fe-stat-card.orange { border-color: var(--aw-primary); }
.aw-fe-stat-val { font-size: 28px; font-weight: 800; color: var(--aw-accent); line-height: 1; }
.aw-fe-stat-lbl { font-size: 11px; color: #9ca3af; margin-top: 6px; text-transform: uppercase; letter-spacing: .06em; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.aw-fe-card { background: #fff; border-radius: var(--aw-radius); box-shadow: var(--aw-shadow); margin-bottom: 22px; overflow: hidden; }
.aw-fe-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--aw-border); flex-wrap: wrap; gap: 10px; }
.aw-fe-card-header h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--aw-accent); }

/* ── Table ──────────────────────────────────────────────────────────────────── */
.aw-fe-table-wrap { overflow-x: auto; }
.aw-fe-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aw-fe-table th { background: #f9fafb; padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--aw-border); white-space: nowrap; }
.aw-fe-table td { padding: 12px 14px; border-bottom: 1px solid #f9fafb; vertical-align: middle; }
.aw-fe-table tbody tr:hover { background: #fafafa; }
.aw-fe-table tbody tr:last-child td { border-bottom: none; }
.aw-fe-code { font-family: monospace; font-size: 12px; background: #fff5ed; padding: 3px 8px; border-radius: 5px; color: var(--aw-primary); font-weight: 700; white-space: nowrap; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.aw-fe-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.aw-fe-badge-pending    { background: #fef9c3; color: #854d0e; }
.aw-fe-badge-processing { background: #dbeafe; color: #1d4ed8; }
.aw-fe-badge-transit    { background: #e0f2fe; color: #0369a1; }
.aw-fe-badge-delivery   { background: #ede9fe; color: #6d28d9; }
.aw-fe-badge-delivered  { background: #dcfce7; color: #166534; }
.aw-fe-badge-hold       { background: #fee2e2; color: #991b1b; }
.aw-fe-badge-returned   { background: #f3f4f6; color: #374151; }
.aw-fe-badge-cancelled  { background: #f3f4f6; color: #6b7280; }
.aw-fe-badge-unpaid     { background: #fee2e2; color: #dc2626; }
.aw-fe-badge-partial    { background: #fef3c7; color: #d97706; }
.aw-fe-badge-paid       { background: #dcfce7; color: #16a34a; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.aw-fe-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all .15s; line-height: 1; white-space: nowrap; }
.aw-fe-btn-primary { background: var(--aw-primary); color: #fff; }
.aw-fe-btn-primary:hover { background: #e55e00; color: #fff; }
.aw-fe-btn-outline { background: #fff; color: var(--aw-accent); border: 1.5px solid var(--aw-border); }
.aw-fe-btn-outline:hover { background: #f3f4f6; border-color: #d1d5db; }
.aw-fe-btn-danger { background: var(--aw-red); color: #fff; }
.aw-fe-btn-danger:hover { background: #b91c1c; }
.aw-fe-btn-sm { padding: 5px 12px; font-size: 12px; }
.aw-fe-btn-full { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.aw-fe-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.aw-fe-form-group label { font-size: 12px; font-weight: 600; color: #374151; }
.aw-fe-form-group input,
.aw-fe-form-group select,
.aw-fe-form-group textarea { border: 1.5px solid var(--aw-border); border-radius: 8px; padding: 9px 12px; font-size: 13.5px; color: #111827; width: 100%; box-sizing: border-box; transition: border-color .15s; background: #fff; }
.aw-fe-form-group input:focus,
.aw-fe-form-group select:focus,
.aw-fe-form-group textarea:focus { outline: none; border-color: var(--aw-primary); box-shadow: 0 0 0 3px rgba(255,107,0,.1); }
.aw-fe-form-group textarea { resize: vertical; min-height: 64px; }
.aw-fe-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.aw-fe-full { grid-column: 1 / -1; }
.aw-fe-form-section-title { font-size: 11px; font-weight: 700; color: var(--aw-primary); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 12px; padding-bottom: 6px; border-bottom: 2px solid #fff5ed; }

/* ── Image Upload ───────────────────────────────────────────────────────────── */
.aw-fe-img-upload { border: 2px dashed var(--aw-border); border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: all .2s; background: #fafafa; }
.aw-fe-img-upload:hover { border-color: var(--aw-primary); background: #fff5ed; }

/* ── Search ─────────────────────────────────────────────────────────────────── */
.aw-fe-search-input { border: 1.5px solid var(--aw-border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #111; background: #fff; min-width: 200px; }
.aw-fe-search-input:focus { outline: none; border-color: var(--aw-primary); }

/* ── Alert ──────────────────────────────────────────────────────────────────── */
.aw-fe-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; font-weight: 500; }
.aw-fe-alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.aw-fe-alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.aw-fe-alert.info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Empty State ────────────────────────────────────────────────────────────── */
.aw-fe-empty { text-align: center; padding: 48px 24px; color: #6b7280; }
.aw-fe-empty-icon { font-size: 48px; margin-bottom: 12px; }
.aw-fe-empty p { margin: 6px 0; font-size: 14px; }

/* ── Denied ─────────────────────────────────────────────────────────────────── */
.aw-fe-denied { background: #fee2e2; color: #991b1b; padding: 20px 24px; border-radius: var(--aw-radius); font-size: 15px; font-weight: 600; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.aw-fe-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.aw-fe-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--aw-shadow-lg); animation: aw-modal-in .2s ease; }
.aw-fe-modal-lg { max-width: 820px; }
.aw-fe-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--aw-border); flex-shrink: 0; }
.aw-fe-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--aw-accent); }
.aw-fe-modal-close { background: #f3f4f6; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; }
.aw-fe-modal-close:hover { background: #e5e7eb; }
.aw-fe-modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.aw-fe-modal-footer { padding: 16px 24px; border-top: 1px solid var(--aw-border); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }

@keyframes aw-modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Customer Detail Modal body ─────────────────────────────────────────────── */
.aw-fe-detail-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid #f9fafb; gap: 16px; }
.aw-fe-detail-row:last-child { border-bottom: none; }
.aw-fe-detail-row span { color: #6b7280; flex-shrink: 0; font-size: 13px; }
.aw-fe-detail-row strong { color: #111827; text-align: right; word-break: break-word; }
.aw-fe-detail-section { margin-bottom: 18px; }
.aw-fe-detail-section-title { font-size: 11px; font-weight: 700; color: var(--aw-primary); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

/* ── Timeline in modal ──────────────────────────────────────────────────────── */
.aw-fe-timeline { position: relative; padding-left: 26px; }
.aw-fe-timeline::before { content:''; position:absolute; left:7px; top:8px; bottom:8px; width:2px; background:#e5e7eb; }
.aw-fe-tl-item { position:relative; margin-bottom:18px; }
.aw-fe-tl-item:last-child { margin-bottom:0; }
.aw-fe-tl-dot { position:absolute; left:-21px; top:4px; width:13px; height:13px; border-radius:50%; background:#d1d5db; border:2px solid #fff; box-shadow:0 0 0 2px #d1d5db; }
.aw-fe-tl-item.active .aw-fe-tl-dot { background: var(--aw-primary); box-shadow:0 0 0 2px var(--aw-primary); }
.aw-fe-tl-status { font-weight:700; font-size:14px; color:#111827; }
.aw-fe-tl-loc { font-size:13px; color:#374151; margin-top:3px; }
.aw-fe-tl-desc { font-size:13px; color:#4b5563; margin-top:2px; }
.aw-fe-tl-time { font-size:12px; color:#9ca3af; margin-top:4px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .aw-fe-stats { grid-template-columns: 1fr 1fr; }
  .aw-fe-form-grid { grid-template-columns: 1fr; }
  .aw-fe-full { grid-column: 1; }
  .aw-fe-topbar { border-radius: 0; flex-wrap: wrap; gap: 10px; }
  .aw-fe-card-header { flex-direction: column; align-items: flex-start; }
  .aw-fe-search-input { min-width: 100%; }
}
@media (max-width: 480px) {
  .aw-fe-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .aw-fe-modal { max-height: 95vh; border-radius: 12px 12px 0 0; }
  .aw-fe-modal-overlay { align-items: flex-end; padding: 0; }
}
