@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --ink: #101828;
  --ink-soft: #475467;
  --line: #e4e7ec;
  --brand: #155eef;
  --brand-soft: #eff4ff;
  --success: #067647;
  --warning: #b54708;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Geist", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(21, 94, 239, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
}

.shell {
  width: calc(100% - 24px);
  margin: 0 12px;
  padding: 24px 0 40px;
}

.shell-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.hero,
.panel,
.login-card,
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  padding: 24px 28px;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

.login-brand {
  margin-bottom: 18px;
}

.brand-logo-login {
  height: 56px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: inherit;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.lede,
.muted,
label span,
th,
td,
input,
select,
button,
a {
  font-size: 0.86rem;
}

.lede,
.muted {
  color: var(--ink-soft);
  line-height: 1.45;
}

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

.stat-card,
.panel,
.login-card {
  border-radius: var(--radius);
}

.stat-card {
  padding: 18px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.stat-card span {
  display: block;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.55rem;
  font-family: inherit;
  letter-spacing: -0.04em;
}

.panel {
  padding: 18px 20px;
  margin-top: 14px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.filters,
.stack {
  display: grid;
  gap: 12px;
}

.filters {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.stack label,
.filters label {
  display: grid;
  gap: 6px;
}

input,
select,
button,
.button-link {
  border-radius: 999px;
}

input,
select {
  width: 100%;
  border: 1px solid #d0d5dd;
  background: #ffffff;
  padding: 10px 12px;
  color: var(--ink);
}

button,
.button-link {
  border: none;
  background: linear-gradient(135deg, #155eef 0%, #004ee8 100%);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
}

.button-secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid #d0d5dd;
}

.login-card {
  width: min(520px, 100%);
  padding: 28px;
  overflow: hidden;
}

.notice {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.notice-error {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.notice-success {
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
}

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

.checkbox-group {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
}

.checkbox-group legend {
  padding: 0 6px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-actions,
.cell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cell-actions {
  min-width: 150px;
  justify-content: flex-start;
  white-space: normal;
}

.button-small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.cell-actions form {
  margin: 0;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  table-layout: fixed;
}

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

th {
  color: var(--ink-soft);
  font-weight: 600;
  background: var(--surface-alt);
  position: sticky;
  top: 0;
  z-index: 1;
  user-select: none;
}

th[draggable="true"] {
  cursor: grab;
}

th.is-dragging {
  opacity: 0.45;
}

.th-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.th-link.is-active {
  color: var(--brand);
}

.sort-form {
  margin: 0;
}

.th-button {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.th-button.is-active {
  color: var(--brand);
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: #d0d5dd;
}

.cell-description {
  min-width: 300px;
  max-width: 480px;
  white-space: normal;
  line-height: 1.4;
}

.mono {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #eef2f6;
}

.status-solved,
.status-closed {
  color: var(--success);
  background: #ecfdf3;
}

.status-new,
.status-open,
.status-pending,
.status-hold {
  color: var(--warning);
  background: #fffaeb;
}

.empty-state {
  padding: 18px 8px 8px;
}

@media (max-width: 900px) {
  .hero,
  .filters,
  .admin-form {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .hero {
    padding: 18px;
  }

  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .login-card {
    padding: 22px;
  }
}
