@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0c1220;
  --bg-muted: #0f172a;
  --surface: #0b1323;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #5b6478;
  --stroke: #e6e8ec;
  --brand: #0ea5e9;
  --brand-strong: #0c8bc9;
  --accent: #10b981;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
}

* { box-sizing: border-box; }

/* ===== Base ===== */
body {
  font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  background: radial-gradient(circle at 15% 20%, rgba(14,165,233,0.08), transparent 35%),
              radial-gradient(circle at 80% 10%, rgba(16,185,129,0.08), transparent 32%),
              #eef1f8;
  color: var(--ink);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(12, 18, 32, 0.9);
  color: #e5e7eb;
  padding: 14px 28px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.topbar .brand {
  font-weight: 800;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar .brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #38bdf8);
  box-shadow: 0 0 0 6px rgba(14,165,233,0.2);
}

.topbar a {
  color: #e5e7eb;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.topbar a:hover { background: rgba(255,255,255,0.07); transform: translateY(-1px); }

.topbar a.active {
  background: linear-gradient(120deg, var(--brand), #38bdf8);
  color: #0b1220;
  box-shadow: 0 10px 30px rgba(14,165,233,0.35);
}

.topbar .spacer { margin-left: auto; }

.topbar button {
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: #e5e7eb;
  cursor: pointer;
  border-radius: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.topbar button:hover { background: rgba(255,255,255,0.12); }

/* ===== Layout ===== */
.container {
  padding: 26px 20px 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.page-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.page-eyebrow {
  font-weight: 800;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.page-title {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.asset-title {
  margin: 4px 0 6px;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.h-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.h-row > * { flex: 1; }
.h-row > .flex-none { flex: 0; }
.h-row > .flex-1 { flex: 1; }
.h-row > .flex-2 { flex: 2; }

.card-title {
  margin: 0;
  font-size: 1.05rem;
}

.card-title + .card-subtitle {
  margin-top: 4px;
}

.card-subtitle {
  margin: 0;
  color: var(--muted);
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.section-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
}

.map-frame {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
}

.card {
  background: linear-gradient(135deg, #ffffff, #f7f9fc);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.card.subtle {
  background: #0f172a;
  color: #e5e7eb;
  border-color: rgba(255,255,255,0.06);
}

.card.inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.card.striped {
  background: linear-gradient(120deg, #0ea5e9 0%, #0ea5e9 35%, #ffffff 35%, #f8fafc 100%);
  color: #0b1220;
  border: none;
}

.card h2, .card h3 { margin-top: 0; }

.muted { color: var(--muted); }

.callout {
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

/* ===== Utilities ===== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.grid { display: grid; }
.wrap { flex-wrap: wrap; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.flex-none { flex: 0; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-18 { gap: 18px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.my-6 { margin-top: 6px; margin-bottom: 6px; }
.my-8 { margin-top: 8px; margin-bottom: 8px; }
.text-center { text-align: center; }
.max-w-140 { max-width: 140px; }
.input-compact { max-width: 140px; }
.is-hidden { display: none; }
.list-spaced {
  margin: 8px 0 0 18px;
  line-height: 1.6;
}

.admin-only { display: none; }
.ops-only { display: none; }
.frontline-only { display: none; }

/* ===== Metrics ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.35);
}

.stat-label { font-size: 0.9rem; color: #cbd5e1; margin-bottom: 6px; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-foot  { font-size: 0.9rem; color: #cbd5e1; margin-top: 6px; }

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.metric-chip {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  display: grid;
  gap: 4px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.35);
}

.metric-chip .label { font-size: 0.9rem; color: #cbd5e1; }
.metric-chip .value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.metric-chip .hint { font-size: 0.85rem; color: #cbd5e1; }

/* ===== Grid cards (Assets) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* Frontline checklist tiles */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.check-tile {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.check-tile.active {
  background: #e0f7ff;
  border-color: #22c55e;
  box-shadow: 0 6px 18px rgba(34,197,94,0.25);
}
.check-tile label {
  font-weight: 700;
  color: var(--ink);
}
.check-tile .hint {
  color: var(--muted);
  font-size: 0.85em;
}

.asset-card {
  display: block;
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--stroke);
  text-decoration: none;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow);
}

.asset-card:hover {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(-3px);
  border-color: rgba(14,165,233,0.35);
}

.asset-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.asset-code {
  font-weight: 800;
  font-size: 1.05em;
  letter-spacing: 0.02em;
}

.asset-name {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}

.asset-type {
  font-size: 0.9em;
  color: var(--muted);
}

/* ===== Pills / badges ===== */
.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 800;
  border: 1px solid #e6e8ec;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill.green { background: #ecfdf3; color: #15803d; border-color: #bbf7d0; }
.pill.amber { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
.pill.red   { background: #fef2f2; color: #b91c1c; border-color: #fecdd3; }
.pill.grey  { background: #f2f4f7; color: #475467; border-color: #e5e7eb; }
.pill.black { background: #0f172a; color: #e2e8f0; border-color: #0f172a; }

.pill.status-pill {
  padding: 6px 10px;
  min-width: 32px;
  justify-content: center;
  background: transparent;
  border-color: transparent;
}

.pill.status-pill::before {
  width: 9px;
  height: 9px;
}

.pill.status-pill.green { color: #15803d; border-color: transparent; background: transparent; }
.pill.status-pill.amber { color: #b45309; border-color: #b45309; background: transparent; animation: pulse-amber 1.2s ease-in-out infinite; }
.pill.status-pill.red   { color: #b91c1c; border-color: #b91c1c; background: transparent; animation: pulse-red 1s ease-in-out infinite; }
.pill.status-pill.grey  { color: #475467; border-color: #475467; background: transparent; }

@keyframes pulse-amber {
  0% { box-shadow: 0 0 0 0 rgba(180, 83, 9, 0.35); }
  100% { box-shadow: 0 0 0 6px rgba(180, 83, 9, 0); }
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.35); }
  100% { box-shadow: 0 0 0 6px rgba(185, 28, 28, 0); }
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 12px;
  background: #0b1220;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.08);
}

.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
}

.status-dot.brand { background: var(--brand); }
.status-dot.success { background: var(--accent); }
.status-dot.warning { background: #f97316; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #312e81;
  font-weight: 700;
  font-size: 0.85rem;
}

.tag .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}

/* ===== Tabs ===== */
.tabs {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs button {
  padding: 10px 14px;
  border: 1px solid #d0d5dd;
  background: #f2f4f7;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.2s ease;
}

.tabs button.active {
  background: linear-gradient(120deg, var(--brand), #38bdf8);
  color: #0b1220;
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(14,165,233,0.35);
}

/* ===== Buttons ===== */
.btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.2s ease;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  background: linear-gradient(120deg, var(--brand), #38bdf8);
  color: #0b1220;
  border-color: var(--brand);
}

.btn-attention {
  background: #fcd34d;
  color: #1f2937;
  border-color: #fcd34d;
}

.btn-attention:disabled {
  background: #f8fafc;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.danger {
  background: #b42318;
  color: #fff;
  border-color: #b42318;
}

.input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  box-sizing: border-box;
  font-weight: 600;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(14,165,233,0.18);
}

label { font-weight: 800; display: block; margin-bottom: 6px; color: var(--ink); }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
}

.filters.filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filters .filter-group {
  display: grid;
  gap: 6px;
}

/* ===== Tables ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll .table {
  min-width: 720px;
}

.table th,
.table td {
  border-bottom: 1px solid #eaecf0;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #f9fafb;
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
}

.table tbody tr:hover {
  background: #f8fbff;
}

/* ===== Expiry colouring ===== */
.status-green  { background: #ecfdf3; }
.status-amber  { background: #fff7ed; }
.status-red    { background: #fef2f2; }
.status-black  { background: #0f172a; color: #fff; }
.status-black a { color: #fff; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(3px);
}

.modal {
  background: #fff;
  max-width: 540px;
  width: 100%;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid #e6e8ec;
  box-shadow: var(--shadow);
}

.modal h3 { margin-top: 0; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.feature-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.feature-card h4 {
  margin: 0;
  font-size: 1.05rem;
}

.feature-card .hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.feature-card .cta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.list-compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.list-compact li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  background: #0f172a;
  color: #e2e8f0;
}

.badge.success { background: #047857; }
.badge.warning { background: #b45309; }
.badge.info    { background: #0ea5e9; }

.table.table-compact td, .table.table-compact th {
  padding: 10px;
  font-size: 0.95rem;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .card.inline { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .topbar .spacer { width: 100%; margin-left: 0; }
  .card { padding: 16px; }
}
