/* ══════════════════════════════
   CRYPTO STYLE ADMIN DASHBOARD
══════════════════════════════ */
:root {
  --crypt-bg: #0b0e14;
  --crypt-panel: #151a25;
  --crypt-panel-hover: #1c2230;
  --crypt-accent: #2de1a2; /* Neon Cyan/Green */
  --crypt-accent-glow: rgba(45, 225, 162, 0.25);
  --crypt-pink: #ff6584; /* Soft neon pink for alerts */
  --crypt-text-main: #f0f4f8;
  --crypt-text-dim: #7a8b9f;
  --crypt-border: rgba(255, 255, 255, 0.05);
}

.screen-full { display:none; width:100vw; height:100vh; background:var(--crypt-bg); color:var(--crypt-text-main); font-family:'Inter', 'Noto Sans KR', sans-serif; overflow:hidden; z-index:100; position:fixed; top:0; left:0; }
.screen-full.active { display:flex; flex-direction:row; animation:screenIn .3s ease; }

/* ── PIN MODAL ── */
.pin-overlay { position:fixed; inset:0; background:rgba(11, 14, 20, 0.9); backdrop-filter:blur(10px); z-index:999; display:none; align-items:center; justify-content:center; }
.pin-overlay.active { display:flex; }
.pin-box { background:var(--crypt-panel); border:1px solid var(--crypt-border); border-radius:24px; padding:40px; text-align:center; box-shadow:0 10px 40px rgba(0,0,0,0.5); width:320px; }
.pin-title { font-size:20px; font-weight:600; margin-bottom:8px; color:var(--crypt-text-main); }
.pin-sub { font-size:13px; color:var(--crypt-text-dim); margin-bottom:24px; }
.pin-input { background:transparent; border:none; border-bottom:2px solid var(--crypt-text-dim); color:var(--crypt-text-main); font-size:32px; font-weight:700; width:120px; text-align:center; outline:none; transition:0.3s; letter-spacing:8px; }
.pin-input:focus { border-color:var(--crypt-accent); box-shadow:0 4px 10px var(--crypt-accent-glow); }

/* ── DASHBOARD LAYOUT ── */
.dash-sidebar { width:320px; border-right:1px solid var(--crypt-border); display:flex; flex-direction:column; background:var(--crypt-panel); }
.dash-main { flex:1; padding:32px; overflow-y:auto; display:flex; flex-direction:column; gap:24px; }

.dash-header { padding:24px; border-bottom:1px solid var(--crypt-border); display:flex; align-items:center; justify-content:space-between; }
.dash-logo { display:flex; align-items:center; gap:12px; font-weight:700; font-size:20px; letter-spacing:1px; color:#fff; }
.dash-logo svg { width:28px; height:28px; fill:var(--crypt-accent); }
.btn-close-dash { background:transparent; border:none; color:var(--crypt-text-dim); cursor:pointer; padding:6px; border-radius:6px; transition:0.2s; }
.btn-close-dash:hover { color:#fff; background:var(--crypt-panel-hover); }

.patient-search { margin:20px; position:relative; }
.patient-search input { width:100%; border:1px solid var(--crypt-border); background:rgba(0,0,0,0.2); border-radius:12px; padding:12px 14px 12px 40px; color:#fff; font-size:14px; outline:none; transition:0.3s; }
.patient-search input:focus { border-color:var(--crypt-accent); }
.patient-search svg { position:absolute; left:14px; top:12px; width:18px; height:18px; stroke:var(--crypt-text-dim); fill:none; stroke-width:2; }

.patient-list { flex:1; overflow-y:auto; padding:0 12px 20px; display:flex; flex-direction:column; gap:8px; }
.patient-list { flex:1; overflow-y:auto; padding:0 12px 20px; display:flex; flex-direction:column; gap:3px; }
.p-card { background:transparent; border:1px solid transparent; border-radius:10px; padding:9px 12px; cursor:pointer; transition:all 0.2s ease; position:relative; overflow:hidden; }
.p-card:hover { background:rgba(255,255,255,0.03); }
.p-card.active { background:rgba(45, 225, 162, 0.08); border-color:rgba(45, 225, 162, 0.3); }
.p-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--crypt-accent); transform:scaleY(0); transition:0.3s; border-radius:3px 0 0 3px; }
.p-card.active::before { transform:scaleY(1); }

.p-name-row { font-weight:600; font-size:14px; color:#fff; line-height:1.3; }
.p-phone { font-weight:400; font-size:12px; color:var(--crypt-text-dim); }
.p-prog { font-size:12px; color:var(--crypt-accent); margin-top:2px; }
.p-prog-none { color:var(--crypt-text-dim) !important; }

/* ── MAIN CONTENT WIDGETS ── */
.top-stats { display:grid; grid-template-columns:repeat(4, 1fr); gap:20px; }
.stat-box { background:var(--crypt-panel); border:1px solid var(--crypt-border); border-radius:20px; padding:24px; display:flex; flex-direction:column; gap:8px; position:relative; overflow:hidden; }
.stat-box::after { content:''; position:absolute; right:-20px; top:-20px; width:80px; height:80px; background:radial-gradient(circle, var(--crypt-accent-glow) 0%, transparent 70%); border-radius:50%; }
.stat-lbl { color:var(--crypt-text-dim); font-size:14px; font-weight:500; }
.stat-val { color:#fff; font-size:32px; font-weight:700; font-family:'Cormorant', serif; letter-spacing:1px; }

.content-grid { display:grid; grid-template-columns: 2fr 1fr; gap:24px; }
.pane { background:var(--crypt-panel); border:1px solid var(--crypt-border); border-radius:24px; padding:32px; }
.pane-title { font-size:18px; font-weight:600; color:#fff; margin-bottom:24px; display:flex; align-items:center; gap:8px; }
.pane-title::before { content:''; display:block; width:12px; height:12px; border-radius:50%; background:var(--crypt-accent); box-shadow:0 0 10px var(--crypt-accent-glow); }

/* Tree Visualization */
.tree-node { margin-bottom:16px; border-left:2px solid rgba(255,255,255,0.05); padding-left:16px; position:relative; }
.tree-node-title { font-size:15px; font-weight:600; color:#fff; margin-bottom:8px; text-transform:capitalize; }
.tree-pill-list { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.tree-pill { background:rgba(0,0,0,0.3); border:1px solid rgba(255,255,255,0.1); border-radius:8px; padding:8px 12px; font-size:13px; color:#d4d4d4; display:flex; gap:8px; align-items:center; }
.tree-pill span.hl { color:var(--crypt-accent); font-weight:600; }
.tree-pill span.warn { color:var(--crypt-pink); font-weight:600; }

.empty-state { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--crypt-text-dim); gap:16px; }
.empty-state svg { width:64px; height:64px; stroke:rgba(255,255,255,0.1); fill:none; stroke-width:1; }

/* Patient card inner layout */
.p-card-inner { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.p-prog-tag { font-size:11px; color:var(--crypt-accent); background:rgba(45,225,162,.1); border:1px solid rgba(45,225,162,.25); border-radius:20px; padding:2px 8px; white-space:nowrap; flex-shrink:0; }

/* Patient basic info */
.pt-basic-info { padding:20px 24px !important; }
.pt-basic-av { width:48px; height:48px; border-radius:50%; background:rgba(45,225,162,.12); border:1px solid rgba(45,225,162,.3); display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700; color:var(--crypt-accent); flex-shrink:0; }

/* 3-column program boxes */
.prog-boxes-wrap { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.prog-box { background:var(--crypt-panel); border:1px solid var(--crypt-border); border-radius:16px; padding:20px; display:flex; flex-direction:column; gap:10px; min-height:130px; }
.prog-box-active { border-color:rgba(45,225,162,.35); background:rgba(45,225,162,.05); }
.prog-box-name { font-size:15px; font-weight:700; color:#fff; }
.prog-box-sub { font-size:12px; color:var(--crypt-text-dim); }
.prog-box-day { font-size:20px; font-weight:700; color:var(--crypt-accent); }
.prog-box-meta { font-size:11px; color:var(--crypt-text-dim); }
.prog-box-date { background:rgba(0,0,0,.3); border:1px solid var(--crypt-border); border-radius:8px; color:#fff; padding:6px 8px; font-size:12px; outline:none; width:100%; }
.prog-box-date:focus { border-color:var(--crypt-accent); }
.prog-box-btn { background:var(--crypt-accent); color:#000; border:none; border-radius:8px; padding:8px; font-weight:700; cursor:pointer; font-size:13px; }
.prog-box-end-btn { background:rgba(255,101,132,.15); color:var(--crypt-pink); border:1px solid rgba(255,101,132,.3); border-radius:8px; padding:6px; font-weight:600; cursor:pointer; font-size:12px; }

/* Program start inputs */
.prog-start-pane { margin-bottom:0; }
.prog-start-row { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--crypt-border); }
.prog-start-row:last-child { border-bottom:none; }
.prog-check-label { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:14px; min-width:150px; color:var(--crypt-text-main); }
.prog-check-label input[type="checkbox"] { width:16px; height:16px; accent-color:var(--crypt-accent); cursor:pointer; flex-shrink:0; }
.prog-date-input { background:rgba(0,0,0,.3); border:1px solid var(--crypt-border); border-radius:8px; color:#fff; padding:6px 10px; font-size:13px; outline:none; }
.prog-date-input:focus { border-color:var(--crypt-accent); }
.prog-start-btn { background:var(--crypt-accent); color:#000; border:none; border-radius:8px; padding:6px 18px; font-weight:700; cursor:pointer; font-size:13px; white-space:nowrap; }

/* Program history */
.prog-hist-row { display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid rgba(255,255,255,.04); font-size:13px; }
.prog-hist-row:last-child { border-bottom:none; }
.prog-hist-date { color:var(--crypt-text-dim); min-width:90px; font-size:12px; }
.prog-hist-prog { color:#fff; font-weight:500; flex:1; }
.prog-hist-active { color:var(--crypt-accent); font-size:11px; font-weight:600; }
.prog-hist-end { color:var(--crypt-text-dim); font-size:11px; }

/* Survey line items */
.survey-line { font-size:13px; color:#d4d4d4; padding:4px 0; border-bottom:1px solid rgba(255,255,255,0.04); line-height:1.5; }
.survey-line:last-child { border-bottom:none; }
.survey-line.na { color:var(--crypt-text-dim); font-style:italic; }
.tree-node-title { font-size:13px; font-weight:700; color:var(--crypt-accent); margin-bottom:6px; letter-spacing:.02em; }

/* ── Checkup pane (건강검진 결과) ── */
.chk-group { margin-bottom: 10px; }
.chk-group-title { font-size: 11px; font-weight: 600; color: var(--crypt-accent); letter-spacing: .08em; margin-bottom: 4px; }
.chk-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--crypt-text-dim); border-bottom: 1px solid rgba(255,255,255,.04); }
.chk-row:last-child { border-bottom: none; }
.chk-row strong { color: #fff; font-weight: 600; }
.chk-row em { font-style: normal; font-size: 11px; color: var(--crypt-text-dim); }
.chk-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chk-add-btn { width: 100%; padding: 9px; margin-top: 12px; background: rgba(45,225,162,.1); border: 1px solid rgba(45,225,162,.3); border-radius: 8px; color: var(--crypt-accent); font-weight: 600; cursor: pointer; font-size: 13px; }
.chk-add-btn:hover { background: rgba(45,225,162,.18); }

/* ── 전체 환자 시트 (sheet.js) ── */
.sheet-open-btn { padding: 9px 16px; background: rgba(45,225,162,.1); border: 1px solid rgba(45,225,162,.3);
  border-radius: 8px; color: var(--crypt-accent); font-weight: 600; cursor: pointer; font-size: 13px; }
.sheet-open-btn:hover { background: rgba(45,225,162,.18); }
.sheet-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; }
.sheet-table th, .sheet-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.07);
  text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.sheet-table th { position: sticky; top: 0; z-index: 2; background: #16202b; color: var(--crypt-text-dim);
  font-weight: 600; cursor: pointer; user-select: none; border-bottom: 1px solid rgba(255,255,255,.15); }
.sheet-table th:hover { color: var(--crypt-accent); }
.sheet-table td { color: #e8edf3; }
.sheet-table tbody tr { cursor: pointer; }
.sheet-table tbody tr:hover td { background: rgba(45,225,162,.07); }
.sheet-table td:first-child, .sheet-table th:first-child { position: sticky; left: 0; z-index: 1;
  background: #131c26; font-weight: 600; }
.sheet-table th:first-child { z-index: 3; background: #16202b; }
.sheet-table th.sheet-editable { color: var(--crypt-accent); }

/* Custom Scrollbar for dark theme */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
