/* Notion 스타일 참고: 순백 배경, 옅은 회색 경계선, 그림자 최소화, 절제된 색 사용 */
:root {
    --bg: #f7f7f8;
    --panel: #ffffff;
    --border: #e9e9e7;
    --ink: #37352f;
    --muted: #9b9a97;
    --brand: #2383e2;
    --brand-soft: #edf3fc;
    --good: #1f9d55;
    --warn: #b26a00;
    --danger: #c0392b;
    --fill-gray: #f7f7f5;
    --fill-gray-hover: #efefed;
    --btn-dark: #191919;
    --btn-dark-hover: #2f2f2d;
    --sidebar-bg: #ffffff;
    --sidebar-ink: #37352f;
    --sidebar-active: #ececea;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
    font-size: 14px;
}

a { color: var(--brand); text-decoration: none; }

.layout {
    display: flex;
    min-height: 100vh;
}

/* ---- 사이드바 ---- */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-ink);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 20px; color: var(--ink); flex-shrink: 0; }
.brand-text { min-width: 0; }
.brand-title {
    font-weight: 700; color: var(--ink); font-size: 35px; line-height: 1.1;
    white-space: nowrap;
}
.brand-sub { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    color: var(--ink);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
}
.nav a:hover { background: var(--fill-gray-hover); }
.nav a.active { background: var(--sidebar-active); font-weight: 600; }
.nav a.nav-bold { font-weight: 700; }
.nav-divider { border-top: 1px solid var(--border); margin: 8px 0; }

/* ---- 메인 ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.topbar {
    height: 56px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.who { display: flex; align-items: center; gap: 10px; }
.who-name { font-weight: 600; }
.who-code { font-size: 12px; color: var(--muted); font-family: Consolas, monospace; }
.who-role {
    font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600;
}
.role-admin { background: #fdecea; color: var(--danger); }
.role-member { background: var(--fill-gray); color: var(--muted); }

.btn-ghost {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--muted);
}
.btn-ghost:hover { background: var(--fill-gray); }

.content { padding: 24px; max-width: 1100px; }

.flash {
    background: #fdf6ec; border: 1px solid #f1e3c8; color: #9a6b00;
    padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; font-size: 13px;
}
.flash p { margin: 2px 0; }

/* ---- 공용 ---- */
.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
    padding: 20px; margin-bottom: 20px;
}
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card .card-sub { color: var(--muted); font-size: 12px; margin: 0 0 16px; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat-tile { background: var(--fill-gray); border-radius: 6px; padding: 14px; text-align: center; }
.stat-tile .num { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-tile .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
td { padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--fill-gray); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-working { background: #e6f7ec; color: var(--good); }
.badge-remote { background: #e8f0fe; color: #1a56db; }
.badge-outside { background: #fff8e1; color: #b28900; }
.badge-business_trip { background: #f3e8ff; color: #7c3aed; }
.badge-vacation { background: #fdecea; color: var(--danger); }
.badge-etc { background: var(--fill-gray); color: var(--muted); }

.progress { background: var(--fill-gray); border-radius: 6px; height: 8px; width: 100%; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; min-width: 140px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="datetime-local"], input[type="number"], input[type="password"],
select, textarea {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit;
    background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand);
}
textarea { resize: vertical; }

.btn {
    padding: 8px 16px; background: var(--btn-dark); color: #fff; border: none;
    border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--btn-dark-hover); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: #fdecea; color: var(--danger); }
.btn-danger:hover { background: #fbdad6; }
.btn-secondary { background: var(--fill-gray); color: var(--ink); }
.btn-secondary:hover { background: var(--fill-gray-hover); }

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tag-row a, .tag-row button {
    font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
    background: #fff; color: var(--muted); cursor: pointer;
}
.tag-row a.active, .tag-row button.active { background: var(--sidebar-active); border-color: var(--sidebar-active); color: var(--ink); }

.empty { color: var(--muted); text-align: center; padding: 24px 0; font-size: 13px; }

/* ---- 캘린더 ---- */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.cal-cell {
    min-height: 84px; border: 1px solid var(--border); border-radius: 6px; padding: 6px;
    font-size: 11px; background: #fff;
}
.cal-cell.other-month { background: var(--fill-gray); color: #c3c2bf; }
.cal-cell.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-daynum { font-weight: 700; margin-bottom: 4px; }
.cal-event { background: var(--brand-soft); color: var(--brand); border-radius: 4px; padding: 1px 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 로그인 ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); padding-inline: 16px; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 40px; width: 440px; max-width: 100%; text-align: center; box-sizing: border-box; }
.login-card h1 { margin: 0 0 4px; font-size: clamp(28px, 9vw, 66px); white-space: nowrap; }
.login-card .login-sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.login-card label { display: block; text-align: left; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.login-card input { width: 100%; padding: 12px 14px; font-size: 15px; margin-bottom: 18px; text-transform: uppercase; }
.login-card .btn { width: 100%; padding: 12px; font-size: 14px; }

/* ---- 온라인 회의 (채팅/요약) ---- */
.chat-msg { margin-bottom: 10px; }
.chat-who { font-weight: 600; font-size: 12px; }
.chat-time { font-size: 11px; color: var(--muted); margin-left: 6px; }
.chat-body { font-size: 13px; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }

.summary-box p { margin: 4px 0; font-size: 13px; line-height: 1.6; }
.sum-lv0 { color: var(--muted); font-size: 12px; }
.sum-lv1 { font-weight: 700; font-size: 14px; margin-top: 14px !important; }
.sum-lv2 { font-weight: 600; margin-left: 16px; }
.sum-lv3 { margin-left: 32px; color: var(--ink); }
.sum-lv4 { margin-left: 48px; color: var(--muted); }

@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; align-items: center; padding: 12px; border-right: none; border-bottom: 1px solid var(--border); }
    .nav { flex-direction: row; }
    .content { padding: 16px; }
}
