:root { --navy: #1d3557; --accent: #2563eb; --bg: #f5f6f8; --line: #dfe3e8; }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Malgun Gothic', 'Segoe UI', sans-serif; background: var(--bg); color: #222; }

.topbar { background: var(--navy); color: #fff; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 18px; }
.topbar .brand { font-weight: 700; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-left: auto; }
.topbar a { color: #dbe4f0; text-decoration: none; font-size: 14px; }
.topbar a:hover { color: #fff; }
.topbar .me { color: #9fb3cc; font-size: 13px; }

main { max-width: 1150px; margin: 18px auto; padding: 0 14px; }
h2 { margin: 8px 0 14px; font-size: 20px; }
h3 { margin: 0 0 10px; font-size: 16px; }
a { color: var(--accent); }

.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
th { background: #eef1f5; }
td.num, th.num { text-align: right; white-space: nowrap; }

.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-row .grow { flex: 1 1 260px; }
input, select, button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }
button { background: var(--accent); color: #fff; border: none; cursor: pointer; white-space: nowrap; }
button:hover { filter: brightness(1.07); }
button.danger { background: #c0392b; }
button.ghost { background: #64748b; }
.btnlink { display: inline-block; background: var(--accent); color: #fff !important; padding: 7px 12px; border-radius: 6px; text-decoration: none; font-size: 14px; white-space: nowrap; }
.btnlink.ghost { background: #64748b; }

.flash { padding: 9px 12px; border-radius: 6px; margin-bottom: 10px; font-size: 14px; }
.flash.ok { background: #e6f4ea; color: #1d6f42; border: 1px solid #bfe3cb; }
.flash.err { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c3; }
.banner-lock { background: #fff3cd; border: 1px solid #ffe08a; color: #8a6d1a; padding: 9px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }

.monthnav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.monthnav a.nav { text-decoration: none; font-size: 18px; }
.monthnav strong { font-size: 18px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.lock { background: #fdecea; color: #b3261e; }
.badge.open { background: #e6f4ea; color: #1d6f42; }
.badge.admin { background: #e0e7ff; color: #3730a3; }
.badge.super { background: #1d3557; color: #fff; }

.chips span { display: inline-block; background: #fdecea; color: #b3261e; border-radius: 10px; padding: 2px 10px; margin: 2px; font-size: 13px; }
.muted { color: #777; font-size: 13px; }
.actions form { display: inline; }
.actions { white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.scroll { overflow-x: auto; }
.spacer { margin-left: auto; }

/* 월 전체 입력 그리드 */
.daygrid td { vertical-align: top; }
.daygrid .datecell { white-space: nowrap; font-weight: 600; }
tr.sat td { background: #eef4ff; }
tr.sat .datecell { color: #1d4ed8; }
tr.sun td { background: #fdf0ef; }
tr.sun .datecell { color: #c0392b; }
.entryline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 2px 0; font-size: 13.5px; }
.entryline .h { font-weight: 700; white-space: nowrap; }
.entryline form { display: inline; }
.addline { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.addline input[name="project"] { flex: 1 1 200px; min-width: 150px; }
.addline input { padding: 4px 7px; font-size: 13px; }
button.mini { padding: 3px 8px; font-size: 12.5px; }

/* PJT 코드 선택창 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 10px; padding: 16px; width: min(960px, 96vw); max-height: 82vh; display: flex; flex-direction: column; }
.pjgrid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.pjitem { text-align: left; background: #f3f5f8; color: #222; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.pjitem:hover { background: #e2e9f5; }
.pjitem strong { color: var(--navy); }
.pjitem span { font-size: 12px; color: #555; }
.pjitem .rem { font-style: normal; font-size: 11.5px; color: #1d6f42; font-weight: 600; }
.pjitem .rem.over { color: #b3261e; }

/* 예상시간 초과 표시 / 팝업 */
.overtxt { color: #b3261e; font-weight: 700; }
td.miss { background: #fdecea; color: #b3261e; font-size: 12px; }
tr.ended-row td { background: #f7f7f8; color: #8a8a8a; }

/* 브랜드 로고 (상단바) */
.brand-link { text-decoration: none; display: inline-flex; align-items: center; }

/* 첫 화면 / 로그인 */
.landing-body { background: linear-gradient(160deg, #eef2f7 0%, #dfe6f0 100%); min-height: 100vh; margin: 0; }
.landing-wrap { max-width: 760px; margin: 0 auto; padding: 64px 20px; text-align: center; }
.landing-head { display: flex; justify-content: center; }
.landing-tagline { color: #5a6b80; font-size: 16px; margin: 14px 0 36px; }
.syscards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .syscards { grid-template-columns: 1fr; } }
.syscard { display: block; background: #fff; border: 1px solid #d7dee8; border-radius: 14px;
  padding: 32px 24px; text-decoration: none; color: #1d3557;
  box-shadow: 0 4px 14px rgba(29,53,87,.06); transition: transform .12s, box-shadow .12s; }
.syscard:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(29,53,87,.14); border-color: #2563eb; }
.sysicon { font-size: 40px; margin-bottom: 10px; }
.syscard h3 { margin: 6px 0 8px; font-size: 19px; }
.syscard p { color: #5a6b80; font-size: 13.5px; margin: 0 0 16px; line-height: 1.6; }
.sysgo { display: inline-block; color: #2563eb; font-weight: 700; font-size: 14px; }
.landing-foot { margin-top: 34px; color: #6b7888; font-size: 13px; }

.login-wrap { max-width: 380px; margin: 0 auto; padding: 60px 20px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 22px; text-decoration: none; }
.login-card { box-shadow: 0 6px 20px rgba(29,53,87,.10); }
.login-card h2 { margin-top: 0; text-align: center; }
.popbox { max-width: 480px; }
.popbox h3 { margin-top: 0; }
.popwarn h3 { color: #8a6d1a; }
.poperr h3 { color: #b3261e; }

/* 월별 PJT 코드 배정 체크 목록 */
.pjcheck { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 4px; max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.pjcheck label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
