:root {
  --bg: #f5f8fc;
  --bg-2: #eaf6ff;
  --panel: rgba(255,255,255,.92);
  --panel-solid: #ffffff;
  --panel-soft: #f0f7ff;
  --text: #162033;
  --muted: #64748b;
  --line: #d9e5f0;
  --primary: #075985;
  --primary-2: #0ea5e9;
  --primary-3: #e0f2fe;
  --success: #047857;
  --success-bg: #d1fae5;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --purple: #6d28d9;
  --purple-bg: #ede9fe;
  --shadow: 0 18px 45px rgba(15, 23, 42, .09);
  --shadow-soft: 0 9px 24px rgba(15, 23, 42, .06);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(14,165,233,.22), transparent 32rem),
    radial-gradient(circle at 90% 18%, rgba(109,40,217,.13), transparent 28rem),
    linear-gradient(180deg, #eef7ff 0%, var(--bg) 38%, #f8fafc 100%);
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  background: rgba(255,255,255,.76);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-weight: 950;
  letter-spacing: -.05em;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow-soft);
}
.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.side-card {
  padding: 14px;
  color: #075985;
  background: var(--primary-3);
  border: 1px solid #bae6fd;
  border-radius: 18px;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}
.nav a, .nav button {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 12px;
  text-decoration: none;
  background: transparent;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 760;
  text-align: left;
}
.nav a:hover, .nav button:hover, .nav a.active {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: var(--primary);
}
.nav small {
  color: var(--muted);
  font-weight: 700;
}

.main {
  width: 100%;
  max-width: 1360px;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.topbar h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -.04em;
}
.topbar p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 30px;
  color: #fff;
  background: linear-gradient(135deg, rgba(7,89,133,.98), rgba(14,165,233,.88));
  box-shadow: var(--shadow);
}
.hero:after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -95px;
  top: -120px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
}
.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: .98;
  letter-spacing: -.055em;
}
.hero p {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: 17px;
}
.hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.grid { display: grid; gap: 18px; }
.grid.one { grid-template-columns: minmax(0, 1fr); }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.section { margin-top: 22px; }

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}
.card.flat { box-shadow: none; background: var(--panel-solid); }
.card h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.025em; }
.card p { color: #475569; margin: 8px 0; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.card-head h3 { margin: 0; }
.muted { color: var(--muted); }

.stat {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-label { color: var(--muted); font-weight: 800; font-size: 13px; }
.stat-number { font-size: 42px; line-height: 1; letter-spacing: -.06em; font-weight: 950; }
.stat small { color: #64748b; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 850;
  text-decoration: none;
  min-height: 42px;
}
.btn:hover { background: #f0f9ff; border-color: #bae6fd; color: var(--primary); }
.btn.primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 9px 20px rgba(14,165,233,.22); }
.btn.danger { color: #be123c; background: #fff1f2; border-color: #fecdd3; }
.btn.ghost { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); color: #fff; }
.btn.small { min-height: 34px; border-radius: 11px; padding: 7px 10px; font-size: 12px; }
.btn.full { width: 100%; }

.pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}
.pill.light { background: rgba(255,255,255,.17); border-color: rgba(255,255,255,.28); color: #fff; }
.tag.success { color: var(--success); background: var(--success-bg); border-color: #a7f3d0; }
.tag.warning { color: var(--warning); background: var(--warning-bg); border-color: #fde68a; }
.tag.danger { color: var(--danger); background: var(--danger-bg); border-color: #fecaca; }
.tag.info { color: #0369a1; background: #e0f2fe; border-color: #bae6fd; }
.tag.purple { color: var(--purple); background: var(--purple-bg); border-color: #ddd6fe; }

.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .02em;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 4px rgba(14,165,233,.12);
}
.checkbox-line {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #334155;
  font-weight: 800;
}
.checkbox-line input { width: 18px; height: 18px; }
.hint-inline { color: var(--muted); font-weight: 700; font-size: 12px; }

.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel-soft); color: #0f172a; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
td { color: #475569; }
tr:last-child td { border-bottom: 0; }

.news-list { display: grid; gap: 13px; }
.news-card {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 7px 16px rgba(15,23,42,.04);
}
.news-card.pinned { border-color: #bae6fd; background: linear-gradient(135deg, #ffffff, #f0f9ff); }
.news-card h4 { margin: 8px 0 6px; font-size: 18px; letter-spacing: -.02em; color: #0f172a; }
.news-card p { white-space: pre-wrap; margin: 0; color: #475569; }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.news-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.notice {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985;
  font-weight: 750;
}
.notice.error { color: var(--danger); background: var(--danger-bg); border-color: #fecaca; }
.notice.success { color: var(--success); background: var(--success-bg); border-color: #a7f3d0; }
.empty {
  border: 1px dashed #bae6fd;
  border-radius: 20px;
  background: #f0f9ff;
  color: #075985;
  padding: 22px;
  text-align: center;
  font-weight: 850;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(470px, 100%);
  padding: 26px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}
.login-card .brand { margin-bottom: 24px; }
.login-card h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.04em; }
.login-card p { margin: 0 0 18px; color: var(--muted); }

.code {
  display: block;
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  color: #e2e8f0;
  background: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.42);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}
.drawer.open { display: flex; }
.drawer-panel {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.drawer-head h3 { margin: 0; font-size: 26px; letter-spacing: -.03em; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  font-weight: 800;
  z-index: 60;
}
.toast.show { display: block; }

.preview-frame {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}
.pas-widget {
  border-radius: 22px;
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #fff, #f0f9ff);
  padding: 18px;
}
.pas-widget-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.pas-widget-head h3 { margin: 0; font-size: 20px; }


.feedback-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.feedback-summary.large { margin: 0 0 16px; }
.feedback-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #dbe4ee;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.feedback-chip.muted-chip { background: #f8fafc; color: #64748b; }
.feedback-box {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
}
.feedback-title { font-weight: 950; color: #334155; margin-bottom: 9px; }
.feedback-buttons { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.feedback-btn {
  border: 1px solid #dbe4ee;
  border-radius: 15px;
  background: #fff;
  padding: 10px 8px;
  display: grid;
  gap: 3px;
  place-items: center;
  color: #334155;
  font-weight: 900;
}
.feedback-btn:hover { background: #f0f9ff; border-color: #bae6fd; color: var(--primary); }
.feedback-btn span { font-size: 12px; }
.feedback-text-row { margin-top: 9px; display: flex; gap: 8px; align-items: stretch; }
.feedback-text-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
}
.feedback-text-row input:focus { border-color: #7dd3fc; box-shadow: 0 0 0 4px rgba(14,165,233,.12); }
.feedback-comments { display: grid; gap: 10px; }
.feedback-comment {
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  background: #fff;
  padding: 13px;
}
.feedback-comment p { white-space: pre-wrap; color: #475569; margin: 9px 0 0; }

@media (max-width: 1080px) {
  .grid.four, .grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
}
@media (max-width: 760px) {
  .main { padding: 18px; }
  .grid.two, .grid.three, .grid.four, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; flex-direction: column; }
  .hero { padding: 24px; border-radius: 24px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
}
@media print {
  .sidebar, .actions, .drawer, .toast { display: none !important; }
  .shell { display: block; }
  .main { max-width: none; padding: 0; }
  body { background: #fff; }
  .card, .hero, .news-card { box-shadow: none; break-inside: avoid; }
}
