:root {
  --orange: #ec6726;
  --ink: #1b1d22;
  --muted: #6b6f76;
  --soft: #9a9ea5;
  --bg: #f5f5f2;
  --line: #e7e6e2;
  --line-strong: #d4d3cd;
  --surface: #fff;
  --success: #1f7a45;
  --warning: #8a640c;
  --danger: #c0212f;
  --blue: #2257a8;
  --purple: #6b3fcb;
  --shadow: 0 1px 3px rgba(20, 20, 20, .08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #e8e8e4;
}
.login-shell {
  width: min(1080px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: 470px 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.brand-panel {
  position: relative;
  background: #16181d;
  color: #fff;
  padding: 46px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.brand-panel::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(236, 103, 38, .18);
  border-radius: 50%;
  right: -150px;
  top: -110px;
}
.brand-panel::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 50%;
  right: -50px;
  bottom: -80px;
}
.brand-mark, .brand-copy, .secure-note { position: relative; }
.brand-mark, .logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .15em;
}
.brand-mark::before, .logo-mark::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--orange);
  flex: none;
}
.brand-copy h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.25;
  letter-spacing: 0;
}
.brand-copy p {
  max-width: 320px;
  margin: 14px 0 20px;
  color: #a7abb2;
  font-size: 15px;
  line-height: 1.6;
}
.brand-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-tags span {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 600;
}
.secure-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8e929a;
  font-size: 12px;
}
.login-form {
  padding: 50px 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form h2 { margin: 0; font-size: 22px; }
.login-form .sub { margin: 6px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { color: #3a3d44; font-size: 13px; font-weight: 500; }
.input-wrap {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
}
.input-wrap svg { width: 18px; height: 18px; color: var(--soft); flex: none; }
.input-wrap input {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  color: var(--ink);
  background: transparent;
}
.password-row { display: flex; align-items: center; justify-content: space-between; }
.password-toggle { border: none; background: transparent; color: var(--soft); padding: 0; display: flex; }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn, .icon-btn {
  height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.primary-btn { background: var(--orange); color: #fff; }
.secondary-btn { background: #fff; border-color: var(--line-strong); color: #3a3d44; }
.ghost-btn { background: transparent; color: var(--muted); }
.danger-btn { background: #fbe7e8; color: var(--danger); }
.icon-btn { width: 36px; padding: 0; background: #fff; border-color: var(--line); color: var(--muted); }
.primary-btn:disabled, .secondary-btn:disabled, .ghost-btn:disabled { opacity: .55; cursor: default; }
.login-submit { width: 100%; height: 48px; font-size: 15px; margin-top: 4px; }
.alert {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 9px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
}
.alert.show { display: flex; }
.alert.error { background: #fbe7e8; border: 1px solid #f3c6cb; color: #a81b28; }
.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--soft);
  font-size: 12px;
}
.login-footer img { height: 20px; width: auto; opacity: .85; }

.app { min-height: 100vh; display: none; }
.app.show { display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  min-height: 100vh;
  background: #16181d;
  color: #8e929a;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
}
.sidebar .logo-mark {
  background: #24262c;
  color: #fff;
  border-radius: 9px;
  padding: 10px 13px;
  margin: 6px;
  width: max-content;
}
.sidebar-caption { margin: 8px 0 0 8px; font-size: 11px; color: #6e727a; }
.menu-title {
  padding: 22px 12px 9px;
  color: #5c606a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav { display: grid; gap: 3px; }
.nav button {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #8e929a;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.nav button.active { background: rgba(236, 103, 38, .16); color: #fff; font-weight: 600; }
.nav button.active svg { color: var(--orange); }
.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 10px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: none;
}
.sidebar-user strong { display: block; color: #fff; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { display: block; color: #8e929a; font-size: 11px; margin-top: 3px; }
.main {
  min-width: 0;
  display: grid;
  grid-template-rows: 66px 1fr;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
}
.mobile-menu { display: none; }
.topbar h1 { margin: 0; font-size: 18px; line-height: 1; }
.global-search {
  margin-left: auto;
  width: min(430px, 42vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}
.global-search input { border: none; outline: none; background: transparent; width: 100%; color: var(--ink); }
.content { padding: 28px; min-width: 0; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.page-title h2 { margin: 0; font-size: 26px; letter-spacing: 0; }
.page-title p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.grid-cards { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.metric .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric .value { margin-top: 9px; font-size: 30px; font-weight: 700; line-height: 1; }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.panel-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-body { padding: 16px; }
.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(130px, .8fr) auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fafaf8;
}
.filters.documents { grid-template-columns: minmax(180px, 1.3fr) minmax(130px, .8fr) minmax(130px, .8fr) auto; }
.control {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #f0f0ec; text-align: left; font-size: 13px; vertical-align: middle; }
th { color: var(--soft); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: #fafaf8; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #fbfbf8; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.badge.completed { background: #e7f4ec; color: var(--success); }
.badge.completed::before { background: #27a35f; }
.badge.renewed { background: #e5eefb; color: var(--blue); }
.badge.renewed::before { background: #3b7bd6; }
.badge.pending { background: #fbf1d7; color: var(--warning); }
.badge.pending::before { background: #d9952a; }
.badge.risky { background: #fbe7e8; color: var(--danger); }
.badge.risky::before { background: #dc3340; }
.badge.active { background: #efeafb; color: var(--purple); }
.badge.active::before { background: #8a5ce0; }
.badge.neutral { background: #ededea; color: #5b6168; }
.badge.neutral::before { background: #9a9ea5; }
.risk-pill {
  min-width: 92px;
  display: inline-flex;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  font: 600 12px/1.2 "IBM Plex Sans";
  white-space: nowrap;
}
.risk-pill.danger { background: #fbe7e8; color: var(--danger); }
.risk-pill.warning { background: #fbf1d7; color: var(--warning); }
.risk-pill.safe { background: #e7f4ec; color: var(--success); }
.file-badge {
  min-width: 36px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 0 6px;
  font: 700 9px/1 "IBM Plex Mono";
  background: #e5eefb;
  color: var(--blue);
}
.file-badge.pdf { background: #fbe7e8; color: var(--danger); }
.file-badge.jpg, .file-badge.jpeg, .file-badge.png { background: #fbefe6; color: #c0561b; }
.file-badge.xls, .file-badge.xlsx, .file-badge.csv { background: #e7f4ec; color: var(--success); }
.list { display: grid; gap: 10px; }
.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.renewal-row {
  grid-template-columns: 1fr auto auto;
  border-left: 4px solid var(--line-strong);
}
.renewal-row.danger { border-left-color: var(--danger); }
.renewal-row.warning { border-left-color: #d9952a; }
.renewal-row.safe { border-left-color: var(--success); }
.calendar-card { min-height: 100%; }
.calendar-title { display: flex; align-items: center; gap: 9px; }
.calendar-legend { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--line-strong);
}
.calendar-dot.danger { background: var(--danger); }
.calendar-dot.warning { background: #d9952a; }
.calendar-dot.safe { background: var(--success); }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.calendar-weekday {
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}
.calendar-day {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #fff;
  display: grid;
  align-content: start;
  gap: 5px;
}
.calendar-day.outside { color: var(--soft); background: #fafaf8; }
.calendar-day.today { outline: 2px solid rgba(236, 103, 38, .35); outline-offset: -2px; }
.calendar-day.has-events { background: #fffdf8; border-color: #ead7aa; }
.calendar-day-number { font: 600 12px/1 "IBM Plex Mono"; }
.calendar-events { display: flex; gap: 3px; flex-wrap: wrap; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}
.detail-drawer {
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 29, .38);
  z-index: 40;
  display: none;
  justify-content: flex-end;
}
.detail-drawer.show { display: flex; }
.drawer-panel {
  width: min(760px, 100%);
  height: 100%;
  background: #fff;
  display: grid;
  grid-template-rows: auto 1fr;
  box-shadow: -18px 0 40px rgba(20, 20, 20, .18);
}
.drawer-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.drawer-body { padding: 20px 22px 28px; overflow: auto; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.info-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.info-item span { display: block; color: var(--soft); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.info-item strong { display: block; margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.note { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafaf8; color: #3a3d44; line-height: 1.55; white-space: pre-wrap; }
.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.doc-card { border: 1px solid var(--line); border-radius: 8px; padding: 13px; display: grid; gap: 10px; min-width: 0; }
.doc-card-head { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; min-width: 0; }
.doc-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-actions { display: flex; gap: 8px; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 24, 29, .48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.show { display: flex; }
.modal-panel {
  width: min(760px, 100%);
  max-height: min(780px, 92vh);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 20, 20, .22);
}
.modal-head { min-height: 58px; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
textarea.control { height: auto; min-height: 84px; padding-top: 10px; resize: vertical; }
.empty {
  padding: 34px 18px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 34px; height: 34px; color: var(--soft); }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}
.toast-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 13px 15px;
  border-radius: 10px;
  background: #16181d;
  color: #fff;
  box-shadow: 0 6px 18px rgba(20, 20, 20, .2);
  font-size: 13px;
}
.toast-item.error { background: #8f1c26; }
.viewer-frame {
  width: 100%;
  height: 72vh;
  border: none;
  background: #f4f4f0;
}
.viewer-image { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; }
.viewer-shell { display: grid; gap: 14px; }
.viewer-tools { display: flex; justify-content: flex-end; gap: 8px; }
.document-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.document-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf8;
  padding: 12px;
  min-width: 0;
}
.document-note strong {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: #3a3d44;
  font-size: 13px;
}
.document-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.document-preview-text {
  max-height: 58vh;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf8;
  color: #2d3138;
  font: 500 12px/1.55 "IBM Plex Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.spreadsheet-preview {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.spreadsheet-sheet + .spreadsheet-sheet { border-top: 1px solid var(--line); }
.spreadsheet-title {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.spreadsheet-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.spreadsheet-table td {
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid #ededeb;
  font: 500 12px/1.35 "IBM Plex Sans";
  vertical-align: top;
  overflow-wrap: anywhere;
  background: #fff;
}
.spreadsheet-table tr:first-child td {
  background: #f5f5f2;
  color: #3a3d44;
  font-weight: 700;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
.map-stage {
  position: relative;
  min-height: 620px;
  padding: 14px;
  background: #f0f2f1;
}
.world-map {
  width: 100%;
  height: min(66vh, 680px);
  min-height: 520px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f4;
  touch-action: none;
}
.map-toolbar {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}
.map-toolbar .icon-btn {
  width: 34px;
  height: 34px;
  background: #fff;
}
.world-country {
  stroke: #fff;
  stroke-width: .55;
  outline: none;
  transition: fill .12s ease, opacity .12s ease;
}
.world-country.has-records { cursor: pointer; }
.world-country.has-records:hover, .world-country.selected {
  stroke: #1b1d22;
  stroke-width: 1.1;
}
.map-marker {
  stroke: #fff;
  stroke-width: 2;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(20, 20, 20, .25));
}
.map-marker.selected {
  stroke: #1b1d22;
  stroke-width: 2.5;
}
.map-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, .08);
  display: inline-block;
  flex: none;
}
.map-swatch.inactive { background: #cfd3ce; }
.map-swatch.active { background: #3f9b62; }
.map-detail {
  position: sticky;
  top: 82px;
}
.map-country-list {
  max-height: calc(100vh - 250px);
  overflow: auto;
}
.map-record {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.map-record + .map-record { margin-top: 9px; }
.map-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.map-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafaf8;
}
.map-stat span { display: block; color: var(--soft); font-size: 11px; font-weight: 700; }
.map-stat strong { display: block; margin-top: 5px; font-size: 20px; line-height: 1; }
.hidden { display: none !important; }

@media (max-width: 1040px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 260px; }
  .app.show { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 248px;
    transform: translateX(-100%);
    transition: transform .18s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .global-search { width: min(360px, 40vw); }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .map-detail { position: static; }
  .map-stage { min-height: 460px; }
  .world-map { height: 54vh; min-height: 420px; }
  .filters, .filters.documents { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .login-screen { padding: 0; place-items: stretch; }
  .login-shell { min-height: 100vh; border-radius: 0; border: 0; }
  .brand-panel { padding: 32px 26px; }
  .login-form { padding: 32px 24px; }
  .content { padding: 18px 14px 80px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar h1 { font-size: 16px; }
  .global-search { display: none; }
  .page-head { display: grid; }
  .actions { justify-content: stretch; }
  .actions > * { flex: 1; }
  .grid-cards { grid-template-columns: 1fr; }
  .filters, .filters.documents { grid-template-columns: 1fr; }
  .info-grid, .doc-grid, .form-grid { grid-template-columns: 1fr; }
  .document-notes { grid-template-columns: 1fr; }
  .renewal-row { grid-template-columns: 1fr; }
  .map-stage { min-height: 350px; padding: 10px; }
  .world-map { height: 48vh; min-height: 310px; }
  .map-toolbar { top: 18px; right: 18px; }
  .map-legend { padding: 8px 0 0; gap: 8px; }
  .map-country-list { max-height: none; }
  .map-record .info-grid { grid-template-columns: 1fr !important; }
  .drawer-panel { width: 100%; }
  .modal { padding: 10px; }
}
