/* Zarada ERP Actual UI Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Pretendard', -apple-system, sans-serif; background: #f8fafc; color: #0f172a; display: flex; height: 100vh; overflow: hidden; letter-spacing: -0.3px; }

/* Demo Banner */
.demo-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: #4f46e5; color: #fff; text-align: center; padding: 6px 16px; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }
.demo-banner span { background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 6px; font-size: 10px; }

/* Sidebar */
.sidebar { width: 230px; background: #fff; border-right: 1px solid #f1f5f9; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; padding-top: 30px; z-index: 100; transition: width 0.3s; }
.sidebar-header { padding: 14px 20px; }
.sidebar-logo { display: flex; align-items: center; justify-content: space-between; }
.sidebar-logo img { height: 24px; object-fit: contain; }
.theme-toggle { width: 44px; height: 24px; background: #f1f5f9; border-radius: 100px; position: relative; cursor: pointer; border: 1px solid #e2e8f0; display:flex; align-items:center; }
.theme-toggle .knob { width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.1); margin-left: 3px; display:flex; align-items:center; justify-content:center; }
.theme-toggle .knob svg { width: 12px; height: 12px; color: #f59e0b; }

.sidebar-profile { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; position: relative; }
.sidebar-profile .avatar { width: 32px; height: 32px; border-radius: 10px; background: #ef4444; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.sidebar-profile .info h3 { font-size: 13px; font-weight: 800; color: #1e293b; display: flex; align-items: center; gap: 4px; }
.sidebar-profile .info h3 span { font-size: 8px; font-weight: 700; background: #ef4444; color: #fff; padding: 2px 4px; border-radius: 4px; }
.sidebar-profile .info p { font-size: 10px; color: #94a3b8; font-weight: 600; margin-top: 2px; }
.sidebar-profile .bell { margin-left: auto; color: #64748b; background: none; border: none; cursor: pointer; }

.homepage-btn { margin: 16px 20px 8px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid #e2e8f0; color: #64748b; font-size: 12px; font-weight: 700; background: #fff; cursor: pointer; transition: all 0.2s; }
.homepage-btn:hover { background: #f8fafc; color: #3b82f6; border-color: #cbd5e1; }
.homepage-btn svg { width: 14px; height: 14px; color: #3b82f6; }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 14px; }
.menu-group { margin-bottom: 4px; }
.menu-group-title { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; color: #64748b; font-size: 12px; font-weight: 700; cursor: pointer; border-radius: 8px; background: transparent; border: none; width: 100%; transition: background 0.2s; }
.menu-group-title:hover { background: #f1f5f9; }
.menu-group-title svg.icon { width: 16px; height: 16px; margin-right: 8px; color: #94a3b8; }
.menu-group-title .left { display: flex; align-items: center; }
.menu-group-title svg.chevron { width: 14px; height: 14px; transition: transform 0.2s; }
.menu-group-title.open svg.chevron { transform: rotate(90deg); }

.menu-items { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; /* margin-left: 28px; */ }
.menu-items.open { max-height: 400px; }
.menu-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 32px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 700; color: #64748b; transition: all 0.15s; text-decoration: none; border: none; background: transparent; width: 100%; text-align: left; margin-bottom: 2px; }
.menu-item:hover { color: #1e293b; background: #f8fafc; }
.menu-item.active { background: #4f46e5; color: #fff; }
.menu-item.active svg { color: #fff; }

/* Main Content Area */
.main { flex: 1; padding-top: 30px; overflow-y: auto; display: flex; flex-direction: column; }
.content-wrapper { padding: 24px 32px 48px; max-width: 1600px; margin: 0 auto; width: 100%; }

/* Page Header */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.page-header-left { display: flex; align-items: center; gap: 10px; }
.page-header-left svg { width: 22px; height: 22px; color: #475569; }
.page-header-left h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: #0f172a; display: flex; align-items:center; gap: 8px;}
.page-date { font-size: 13px; font-weight: 700; color: #94a3b8; margin-bottom: 4px; }

/* Dashboard specifics */
.dash-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: #fff; border: 1px solid #f1f5f9; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; position: relative; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); }
.kpi-title { font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 800; color: #0f172a; margin-bottom: 12px; letter-spacing: -1px; }
.kpi-value small { font-size: 16px; font-weight: 700; color: #64748b; margin-left: 2px; }
.kpi-trend { display: inline-flex; align-items: center; background: #dcfce7; color: #16a34a; font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 6px; width: fit-content; gap: 4px; }
.kpi-icon { position: absolute; top: 20px; right: 20px; width: 36px; height: 36px; border-radius: 12px; border: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: center; color: #6366f1; background: #f8fafc; }

/* Dashboard Tabs */
.dash-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.dash-tab { padding: 8px 16px; border-radius: 100px; font-size: 13px; font-weight: 700; border: 1px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer; }
.dash-tab.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* Chart Container */
.chart-panel { background: #fff; border-radius: 24px; border: 1px solid #f1f5f9; padding: 24px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.02); height: 100%; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; margin-bottom: 20px; font-size: 15px; font-weight: 800; color: #1e293b; gap: 8px; }
.panel-head svg { color: #6366f1; width: 18px; height: 18px; }

/* Layout Grids */
.grid-23 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-122 { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 20px; }

/* Bars */
.therapist-rank { margin-bottom: 12px; }
.rank-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.rank-head .num { width: 18px; height: 18px; background: #f59e0b; color: #fff; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; margin-right: 8px; }
.rank-head .num.gray { background: #94a3b8; }
.rank-bar-bg { height: 6px; background: #f1f5f9; border-radius: 10px; width: 100%; overflow: hidden; }
.rank-bar-fill { height: 100%; background: #6366f1; border-radius: 10px; }

/* Placeholder for chart image */
.mock-chart { width: 100%; height: 260px; position:relative; }
.mock-chart img { width:100%; height:100%; object-fit:contain; object-position:bottom left;}

/* Schedule Layout */
.schedule-layout { display: grid; grid-template-columns: 244px 1fr; gap: 20px; height: calc(100vh - 150px); }
.sched-sidebar { background: #fff; border-radius: 16px; padding: 16px; border: 1px solid #f1f5f9; overflow-y: auto; }
.btn-primary { background: #0f172a; color: #fff; width: 100%; padding: 12px; border-radius: 12px; font-weight: 800; font-size: 13px; border: none; cursor: pointer; margin-bottom: 16px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.sched-filter { font-size: 11px; font-weight: 700; color: #94a3b8; margin-bottom: 8px; display: flex; justify-content: space-between; }
.filter-item { display: flex; align-items: center; gap: 8px; padding: 10px; cursor: pointer; font-size: 13px; font-weight: 700; color: #475569; border-radius: 8px; }
.filter-item:hover { background: #f8fafc; }
.filter-item.active { background: #0f172a; color: #fff; }
.filter-item .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; }

.cal-main { background: #fff; border-radius: 20px; border: 1px solid #f1f5f9; display: flex; flex-direction: column; overflow: hidden; }
.cal-head-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #f1f5f9; }
.cal-date-ctr { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; color: #1e293b; }
.btn-icon { padding: 6px; border: 1px solid #e2e8f0; background: #fff; border-radius: 6px; cursor: pointer; color: #64748b; }
.view-modes { display: flex; background: #f1f5f9; border-radius: 8px; padding: 4px; }
.view-modes button { padding: 6px 12px; border: none; background: transparent; font-size: 12px; font-weight: 700; color: #64748b; cursor: pointer; border-radius: 6px; }
.view-modes button.active { background: #4f46e5; color: #fff; }

.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid #f1f5f9; } /* 6 days shown in ss */
.cal-col { border-right: 1px solid #f1f5f9; display: flex; flex-direction: column; }
.day-header { padding: 12px; text-align: center; border-bottom: 1px solid #f1f5f9; }
.day-header .dow { font-size: 12px; font-weight: 700; color: #64748b; }
.day-header .date { font-size: 14px; font-weight: 800; color: #4f46e5; margin-left: 4px; }
.day-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.cal-session { font-size: 10px; font-weight: 700; padding: 4px 6px; border-radius: 6px; border-left: 3px solid; line-height: 1.4; display: flex; gap: 4px; align-items: flex-start; }
.cal-session .time { color: #475569; font-weight: 800; }
.cal-session .txt { color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Billing & Cards Grid Layout */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.bill-card { background: #fff; border: 1px solid #f1f5f9; border-radius: 16px; padding: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); display: flex; flex-direction: column; }
.card-header-flex { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.child-profile { display: flex; gap: 12px; align-items: center; }
.child-avatar { width: 40px; height: 40px; background: #e0e7ff; color: #4f46e5; font-size: 16px; font-weight: 900; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.child-info h4 { font-size: 16px; font-weight: 800; color: #1e293b; margin-bottom: 2px; }
.child-info p { font-size: 10px; font-weight: 600; color: #64748b; }
.bill-tag { font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 6px; }
.tag-red { background: #fee2e2; color: #ef4444; border: 1px solid #fca5a5; }
.tag-green { background: #dcfce7; color: #10b981; border: 1px solid #86efac; }
.tag-blue { background: #dbeafe; color: #3b82f6; border: 1px solid #93c5fd; }
.tag-gray { background: #f1f5f9; color: #64748b; }
.prog-tags { display: flex; gap: 4px; margin-bottom: 16px; }
.prog-tags span { font-size: 9px; font-weight: 700; color: #64748b; background: #f8fafc; padding: 3px 6px; border-radius: 4px; }
.bill-amounts { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px dotted #e2e8f0; padding-top: 12px; gap: 8px; }
.amount-col { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.amount-label { font-size: 10px; font-weight: 700; color: #94a3b8; }
.amount-val { font-size: 13px; font-weight: 800; color: #1e293b; }
.val-red { color: #ef4444; }

/* Table styles */
.data-table-wrapper { background: #fff; border-radius: 20px; border: 1px solid #e2e8f0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 700; padding: 16px 24px; border-bottom: 1px solid #e2e8f0; }
.data-table td { padding: 16px 24px; border-bottom: 1px solid #f1f5f9; font-size: 13px; font-weight: 700; color: #475569; }
.data-table tr:hover td { background: #fcfcfd; }
.action-btns { display: flex; gap: 8px; }
.action-btns button { padding: 6px; border-radius: 6px; border: 1px solid #e2e8f0; background: #fff; color: #94a3b8; cursor: pointer; }

/* Utilities */
.animate-enter { animation: fadeSlideUp 0.4s ease forwards; opacity: 0; transform: translateY(10px); }
@keyframes fadeSlideUp { to { opacity: 1; transform: translateY(0); } }

/* ─── 월간 캘린더 · 좌측 패널 (실제 앱 구조) ─────────────── */
.notice-ticker { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:800; margin-bottom:14px; }
.notice-ticker .nt-label { color:#94a3b8; }
.notice-ticker .nt-dot { color:#cbd5e1; }
.notice-ticker .nt-text { color:#4f46e5; }

.btn-sub { display:flex; align-items:center; justify-content:center; gap:7px; width:100%; padding:11px; margin-top:8px;
  border:1px solid #e2e8f0; background:#fff; color:#0f172a; border-radius:14px; font-size:13px; font-weight:900; cursor:pointer; }
.btn-sub:hover { background:#f8fafc; }

.seg { display:flex; gap:2px; background:#f1f5f9; border-radius:11px; padding:2px; margin:12px 0 4px; }
.seg-btn { flex:1; padding:7px 4px; border:none; background:none; border-radius:9px; font-size:11px; font-weight:900; color:#94a3b8; cursor:pointer; }
.seg-btn.active { background:#fff; color:#1e293b; box-shadow:0 1px 2px rgba(0,0,0,.06); }

.mini-tabs { display:flex; gap:2px; background:#f1f5f9; border-radius:8px; padding:2px; }
.mini-tabs button { border:none; background:none; padding:3px 9px; border-radius:6px; font-size:10.5px; font-weight:900; color:#94a3b8; cursor:pointer; }
.mini-tabs button.active { background:#fff; color:#1e293b; }

.sched-subrow { display:flex; justify-content:space-between; align-items:center; margin:6px 0 8px; font-size:10.5px; font-weight:800; }
.sched-subrow .order-btn { color:#64748b; border:1px solid #e2e8f0; border-radius:7px; padding:3px 8px; }
.sched-subrow .all-sel { color:#4f46e5; }

.filter-item .dot.sq { border-radius:4px; }
.sched-cond { margin-top:10px; padding-top:10px; border-top:1px solid #f1f5f9; font-size:11px; font-weight:800; color:#64748b; display:flex; justify-content:space-between; }
.quick-filter { margin-top:10px; }
.quick-filter .qf-title { font-size:11px; font-weight:900; color:#475569; margin-bottom:7px; }
.quick-filter .qf-sel { border:1px solid #e2e8f0; border-radius:10px; padding:8px 10px; font-size:11px; font-weight:700;
  color:#94a3b8; margin-bottom:6px; display:flex; justify-content:space-between; background:#fff; }

.mv-head { display:grid; grid-template-columns:repeat(6,1fr); border-top:1px solid #f1f5f9; background:#fff; }
.mv-head > div { padding:9px 0; text-align:center; font-size:11.5px; font-weight:900; color:#64748b; border-right:1px solid #f1f5f9; }
.mv-head > div:last-child { border-right:0; }

.mv-grid { flex:1; display:grid; grid-template-columns:repeat(6,1fr); grid-auto-rows:1fr; background:#fff; }
.mv-cell { border-top:1px solid #f1f5f9; border-right:1px solid #f1f5f9; padding:5px 5px 6px; min-height:0; overflow:hidden; }
.mv-cell:nth-child(6n) { border-right:0; }
.mv-cell.is-today { background:#eff6ff; }
.mv-day { font-size:11px; font-weight:900; color:#334155; margin-bottom:4px; display:flex; align-items:center; }

.mv-ev { display:flex; align-items:center; gap:3px; font-size:9px; font-weight:700; line-height:1.5;
  padding:2px 4px; border-radius:3px; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mv-ev .mv-dot { width:4px; height:4px; border-radius:50%; flex:0 0 auto; }
.mv-ev .mv-t { color:#475569; font-weight:800; }
.mv-ev .mv-n { color:#1e293b; font-weight:800; }
.mv-ev .mv-p { color:#64748b; }
.mv-more { font-size:9.5px; font-weight:800; color:#4f46e5; margin-top:2px; }

/* ─── 대시보드 탭 · 패널 (실제 화면 기준) ─────────────── */
.dash-tabs { background:#fff; border:1px solid #e2e8f0; border-radius:16px; padding:6px; width:fit-content; gap:4px; box-shadow:0 1px 2px rgba(0,0,0,.03); }
.dash-tab { border:none; background:none; border-radius:11px; padding:9px 18px; font-size:13px; font-weight:900; color:#94a3b8; }
.dash-tab.active { background:#4f46e5; color:#ffffff; border:none; box-shadow:0 2px 6px rgba(79,70,229,.32); }

.dash-pane { display:none; }
.dash-pane.active { display:block; animation:fadeUp .35s ease both; }
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.ph-ico { display:inline-grid; place-items:center; width:28px; height:28px; border-radius:9px; font-size:13px; flex:0 0 auto; }
.panel-head { align-items:center; }

.grid-12  { display:grid; grid-template-columns:1fr 1.9fr; gap:20px; }
.grid-11  { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.grid-111 { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
@media (max-width:1180px){ .grid-12,.grid-11,.grid-111,.grid-23{ grid-template-columns:1fr; } }

/* 치료사 랭킹 — 실제 화면처럼 번호 배지 + 카드형 */
.rk-list { display:flex; flex-direction:column; gap:9px; }
.rk-row { display:flex; align-items:center; gap:10px; background:#f8fafc; border-radius:11px; padding:10px 12px; }
.rk-no { width:22px; height:22px; border-radius:7px; background:#4f46e5; color:#ffffff; display:grid; place-items:center;
  font-size:11px; font-weight:900; flex:0 0 auto; }
.rk-no.gray { background:#e2e8f0; color:#64748b; }
.rk-body { flex:1; min-width:0; }
.rk-head { display:flex; justify-content:space-between; gap:8px; font-size:11.5px; font-weight:800; color:#334155; margin-bottom:5px; }
.rk-head b { color:#1e293b; }
.rk-bg { height:5px; background:#e2e8f0; border-radius:10px; overflow:hidden; }
.rk-fill { height:100%; background:#4f46e5; border-radius:10px; }

/* ─── 직원 및 권한 관리 (실제 화면 구조) ─────────────── */
.stf-add { border:none; border-radius:11px; padding:9px 15px; font-size:12.5px; font-weight:900; cursor:pointer; }

.stf-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
@media (max-width:1180px){ .stf-grid{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:760px){ .stf-grid{ grid-template-columns:1fr;} }

.stf-card { display:flex; align-items:center; gap:13px; background:#fff; border:1px solid #f1f5f9;
  border-radius:18px; padding:18px 18px; box-shadow:0 2px 8px rgba(15,23,42,.04); transition:.18s; }
.stf-card:hover { border-color:#c7d2fe; transform:translateY(-2px); box-shadow:0 10px 22px -12px rgba(79,70,229,.4); }

.stf-avatar { width:50px; height:50px; border-radius:14px; display:grid; place-items:center;
  color:#fff; font-size:17px; font-weight:900; flex:0 0 auto; }
.stf-body { flex:1; min-width:0; }
.stf-name { font-size:14.5px; font-weight:900; color:#1e293b; display:flex; align-items:center;
  gap:7px; flex-wrap:wrap; margin-bottom:6px; }
.stf-name .stf-sub { color:#94a3b8; font-weight:700; font-size:13px; }
.stf-role { font-size:9.5px; font-weight:900; padding:3px 8px; border-radius:6px; letter-spacing:.02em; }
.stf-mail { font-size:11.5px; font-weight:700; color:#94a3b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.stf-actions { display:flex; gap:6px; flex:0 0 auto; }
.stf-actions span { width:30px; height:30px; border-radius:9px; display:grid; place-items:center;
  font-size:12px; cursor:pointer; }
.stf-edit { background:#f8fafc; color:#64748b; }
.stf-del { background:#fef2f2; color:#ef4444; }

.pager { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:26px; }
.pg-num, .pg-arrow { min-width:31px; height:31px; border-radius:9px; display:grid; place-items:center;
  font-size:12.5px; font-weight:800; color:#64748b; cursor:pointer; }
.pg-num.active { background:#4f46e5; color:#fff; }
.pg-arrow { color:#cbd5e1; }
