:root {
  --bg: #eef3f1;
  --panel: #ffffff;
  --panel-soft: linear-gradient(180deg, #ffffff 0%, #f5fbfa 100%);
  --text: #1c2328;
  --muted: #5d696d;
  --line: #d2ddda;
  --brand: #58bfc0;
  --brand-deep: #207f84;
  --accent: #0d3d46;
  --shadow: 0 24px 60px rgba(11, 48, 54, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(88, 191, 192, 0.18), transparent 30%),
    linear-gradient(180deg, #edf3f2 0%, #e5ecea 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 28px;
  background: linear-gradient(180deg, #0e2f35 0%, #173c43 100%);
  color: #eff8f6;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, #a8efea 100%);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}

.brand p,
.sidebar-footer p,
.sidebar-footer span {
  margin: 0;
}

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

.nav a {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.main-content {
  padding: 34px;
}

.auth-layout {
  display: grid;
  place-items: center;
}

.auth-card,
.panel,
.stat-card {
  border-radius: var(--radius);
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  border: 1px solid rgba(32, 127, 132, 0.08);
}

.auth-card {
  max-width: 620px;
  padding: 36px;
}

.hero-badge,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

h1,
h2,
p {
  margin-top: 0;
}

.lead,
.muted,
.table-sub,
.hint,
.page-header p {
  color: var(--muted);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.flash-success {
  background: #ebf9f5;
  border-color: #b8ead8;
}

.flash-error {
  background: #fff1f1;
  border-color: #efc1c1;
}

.page-header,
.section-heading.inline,
.header-actions,
.filter-actions,
.user-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  margin-bottom: 18px;
}

.button-primary,
.button-secondary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 12px 18px;
  border: none;
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
  color: white;
}

.button-secondary {
  background: #d8efed;
  color: var(--accent);
}

.button-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

.button-ghost.small {
  padding: 8px 12px;
}

.filter-panel,
.panel {
  padding: 24px;
}

.filter-grid,
.form-grid,
.detail-grid,
.stats-grid {
  display: grid;
  gap: 18px;
}

.filter-grid {
  grid-template-columns: 2fr 1fr auto;
}

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

.form-stack {
  display: grid;
  gap: 20px;
}

.compact {
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
}

textarea {
  resize: vertical;
}

.radio-row,
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.check-grid.triple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chip,
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-weight: 500;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 22px 0;
}

.stat-card {
  padding: 24px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 32px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 12px;
  background: #dbf4f2;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.status-muted {
  background: #eceff1;
  color: #687175;
}

.detail-grid {
  grid-template-columns: 1.7fr 1fr;
  align-items: start;
}

.detail-card,
.stack,
.timeline-panel {
  min-height: 100%;
}

.stack {
  display: grid;
  gap: 20px;
}

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

dt {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

dd {
  margin: 0;
  white-space: pre-line;
}

.attachment-list,
.timeline,
.user-list {
  display: grid;
  gap: 14px;
}

.attachment-item,
.timeline-item,
.user-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: white;
}

.attachment-item span,
.timeline-item header span,
.user-row p {
  color: var(--muted);
  font-size: 14px;
}

.timeline-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hidden {
  display: none;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px 0;
}

code {
  background: #eef5f5;
  padding: 2px 6px;
  border-radius: 8px;
}

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

  .sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .nav {
    grid-auto-flow: column;
  }

  .sidebar-footer {
    display: none;
  }
}

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

  .page-header,
  .section-heading.inline,
  .header-actions,
  .filter-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-grid,
  .form-grid,
  .detail-grid,
  .stats-grid,
  .meta-grid,
  .check-grid.triple {
    grid-template-columns: 1fr;
  }

  .nav {
    grid-auto-flow: row;
  }
}
