@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Sora:wght@500;600;700&display=swap');

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --bg: #f1f5f9;
  --brand: #0ea5e9;
  --brand-dark: #0284c7;
  --accent: #14b8a6;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

html, body, .app-body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.wrapper, .content-wrapper {
  background: transparent !important;
}

.app-content {
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(14, 165, 233, 0.12), transparent 60%),
    radial-gradient(700px 320px at 100% 0%, rgba(20, 184, 166, 0.10), transparent 55%),
    var(--bg) !important;
  min-height: 100vh;
}

.app-sidebar {
  background: linear-gradient(180deg, #0b1220 0%, #111827 100%) !important;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.brand-link {
  display: flex !important;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  padding: 1rem 1.1rem !important;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 8px 18px rgba(14,165,233,.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: #fff !important;
}

.brand-text small {
  opacity: .65;
  font-size: .72rem;
}

.nav-sidebar .nav-link {
  border-radius: 12px !important;
  margin: 4px 10px;
  color: rgba(255,255,255,.72) !important;
}

.nav-sidebar .nav-link.active,
.nav-sidebar .nav-link:hover {
  background: rgba(14,165,233,.18) !important;
  color: #fff !important;
}

.main-header {
  background: rgba(255,255,255,.85) !important;
  backdrop-filter: blur(10px);
}

.page-crumb {
  font-family: Sora, sans-serif;
  font-weight: 600;
  color: var(--ink) !important;
}

.user-chip {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 991px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(226,232,240,.8);
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(15,23,42,.12);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  opacity: .15;
}

.stat-card.total::after { background: var(--brand); }
.stat-card.pending::after { background: var(--warn); }
.stat-card.delivered::after { background: var(--ok); }
.stat-card.amount::after { background: var(--accent); }

.stat-label {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
}

.stat-value {
  font-family: Sora, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: .15rem;
}

.panel-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,.85);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.panel-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem;
  font-family: Sora, sans-serif;
  font-weight: 600;
}

.panel-card .card-body {
  padding: 1.25rem;
}

.form-control, .custom-select {
  border-radius: 12px !important;
  border-color: #dbe3ee !important;
  min-height: 44px;
  box-shadow: none !important;
}

.form-control:focus, .custom-select:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 .2rem rgba(14,165,233,.15) !important;
}

.btn {
  border-radius: 12px !important;
  font-weight: 600;
  padding: .55rem 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)) !important;
  border: none !important;
  box-shadow: 0 8px 18px rgba(14,165,233,.28);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border: none !important;
}

.btn-outline-secondary {
  border-radius: 12px !important;
}

.table thead th {
  border-top: 0;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  border-bottom-width: 1px;
}

.table td {
  vertical-align: middle;
}

.badge-pill {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .03em;
}

.paste-box {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1.5px dashed #94a3b8;
  border-radius: 14px;
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(800px 400px at 0% 0%, rgba(14,165,233,.25), transparent 50%),
    radial-gradient(700px 380px at 100% 100%, rgba(20,184,166,.22), transparent 50%),
    #0b1220;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(0,0,0,.25);
  overflow: hidden;
}

.auth-card .auth-head {
  padding: 1.6rem 1.6rem 0.5rem;
}

.auth-card .auth-head h1 {
  font-family: Sora, sans-serif;
  font-size: 1.45rem;
  margin: 0;
}

.auth-card .auth-body {
  padding: 1rem 1.6rem 1.6rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: .75rem;
}

.filter-bar .form-control,
.filter-bar .custom-select {
  min-height: 42px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: .75rem;
  opacity: .5;
}

.action-btns .btn {
  padding: .35rem .55rem;
  margin: 0 2px;
}

.badge-panel {
  background: rgba(14,165,233,.12);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: .4rem .75rem;
  font-weight: 600;
  font-size: .75rem;
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: 1rem;
}

.status-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 46px;
  padding: .55rem .7rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: #334155 !important;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(15,23,42,.04);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.status-tab i { opacity: .75; }
.status-tab em {
  font-style: normal;
  background: #e2e8f0;
  border-radius: 999px;
  padding: .05rem .45rem;
  font-size: .72rem;
  font-weight: 700;
}

.status-tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.status-tab.active {
  color: #fff !important;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 10px 22px rgba(14,165,233,.28);
}
.status-tab.active em { background: rgba(255,255,255,.22); color: #fff; }

.status-tab.tab-pending.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 10px 22px rgba(245,158,11,.28);
}
.status-tab.tab-delivered.active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 10px 22px rgba(34,197,94,.28);
}
.status-tab.tab-supplier.active {
  background: linear-gradient(135deg, #f59e0b, #ca8a04);
  box-shadow: 0 10px 22px rgba(202,138,4,.25);
}

.panel-intro {
  margin-bottom: 1rem;
}
.panel-intro h2 {
  font-family: Sora, sans-serif;
  font-size: 1.25rem;
  margin: 0 0 .25rem;
}
.panel-intro p {
  margin: 0;
  color: var(--muted);
  max-width: 52rem;
}

.supplier-item {
  padding: 1rem 1.15rem !important;
}
.supplier-item:hover {
  background: #f8fafc !important;
}

@media (max-width: 767.98px) {
  .status-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .status-tab {
    font-size: .82rem;
    min-height: 44px;
  }
  .status-tab span { white-space: nowrap; }
}

/* —— Mobile-first enhancements —— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.filter-toolbar { display: flex; flex-direction: column; gap: .85rem; }

.preset-row {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.preset-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: .4rem .85rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
}
.chip.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}

@media (min-width: 768px) {
  .filter-grid {
    grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)) auto;
    align-items: center;
  }
}

@media (min-width: 1200px) {
  .filter-grid {
    grid-template-columns: 1.8fr repeat(5, minmax(0, .9fr)) auto;
  }
}

.search-wrap { position: relative; }
.search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-wrap .form-control { padding-left: 2.2rem; }

.fg-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.result-count {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
}

.ship-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .85rem;
}

.ship-card {
  background: var(--surface);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.ship-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .75rem;
}

.ship-card-title {
  font-family: Sora, sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
}

.ship-card-sub {
  color: var(--muted);
  font-size: .8rem;
  margin-top: .15rem;
}

.ship-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem .75rem;
  margin-bottom: .9rem;
}

.ship-card-grid span {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
}

.ship-card-grid strong {
  font-size: .92rem;
  word-break: break-word;
}

.ship-card-actions {
  display: flex;
  gap: .4rem;
  align-items: stretch;
}

.ship-card-actions .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-modal {
  border-radius: 18px;
  border: 0;
}

@media (max-width: 991.98px) {
  .content-wrapper > .content > .container-fluid {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }

  .main-sidebar {
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }

  .stat-grid { gap: .7rem; }

  .stat-card { padding: .9rem 1rem; }
  .stat-value { font-size: 1.45rem; }

  .panel-card .card-header {
    padding: .9rem 1rem;
    font-size: .98rem;
  }

  .btn, .form-control, .custom-select {
    min-height: 44px;
  }

  .auth-wrap { padding: 1.25rem .85rem; }
  .auth-card { border-radius: 18px; }

  /* Sticky mobile add affordance space */
  .app-content { padding-bottom: 2rem; }
}

@media (max-width: 575.98px) {
  .brand-text small { display: none; }
  .page-crumb { font-size: .95rem !important; }
  .ship-card-grid { grid-template-columns: 1fr 1fr; }
  .export-row .btn { flex: 1 1 auto; text-align: center; }
}

@supports (padding: max(0px)) {
  .app-content {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}
