:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
  --primary: #2563eb;
  --primary2: #4f46e5;
  --success: #10b981;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 20% -10%, rgba(37, 99, 235, 0.12), transparent 60%),
              radial-gradient(900px 600px at 90% 0%, rgba(79, 70, 229, 0.10), transparent 55%),
              var(--bg);
  color: var(--text);
}

.container { max-width: 1200px; margin: 0 auto; padding: 28px 18px 40px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 76px; width: auto; display: block; }
.brand .title { font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}
.pill strong { color: var(--text); }

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.control label { font-weight: 700; color: var(--muted); }
.control select, .control input[type="date"] {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h2 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 700; }
.kpi { display: flex; align-items: baseline; gap: 10px; }
.kpi .value { font-size: 28px; font-weight: 850; letter-spacing: -0.03em; }
.kpi .hint { font-size: 13px; color: var(--muted); }

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-12 { grid-column: span 12; }

@media (max-width: 980px) {
  .span-3, .span-4 { grid-column: span 6; }
}
@media (max-width: 640px) {
  .span-6 { grid-column: span 12; }
  .span-3, .span-4 { grid-column: span 12; }
  .brand img { height: 44px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .controls { width: 100%; }
  .control { width: 100%; justify-content: space-between; }
  .control select, .control input[type="date"] { width: 100%; }
}

.chart {
  width: 100%;
  height: 260px;
  display: block;
}

/* Make returns block more compact */
#kpiReturnsInTransit, #kpiReturnsPaid {
  font-size: 18px !important;
  line-height: 1.15;
}
.legend { display: flex; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.rev { background: var(--primary); }
.dot.cnt { background: var(--primary2); }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-outline{
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover{
  background: #f9fafb;
}

.note { color: var(--muted); font-size: 12px; line-height: 1.5; }

/* Login page */
.login-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.login-brand {
  display:flex;
  justify-content:center;
  margin-bottom: 14px;
}
.login-brand img { height: 110px; width:auto; }
.login-title {
  text-align:center;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.login-subtitle {
  text-align:center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.login-row {
  display:flex;
  gap: 10px;
  align-items:center;
}
.login-row input[type="password"], .login-row input[type="text"]{
  flex: 1;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
}

