:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #18212f;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --border: #dfe5ee;
  --sidebar: #101827;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(24, 33, 47, 0.08);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

#app { flex: 1; }

.app-shell {
  min-height: calc(100vh - 52px);
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  background: var(--sidebar);
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  font-size: 24px;
}

.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 4px 0 0; color: #aab4c4; font-size: 12px; }

.side-btn {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  text-align: right;
}

.side-btn:hover,
.side-btn.active { background: rgba(59, 130, 246, .28); }

.workspace-status {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.7;
}

.main { padding: 28px; overflow: auto; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.search { position: relative; flex: 1; }
.search span { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); }
.search input {
  width: 100%;
  padding: 14px 46px 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: #fff;
  box-shadow: 0 4px 18px rgba(24, 33, 47, .04);
}

.btn {
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fee2e2; color: var(--danger); }

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #60a5fa);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero h2 { margin: 0 0 8px; font-size: 26px; }
.hero p { margin: 0; opacity: .88; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn { background: #fff; color: var(--primary-dark); }

.notice-box {
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat,
.section {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(24, 33, 47, .05);
}

.stat { padding: 20px; border-radius: var(--radius); }
.stat strong { display: block; margin-top: 8px; font-size: 28px; }

.section { margin-bottom: 20px; padding: 22px; border-radius: 22px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h3 { margin: 0; font-size: 19px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(24, 33, 47, .08); }
.card h4 { margin: 0 0 8px; overflow-wrap: anywhere; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.folder-icon,
.file-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 15px;
  background: #dbeafe;
  font-size: 26px;
}
.file-icon { background: #ede9fe; }

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mini-btn {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 12px;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { padding: 5px 9px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 11px; }

.empty {
  padding: 40px 20px;
  border: 2px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .55);
}
.modal.open { display: flex; }
.modal-card {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.modal-card h3 { margin-top: 0; }

.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; }
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #fff;
}
.field textarea { min-height: 110px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 50;
  display: none;
  padding: 13px 16px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
}
.toast.show { display: block; }

.footer-note {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: var(--sidebar);
  color: #cbd5e1;
  text-align: center;
  font-size: 13px;
}
.footer-note a { color: #60a5fa; text-decoration: none; font-weight: 700; }
.footer-note a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; padding: 14px; }
  .brand { min-width: 220px; padding: 0; border: 0; }
  .side-btn { width: auto; white-space: nowrap; }
  .workspace-status { display: none; }
  .main { padding: 18px; }
  .hero { flex-direction: column; align-items: stretch; }
  .stats { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .search { min-width: 100%; }
}
