:root {
  --ink: #12283f;
  --ink2: #1c4f82;
  --ink2-dark: #163f68;
  --bg: #f4f6f9;
  --surface: #fff;
  --border: #e5e8ee;
  --text: #1a2130;
  --text-2: #5b6472;
  --text-3: #94a0ad;
  --success: #1e8a4c;
  --success-bg: #e8f6ee;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 8px 20px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.05);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 30px 32px 60px; }
.center-wrap { max-width: 380px; margin: 40px auto; padding: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

h1 { font-size: 24px; margin: 0; letter-spacing: -.3px; font-weight: 700; }
h2 { font-size: 16px; margin: 30px 0 12px; font-weight: 700; }
.sub { color: var(--text-2); font-size: 13.5px; margin: 5px 0 0; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .actions-top { display: flex; gap: 8px; flex-shrink: 0; }

label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; margin: 16px 0 6px; color: var(--text-3); }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px;
  background: var(--surface); color: var(--text); font-family: inherit;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=number]:focus, input[type=date]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink2); box-shadow: 0 0 0 3px rgba(28,79,130,.14);
}
.check-row { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; }
.check-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--ink2); }
.check-row label { margin: 0; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 10px 18px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  background: var(--ink2); color: #fff; cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
button:hover, .btn:hover { background: var(--ink2-dark); box-shadow: var(--shadow-md); }
button:active, .btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(192,57,43,.18); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
form.inline { display: inline; }

/* Auth (login / signup) */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(circle at 10% 12%, rgba(28,79,130,.40), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(18,40,63,.50), transparent 50%),
    radial-gradient(circle at 15% 95%, rgba(18,40,63,.40), transparent 52%),
    radial-gradient(circle at 95% 92%, rgba(28,79,130,.50), transparent 50%),
    #f7f5ef;
}
.auth-card {
  width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 36px 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 12px 32px rgba(18,40,63,.10); text-align: center;
}
.auth-card .mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--ink2), var(--ink)); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: -.5px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; box-shadow: 0 6px 16px rgba(18,40,63,.25);
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.2px; }
.auth-card .sub { margin-bottom: 24px; }
.auth-card form { text-align: left; }
.auth-card .btn-submit { width: 100%; padding: 12px 16px; font-size: 15.5px; }
.auth-card .switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-2); }
.auth-card .switch a { color: var(--ink2); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--ink2); }

@media (max-width: 460px) {
  .auth-card { padding: 30px 22px; border-radius: 12px; }
}

.msg { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; font-weight: 500; }
.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.ok { background: var(--success-bg); color: var(--success); }
.msg.info { background: #eef2f8; color: #35507a; }

/* App shell: sidebar + main */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  width: 220px; flex: 0 0 220px; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 2px 8px 24px; }
.sidebar .mark.sm {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--ink2), #0c1a29);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; letter-spacing: -.3px;
  margin: 0; box-shadow: none; flex-shrink: 0;
}
.sidebar .wordmark { font-weight: 700; font-size: 14px; letter-spacing: -.2px; line-height: 1.3; }
.sidebar .wordmark small { display: block; font-weight: 500; font-size: 11px; color: rgba(255,255,255,.5); }
.sidenav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.navlink {
  display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.72); text-decoration: none;
  font-size: 13.5px; font-weight: 500; padding: 9px 10px; border-radius: 8px; transition: background .15s ease, color .15s ease;
}
.navlink:hover { background: rgba(255,255,255,.08); color: #fff; }
.navlink.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.sidefoot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.who { display: flex; align-items: center; gap: 9px; padding: 6px 10px; }
.who .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink2); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.who .whoname { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.25; }
.who .whoname em { display: block; font-style: normal; font-weight: 500; font-size: 11px; color: rgba(255,255,255,.55); }
.app-main { flex: 1; min-width: 0; background: var(--bg); }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 22px; -webkit-overflow-scrolling: touch; }
.tabs a {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 600; color: var(--text-2); text-decoration: none;
}
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px,1fr)); gap: 12px; margin-bottom: 22px; }
.summary-grid .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.summary-grid .stat .ico { width: 36px; height: 36px; border-radius: 10px; background: rgba(28,79,130,.09); color: var(--ink2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.summary-grid .stat .label { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.summary-grid .stat .val { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }

.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; margin-bottom: 26px; }
.person-grid .pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.person-grid .phead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.person-grid .pavatar {
  width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--ink2), var(--ink));
  color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.person-grid .pname { font-weight: 700; font-size: 14.5px; }
.person-grid .pstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person-grid .pstat .plabel { font-size: 10.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.person-grid .pstat .pval { font-size: 14px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 780px; font-size: 13.5px; }
thead th {
  background: #fafbfc; color: var(--text-3); padding: 12px 14px; text-align: left; white-space: nowrap; position: sticky; top: 0;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.right { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.tag.done { background: var(--success-bg); color: var(--success); }
.tag.wait { background: #f0f1f3; color: var(--text-3); }

.projects-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 14px; }
.projects-list .card {
  text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.projects-list .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d7dce4; }
.projects-list .picon {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(28,79,130,.09); color: var(--ink2);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.projects-list .pname { font-weight: 700; font-size: 15.5px; letter-spacing: -.1px; }
.projects-list .powner { color: var(--text-3); font-size: 12.5px; margin-top: 6px; }

.empty-state { text-align: center; padding: 52px 20px; color: var(--text-3); }
.empty-state .ico {
  width: 46px; height: 46px; border-radius: 50%; background: var(--bg); color: var(--text-3);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.empty-state p { font-size: 14px; margin: 0; }

.actions { display: flex; gap: 6px; }

@media (max-width: 880px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: 0 0 auto; height: auto; position: sticky; top: 0;
    flex-direction: row; align-items: center; padding: 10px 14px; gap: 4px;
  }
  .sidebar .brand { padding: 0; margin-right: 6px; }
  .sidebar .wordmark small { display: none; }
  .sidenav { flex-direction: row; flex: 1; gap: 2px; overflow-x: auto; }
  .navlink span { display: none; }
  .navlink { padding: 8px; }
  .sidefoot { flex-direction: row; border-top: none; padding-top: 0; gap: 2px; }
  .who { padding: 6px; }
  .who .whoname { display: none; }
}

@media (max-width: 640px) {
  .wrap { padding: 18px 14px 48px; }
  .card { padding: 16px; }
  h1 { font-size: 20px; }
}
