:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111923;
  --panel-2: #151f2b;
  --line: #263241;
  --text: #eef4f8;
  --muted: #94a3b8;
  --accent: #d73535;
  --cyan: #1fb6d9;
  --green: #22c55e;
  --amber: #f59e0b;
  --shadow: 0 18px 48px rgba(0, 0, 0, .24);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #d9e1ea;
  --text: #111827;
  --muted: #596579;
  --shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(215, 53, 53, .12), transparent 34%),
    radial-gradient(circle at 75% 25%, rgba(31, 182, 217, .12), transparent 28%),
    var(--bg);
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 4px;
}

.login-card h1 {
  font-size: 24px;
  text-transform: none;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
}

.login-card form {
  display: grid;
  gap: 14px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 14px;
}

.remember input {
  width: auto;
  height: auto;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, .45);
  border-radius: 6px;
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
  font-size: 14px;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: linear-gradient(180deg, #080d13, #0c131d);
  border-right: 1px solid var(--line);
}

:root[data-theme="light"] .sidebar {
  background: #101722;
  color: #f8fafc;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.35;
  text-transform: uppercase;
}

.brand-mark {
  width: 3px;
  height: 58px;
  background: var(--accent);
  flex: 0 0 auto;
}

.priority-label {
  color: #ff5959;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 8px 12px;
  letter-spacing: 0;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: inherit;
  background: transparent;
  padding: 0 12px;
  text-align: left;
}

.nav-item span {
  width: 26px;
  color: #cbd5e1;
  font-size: 22px;
  text-align: center;
}

.nav-item.active {
  background: #1a2430;
  border-left-color: var(--accent);
}

.operator {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  gap: 12px;
}

.clock {
  font-size: 21px;
  color: #e5e7eb;
}

.operator small {
  color: #cbd5e1;
  line-height: 1.4;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 25, 35, .82);
  backdrop-filter: blur(16px);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, .86);
}

.search {
  width: min(560px, 46vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill {
  color: var(--green);
  font-weight: 800;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--panel);
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
}

.icon-button b {
  position: absolute;
  top: -8px;
  right: -7px;
  min-width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  font-size: 12px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 0;
}

.main-column {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(430px, 1fr) auto;
}

.panel {
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--panel) 90%, #000));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.queue {
  border-top: 0;
  border-left: 0;
  padding: 22px 24px;
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head.compact {
  align-items: center;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.2;
  text-transform: uppercase;
}

h2 {
  font-size: 17px;
  text-transform: uppercase;
}

h3 {
  font-size: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 16px;
}

.tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 0 10px;
}

.tabs button.active {
  color: #ff5959;
  border-color: #ff5959;
}

.primary, .wide, .ghost {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 700;
}

.primary {
  background: linear-gradient(180deg, #e44747, #bd272d);
  border-color: #ef4444;
  color: white;
}

.wide {
  width: 100%;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th {
  height: 42px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  vertical-align: top;
}

tr {
  transition: background .18s ease;
}

tbody tr:hover,
tbody tr.selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

td strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.urgency {
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.urgency.yüksek {
  color: #fecaca;
  background: rgba(220, 38, 38, .25);
}

.urgency.orta {
  color: #fde68a;
  background: rgba(245, 158, 11, .22);
}

.urgency.düşük {
  color: #67e8f9;
  background: rgba(6, 182, 212, .18);
}

.state {
  color: var(--green);
  font-weight: 800;
}

.alerts {
  border-top: 0;
  border-right: 0;
  padding: 20px 18px;
  min-width: 0;
}

.alert-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.alert {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}

.alert-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  background: rgba(148, 163, 184, .16);
}

.alert.critical .alert-icon { color: #ff6b6b; background: rgba(239, 68, 68, .22); }
.alert.warning .alert-icon { color: #fbbf24; background: rgba(245, 158, 11, .2); }
.alert.success .alert-icon { color: #4ade80; background: rgba(34, 197, 94, .18); }
.alert.info .alert-icon { color: #38bdf8; background: rgba(56, 189, 248, .18); }

.alert strong {
  color: color-mix(in srgb, var(--text) 90%, var(--accent));
  text-transform: uppercase;
  font-size: 13px;
}

.alert p {
  margin-top: 4px;
  font-size: 14px;
}

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

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr);
}

.special-days, .design-center {
  padding: 18px 20px;
  border-left: 0;
  border-bottom: 0;
}

.design-center {
  border-right: 0;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(126px, 1fr));
  gap: 8px;
  overflow: auto;
}

.day-card {
  min-height: 140px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.day-card.important {
  border-color: #ef4444;
}

.day-card strong {
  font-size: 28px;
}

.day-card span {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
}

.day-card p {
  font-size: 13px;
  line-height: 1.35;
}

.day-card small {
  margin-top: auto;
  color: var(--muted);
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 10px;
}

.template-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template {
  min-height: 58px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  padding: 8px;
  font-weight: 800;
}

.template small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}

.plan-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
}

.plan-card i {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
}

.statusbar {
  height: 44px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.earthquake-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0;
  min-height: 0;
}

.earthquake-main {
  border-top: 0;
  border-left: 0;
  padding: 22px 24px;
}

.section-note {
  max-width: 760px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.quake-filters {
  display: grid;
  grid-template-columns: 160px 160px 150px minmax(220px, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.quake-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.quake-summary span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
}

.quake-summary strong {
  color: var(--text);
}

.magnitude {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-weight: 900;
}

.magnitude.alarm-seven,
.magnitude.alarm-six,
.magnitude.alarm-five {
  color: #fee2e2;
  background: rgba(220, 38, 38, .34);
}

.magnitude.alarm-three {
  color: #fde68a;
  background: rgba(245, 158, 11, .22);
}

.magnitude.alarm-two {
  color: #bfdbfe;
  background: rgba(59, 130, 246, .2);
}

.magnitude.silent {
  color: var(--muted);
  background: rgba(148, 163, 184, .12);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
}

.quake-rules {
  border-top: 0;
  border-right: 0;
  padding: 22px 18px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.quake-rules article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.quake-rules span {
  color: var(--muted);
  line-height: 1.4;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.inspector {
  width: min(980px, calc(100vw - 32px));
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 22px;
}

.inspector::backdrop {
  background: rgba(0, 0, 0, .64);
  backdrop-filter: blur(4px);
}

.close {
  float: right;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
}

.inspector-head {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.inspector-head img {
  width: 112px;
  height: 82px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.inspector-head p {
  color: var(--muted);
  margin-top: 6px;
}

.control-row {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.generated-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.generated-grid article,
.plan-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 12px;
}

pre {
  white-space: pre-wrap;
  margin: 10px 0 0;
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.plan-detail {
  margin-top: 12px;
  color: var(--muted);
}

.plan-detail h3 {
  color: var(--text);
  margin-bottom: 8px;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .brand strong, .priority-label, .nav-item:not(.active), .operator small {
    display: none;
  }

  .brand {
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-item span {
    width: auto;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .earthquake-page {
    grid-template-columns: 1fr;
  }

  .alerts {
    border-left: 0;
    border-bottom: 0;
  }

  .alert-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 12px;
  }

  .search {
    order: 3;
    width: 100%;
  }

  .top-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .queue {
    padding: 16px 12px;
  }

  .panel-head {
    flex-direction: column;
  }

  .lower-grid,
  .design-grid,
  .quake-filters,
  .generated-grid {
    grid-template-columns: 1fr;
  }

  .alert-list {
    grid-template-columns: 1fr;
  }

  .statusbar {
    justify-content: flex-start;
    overflow: auto;
  }
}
