:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --text: #19324d;
  --muted: #62748a;
  --line: #d9e3ef;
  --primary: #0f4c81;
  --primary-strong: #0b3a62;
  --accent: #d8ecff;
  --success: #1f8f5f;
  --warning: #d18a16;
  --danger: #c2413d;
  --shadow: 0 18px 40px rgba(15, 76, 129, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top left, rgba(216, 236, 255, 0.8), transparent 34%), linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(248, 251, 255, 0.92);
  border-bottom: 1px solid rgba(217, 227, 239, 0.85);
}
.topbar-inner, .container, .footer {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.topbar-inner {
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.container { padding-top: 32px; padding-bottom: 60px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, var(--primary) 0%, #2f78ba 100%);
  color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: var(--shadow);
}
.brand-text strong, .brand-text span { display: block; }
.brand-text span, .muted, .lead, .helper { color: var(--muted); }
.nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav a {
  padding: 10px 14px; border-radius: 999px; color: var(--muted); font-size: .95rem;
}
.nav a.active, .nav a:hover { background: var(--accent); color: var(--primary-strong); }
.hero, .grid-2, .grid-3, .layout-admin, .split, .ticket-header, .filter-row, .stats, .service-choice, .meta-list {
  display: grid;
  gap: 20px;
}
.hero, .ticket-header { grid-template-columns: 1.2fr .8fr; }
.grid, .hero-side, .ticket-list, .timeline, .thread, .notice-list, .faq-list { display: grid; gap: 18px; }
.grid-2, .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-admin { grid-template-columns: 260px minmax(0, 1fr); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-choice { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-row { grid-template-columns: 1.2fr auto; align-items: end; }
.meta-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-main, .card, .panel, .table-wrap, .toolbar, .ticket-header, .sidebar, .flash {
  background: var(--panel); border: 1px solid rgba(217, 227, 239, 0.9); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-main, .card, .panel, .toolbar, .ticket-header, .flash { padding: 24px; }
.hero-main h1, .page-heading h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; margin: 14px 0 0; }
.lead { line-height: 1.7; max-width: 64ch; }
.eyebrow, .badge {
  display: inline-flex; align-items: center; border-radius: 999px; font-size: .88rem; font-weight: 600;
}
.eyebrow { gap: 8px; padding: 8px 12px; background: var(--accent); color: var(--primary-strong); }
.badge { padding: 7px 11px; }
.button, button {
  border: 0; border-radius: 14px; padding: 12px 18px; font: inherit; cursor: pointer; transition: .2s ease;
}
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-strong); }
.button-secondary { background: #fff; color: var(--primary); border: 1px solid var(--line); }
.button-ghost { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.input, select, textarea {
  width: 100%; margin-top: 8px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit;
}
textarea { min-height: 140px; resize: vertical; }
.stat { padding: 20px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.stat-value { margin-top: 10px; font-size: 2rem; font-weight: 700; }
.service-item, .meta-item, .choice {
  padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, #ffffff 0%, var(--panel-soft) 100%);
}
.sidebar { position: sticky; top: 100px; height: fit-content; padding: 18px; }
.sidebar a { display: block; padding: 12px 14px; border-radius: 14px; color: var(--muted); margin-bottom: 8px; }
.sidebar a.active, .sidebar a:hover { background: var(--accent); color: var(--primary-strong); }
.line-item { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.line-item:last-child { padding-bottom: 0; border-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: .95rem; }
th { color: var(--muted); font-weight: 600; background: #fbfdff; }
tr:last-child td { border-bottom: 0; }
.timeline-item, .thread-item { position: relative; padding-left: 24px; }
.timeline-item::before, .thread-item::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
}
.timeline-item::after {
  content: ""; position: absolute; left: 4px; top: 18px; bottom: -18px; width: 2px; background: #d4e3f3;
}
.timeline-item:last-child::after { display: none; }
.flash-success { border-color: #c7ebd8; background: #effbf4; color: #0f6f48; }
.error { margin-top: 8px; color: var(--danger); font-size: .9rem; }
.badge-open, .badge-assigned { background: #e1efff; color: #17518a; }
.badge-in_progress, .badge-waiting_user, .badge-medium { background: #fff1d7; color: #9a6500; }
.badge-resolved, .badge-closed, .badge-low { background: #ddf5ea; color: #0f6f48; }
.badge-escalated, .badge-high, .badge-critical { background: #fde4e2; color: #a22d29; }
@media (max-width: 1100px) {
  .hero, .layout-admin, .split, .ticket-header, .stats, .service-choice, .grid-3 { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 720px) {
  .topbar-inner, .container { padding-left: 16px; padding-right: 16px; }
  .nav, .grid-2, .meta-list, .stats, .stats-2, .filter-row { grid-template-columns: 1fr; display: grid; }
  .hero-main, .card, .panel, .toolbar, .ticket-header { padding: 18px; }
}
