:root {
  --primary: #00D5C8;
  --accent: #14B8A6;
  --dark: #0F172A;
  --bg: #f6f8fb;
  --card: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(145deg, #f7fdfa, #f4f7ff);
  color: var(--dark);
}
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--line);
  padding: 20px;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
}
.brand span { color: var(--primary); }
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--dark);
  font-size: 14px;
  cursor: pointer;
}
.nav-item:hover, .nav-item.active {
  background: #ecfeff;
  color: #0f766e;
}
.content { padding: 20px; }
.topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.room-pill {
  background: #ecfeff;
  color: #0f766e;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.input, .btn, select {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font-size: 14px;
}
.input { min-width: 200px; background: #fff; }
.btn {
  background: #fff;
  cursor: pointer;
}
.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn.danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.pathbar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}
.pathbar a { color: #0f766e; text-decoration: none; font-size: 13px; }
.pathbar .sep { color: #94a3b8; }
.dropzone {
  border: 2px dashed #99f6e4;
  background: rgba(240, 253, 250, 0.65);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
  color: #0f766e;
}
.dropzone.dragging { border-color: var(--primary); background: #ccfbf1; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.explorer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 420px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  padding: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
}
.card:hover { border-color: #99f6e4; box-shadow: 0 6px 20px rgba(20, 184, 166, 0.08); }
.thumb {
  height: 90px;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.name { margin-top: 8px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.table tr:hover { background: #f8fafc; }
.context-menu {
  position: fixed;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  min-width: 170px;
}
.context-menu button {
  width: 100%;
  border: 0;
  text-align: left;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.context-menu button:hover { background: #f1f5f9; }
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.58);
  z-index: 200;
}
.modal.open { display: flex; }
.modal-box {
  width: min(900px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
}
.viewer img, .viewer video, .viewer iframe, .viewer audio { width: 100%; max-height: 70vh; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.hidden { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}
