:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #dbe3ee;
  --text: #152033;
  --muted: #64748b;
  --navy: #06284a;
  --blue: #0b5f9f;
  --green: #0aa43c;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #071d33;
  color: #ffffff;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin: 6px 0 28px;
  color: #b7c7d8;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #dbeafe;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-footer {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
}

.logout {
  display: block;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.main {
  padding: 28px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  outline: none;
}

textarea {
  min-height: 380px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 95, 159, 0.12);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.button.danger {
  background: var(--danger);
}

.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
}

.error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
  font-weight: 700;
}

.zone-table {
  display: grid;
  gap: 10px;
}

.zone-row,
.zone-head {
  display: grid;
  grid-template-columns: 70px 1.2fr 110px 110px 130px 95px 92px 82px;
  gap: 10px;
  align-items: center;
}

.zone-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.zone-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.preview-frame {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

  .sidebar-footer {
    position: static;
    margin-top: 18px;
  }

  .zone-head {
    display: none;
  }

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

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .grid,
  .zone-row {
    grid-template-columns: 1fr;
  }
}
