:root {
  --sidebar: #1e293b;
  --sidebar-text: #e8eef6;
  --sidebar-muted: #94a3b8;
  --sidebar-active: #334155;
  --canvas: #f3f5f8;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --input: #d1d5db;
  --green: #22c55e;
  --green-press: #16a34a;
  --slate: #64748b;
  --slate-press: #475569;
  --danger: #ef4444;
  --blue: #3b82f6;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius: 12px;
  --radius-control: 8px;
  --font: "Pretendard", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

.login-page {
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  padding: 24px 16px;
  background: var(--canvas);
}

.login-card,
.panel {
  display: grid;
  gap: 16px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card { max-width: 28rem; padding: 28px 20px; }
.panel { padding: 16px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-copy, .who, .nav-block, .page, .stack { display: grid; }
.brand-copy, .who { gap: 2px; }
.nav-block, .page, .stack { gap: 8px; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--sidebar);
  flex: 0 0 auto;
}
.login-card .brand-name { color: var(--ink); }
.brand-name { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub, .meta { color: var(--muted); font-size: 0.875rem; }

h1, h2 { margin: 0; letter-spacing: -0.02em; line-height: 1.3; }
h1 { font-size: 1.25rem; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 700; }

.field { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 600; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select {
  min-height: 44px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-control);
  background: var(--card);
  font-weight: 400;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus, .toolbar select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: #eef2f6;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:active { background: var(--green-press); }
.btn-slate { background: var(--slate); color: #fff; }
.btn-slate:active { background: var(--slate-press); }
.btn-block { width: 100%; }

.alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: #fee2e2;
  color: #991b1b;
}

.shell { display: grid; min-height: 100vh; }
.sidebar {
  display: none;
  grid-template-rows: auto 1fr;
  background: var(--sidebar);
  color: var(--sidebar-text);
}
.shell.is-nav-open .sidebar {
  display: grid;
  position: fixed;
  z-index: 3;
  inset: 0 auto 0 0;
  width: min(16rem, 86vw);
  height: 100vh;
}
.sidebar .brand { min-height: 64px; padding: 0 16px; }
.sidebar .brand-name { color: #fff; }
.sidebar .brand-sub { color: var(--sidebar-muted); }
.sidebar .brand-mark { background: #fff; }
.backdrop { display: none; border: 0; padding: 0; }
.shell.is-nav-open .backdrop {
  display: block;
  position: fixed;
  z-index: 2;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.nav-label {
  margin: 8px 16px 4px;
  color: var(--sidebar-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.nav-block { align-content: start; padding: 8px; gap: 4px; }
.nav-link {
  display: grid;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--sidebar-text);
  font-weight: 600;
  text-decoration: none;
}
.nav-link.is-current { background: var(--sidebar-active); color: #fff; }

.workspace { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 64px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.menu-button {
  width: 44px;
  height: 44px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
}
.top-title { font-weight: 700; }
.top-user { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #dbeafe;
}
.page {
  align-content: start;
  gap: 16px;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: 16px;
}

.panel-head, .form-actions {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 8px;
}
.form-actions { justify-content: end; padding-top: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef2f6;
  font-weight: 700;
  text-decoration: none;
}
.tab.is-current { background: var(--sidebar); color: #fff; }

.toolbar { display: grid; gap: 8px; }
.form-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.table-wrap { overflow-x: auto; }
.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.data th, .data td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.data th { color: var(--muted); font-size: 0.8125rem; font-weight: 700; background: #f8fafc; }
.data .empty { text-align: center; color: var(--muted); white-space: normal; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.pill-open { background: #fff7ed; color: #c2410c; }
.pill-in_progress { background: #fef9c3; color: #a16207; }
.pill-done { background: #dcfce7; color: #15803d; }
.pill-scheduled { background: #e2e8f0; color: #334155; }

@media (min-width: 640px) {
  .page { padding: 20px 24px; }
  .login-card, .panel { padding: 24px; }
  .fields { display: flex; flex-wrap: wrap; gap: 12px; }
  .fields .field { flex: 1 1 16rem; min-width: 0; }
  .toolbar { grid-template-columns: 1fr auto auto; align-items: end; }
}

@media (min-width: 1024px) {
  .shell { display: flex; flex-direction: row; align-items: stretch; }
  .sidebar {
    display: grid;
    position: sticky;
    top: 0;
    width: 16rem;
    height: 100vh;
    flex: 0 0 16rem;
  }
  .shell.is-nav-open .sidebar { position: sticky; width: 16rem; }
  .shell.is-nav-open .backdrop, .menu-button { display: none; }
  .workspace { flex: 1 1 auto; min-width: 0; }
}
