/* yeram.dev 개인 대시보드 — lab.yeram.dev 와 같은 다크 + 유리 패널 톤 */
:root {
  --bg: #0b1120;
  --glass: rgba(148, 163, 184, .055);
  --glass-2: rgba(148, 163, 184, .10);
  --glass-3: rgba(148, 163, 184, .16);
  --line: rgba(148, 163, 184, .14);
  --line-soft: rgba(148, 163, 184, .08);
  --text: #e8edf5;
  --text-2: #b6c0d1;
  --muted: #7d889b;
  --blue: #3182f6;
  --blue-2: #5b9dff;
  --blue-soft: rgba(49, 130, 246, .16);
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #2fca73;
  --green-soft: rgba(47, 202, 115, .15);
  --red: #f04452;
  --red-soft: rgba(240, 68, 82, .16);
  --amber: #f5b544;
  --radius: 20px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* 배경 빛 (lab 과 동일) */
.orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orbs i { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .5; }
.orbs i:nth-child(1) { width: 720px; height: 520px; left: -180px; top: -240px; background: rgba(49, 130, 246, .32); }
.orbs i:nth-child(2) { width: 620px; height: 480px; right: -200px; bottom: -220px; background: rgba(139, 92, 246, .2); }
.orbs i:nth-child(3) { display: none; }

/* 유리 패널 */
.glass, .card, .top {
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.mark { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--blue-2), var(--violet)); box-shadow: 0 4px 14px rgba(49, 130, 246, .35); flex: none; }
.mark svg { width: 16px; height: 16px; fill: #fff; }
.mark.lg { width: 48px; height: 48px; border-radius: 14px; }
.mark.lg svg { width: 26px; height: 26px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 600; white-space: nowrap; transition: filter .15s, background .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--glass-2); }
.btn-ghost:hover { background: var(--glass-3); }
.btn-lg { width: 100%; height: 50px; font-size: 15px; border-radius: 14px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--glass-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spin svg { animation: spin .8s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 로그인 */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 380px; max-width: 100%; padding: 28px 26px 26px; border-radius: 22px; background: rgba(15, 23, 42, .78); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); display: flex; flex-direction: column; }
.auth-card h1 { margin: 16px 0 4px; font-size: 24px; letter-spacing: -.02em; }
.auth-card > p { margin: 0 0 6px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field > span { font-size: 13px; color: var(--muted); }
.field input { width: 100%; height: 46px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line); background: rgba(2, 6, 23, .35); outline: 0; }
.field input:focus { border-color: var(--blue); }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.pw-eye { position: absolute; right: 7px; top: 7px; height: 32px; padding: 0 10px; border-radius: 9px; border: 0; background: var(--glass-2); color: var(--text-2); font-size: 12px; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.err { min-height: 20px; margin: 12px 0 10px; color: var(--red); font-size: 13px; }

/* 상단 바 (lab 과 동일) */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 24px; border-width: 0 0 1px; background: rgba(11, 17, 32, .72); }
.top .spacer { flex: 1; }
.clock { color: var(--text-2); font-weight: 600; margin-right: 4px; }

/* 본문 */
.wrap { max-width: 1680px; margin: 0 auto; padding: 22px 24px 40px; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.hello h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.hello p { margin: 4px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line-soft); font-weight: 600; font-size: 13px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.pill.bad::before { background: var(--red); box-shadow: 0 0 10px var(--red); }

.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.c-server { grid-column: span 5; }
.c-sites { grid-column: span 3; }
.c-lab { grid-column: span 4; }
.c-ads { grid-column: span 8; }
.c-todo { grid-column: span 4; }
.c-links { grid-column: span 12; }

/* 카드 = lab 패널 (머리줄 + 본문) */
.card { border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.card > .skeleton { margin: 14px; }
.card-h { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 14px 0 8px; border-bottom: 1px solid var(--line-soft); flex: none; }
.card-h h2 { margin: 0; height: 32px; padding: 0 12px; border-radius: 9px; background: var(--glass-2); display: inline-flex; align-items: center; font-size: 14px; font-weight: 700; white-space: nowrap; }
.card-h .spacer { flex: 1; }
.card-h .sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-b { padding: 14px 16px 16px; flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--glass-2); color: var(--text-2); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.bad { background: var(--red-soft); color: var(--red); }
.chip.wait { background: rgba(245, 181, 68, .14); color: var(--amber); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }
.ext { color: var(--muted); font-size: 13px; }
.ext:hover { color: var(--text); }
.skeleton { height: 140px; border-radius: 12px; background: linear-gradient(90deg, var(--glass) 0%, var(--glass-2) 50%, var(--glass) 100%); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty { padding: 22px 6px; text-align: center; color: var(--muted); }

/* 미니 PC */
.rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ring svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--glass-2); }
.ring .val { stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring-box { position: relative; width: 92px; height: 92px; }
.ring-box b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring .k { font-weight: 600; }
.ring .s { color: var(--muted); font-size: 12px; text-align: center; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 12px; }
.fact { padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line-soft); }
.fact .k { color: var(--muted); font-size: 12px; }
.fact .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.svcs { display: flex; flex-wrap: wrap; gap: 6px; }
.svc { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 9px; background: var(--glass); border: 1px solid var(--line-soft); font-size: 12.5px; font-weight: 600; }

/* 사이트 */
.site { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
.site:last-of-type { border-bottom: 0; }
.site .n { font-weight: 700; }
.site .ms { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tunnel { margin-top: 10px; padding: 11px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line-soft); font-size: 12.5px; }

/* lab */
.big { display: flex; align-items: baseline; gap: 8px; }
.big b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.req { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.req:last-child { border-bottom: 0; }
.req:hover { background: var(--glass); border-radius: 10px; }
.req .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req .s { color: var(--muted); font-size: 12px; }
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }

/* 광고 */
.plats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plat { padding: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line-soft); }
.plat .name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.plat .badge { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: var(--c); }
.plat .metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 12px; font-size: 12.5px; }
.plat .metrics span { color: var(--muted); }
.plat .metrics b { color: var(--text-2); font-weight: 600; text-align: right; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.step { padding: 12px; border-radius: 12px; border: 1px dashed var(--line); color: var(--text-2); font-size: 13px; }
.step b { display: block; color: var(--text); margin-bottom: 2px; }
.step i { font-style: normal; color: var(--blue-2); font-weight: 800; margin-right: 4px; }

/* 할 일 */
.todo-add input { width: 100%; height: 42px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line); background: rgba(2, 6, 23, .35); outline: 0; }
.todo-add input:focus { border-color: var(--blue); }
.todos { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.todo { display: grid; grid-template-columns: 26px 1fr 28px; gap: 8px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); }
.todo:last-child { border-bottom: 0; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center; }
.tick:hover { border-color: var(--blue); }
.todo.done .tick { background: var(--blue); border-color: var(--blue); }
.todo.done .tick::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 800; }
.todo.done .txt { color: var(--muted); text-decoration: line-through; }
.todo .txt { word-break: break-word; }
.todo .del { opacity: 0; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.todo:hover .del, .todo .del:focus { opacity: 1; }
.todo .del:hover { background: var(--glass-2); color: var(--red); }

/* 바로가기 */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.link { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 13px; background: var(--glass); border: 1px solid var(--line-soft); transition: background .15s; min-width: 0; }
.link:hover { background: var(--glass-2); }
.link .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: var(--c); flex: none; }
.link .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; z-index: 50; padding: 11px 16px; border-radius: 12px; background: rgba(30, 41, 59, .95); border: 1px solid var(--line); font-weight: 600; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .c-server, .c-sites, .c-lab, .c-ads, .c-todo { grid-column: span 6; }
  .links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .top { padding: 0 16px; }
  .wrap { padding: 16px 16px 32px; }
  .dash > .card { grid-column: span 12; }
  .hello h1 { font-size: 22px; }
  .plats { grid-template-columns: minmax(0, 1fr); }
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ring svg, .ring-box { width: 78px; height: 78px; }
  .clock { display: none; }
  .todo .del { opacity: 1; }
}
.plat .badge.sm { width: 12px; height: 12px; border-radius: 4px; }

/* ---------- 밝은 화면 (lab · ads 와 같은 설정) ---------- */
:root[data-theme="light"] {
  --bg: #f3f5f9;
  --glass: rgba(15, 23, 42, .035); --glass-2: rgba(15, 23, 42, .06); --glass-3: rgba(15, 23, 42, .1);
  --line: rgba(15, 23, 42, .12); --line-soft: rgba(15, 23, 42, .07);
  --text: #0f172a; --text-2: #334155; --muted: #64748b;
  --blue: #2563eb; --blue-2: #2563eb; --blue-soft: rgba(37, 99, 235, .12); --violet: #7c3aed; --cyan: #0891b2;
  --green: #15803d; --green-soft: rgba(22, 163, 74, .12); --red: #dc2626; --red-soft: rgba(220, 38, 38, .1); --amber: #b45309;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .06);
  color-scheme: light;
}
[data-theme="light"] .orbs { display: none; }
[data-theme="light"] .glass, [data-theme="light"] .card { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="light"] .top { background: rgba(255, 255, 255, .9); }
[data-theme="light"] .auth-card { background: #fff; box-shadow: 0 20px 60px rgba(15, 23, 42, .12); }
[data-theme="light"] .field input, [data-theme="light"] .todo-add input { background: #fff; }
[data-theme="light"] .toast { background: #0f172a; color: #fff; border-color: #0f172a; }
[data-theme="light"] .chip.wait { background: rgba(217, 119, 6, .12); }
