@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  --bg: #f6f2ec;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #6b7280;
  --border: #e5e1da;
  --accent: #0f766e;
  --accent-2: #f59e0b;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --font-body: "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 40% at 10% 0%, rgba(245, 158, 11, 0.12), transparent 60%),
    radial-gradient(50% 45% at 90% 10%, rgba(15, 118, 110, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.8));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #1b9a90);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.app-nav a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.app-nav a.active,
.app-nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.25);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.user-chip .user-name {
  font-weight: 600;
  color: var(--ink);
}

.user-chip a {
  text-decoration: none;
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}

.user-chip a:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.role-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  color: #0f172a;
}

.role-badge.admin {
  background: rgba(15, 118, 110, 0.15);
  color: #0f766e;
}

.role-badge.user {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.app-main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 48px;
  flex: 1;
}

.app-main.full-bleed {
  max-width: none;
  padding: 0;
}

.app-main.map-main {
  display: flex;
  min-height: 0;
}

.map-frame {
  flex: 1;
  min-height: 0;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

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

.op-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.op-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.op-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 4px;
}

.op-card-sub {
  font-size: 12px;
  color: var(--muted);
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 6px 0;
}

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

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

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

.stack {
  display: grid;
  gap: 12px;
}

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

.ok {
  color: #0f766e;
  font-weight: 700;
}

.err,
.bad {
  color: #b91c1c;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 720px) {
  .app-header-inner {
    align-items: flex-start;
  }

  .page-title {
    font-size: 22px;
  }
}
