/* Arya Dome Dashboard — Directus-inspired clean design */
:root {
  --primary: #6644ff;
  --primary-light: #8b6fff;
  --primary-bg: rgba(102, 68, 255, 0.08);
  --sidebar-bg: #172940;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(102, 68, 255, 0.25);
  --bg: #f0f4f9;
  --card: #ffffff;
  --border: #e4e9f0;
  --text: #1a2235;
  --text-muted: #8696a7;
  --text-light: #a3b1c2;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== LOGIN ===== */
.landing {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #172940 0%, #0f1b2d 50%, #0a1220 100%);
}

.landing-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(102, 68, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
}

.landing-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 380px;
  padding: 0 24px;
}

.landing-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(102, 68, 255, 0.35);
}

.landing-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.landing-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  margin-bottom: 24px;
}

.landing-context {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
  margin-bottom: 28px;
}

.landing-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-form input {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.landing-form input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
}

.landing-form input::placeholder { color: rgba(255, 255, 255, 0.25); }

.landing-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(102, 68, 255, 0.3);
}

.landing-btn:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 20px rgba(102, 68, 255, 0.4);
  transform: translateY(-1px);
}

.landing-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.landing-error {
  color: #f87171;
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.landing-links {
  margin-top: 32px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.landing-links a {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.15s;
}

.landing-links a:hover { color: rgba(255, 255, 255, 0.6); }
.landing-links span { color: rgba(255, 255, 255, 0.15); font-size: 10px; }

/* ===== APP SHELL ===== */
.app-hidden { display: none !important; }
.app-hidden ~ .lightbox { display: none !important; }
.hidden { display: none !important; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
  overflow-y: auto;
}

.sidebar-top { flex: 1; padding: 0 0 16px; }
.sidebar-bottom { padding: 8px 12px 16px; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.nav-group { margin-bottom: 4px; }

.nav-section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.3);
  padding: 16px 16px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-item:hover {
  color: #fff;
  background: var(--sidebar-hover);
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  color: #fff;
  background: var(--sidebar-active);
  border-left: 3px solid var(--primary);
}

.nav-item.active svg { opacity: 1; }

.nav-accent { color: rgba(255, 200, 100, 0.7) !important; }
.nav-accent:hover { color: #ffd666 !important; }
.nav-external { opacity: 0.5; }
.nav-external:hover { opacity: 1; }

.nav-logout {
  color: rgba(255, 255, 255, 0.4);
  border-left: none;
}

.nav-logout:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* ===== CONTENT ===== */
.content {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  max-width: 1300px;
  min-height: 100vh;
}

.data-error-banner {
  display: none;
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.data-error-banner.is-visible {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.page-subtitle code {
  font-size: 12px;
  background: var(--primary-bg);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--primary);
}

.text-muted {
  font-size: 12px;
  color: var(--text-muted);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.link-accent {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.link-accent:hover { text-decoration: underline; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-sub {
  font-size: 11px;
  color: var(--green);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== CARDS & GRID ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { background: var(--bg); border-color: #cdd5e0; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
}

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: #fef2f2; border-color: #fecaca; }

/* ===== PHASES ===== */
.phase-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
  transition: background 0.15s;
}

.phase-card:hover { background: #e8edf4; }

.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.phase-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.phase-budget {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.phase-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.phase-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.5s;
}

.phase-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.phase-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ===== QUICK ACTIONS ===== */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
  text-align: center;
}

.quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

/* ===== TEAM ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.team-card {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.team-card:hover {
  border-color: #c8d0dc;
  box-shadow: var(--shadow-md);
}

.team-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.team-info { min-width: 0; flex: 1; }

.team-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.team-role {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 6px;
}

.team-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.team-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.team-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.team-email, .team-tg {
  font-size: 11px;
  color: var(--primary);
  margin-top: 2px;
}

.team-tg a { color: var(--primary); text-decoration: none; }
.team-tg a:hover { text-decoration: underline; }

.team-scope-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge-scope {
  font-size: 10px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
  font-weight: 500;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.tl-item {
  position: relative;
  margin-bottom: 20px;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  position: absolute;
  left: -27px;
  top: 16px;
  z-index: 2;
}

.tl-done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-active .tl-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(102, 68, 255, 0.15);
}
.tl-future .tl-dot { background: var(--bg); border-color: var(--text-light); }

.tl-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}

.tl-content:hover { border-color: #c8d0dc; }

.tl-active .tl-content {
  border-color: var(--primary);
  background: rgba(102, 68, 255, 0.03);
}

.tl-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tl-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.tl-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tl-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ===== MEMORY ===== */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.mem-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mem-card:hover {
  border-color: #c8d0dc;
  box-shadow: var(--shadow-md);
}

.mem-card--live { border-left: 3px solid var(--green); }

.mem-cat {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.mem-live {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border-radius: 3px;
  vertical-align: middle;
}

.mem-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.mem-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.mem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.mem-tags span {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
  color: var(--text-muted);
}

.mem-source {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mem-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.memory-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.mem-recent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.mem-recent-row:hover { border-color: #c8d0dc; }

.mem-recent-body { flex: 1; min-width: 0; }

.mem-recent-title {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.mem-recent-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  font-weight: 500;
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.badge-open { background: #fff7ed; color: #c2410c; }
.badge-in-progress,
.badge-progress,
.badge-active { background: #eff6ff; color: #1d4ed8; }
.badge-done { background: #ecfdf5; color: #059669; }
.badge-planned { background: #f0f4f9; color: #64748b; }
.badge-future { background: #faf5ff; color: #7c3aed; }
.badge-high { background: #fef2f2; color: #dc2626; }
.badge-medium { background: #fffbeb; color: #d97706; }
.badge-low { background: #ecfdf5; color: #059669; }
.badge-role { background: var(--primary-bg); color: var(--primary); }

/* ===== GALLERY ===== */
.gallery-tabs { display: flex; gap: 6px; }

.gallery-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  font-weight: 500;
}

.gallery-tab:hover { border-color: var(--primary); color: var(--primary); }

.gallery-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gallery-item.hidden { display: none; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-action {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.15s;
}

.gallery-action:hover { background: rgba(239, 68, 68, 0.85); }

.gallery-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  padding: 28px 12px 10px;
}

.gallery-label strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.gallery-label small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
}

/* ===== FILES ===== */
.upload-form { display: flex; flex-direction: column; gap: 14px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.upload-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.upload-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

.upload-status.is-success { color: var(--green); }
.upload-status.is-error { color: var(--red); }

/* ===== UNIFIED FILE MANAGER ===== */
.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.files-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
}

.files-search svg { color: var(--text-muted); flex-shrink: 0; }

.files-search input {
  border: none;
  outline: none;
  background: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}

.files-toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.files-toolbar-right select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.files-category-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.files-grid {
  /* container — sections render inside */
}

.files-grid-full {
  display: block;
}

/* --- Section titles --- */
.files-section { margin-bottom: 28px; }

.files-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.files-section-title .text-muted { font-weight: 400; }

/* --- Media grid (images + video thumbnails) --- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

@media (min-width: 1200px) {
  .media-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1600px) {
  .media-grid { grid-template-columns: repeat(8, 1fr); }
}

.media-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.media-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(102, 68, 255, 0.08);
}

.media-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}

.media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.media-play-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  pointer-events: none;
  transition: opacity 0.2s;
}

.media-card:hover .media-play-badge { opacity: 0; }

.media-info {
  padding: 8px 10px;
}

.media-info .file-title {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-info .file-meta { font-size: 10px; }

/* --- Document list --- */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.doc-row:hover { border-color: #c8d0dc; background: #fafbfd; }

.doc-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.doc-icon svg { width: 22px; height: 22px; }

.doc-icon--thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}

.doc-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-info { flex: 1; min-width: 0; }

.doc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.doc-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.file-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}

.file-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(102, 68, 255, 0.08);
}

.file-thumb {
  height: 140px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.file-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.file-thumb-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.file-thumb-icon svg { width: 36px; height: 36px; opacity: 0.6; }

.file-ext {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.file-info {
  padding: 10px 12px 4px;
  min-width: 0;
}

.file-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-actions {
  display: flex;
  gap: 4px;
  padding: 4px 12px 10px;
}

.file-card-actions .btn { font-size: 11px; padding: 3px 8px; }

/* Legacy compat */
.files-list { display: flex; flex-direction: column; gap: 10px; }

/* ===== TABLE ===== */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--bg);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(102, 68, 255, 0.02); }

/* ===== FORMS & MODAL ===== */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 68, 255, 0.1);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h2 { margin-bottom: 20px; font-size: 18px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.lb-close {
  position: fixed;
  top: 16px;
  right: 24px;
  color: #666;
  font-size: 32px;
  cursor: pointer;
  transition: color 0.15s;
  z-index: 201;
}

.lb-close:hover { color: #fff; }

.lb-caption {
  color: #999;
  font-size: 14px;
  margin-top: 12px;
  font-weight: 500;
}

/* ===== VIEWS ===== */
.view { display: none; }
.view.active { display: block; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state p { font-size: 13px; line-height: 1.6; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar .nav-section,
  .sidebar .logo-text,
  .sidebar .nav-item span:not(.nav-item svg) {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 10px;
    font-size: 0;
  }

  .logo { padding: 14px 8px; justify-content: center; }
  .logo-icon { margin: 0; }

  .content {
    margin-left: 60px;
    padding: 20px;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .memory-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .file-item {
    flex-direction: column;
    align-items: stretch;
  }
  .file-actions { justify-content: flex-start; }
}
