:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-strong: #f1f4f6;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9e0e7;
  --primary: #156f6b;
  --primary-strong: #0b5754;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --ok: #0f766e;
  --warning: #b54708;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.auth-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 28px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-logo-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-logo-lockup img {
  width: 98px;
  height: 58px;
  object-fit: contain;
  padding: 8px 10px;
  border: 1px solid #cfe9e6;
  border-radius: 8px;
  background: #e6f7f4;
}

.auth-logo-lockup span {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.18;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.3;
}

.muted,
.panel-header p,
.metric-card span,
.report-meta,
.small-note {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c8d2dc;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 111, 107, 0.14);
}

.primary-button,
.google-button,
.ghost-button,
.icon-button,
.nav-button,
.segment,
.danger-button,
.warning-button,
.plain-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  min-height: 46px;
  background: var(--primary);
  color: #fff;
}

.compact-button {
  width: auto;
  justify-self: start;
  padding: 0 16px;
}

.google-button {
  width: 100%;
  min-height: 46px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.primary-button:hover {
  background: var(--primary-strong);
}

.ghost-button,
.plain-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  padding: 0 14px;
}

.danger-button {
  background: var(--danger-soft);
  border-color: #fecdca;
  color: var(--danger);
  padding: 0 12px;
}

.warning-button {
  background: #fff7ed;
  border-color: #fed7aa;
  color: var(--warning);
  padding: 0 12px;
}

.icon-button {
  width: 40px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.primary-button svg,
.google-button svg,
.ghost-button svg,
.icon-button svg,
.nav-button svg,
.danger-button svg,
.warning-button svg,
.plain-button svg,
.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.form-error,
.global-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.global-error {
  padding: 12px 14px;
  border: 1px solid #fecdca;
  border-radius: 6px;
  background: var(--danger-soft);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #18212f;
  color: #fff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 24px;
}

.brand-mark {
  width: 66px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d7f2ee;
  overflow: hidden;
}

.brand-mark img {
  width: 58px;
  height: 34px;
  object-fit: contain;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block span {
  color: #b8c2cc;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  justify-content: flex-start;
  padding: 0 12px;
  background: transparent;
  color: #dbe4ee;
}

.nav-button:hover,
.nav-button.active {
  background: #253143;
  color: #fff;
}

.content-shell {
  min-width: 0;
  padding: 24px 28px 36px;
}

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

.topbar h1 {
  margin: 0;
}

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

.session-pill {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.view-stack {
  display: grid;
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card,
.panel,
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.1;
}

.panel {
  padding: 18px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

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

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segment {
  min-height: 34px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--ink);
  color: #fff;
}

.activity-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(14px, 1fr);
  align-items: end;
  gap: 6px;
  min-height: 180px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.bar {
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
}

.bar.empty {
  background: #d6dde5;
}

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

.report-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.report-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.report-body {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.report-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-meta {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8d2dc;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.language-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.language-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.language-tab.active {
  background: var(--primary);
  color: #fff;
}

.notice-form {
  display: grid;
  gap: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notice-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.notice-card-header h3 {
  margin: 0;
}

.notice-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f6f2;
  color: var(--ok);
  font-size: 12px;
  font-weight: 900;
}

.notice-status.hidden-status {
  background: #eef2f6;
  color: var(--muted);
}

.notice-body {
  margin: 0 0 10px;
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.notice-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.search-box {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-box input {
  min-height: 40px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

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

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-strong);
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

.code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  word-break: break-all;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #18212f;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

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

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

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-button {
    justify-content: center;
  }

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

@media (max-width: 720px) {
  .content-shell {
    padding: 18px 14px 28px;
  }

  .topbar,
  .topbar-actions,
  .toolbar,
  .setting-row,
  .notice-card {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-card {
    grid-template-columns: 1fr;
  }

  .nav-list,
  .metric-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .session-pill {
    max-width: 100%;
  }
}
