:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --panel: #141419;
  --panel-2: #1b1b22;
  --line: #2a2a32;
  --muted: #92929e;
  --text: #f6f6f2;
  --lime: #c7ff4a;
  --lime-dark: #91bd26;
  --danger: #ff6868;
  --warning: #ffb74a;
  --blue: #68a8ff;
  --radius: 18px;
  font-family: "DM Sans", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.login-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr;
  background:
    radial-gradient(circle at 15% 10%, rgba(199,255,74,.1), transparent 30%),
    var(--bg);
}
.login-brand { padding: clamp(32px, 8vw, 110px); display: flex; flex-direction: column; justify-content: space-between; }
.wordmark { font-size: 28px; font-weight: 700; letter-spacing: -1.4px; }
.wordmark span { color: var(--lime); }
.hero-copy h1 { max-width: 780px; font-size: clamp(46px, 6vw, 92px); line-height: .98; letter-spacing: -5px; margin: 0 0 28px; }
.hero-copy p { color: var(--muted); font-size: 19px; max-width: 560px; line-height: 1.7; }
.login-panel { margin: 18px; border: 1px solid var(--line); border-radius: 28px; background: var(--panel); display: grid; place-items: center; padding: 30px; }
.login-form { width: min(400px, 100%); }
.login-form h2 { font-size: 30px; margin: 0 0 8px; }
.login-form > p { color: var(--muted); margin: 0 0 32px; }

.field { display: grid; gap: 8px; margin-bottom: 17px; }
.field label { font-size: 13px; color: #b6b6bf; font-weight: 600; }
.input, .field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); color: var(--text); background: #101014;
  padding: 13px 14px; border-radius: 11px; outline: none; transition: .2s;
}
.field textarea { min-height: 92px; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px rgba(199,255,74,.08); }
.btn { border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); color: var(--text); padding: 11px 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { border-color: #45454f; background: #24242c; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: #111; }
.btn-primary:hover { background: #d4ff70; border-color: #d4ff70; }
.btn-danger { color: #ff9b9b; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 11px; font-size: 13px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { border-right: 1px solid var(--line); padding: 28px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #0d0d11; z-index: 5; }
.sidebar .wordmark { padding: 0 10px 34px; }
.nav { display: grid; gap: 5px; }
.nav button { border: 0; background: transparent; color: var(--muted); padding: 11px 12px; border-radius: 10px; text-align: left; display: flex; gap: 12px; align-items: center; font-weight: 600; }
.nav button.active, .nav button:hover { background: var(--panel-2); color: var(--text); }
.nav .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 18px 10px 0; }
.user { font-size: 13px; }
.user strong, .user span { display: block; }
.user span { color: var(--muted); margin-top: 3px; }

.main { min-width: 0; padding: 32px clamp(20px, 4vw, 58px) 80px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 36px; }
.eyebrow { color: var(--lime); text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: 1.8px; }
.page-title h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -2px; margin: 5px 0 0; }
.top-actions { display: flex; gap: 10px; }
.mobile-brand { display: none; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 19px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 34px; letter-spacing: -1.5px; }
.stat.accent { background: var(--lime); color: #101010; border-color: var(--lime); }
.stat.accent span { color: #34420f; }

.section { margin-top: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.5px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 20px; transition: transform .18s, border-color .18s; min-width: 0; }
.project-card:hover { transform: translateY(-2px); border-color: #41414c; }
.project-card-top { display: flex; justify-content: space-between; gap: 12px; }
.project-id { display: flex; gap: 12px; min-width: 0; }
.project-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; box-shadow: 0 0 16px currentColor; }
.project-card h3 { margin: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card .desc { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 5px 0 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 17px 0; }
.badge { display: inline-flex; padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; font-size: 10px; font-weight: 700; color: #bcbcc5; text-transform: uppercase; letter-spacing: .5px; }
.badge.active { color: var(--lime); border-color: rgba(199,255,74,.3); background: rgba(199,255,74,.06); }
.badge.blocked { color: #ff8989; border-color: rgba(255,104,104,.3); }
.work-block { border-top: 1px solid var(--line); padding-top: 15px; }
.work-row { display: grid; grid-template-columns: 74px 1fr; gap: 9px; font-size: 13px; margin: 8px 0; }
.work-row span:first-child { color: var(--muted); }
.work-row span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-summary { display: flex; justify-content: space-between; gap: 10px; border-radius: 9px; padding: 8px 10px; margin-top: 13px; font-size: 11px; }
.scan-summary.clean { color: var(--lime); background: rgba(199,255,74,.06); }
.scan-summary.dirty { color: #ffb56b; background: rgba(255,183,74,.07); }
.progress { height: 4px; background: #282830; border-radius: 99px; margin-top: 18px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--lime); border-radius: inherit; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--muted); font-size: 11px; }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 14px; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-head h3 { margin: 0; font-size: 16px; }
.todo-list, .activity-list { display: grid; }
.todo-item, .activity-item { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.todo-item:last-child, .activity-item:last-child { border: 0; }
.check { width: 21px; height: 21px; border: 1px solid #464650; border-radius: 7px; background: transparent; color: #111; flex: 0 0 auto; padding: 0; }
.check:hover, .check.done { background: var(--lime); border-color: var(--lime); }
.todo-copy { min-width: 0; flex: 1; }
.todo-copy strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-copy span, .activity-copy span { color: var(--muted); font-size: 11px; }
.priority { width: 7px; height: 7px; border-radius: 50%; }
.priority.high { background: var(--danger); }
.priority.medium { background: var(--warning); }
.priority.low { background: var(--blue); }
.activity-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); font-size: 13px; flex: 0 0 auto; }
.activity-copy { min-width: 0; }
.activity-copy strong { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 44px 20px; color: var(--muted); text-align: center; font-size: 13px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 18px; }
.toolbar .input { max-width: 340px; }
.project-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-row { display: grid; grid-template-columns: minmax(220px, 1.3fr) 110px 110px 1fr 110px; gap: 15px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.table-row:last-child { border: 0; }
.table-row.header { background: #101014; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.project-name-cell { display: flex; gap: 10px; align-items: center; min-width: 0; }
.project-name-cell strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(760px, 100%); max-height: 92vh; overflow: auto; background: var(--panel); border: 1px solid #35353f; border-radius: 22px; box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.modal-head { padding: 20px 22px; position: sticky; top: 0; background: rgba(20,20,25,.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-size: 19px; margin: 0; }
.icon-btn { width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--muted); background: var(--panel-2); }
.modal-body { padding: 22px; }
.import-box { border: 1px solid rgba(199,255,74,.22); background: rgba(199,255,74,.045); border-radius: 14px; padding: 16px; margin-bottom: 20px; }
.import-box strong { font-size: 14px; }
.import-box p { color: var(--muted); font-size: 12px; margin: 5px 0 13px; line-height: 1.5; }
.import-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.import-row input { width: 100%; border: 1px solid var(--line); color: var(--text); background: #101014; padding: 11px 12px; border-radius: 10px; outline: none; }
.import-result { color: var(--lime); font-size: 12px; min-height: 17px; margin-top: 8px; }
.recommendations, .suggested-todos { color: var(--text); border-top: 1px solid rgba(199,255,74,.14); margin-top: 10px; padding-top: 9px; }
.recommendations > span, .suggested-todos > span { color: var(--lime); font-weight: 700; display: block; margin-bottom: 6px; }
.recommendations p { color: #c5c5cd; margin: 4px 0; line-height: 1.45; }
.suggested-todos { display: grid; gap: 6px; }
.suggested-todos label { color: #d3d3da; display: flex; align-items: center; gap: 7px; }
.suggested-todos input { accent-color: var(--lime); }
.folder-browser-layer { z-index: 30; }
.folder-browser { width: min(720px, 100%); }
.folder-path { color: var(--muted); font-size: 11px; margin-top: 5px; max-width: 560px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-toolbar { padding: 12px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 7px; overflow-x: auto; }
.folder-list { min-height: 280px; max-height: 52vh; overflow-y: auto; }
.folder-item { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); padding: 13px 20px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; text-align: left; }
.folder-item:hover { background: var(--panel-2); }
.folder-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(199,255,74,.07); color: var(--lime); }
.folder-item strong, .folder-item small { display: block; }
.folder-item strong { font-size: 13px; }
.folder-item small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.folder-item b { color: var(--muted); font-size: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field.full { grid-column: 1 / -1; }
.modal-actions { position: sticky; bottom: 0; padding: 15px 22px; background: rgba(20,20,25,.97); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }

.project-detail-head { border: 1px solid var(--line); border-radius: 22px; padding: 26px; background: var(--panel); margin-bottom: 18px; }
.detail-title { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.detail-title h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -2px; margin: 5px 0 8px; }
.detail-title p { color: var(--muted); max-width: 700px; line-height: 1.6; margin: 0; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.info-cell { padding: 17px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.info-cell:nth-child(2n) { border-right: 0; }
.info-cell span { color: var(--muted); display: block; font-size: 11px; margin-bottom: 7px; }
.info-cell strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.git-box { padding: 20px; }
.git-state { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.git-state .big-dot { width: 38px; height: 38px; border-radius: 12px; background: rgba(199,255,74,.08); display: grid; place-items: center; color: var(--lime); }
.git-meta { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.git-meta strong { color: var(--text); }
.note { white-space: pre-wrap; line-height: 1.7; color: #c4c4cb; font-size: 13px; padding: 20px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: #f6f6f2; color: #111; padding: 11px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; z-index: 50; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.error-text { color: #ff9292; font-size: 13px; min-height: 20px; margin-top: 10px; }
.auth-switch { width: 100%; border: 0; background: transparent; color: var(--muted); padding: 10px; margin-top: 2px; }
.auth-switch:hover { color: var(--lime); }
.muted { color: var(--muted); }
.mobile-nav { display: none; }
.device-list, .discovered-list { display: grid; }
.device-item, .discovered-item { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 11px; align-items: center; }
.device-item:last-child, .discovered-item:last-child { border-bottom: 0; }
.device-icon { width: 36px; height: 36px; display: grid; place-items: center; background: var(--panel-2); border-radius: 11px; color: var(--lime); }
.device-item > div:nth-child(2), .discovered-item > div { min-width: 0; flex: 1; }
.device-item strong, .device-item span, .discovered-item strong, .discovered-item span, .discovered-item small { display: block; }
.device-item strong, .discovered-item strong { font-size: 13px; }
.device-item span, .discovered-item span, .discovered-item small { color: var(--muted); font-size: 10px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-item > i { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.device-item > i.online { background: var(--lime); box-shadow: 0 0 10px rgba(199,255,74,.6); }
.pairing-box { margin: 15px; padding: 17px; border: 1px solid rgba(199,255,74,.25); background: rgba(199,255,74,.05); border-radius: 13px; }
.pairing-box > span, .pairing-box > strong { display: block; }
.pairing-box > span { color: var(--muted); font-size: 11px; }
.pairing-box > strong { color: var(--lime); font-size: 25px; letter-spacing: 3px; margin: 5px 0 12px; }
.pairing-box p { color: var(--muted); font-size: 11px; }
.pairing-box code { display: block; background: #09090c; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 10px; overflow-x: auto; white-space: nowrap; margin-bottom: 9px; }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .detail-grid { grid-template-columns: 1fr; }
  .table-row { grid-template-columns: minmax(180px, 1.3fr) 90px 90px 1fr; }
  .table-row > :nth-child(5) { display: none; }
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 35vh; padding: 30px 24px; }
  .hero-copy h1 { font-size: 48px; letter-spacing: -3px; margin-top: 70px; }
  .hero-copy p { font-size: 15px; }
  .login-panel { margin: 0; border-radius: 26px 26px 0 0; min-height: 58vh; padding: 28px 24px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 95px; }
  .mobile-brand { display: block; }
  .topbar { margin-bottom: 26px; align-items: flex-start; }
  .page-title h1 { font-size: 32px; }
  .top-actions .btn:not(.btn-primary) { display: none; }
  .summary-grid { gap: 9px; margin-bottom: 24px; }
  .stat { min-height: 100px; padding: 15px; }
  .stat strong { font-size: 29px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { padding: 17px; }
  .split { display: block; }
  .split .panel + .panel { margin-top: 14px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 10; background: rgba(24,24,30,.94); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 16px; padding: 7px; }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); padding: 8px 2px; font-size: 10px; border-radius: 10px; display: grid; gap: 3px; place-items: center; }
  .mobile-nav button.active { color: var(--lime); background: rgba(199,255,74,.07); }
  .mobile-nav b { font-size: 18px; font-weight: 400; }
  .toolbar { flex-direction: column; }
  .toolbar .input { max-width: none; }
  .project-table { border: 0; display: grid; gap: 10px; overflow: visible; }
  .table-row.header { display: none; }
  .table-row { border: 1px solid var(--line); border-radius: 14px; grid-template-columns: 1fr auto; gap: 10px; padding: 16px; }
  .table-row > :nth-child(3), .table-row > :nth-child(4), .table-row > :nth-child(5) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .import-row { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 22px 22px 0 0; max-height: 94vh; }
  .detail-title { display: block; }
  .detail-actions { margin-top: 20px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-cell { border-right: 0; }
}
