:root {
  --bg: #f3f6f8;
  --card: #ffffff;
  --line: #d8e0e8;
  --text: #112132;
  --muted: #5e6f82;
  --brand: #e72a80;
  --brand-soft: #fff1f7;
  --danger: #a41e32;
  --danger-soft: #fff2f4;
  --warn: #925200;
  --warn-soft: #fff8ea;
  --ok: #0b6f3d;
  --ok-soft: #eefcf4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -5%, #ffd7e9 0%, transparent 31%),
    radial-gradient(circle at 100% 0%, #ffe7f1 0%, transparent 27%),
    var(--bg);
  min-height: 100vh;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(17, 33, 50, 0.05);
}

.hidden { display: none !important; }
.mt14 { margin-top: 14px; }
.overflow-auto { overflow: auto; }

.login {
  max-width: 460px;
  margin: 52px auto;
  padding: 26px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.login-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #edf1f4;
  padding: 6px;
}

.login h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.36rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.sub {
  color: var(--muted);
  margin: 3px 0 0;
  font-size: 0.95rem;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

label {
  font-size: 0.88rem;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input, select, button { font: inherit; }

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

input:focus, select:focus {
  outline: none;
  border-color: #f2a5c9;
  box-shadow: 0 0 0 4px rgba(231, 42, 128, 0.14);
}

button {
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .07s ease, opacity .18s ease;
}

button:hover { opacity: 0.95; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-main {
  background: linear-gradient(135deg, var(--brand), #c71967);
  color: #fff;
}

.btn-soft {
  background: #fff7fb;
  color: #314154;
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #ffd3da;
}

.alert {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 12px;
  font-size: 0.9rem;
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: #bee8ce; }
.alert.err { background: var(--danger-soft); color: var(--danger); border-color: #ffd3da; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: #ffd88f; }

.app-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 14px;
}

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

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid #edf1f4;
  padding: 6px;
  background: #fff;
}

.brand h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.34rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.brand .sub { margin-top: 4px; }

.role {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #f3bad6;
  padding: 4px 10px;
  font-size: .84rem;
  color: #a01857;
  background: var(--brand-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  background: #fff8fb;
  border: 1px solid var(--line);
  color: #2f4155;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
}

.tab.active {
  background: #ffeef6;
  border-color: #f3bad6;
  color: #b11961;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.split {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.panel { padding: 18px; }

.panel h3 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 1.32rem;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.panel .desc {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: .95rem;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 9px;
  margin: 10px 0 14px;
}

.year-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfdfe;
  padding: 9px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.year-item.disabled {
  opacity: .5;
  cursor: not-allowed;
  background: #f8fafb;
}

.year-item .year-tag {
  font-size: .74rem;
  color: #a33f2f;
  background: #fff1ef;
  border: 1px solid #ffd4cd;
  border-radius: 999px;
  padding: 1px 8px;
  justify-self: start;
  margin-left: 24px;
}

.year-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  margin: 0;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mono {
  margin-top: 12px;
  border-radius: 13px;
  border: 1px solid #132641;
  background: linear-gradient(180deg, #07152d 0%, #091938 100%);
  color: #d5ffe5;
  font-family: "IBM Plex Mono", monospace;
  font-size: .81rem;
  line-height: 1.6;
  min-height: 120px;
  max-height: 290px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-line {
  color: var(--muted);
  margin: 0 0 8px;
  font-size: .95rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .86rem;
  font-weight: 600;
  border: 1px solid;
  margin-bottom: 8px;
}

.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: #ffd88f; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: #bee8ce; }
.chip-err { background: var(--danger-soft); color: var(--danger); border-color: #ffd3da; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

th, td {
  text-align: left;
  border-bottom: 1px solid #e6edf3;
  padding: 10px 8px;
  vertical-align: top;
}

th {
  font-size: .75rem;
  letter-spacing: .06em;
  color: #617284;
  text-transform: uppercase;
  font-weight: 700;
}

.small {
  font-size: .84rem;
  color: var(--muted);
}

.warning-box {
  background: #fff8ea;
  border: 1px solid #ffd88f;
  color: #885200;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .9rem;
  margin-bottom: 12px;
}

.edit-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.id-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  max-height: 290px;
  overflow: auto;
  padding-right: 2px;
}

.id-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #e8edf2;
  border-radius: 10px;
  padding: 8px;
  background: #fcfdff;
  font-family: "IBM Plex Mono", monospace;
  font-size: .8rem;
}

.id-row .btn-danger {
  padding: 7px 10px;
  font-size: .8rem;
}

.audit-changes {
  font-size: .82rem;
  color: #2f4155;
  line-height: 1.35;
  display: grid;
  gap: 2px;
}

@media (min-width: 920px) {
  .split {
    grid-template-columns: 1.2fr .8fr;
  }

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