/* ============================================================
   Runic HR — Premium Design System
   ============================================================ */
:root {
  /* surfaces */
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e8eaf0;
  --border-strong: #dcdfe8;

  /* text */
  --text: #0c1322;
  --text-2: #5a6373;
  --text-3: #939bab;

  /* brand (indigo → violet) */
  --brand: #4f46e5;
  --brand-2: #6d4ae8;
  --brand-ink: #3730a3;
  --brand-soft: #eef1ff;
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-soft: linear-gradient(135deg, #eef1ff 0%, #f5edff 100%);

  /* status */
  --danger: #e11d48;
  --danger-soft: #fff1f3;
  --success: #15a34a;
  --success-soft: #effaf2;

  /* shadows */
  --sh-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --sh: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 16px -6px rgba(15, 23, 42, .10);
  --sh-lg: 0 8px 30px -10px rgba(15, 23, 42, .18);
  --sh-brand: 0 8px 22px -8px rgba(79, 70, 229, .55);

  /* radii */
  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;

  --maxw: 1000px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, Roboto, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  line-height: 1.55;
  letter-spacing: -0.01em;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 100% -10%, rgba(124, 58, 237, .07), transparent 60%),
    radial-gradient(800px 500px at -10% 0%, rgba(79, 70, 229, .07), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; font-size: 16px; }
::selection { background: rgba(79, 70, 229, .18); }

/* ===== Layout ===== */
.container { max-width: var(--maxw); margin: 0 auto; padding: 26px 18px calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .container { padding: 30px 24px 36px; } }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(232, 234, 240, .9);
}
.topbar-inner { max-width: var(--maxw); margin: 0 auto; height: 62px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; }
@media (min-width: 640px){ .topbar-inner{ padding: 0 24px; } }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px;
  letter-spacing: -0.02em; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: var(--sh-brand); flex-shrink: 0;
}
.topnav { display: none; gap: 2px; }
@media (min-width: 640px) { .topnav { display: flex; } }
.topnav a { padding: 8px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 600;
  color: var(--text-2); transition: background .15s, color .15s; }
.topnav a:hover { background: rgba(15, 23, 42, .04); color: var(--text); }
.topnav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-name { display: none; font-size: 14px; font-weight: 600; color: var(--text-2); }
@media (min-width: 640px) { .user-name { display: inline-flex; align-items: center; } }
.tag-admin { background: var(--grad); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; margin-left: 7px; letter-spacing: .02em; }
.btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s; }
.btn-ghost:hover { background: var(--surface-2); border-color: #cfd3de; }
.btn-ghost:active { transform: translateY(1px); }

/* ===== Bottom tab bar (mobile) ===== */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(18px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 640px) { .tabbar { display: none; } }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 0 8px; font-size: 11px; font-weight: 600; color: var(--text-3);
  transition: color .15s; }
.tabbar a.active { color: var(--brand); }
.tabbar .ic { font-size: 19px; line-height: 1; }

/* ===== Cards / sections ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; box-shadow: var(--sh); }
@media (min-width: 640px){ .card{ padding: 22px; } }
a.card { transition: transform .15s, box-shadow .2s, border-color .2s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); border-color: #dadfee; }
.section { margin-bottom: 24px; }
h1.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
h2.card-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 14px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

/* ===== Stat cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (min-width: 640px) { .stat-grid { gap: 16px; } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px 14px; text-align: center; box-shadow: var(--sh-sm); }
@media (min-width: 640px){ .stat{ padding: 22px 16px; } }
.stat .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px;
  font-variant-numeric: tabular-nums; }
.stat .unit { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
@media (min-width: 640px) { .stat .value { font-size: 32px; } }
.stat.accent { background: var(--grad); border: none; color: #fff; box-shadow: var(--sh-brand); }
.stat.accent .label { color: rgba(255, 255, 255, .85); }
.stat.accent .value { color: #fff; font-size: 30px; }
.stat.accent .unit { color: rgba(255, 255, 255, .8); }
@media (min-width: 640px) { .stat.accent .value { font-size: 40px; } }

/* ===== Progress ===== */
.progress { height: 12px; background: #edeef3; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); border-radius: 999px; transition: width .4s ease; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; letter-spacing: .01em; }
.badge-full { background: var(--brand-soft); color: var(--brand-ink); }
.badge-am { background: #fff3d6; color: #b45309; }
.badge-pm { background: #d6f5ef; color: #0f766e; }
.tag { display: inline-flex; align-items: center; background: var(--grad-soft); color: var(--brand-ink);
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(79,70,229,.12); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--grad); color: #fff; border: none; border-radius: 11px;
  padding: 11px 18px; font-weight: 700; letter-spacing: -0.01em; cursor: pointer;
  box-shadow: var(--sh-brand); transition: transform .12s, box-shadow .2s, filter .15s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); box-shadow: 0 4px 12px -6px rgba(79,70,229,.6); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 9px; box-shadow: none; }
.btn-sm:hover { box-shadow: none; }
.btn-outline { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn-outline:hover { background: var(--surface-2); border-color: #cfd3de; filter: none; }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid #fbcfd8; box-shadow: none; }
.btn-danger:hover { background: var(--danger-soft); filter: none; }
.link { color: var(--brand); font-weight: 700; font-size: 14px; transition: color .15s; }
.link:hover { color: var(--brand-ink); }

/* ===== Forms ===== */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 11px;
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .14); }
select.input { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235a6373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-row { display: grid; gap: 13px; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ===== Alerts ===== */
.alert { padding: 12px 15px; border-radius: 12px; font-size: 14px; font-weight: 500; margin-bottom: 16px;
  border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: #be123c; border-color: #fbd0da; }
.alert-success { background: var(--success-soft); color: #15803d; border-color: #c5ecd2; }
.alert-info { background: var(--brand-soft); color: var(--brand-ink); border-color: #dce1ff; }

/* ===== Lists ===== */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 13px; padding: 13px 0;
  border-top: 1px solid var(--border); flex-wrap: wrap; }
.list li:first-child { border-top: none; }
.list .date { width: 92px; flex-shrink: 0; font-weight: 700; color: var(--text-2);
  font-variant-numeric: tabular-nums; font-size: 14px; }
.list .reason { color: var(--text-2); font-size: 14px; flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--text-3); padding: 34px 0; font-size: 14px; font-weight: 500; }

/* ===== Table / cards ===== */
.table-wrap { display: none; }
.cards { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .table-wrap { display: block; overflow-x: auto; border: 1px solid var(--border);
    border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-sm); }
  .cards { display: none; }
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl th { background: var(--surface-2); font-weight: 700; color: var(--text-2); font-size: 12.5px;
  text-transform: none; letter-spacing: .01em; }
table.tbl tr:last-child td { border-bottom: none; }
.row-inactive { opacity: .55; }

/* ===== Expandable edit ===== */
details.edit > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit > summary::after { content: "▾"; font-size: 11px; color: var(--text-3); transition: transform .2s; }
details.edit[open] > summary::after { transform: rotate(180deg); }
.edit-panel { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }

/* ===== Calendar ===== */
.cal { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  background: var(--surface); box-shadow: var(--sh); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-head div { text-align: center; padding: 10px 0; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
@media (min-width: 640px) { .cal-head div { font-size: 13.5px; } }
.cal-cell { min-height: 66px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 5px; transition: background .12s; }
@media (min-width: 640px) { .cal-cell { min-height: 110px; padding: 7px; } }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--surface-2); }
.cal-daynum { text-align: right; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }
@media (min-width: 640px) { .cal-daynum { font-size: 13.5px; } }
.cal-out { background: #fafbfc; }
.cal-out .cal-daynum { color: #c4cad6; }
.cal-today { background: var(--brand-soft); }
.cal-today .cal-daynum { color: var(--brand); }
.cal-today .cal-daynum::before { content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--brand); border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.cal-badge { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 6px; font-size: 10px;
  font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .cal-badge { font-size: 11.5px; } }
.cal-more { font-size: 10px; color: var(--text-3); padding: 1px 6px; font-weight: 600; }
.sun { color: #ef4444; } .sat { color: #2563eb; }

/* ===== Utilities ===== */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-1{margin-top:7px}.mt-2{margin-top:13px}.mt-3{margin-top:19px}.mb-2{margin-bottom:13px}
.wrap-gap { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

/* ===== Auth (login) — split screen ===== */
.auth-split { min-height: 100svh; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
@media (min-width: 920px) { .auth-split { grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); } }

.auth-aside { display: none; position: relative; overflow: hidden; padding: 56px;
  flex-direction: column; justify-content: space-between; color: #fff;
  background: linear-gradient(155deg, #4f46e5 0%, #6d28d9 50%, #9333ea 100%); }
@media (min-width: 920px) { .auth-aside { display: flex; } }
.auth-aside::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  top: -190px; right: -180px; background: radial-gradient(circle, rgba(255,255,255,.20), transparent 62%); }
.auth-aside::after { content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  bottom: -160px; left: -130px; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 62%); }
.auth-aside > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 13px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark-lg { width: 42px; height: 42px; border-radius: 13px; font-size: 20px;
  background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.auth-headline { font-size: 40px; line-height: 1.16; font-weight: 800; letter-spacing: -0.04em; margin: 0 0 20px; }
.auth-lead { font-size: 16px; line-height: 1.7; color: rgba(255,255,255,.82); max-width: 32ch; margin: 0 0 34px; }
.auth-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-feats li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; color: rgba(255,255,255,.96); }
.auth-feats li i { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-size: 13px; font-weight: 800; font-style: normal; }
.auth-aside-foot { font-size: 13px; color: rgba(255,255,255,.66); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 36px 22px; background: var(--surface); min-width: 0; }
@media (min-width: 920px) { .auth-main { padding: 40px; } }
.auth-form-wrap { width: 100%; max-width: 384px; min-width: 0; }
.auth-mobile-logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px;
  letter-spacing: -0.02em; margin-bottom: 32px; }
@media (min-width: 920px) { .auth-mobile-logo { display: none; } }
.auth-h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 7px; }
.auth-h1-sub { color: var(--text-2); font-size: 14.5px; margin: 0 0 30px; }
.auth-foot { color: var(--text-3); font-size: 12.5px; margin-top: 22px; text-align: center; }
