/* Simple StoryBoard - 화면 정의서(v1.0) 기반 프로토타입 스타일
   Palette: Primary #2E5E8C, Success #2E9E5B, Danger #C0392B, BG #F4F6F8 */
:root {
  --primary: #2E5E8C;
  --primary-dark: #234a70;
  --success: #2E9E5B;
  --danger: #C0392B;
  --bg: #F4F6F8;
  --surface: #ffffff;
  --border: #d9dee3;
  --text: #253038;
  --muted: #6b7884;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- GNB ---------- */
.gnb {
  height: 56px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
.gnb .logo { font-weight: 700; font-size: 17px; margin-right: 28px; color:#fff; }
.gnb .logo:hover { text-decoration: none; }
.gnb nav { display: flex; gap: 4px; flex: 1; }
.gnb nav a {
  color: #dfeaf4; padding: 8px 14px; border-radius: 6px; font-size: 14px;
}
.gnb nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.gnb nav a.active { background: rgba(255,255,255,.2); color:#fff; font-weight:600; }
.gnb .user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.gnb .user .name { font-weight: 600; }
.gnb .user .badge {
  background: rgba(255,255,255,.2); border-radius: 10px; padding: 2px 9px; font-size: 11px;
}

/* ---------- layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.page-head h1 { font-size: 22px; margin: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-family: inherit; transition: .12s;
}
.btn:hover { background: #f0f2f5; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--success); border-color: var(--success); color:#fff; }
.btn.danger  { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color:#fff; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.link { border: none; background: none; color: var(--primary); padding: 4px 6px; }

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field label .req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=email], input[type=password], input[type=date],
select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit; background:#fff; color:var(--text);
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,94,140,.12);
}
.field .err { color: var(--danger); font-size: 12px; margin-top: 4px; min-height: 14px; display:block; }
.row2 { display: flex; gap: 12px; }
.row2 > .field { flex: 1; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox input { width: auto; }

/* ---------- card grid (projects) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.pcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; box-shadow: var(--shadow); position: relative; transition:.12s;
}
.pcard:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-1px); }
.pcard h3 { margin: 0 0 6px; font-size: 16px; }
.pcard .desc { color: var(--muted); font-size: 12.5px; min-height: 34px; margin-bottom: 10px; }
.pcard .meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.progress { height: 8px; background: #e7ebee; border-radius: 5px; overflow: hidden; margin: 6px 0 4px; }
.progress > span { display: block; height: 100%; background: var(--success); }
.pcard .actions { display: flex; gap: 6px; margin-top: 12px; }
.pcard .more { position: absolute; top: 10px; right: 10px; }
.dropdown { position: relative; }
.dropdown .menu {
  position: absolute; right: 0; top: 26px; background:#fff; border:1px solid var(--border);
  border-radius:8px; box-shadow: var(--shadow); min-width: 120px; display:none; z-index: 20; overflow:hidden;
}
.dropdown.open .menu { display: block; }
.dropdown .menu button {
  display:block; width:100%; text-align:left; border:none; background:none; padding:9px 14px;
  font-size:13px; cursor:pointer; font-family:inherit;
}
.dropdown .menu button:hover { background:#f0f2f5; }
.dropdown .menu button.danger { color: var(--danger); }

/* ---------- badges / status ---------- */
.status { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight:600; }
.status.doing { background:#eaf1f8; color: var(--primary); }
.status.done  { background:#e7f6ee; color: var(--success); }
.status.todo  { background:#f0f2f5; color: var(--muted); }

/* ---------- table ---------- */
table.data { width: 100%; border-collapse: collapse; background:#fff; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
table.data th, table.data td { padding: 11px 13px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
table.data thead th { background: var(--primary); color:#fff; font-weight:600; }
table.data tbody tr:hover { background: #f7f9fb; }
table.data td .btn { margin-right: 4px; }
.pager { display:flex; gap:6px; margin-top:14px; align-items:center; }
.pager button { min-width: 32px; }

/* ---------- board (kanban) ---------- */
/* 보드 페이지는 화면의 약 90%를 사용 */
.container.board-container { max-width: 90%; }
.board-head { display:flex; align-items:center; gap:16px; margin-bottom:18px; flex-wrap: wrap; }
.board-head h1 { font-size: 20px; margin:0; }
.board-head .prog-wrap { display:flex; align-items:center; gap:8px; min-width:220px; }
.board-head .progress { flex:1; margin:0; }
.board { display:flex; gap:14px; align-items:flex-start; overflow-x:auto; padding-bottom:12px; }
.column {
  background:#eef1f4; border:1px solid var(--border); border-radius:10px;
  /* 유동폭: 사용 가능한 가로 공간을 균등 분배(최소 260px, 넘치면 가로 스크롤) */
  flex: 1 1 260px; min-width:260px; max-height: calc(100vh - 220px); display:flex; flex-direction:column;
}
.column .col-head { display:flex; align-items:center; justify-content:space-between; padding:12px 12px 8px; }
.column .col-head .title { font-weight:700; font-size:14px; cursor:text; }
.column .col-head .count { color:var(--muted); font-size:12px; }
.column .cards { padding: 4px 10px 10px; overflow-y:auto; flex:1; min-height: 40px; }
.scard {
  background:#fff; border:1px solid var(--border); border-radius:8px; padding:10px 12px;
  margin-bottom:9px; box-shadow: var(--shadow); cursor:grab; font-size:13px;
}
.scard:hover { border-color: var(--primary); }
.scard.dragging { opacity:.5; }
.scard h4 { margin:0 0 5px; font-size:13.5px; font-weight:600; }
.scard .sc-meta { color: var(--muted); font-size:11.5px; display:flex; gap:8px; flex-wrap:wrap; }
.scard .sc-attach { color: var(--primary); font-size:11px; margin-top:4px; }
.column .add-card { border:none; background:none; color:var(--muted); text-align:left; padding:8px 12px; cursor:pointer; font-size:13px; font-family:inherit; border-radius:6px; }
.column .add-card:hover { background:#e3e8ed; color:var(--text); }
.col-drop-hint { outline: 2px dashed var(--primary); outline-offset:-4px; }
.add-column { flex: 0 0 160px; min-width:160px; }
.add-column button { width:100%; height:44px; border:1px dashed var(--border); background:rgba(255,255,255,.6); border-radius:10px; cursor:pointer; color:var(--muted); font-family:inherit; }
.add-column button:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset:0; background: rgba(20,30,40,.45); display:none;
  align-items:flex-start; justify-content:center; z-index: 100; padding: 60px 16px; overflow:auto;
}
.modal-backdrop.open { display:flex; }
.modal {
  background:#fff; border-radius:12px; width: 100%; max-width: 520px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  animation: pop .14s ease-out;
}
@keyframes pop { from { transform: translateY(-8px); opacity:.6; } to { transform:none; opacity:1; } }
.modal .m-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border); }
.modal .m-head h2 { margin:0; font-size:17px; }
.modal .m-head .x { border:none; background:none; font-size:20px; cursor:pointer; color:var(--muted); line-height:1; }
.modal .m-body { padding: 18px 20px; }
.modal .m-foot { padding: 14px 20px; border-top:1px solid var(--border); display:flex; justify-content:space-between; gap:8px; }
.modal .m-foot .right { display:flex; gap:8px; margin-left:auto; }

/* ---------- login ---------- */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#2E5E8C,#1f3f5f); padding:20px; }
.login-box { background:#fff; border-radius:14px; padding:36px 32px; width:100%; max-width:380px; box-shadow:0 12px 40px rgba(0,0,0,.25); }
.login-box .brand { text-align:center; margin-bottom:24px; }
.login-box .brand .t { font-size:22px; font-weight:700; color:var(--primary); }
.login-box .brand .s { font-size:12px; color:var(--muted); margin-top:4px; }
.login-box .btn.primary { width:100%; justify-content:center; padding:11px; font-size:15px; margin-top:6px; }
.login-hint { margin-top:16px; font-size:11.5px; color:var(--muted); text-align:center; line-height:1.7; }

/* ---------- attachments / chips ---------- */
.chips { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.chip { background:#eef1f4; border-radius:14px; padding:3px 10px; font-size:12px; display:inline-flex; gap:6px; align-items:center; }
.chip .x { cursor:pointer; color:var(--muted); }

/* ---------- toast ---------- */
#toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:#253038; color:#fff; padding:10px 18px; border-radius:8px; font-size:13px; opacity:0; transition:.2s; z-index:200; pointer-events:none; }
#toast.show { opacity:1; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.public-head { background:#253038; color:#fff; padding:18px 20px; }
.public-head .t { font-size:18px; font-weight:700; }
.empty { text-align:center; color:var(--muted); padding:40px 0; }
.notice { background:#fff8e6; border:1px solid #f0d98a; color:#8a6d1a; padding:10px 14px; border-radius:8px; font-size:12.5px; margin-bottom:16px; }
