/* ====== 삼성자산운용 AI BI — 디자인 토큰 & 베이스 ====== */
:root{
  --navy-900:#0B1B40; --navy-800:#11295E; --navy-700:#1A3A78; --navy-600:#214A96;
  --blue-600:#1B5BD7; --blue-500:#2E6BE0; --blue-400:#5B8DEF; --blue-100:#E5EEFD; --blue-50:#F1F6FE;
  --ink-1:#15233D; --ink-2:#46566F; --ink-3:#8B95A9; --ink-4:#B4BCCB;
  --line:#E3E8F0; --line-soft:#EEF1F6; --bg:#F4F6FA; --surface:#FFFFFF; --surface-2:#FAFBFD;
  --pos:#0E8A5F; --neg:#D23B49; --warn:#C97A0A;
  --r-s:6px; --r-m:10px; --r-l:14px;
  --sh-1:0 1px 2px rgba(16,32,64,.06); --sh-2:0 2px 8px rgba(16,32,64,.08); --sh-3:0 8px 28px rgba(16,32,64,.14);
  --font:'Pretendard','Pretendard Variable',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Malgun Gothic',sans-serif;
}
*{box-sizing:border-box;}
html,body{margin:0;height:100%;}
body{font-family:var(--font);background:var(--bg);color:var(--ink-1);-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.45;}
#root{height:100%;}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;}
input,select,textarea{font-family:inherit;font-size:inherit;}
::-webkit-scrollbar{width:10px;height:10px;}
::-webkit-scrollbar-thumb{background:#D3DAE6;border-radius:6px;border:2px solid var(--bg);}
::-webkit-scrollbar-thumb:hover{background:#BCC5D6;}

/* ====== App shell ====== */
.app{display:flex;height:100%;overflow:hidden;}
.sidebar{width:236px;flex:0 0 236px;background:var(--navy-900);color:#fff;display:flex;flex-direction:column;}
.sb-brand{display:flex;align-items:center;gap:10px;padding:18px 18px 14px;}
.sb-logo{width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#2E6BE0,#5B8DEF);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;color:#fff;}
.sb-brand .nm{font-weight:700;font-size:15px;letter-spacing:-.2px;}
.sb-brand .sub{font-size:11px;color:#8FA0C4;margin-top:1px;}
.sb-nav{padding:8px;display:flex;flex-direction:column;gap:2px;flex:1;}
.sb-section{font-size:10.5px;font-weight:700;color:#6E7EA6;letter-spacing:.06em;padding:14px 12px 6px;text-transform:uppercase;}
.sb-item{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:8px;color:#C3CCE0;font-size:13.5px;font-weight:500;transition:.13s;text-align:left;width:100%;}
.sb-item:hover{background:rgba(255,255,255,.06);color:#fff;}
.sb-item.active{background:var(--blue-600);color:#fff;font-weight:600;}
.sb-item svg{width:18px;height:18px;flex:0 0 auto;}
.sb-item .badge{margin-left:auto;font-size:10.5px;background:rgba(255,255,255,.16);padding:1px 7px;border-radius:10px;font-weight:600;}
.sb-foot{padding:12px;border-top:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:10px;}
.sb-avatar{width:32px;height:32px;border-radius:50%;background:#2C4A8F;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;}
.sb-foot .nm{font-size:13px;font-weight:600;}
.sb-foot .role{font-size:11px;color:#8FA0C4;}

.main{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden;}
.topbar{height:56px;flex:0 0 56px;background:var(--surface);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:14px;padding:0 22px;}
.topbar h1{font-size:16px;font-weight:700;letter-spacing:-.3px;margin:0;}
.topbar .crumb{font-size:12.5px;color:var(--ink-3);}
.topbar .spacer{flex:1;}
.content{flex:1;overflow:auto;min-height:0;}

/* ====== Buttons ====== */
.btn{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border-radius:8px;font-size:13px;font-weight:600;transition:.13s;border:1px solid transparent;white-space:nowrap;}
.btn svg{width:16px;height:16px;}
.btn-primary{background:var(--blue-600);color:#fff;}
.btn-primary:hover{background:#1750c2;}
.btn-ghost{background:var(--surface);border-color:var(--line);color:var(--ink-2);}
.btn-ghost:hover{background:var(--surface-2);border-color:#D3DAE6;color:var(--ink-1);}
.btn-soft{background:var(--blue-50);color:var(--blue-600);}
.btn-soft:hover{background:var(--blue-100);}
.btn-sm{padding:5px 10px;font-size:12px;border-radius:7px;}
.btn-sm svg{width:14px;height:14px;}
.btn-danger{background:var(--neg);color:#fff;}
.btn-danger:hover{background:#b92f3c;}
.btn:disabled{opacity:.5;cursor:not-allowed;}

/* ====== Generic ====== */
.chip{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:20px;font-size:11.5px;font-weight:600;background:var(--blue-50);color:var(--blue-600);}
.chip svg{width:13px;height:13px;flex:0 0 auto;}
.vic svg{width:16px;height:16px;}
.ic-16 svg{width:16px;height:16px;}
.ico-btn svg{width:15px;height:15px;}
.chip.gray{background:var(--line-soft);color:var(--ink-2);}
.chip.green{background:#E6F5EE;color:var(--pos);}
.chip.amber{background:#FBF0DF;color:var(--warn);}
.chip.red{background:#FBE9EB;color:var(--neg);}
.pos{color:var(--pos);} .neg{color:var(--neg);}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-l);box-shadow:var(--sh-1);}

/* ====== Charts ====== */
.chart-bars{display:flex;flex-direction:column;gap:7px;width:100%;}
.chart-bar-row{display:grid;grid-template-columns:148px 1fr;align-items:center;gap:10px;}
.chart-bar-label{font-size:12px;color:var(--ink-2);text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chart-bar-track{position:relative;background:var(--line-soft);border-radius:4px;height:18px;display:flex;align-items:center;}
.chart-bar-fill{height:100%;border-radius:4px;transition:width .6s cubic-bezier(.2,.7,.3,1);}
.chart-bar-value{position:absolute;right:8px;font-size:11.5px;font-weight:600;color:var(--ink-1);font-variant-numeric:tabular-nums;}
.chart-svg{width:100%;display:block;}
.chart-line-wrap{width:100%;}
.chart-legend{display:flex;flex-wrap:wrap;gap:5px 14px;padding-top:8px;}
.chart-legend-item{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--ink-2);}
.chart-legend-item i{width:11px;height:3px;border-radius:2px;display:inline-block;}
.chart-pie-wrap{display:flex;align-items:center;gap:22px;flex-wrap:wrap;}
.chart-pie-svg{width:170px;flex:0 0 auto;}
.chart-pie-legend{display:flex;flex-direction:column;gap:8px;flex:1;min-width:180px;}
.chart-pie-legend-row{display:flex;align-items:center;gap:9px;font-size:12.5px;}
.chart-pie-legend-row i{width:10px;height:10px;border-radius:3px;flex:0 0 auto;}
.chart-pie-legend-row .lbl{color:var(--ink-2);flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chart-pie-legend-row .val{font-weight:700;color:var(--ink-1);font-variant-numeric:tabular-nums;}

/* ====== Table ====== */
.data-table-wrap{width:100%;overflow:auto;}
.data-table{width:100%;border-collapse:collapse;font-size:12.5px;}
.data-table th{text-align:left;font-weight:600;color:var(--ink-3);padding:8px 12px;border-bottom:1px solid var(--line);white-space:nowrap;font-size:11.5px;position:sticky;top:0;background:var(--surface);}
.data-table td{padding:8px 12px;border-bottom:1px solid var(--line-soft);color:var(--ink-2);white-space:nowrap;}
.data-table td.strong{color:var(--ink-1);font-weight:600;}
.data-table .num{text-align:right;font-variant-numeric:tabular-nums;}
.data-table tbody tr:hover{background:var(--blue-50);}
.compact .data-table th,.compact .data-table td{padding:6px 10px;}

/* ====== Modal ====== */
.modal-scrim{position:fixed;inset:0;background:rgba(11,27,64,.42);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;z-index:60;animation:fade .15s ease;}
@keyframes fade{from{opacity:0;}to{opacity:1;}}
.modal{background:var(--surface);border-radius:16px;box-shadow:var(--sh-3);width:min(560px,92vw);max-height:88vh;display:flex;flex-direction:column;animation:pop .18s cubic-bezier(.2,.8,.3,1);}
@keyframes pop{from{opacity:0;transform:translateY(8px) scale(.98);}to{opacity:1;transform:none;}}
.modal.wide{width:min(880px,94vw);}
.modal-head{display:flex;align-items:center;gap:12px;padding:18px 22px;border-bottom:1px solid var(--line);}
.modal-head h3{margin:0;font-size:16px;font-weight:700;}
.modal-head svg{width:18px;height:18px;flex:0 0 auto;}
.modal-head .x{margin-left:auto;width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--ink-3);flex:0 0 auto;}
.modal-head .x:hover{background:var(--line-soft);color:var(--ink-1);}
.modal-body{padding:20px 22px;overflow:auto;}
.modal-foot{display:flex;gap:10px;justify-content:flex-end;padding:16px 22px;border-top:1px solid var(--line);}

/* ====== Toast ====== */
.toast-wrap{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:90;display:flex;flex-direction:column;gap:8px;align-items:center;}
.toast{background:var(--navy-900);color:#fff;padding:11px 18px;border-radius:10px;font-size:13px;font-weight:500;box-shadow:var(--sh-3);display:flex;align-items:center;gap:10px;animation:toastIn .25s cubic-bezier(.2,.8,.3,1);}
.toast svg{width:17px;height:17px;color:#6FE0A8;}
@keyframes toastIn{from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:none;}}

/* ====== Form ====== */
.field{margin-bottom:16px;}
.field>label{display:block;font-size:12.5px;font-weight:600;color:var(--ink-2);margin-bottom:7px;}
.input,.select{width:100%;padding:9px 12px;border:1px solid var(--line);border-radius:8px;font-size:13px;color:var(--ink-1);background:#fff;transition:.13s;}
.input:focus,.select:focus{outline:none;border-color:var(--blue-400);box-shadow:0 0 0 3px var(--blue-50);}
.seg{display:flex;gap:4px;background:var(--line-soft);padding:3px;border-radius:9px;}
.seg button{flex:1;padding:7px 10px;border-radius:7px;font-size:12.5px;font-weight:600;color:var(--ink-3);display:flex;align-items:center;justify-content:center;gap:6px;transition:.12s;}
.seg button.active{background:#fff;color:var(--blue-600);box-shadow:var(--sh-1);}
.seg button svg{width:15px;height:15px;}
.swatches{display:flex;gap:9px;}
.swatch{width:34px;height:34px;border-radius:9px;border:2px solid transparent;cursor:pointer;position:relative;transition:.12s;}
.swatch.active{border-color:var(--ink-1);}
.swatch.active::after{content:'';position:absolute;inset:0;border-radius:7px;border:2px solid #fff;}
.stepper{display:flex;align-items:center;border:1px solid var(--line);border-radius:8px;overflow:hidden;width:max-content;}
.stepper button{width:34px;height:34px;font-size:16px;color:var(--ink-2);}
.stepper button:hover{background:var(--line-soft);}
.stepper input{width:48px;text-align:center;border:none;border-left:1px solid var(--line);border-right:1px solid var(--line);height:34px;}
.stepper input:focus{outline:none;}
.settings-group-title{font-size:11px;font-weight:700;color:var(--ink-3);letter-spacing:.05em;text-transform:uppercase;margin:6px 0 12px;padding-bottom:7px;border-bottom:1px solid var(--line-soft);}
.ds-pill{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;background:var(--blue-50);color:var(--blue-600);font-size:13px;font-weight:600;}
.ds-pill svg{width:16px;height:16px;}

/* ====== 컴포넌트 라이브러리: 사용 현황 배지 + 호버 팝오버 ====== */
.usage-wrap{position:relative;display:inline-flex;}
.usage-wrap .chip{cursor:default;}
.usage-pop{display:none;position:absolute;bottom:calc(100% + 8px);left:0;width:236px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--sh-3);padding:6px;z-index:40;}
.usage-pop::after{content:'';position:absolute;top:100%;left:0;right:0;height:10px;}
.usage-wrap:hover .usage-pop{display:block;animation:fade .12s ease;}
.usage-pop .cap{font-size:10.5px;font-weight:700;color:var(--ink-3);letter-spacing:.04em;text-transform:uppercase;padding:6px 9px 4px;}
.usage-pop .row{display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:7px;font-size:12.5px;color:var(--ink-1);font-weight:500;}
.usage-pop .row:hover{background:var(--blue-50);}
.usage-pop .row svg{width:14px;height:14px;color:var(--blue-600);flex:0 0 auto;}
.usage-pop .row .n{margin-left:auto;font-size:11px;color:var(--ink-3);font-weight:500;}
