@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --yellow: #FFCB49;
  --yellow-light: #FFF8E6;
  --yellow-border: rgba(255,203,73,.35);
  --yellow-deep: #8a6400;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface2: #fafaf8;
  --border: #e8e8e4;
  --border-strong: #d4d4ce;
  --text: #1a1a18;
  --muted: #7a7a72;
  --subtle: #b0b0a8;
  --shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 240px;
  --focus: 0 0 0 3px rgba(255,203,73,.30);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:var(--sans);color:var(--text);background:var(--bg);overflow:hidden;}
.row{display:flex;gap:16px}
.col{display:flex;flex-direction:column;gap:12px}
.muted{color:var(--muted)}
.hidden{display:none !important}
.pill{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);font-size:12px;user-select:none;}
.kbd{font-family:var(--mono);font-size:11px;padding:2px 5px;border-radius:5px;border:1px solid var(--border);background:var(--surface2);color:var(--text);}
#app{height:100%;display:flex;}
.sidebar{width:var(--sidebar-w);background:var(--surface);border-right:1px solid var(--border);padding:16px;display:flex;flex-direction:column;gap:4px;flex-shrink:0;}
.content{flex:1;height:100%;display:flex;flex-direction:column;overflow:hidden;background:var(--bg);}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-bottom:1px solid var(--border);background:var(--surface);}
.page{flex:1;overflow:auto;padding:20px;}
.logoBox{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--radius-sm);margin-bottom:8px;}
.logoMark{width:34px;height:34px;border-radius:9px;background:var(--yellow);display:grid;place-items:center;font-weight:800;font-size:14px;color:#1a1a18;flex-shrink:0;}
.brand{line-height:1.2;}
.brand .name{font-weight:800;font-size:15px;color:var(--text);letter-spacing:-.2px;}
.brand .tag{font-size:11px;color:var(--muted);}
.brand .yellow{color:var(--yellow-deep);}
.sidebar-divider{height:1px;background:var(--border);margin:8px 0;}
.sidebar-label{font-size:10px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--subtle);padding:6px 10px 2px;}
.nav{display:flex;flex-direction:column;gap:2px;}
.nav button{width:100%;text-align:left;border:1px solid transparent;background:transparent;color:var(--muted);padding:9px 10px;border-radius:var(--radius-sm);cursor:pointer;display:flex;align-items:center;gap:9px;font-size:13px;font-weight:500;font-family:var(--sans);transition:.12s ease;}
.nav button:hover{background:var(--surface2);color:var(--text);}
.nav button.active{background:var(--yellow-light);color:var(--yellow-deep);font-weight:600;border-color:var(--yellow-border);}
.nav .icon{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;background:var(--surface2);border:1px solid var(--border);flex-shrink:0;}
.nav button.active .icon{background:rgba(255,203,73,.2);border-color:var(--yellow-border);}
.nav .icon svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;}
.grid{display:grid;grid-template-columns:1.1fr .9fr;gap:16px;align-items:start;}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden;}
.card .hd{padding:14px 16px 12px;border-bottom:1px solid var(--border);display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.card .hd h3{margin:0;font-size:14px;font-weight:700;color:var(--text);}
.card .bd{padding:16px;}
.card .ft{padding:12px 16px;border-top:1px solid var(--border);background:var(--surface2);display:flex;gap:10px;justify-content:flex-end;align-items:center;}
label{display:block;font-size:12px;font-weight:500;color:var(--muted);margin-bottom:5px}
input[type="text"],input[type="email"],input[type="password"],textarea,select{width:100%;padding:10px 12px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface);color:var(--text);font-family:var(--sans);font-size:13px;outline:none;transition:.12s ease;}
input::placeholder,textarea::placeholder{color:var(--subtle);}
textarea{min-height:110px;resize:vertical}
input:focus,textarea:focus,select:focus{box-shadow:var(--focus);border-color:var(--yellow);}
.btn{border:1px solid var(--border);background:var(--surface);color:var(--text);padding:9px 14px;border-radius:var(--radius-sm);cursor:pointer;transition:.12s ease;display:inline-flex;align-items:center;gap:7px;font-size:13px;font-weight:500;font-family:var(--sans);user-select:none;}
.btn:hover{background:var(--surface2);border-color:var(--border-strong);}
.btn:focus{outline:none;box-shadow:var(--focus);}
.btn.primary{background:var(--yellow);border-color:var(--yellow);color:#1a1a18;font-weight:700;}
.btn.primary:hover{filter:brightness(0.97);}
.btn.danger{color:#c0392b;border-color:#fcd4d0;background:#fff5f4;}
.btn.danger:hover{background:#ffe8e5;}
.btn.small{padding:7px 10px;font-size:12px;border-radius:8px;}
#auth{height:100%;display:grid;place-items:center;padding:24px;background:#f7f7f5;}
.divider{height:1px;background:var(--border);margin:2px 0;}
.chatLog{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface2);padding:14px;overflow:auto;}
.msg{max-width:92%;padding:10px 12px;border-radius:12px;border:1px solid var(--border);background:var(--surface);margin:0 0 10px;line-height:1.5;font-size:13px;color:var(--text);white-space:pre-wrap;}
.msg .meta{font-size:11px;color:var(--subtle);margin-bottom:5px;font-weight:600;}
.msg.user{margin-left:auto;background:var(--yellow-light);border-color:var(--yellow-border);}
.msg.ai{background:var(--surface);border-color:var(--border);}
table{width:100%;border-collapse:collapse;font-size:13px;}
th,td{padding:10px 12px;border-bottom:1px solid var(--border);text-align:left;}
th{color:var(--muted);font-weight:600;font-size:11px;background:var(--surface2);text-transform:uppercase;letter-spacing:.4px;}
tr:last-child td{border-bottom:none;}
.tag{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:999px;border:1px solid var(--border);background:var(--surface2);font-size:11px;color:var(--muted);white-space:nowrap;}
.tag.y{border-color:var(--yellow-border);background:var(--yellow-light);color:var(--yellow-deep);font-weight:600;}
.tag.s{border-color:var(--border-strong);background:var(--surface);color:var(--text);}
.kpiGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.kpi{padding:14px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface2);}
.kpi .k{font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;}
.kpi .v{font-size:22px;font-weight:800;margin-top:5px;color:var(--text);}
.kpi .s{font-size:12px;color:var(--subtle);margin-top:4px;}
canvas{width:100%;height:220px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface2);}
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.mcard{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-sm);overflow:hidden;display:flex;flex-direction:column;transition:border-color .15s,box-shadow .15s;}
.mcard:hover{border-color:var(--yellow-border);box-shadow:0 4px 16px rgba(255,203,73,.12);}
.mcard .body{padding:16px;display:flex;flex-direction:column;gap:10px;flex:1;}
.mcard .title{font-weight:700;font-size:14px;color:var(--text);line-height:1.35;}
.mcard .desc{color:var(--muted);font-size:12px;line-height:1.55;}
.mcard .meta{display:flex;gap:6px;flex-wrap:wrap;align-items:center;}
.mcard .score-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;background:var(--yellow-light);border:1px solid var(--yellow-border);font-size:11px;font-weight:700;color:var(--yellow-deep);}
.mcard .foot{padding:12px 16px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--surface2);}
.price{font-weight:800;color:var(--text);font-size:15px;}
.toast{position:fixed;right:20px;bottom:20px;width:min(400px,calc(100% - 40px));border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);box-shadow:0 8px 32px rgba(0,0,0,.12);padding:14px;display:flex;gap:12px;align-items:flex-start;transform:translateY(16px);opacity:0;pointer-events:none;transition:.18s ease;z-index:50;}
.toast.show{transform:translateY(0);opacity:1;pointer-events:auto;}
.toast .ticon{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:var(--yellow-light);border:1px solid var(--yellow-border);flex:0 0 auto;}
.toast .tmain{display:flex;flex-direction:column;gap:3px;}
.toast .ttitle{font-weight:700;font-size:13px;color:var(--text);}
.toast .tmsg{color:var(--muted);font-size:12px;line-height:1.4;}
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);display:none;align-items:center;justify-content:center;padding:20px;z-index:60;}
.overlay.show{display:flex;}
.modal{width:min(540px,100%);border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);box-shadow:0 20px 60px rgba(0,0,0,.15);overflow:hidden;}
.modal .mh{padding:16px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;}
.modal .mh h3{margin:0;font-size:15px;font-weight:700;}
.modal .mb{padding:16px;}
.modal .mf{padding:12px 16px;border-top:1px solid var(--border);background:var(--surface2);display:flex;justify-content:flex-end;gap:10px;}
@media(max-width:980px){body{overflow:auto;}#app{flex-direction:column;height:auto;min-height:100%;}.sidebar{width:100%;position:sticky;top:0;z-index:10;}.grid{grid-template-columns:1fr;}.kpiGrid{grid-template-columns:1fr 1fr;}.cards{grid-template-columns:1fr;}.content{height:auto;}.page{overflow:visible;}}
