/* BreadBook · Lumina Design Tokens (from demo) */
@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-canvas: #f7f8fa;
  --surface-ground: rgba(255, 255, 255, 0.72);
  --surface-pure: #ffffff;
  --surface-float: rgba(255, 255, 255, 0.88);
  --text-heading: #121316;
  --text-body: #2d3139;
  --text-muted: #737887;
  --text-subtle: #9ea3b0;
  --border-hairline: rgba(0, 0, 0, 0.05);
  --border-glass: rgba(255, 255, 255, 0.85);
  --border-active: rgba(18, 19, 22, 0.12);
  --status-emerald: #059669;
  --status-emerald-bg: rgba(5, 150, 105, 0.08);
  --status-amber: #d97706;
  --status-amber-bg: rgba(217, 119, 6, 0.08);
  --status-crimson: #e11d48;
  --status-crimson-bg: rgba(225, 29, 72, 0.08);
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.02), 0 6px 16px -4px rgba(0, 0, 0, 0.03);
  --shadow-float: 0 12px 36px -8px rgba(0, 0, 0, 0.06), 0 1px 1px rgba(0, 0, 0, 0.03);
  --spring-glide: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-wenkai: "LXGW WenKai Screen", "LXGW WenKai", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --btn-obsidian: #111113;
  --btn-obsidian-fg: #fafafa;
  --primary: #18181b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg-canvas);
  color: var(--text-body);
  font-family: var(--font-wenkai);
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }

.ambient-glow { position: fixed; pointer-events: none; z-index: 0; border-radius: 50%; filter: blur(80px); }
.ambient-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(220, 235, 248, 0.45) 0%, transparent 70%);
  top: -150px; left: -100px;
}
.ambient-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(245, 238, 230, 0.35) 0%, transparent 70%);
  bottom: -100px; right: 5%;
}

/* Buttons */
.lu-btn {
  background: var(--btn-obsidian); color: var(--btn-obsidian-fg);
  height: 40px; padding: 0 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: transform 0.25s var(--spring-bounce), background 0.2s, box-shadow 0.3s;
  font-family: inherit;
}
.lu-btn:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.16); }
.lu-btn:active { transform: scale(0.96); }
.lu-btn.outline, .lu-btn.btn-ghost {
  background: #fff; color: var(--text-heading);
  border: 1px solid var(--border-hairline); box-shadow: var(--shadow-subtle);
}
.lu-btn.danger { background: var(--status-crimson); }
.lu-btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.lu-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Layout shell */
.app-shell { display: flex; height: 100vh; overflow: hidden; position: relative; z-index: 1; }
aside.sidebar {
  width: 256px; height: 100%;
  background: var(--surface-ground);
  backdrop-filter: blur(30px) saturate(160%);
  border-right: 1px solid var(--border-hairline);
  display: flex; flex-direction: column;
  padding: 24px 14px 18px; flex-shrink: 0;
}
.brand-zone {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 22px; border-bottom: 1px solid var(--border-hairline); margin-bottom: 14px;
}
.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #1a1b1f, #2d3139);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-subtle);
}
.brand-text strong { display: block; font-size: 15px; color: var(--text-heading); letter-spacing: -0.02em; }
.brand-text span { font-size: 11px; color: var(--text-muted); }

.nav-group-label {
  font-size: 11px; color: var(--text-subtle); padding: 10px 12px 6px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-item {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; color: var(--text-muted);
  cursor: pointer; transition: all 0.25s var(--spring-glide); margin-bottom: 2px;
  font-size: 14px;
}
.nav-item:hover { color: var(--text-heading); background: rgba(255,255,255,0.55); }
.nav-item.active {
  color: var(--text-heading); background: var(--surface-pure);
  box-shadow: var(--shadow-subtle); font-weight: 600;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; flex-shrink: 0; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding-right: 2px; }
.sidebar-footer {
  border-top: 1px solid var(--border-hairline); padding-top: 14px; margin-top: 8px;
  font-size: 12px; color: var(--text-muted);
}

main.workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--border-hairline);
  background: rgba(247,248,250,0.75); backdrop-filter: blur(16px);
}
.topbar h1 { font-size: 20px; font-weight: 700; color: var(--text-heading); letter-spacing: -0.03em; }
.topbar .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.content { flex: 1; overflow: auto; padding: 24px 28px 40px; }

/* Cards */
.lu-card {
  background: var(--surface-float);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 20px; padding: 22px;
  box-shadow: var(--shadow-subtle);
}
.lu-card h3 { font-size: 15px; font-weight: 600; color: var(--text-heading); margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 960px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } aside.sidebar { display: none; } }

.stat-card .label { font-size: 12px; color: var(--text-muted); }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--text-heading); margin-top: 6px; letter-spacing: -0.03em; }
.stat-card .hint { font-size: 12px; color: var(--text-subtle); margin-top: 8px; }

/* Forms */
.lu-input, .lu-select, .lu-textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--border-hairline);
  background: #fff; font-family: inherit; font-size: 14px; color: var(--text-body);
  outline: none; transition: border 0.2s, box-shadow 0.2s;
}
.lu-textarea { height: auto; min-height: 100px; padding: 10px 12px; resize: vertical; }
.lu-input:focus, .lu-select:focus, .lu-textarea:focus {
  border-color: var(--border-active); box-shadow: 0 0 0 3px rgba(18,19,22,0.06);
}
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }

/* Table */
.lu-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lu-table th {
  text-align: left; padding: 10px 12px; color: var(--text-muted); font-weight: 500;
  border-bottom: 1px solid var(--border-hairline); font-size: 12px;
}
.lu-table td { padding: 12px; border-bottom: 1px solid var(--border-hairline); vertical-align: middle; }
.lu-table tr:hover td { background: rgba(255,255,255,0.5); }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500;
}
.badge.ok { background: var(--status-emerald-bg); color: var(--status-emerald); }
.badge.warn { background: var(--status-amber-bg); color: var(--status-amber); }
.badge.err { background: var(--status-crimson-bg); color: var(--status-crimson); }

/* Login */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; position: relative;
}
.login-card {
  width: 400px; max-width: calc(100vw - 32px);
  padding: 36px 32px; border-radius: 24px;
  background: var(--surface-float); backdrop-filter: blur(30px);
  border: 1px solid var(--border-glass); box-shadow: var(--shadow-float);
  position: relative; z-index: 1;
}
.login-card h1 { font-size: 26px; letter-spacing: -0.03em; color: var(--text-heading); }
.login-card p { color: var(--text-muted); font-size: 13.5px; margin: 8px 0 28px; }

/* Toast */
#toast-root { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #111113; color: #fff; padding: 12px 16px; border-radius: 12px;
  font-size: 13px; box-shadow: var(--shadow-float);
  animation: toastIn 0.4s var(--spring-glide);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* File manager */
.file-path { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }
.file-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; cursor: pointer; transition: background 0.2s;
}
.file-row:hover { background: rgba(255,255,255,0.7); }
.file-icon { width: 32px; height: 32px; border-radius: 8px; background: #f0f2f5; display: grid; place-items: center; font-size: 14px; }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18,19,22,0.28); backdrop-filter: blur(6px);
  z-index: 100; display: none; align-items: center; justify-content: center;
}
.modal-mask.open { display: flex; }
.modal {
  width: 480px; max-width: calc(100vw - 24px); max-height: 85vh; overflow: auto;
  background: #fff; border-radius: 20px; padding: 24px; box-shadow: var(--shadow-float);
  animation: toastIn 0.35s var(--spring-glide);
}
.modal h2 { font-size: 18px; margin-bottom: 16px; color: var(--text-heading); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  color: var(--text-muted); background: transparent; border: none; font-family: inherit;
}
.tab.active { background: #111113; color: #fff; }

.empty-hint { text-align: center; padding: 48px 16px; color: var(--text-muted); font-size: 14px; }
