:root {
  --bg: #070b12;
  --panel: rgba(13, 19, 31, .78);
  --panel-strong: rgba(16, 24, 39, .92);
  --text: #f2f6ff;
  --muted: #8f9bb2;
  --line: rgba(115, 140, 190, .18);
  --accent: #44a8ff;
  --accent2: #8bd8ff;
  --danger: #ff6b6b;
  --shadow: 0 22px 70px rgba(0,0,0,.35);
}

body[data-theme="light"] {
  --bg: #dce3ec;
  --panel: rgba(236, 241, 247, .76);
  --panel-strong: rgba(244, 247, 251, .92);
  --text: #121926;
  --muted: #5f6b80;
  --line: rgba(50, 70, 100, .16);
  --accent: #1b6fe8;
  --accent2: #388cff;
  --shadow: 0 22px 60px rgba(46, 66, 91, .18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, rgba(29, 113, 190, .42), transparent 32%),
              radial-gradient(circle at 82% 24%, rgba(26, 183, 221, .22), transparent 28%),
              linear-gradient(135deg, var(--bg), #020408);
  overflow-x: hidden;
}

body[data-theme="light"] {
  background: radial-gradient(circle at 18% 8%, rgba(77, 144, 217, .26), transparent 33%),
              radial-gradient(circle at 82% 22%, rgba(60, 170, 210, .18), transparent 30%),
              linear-gradient(135deg, #dbe3ee, #eef3f8);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-page { display: grid; place-items: center; }
.login-shell { width: min(430px, calc(100% - 32px)); }
.login-card {
  border-radius: 28px;
  padding: 34px;
  text-align: center;
}
.brand-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #12243d, #1376ca);
  color: white;
  font-size: 32px;
  font-weight: 800;
  box-shadow: 0 0 38px rgba(68,168,255,.36);
}
.brand-mark.small { width: 44px; height: 44px; margin: 0; border-radius: 14px; font-size: 20px; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.muted { color: var(--muted); margin: 8px 0 0; }
.login-form { margin-top: 24px; display: grid; gap: 14px; text-align: left; }
label span { display: block; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}
body[data-theme="light"] input, body[data-theme="light"] select { background: rgba(255,255,255,.68); }
.primary-btn, .download-btn, .ghost-btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: white;
  font-weight: 700;
}
.primary-btn, .download-btn { background: linear-gradient(135deg, var(--accent), #1258d6); }
.ghost-btn { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line); }
.error-line { color: var(--danger); min-height: 22px; text-align: center; }

.dashboard-page { min-height: 100%; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  position: fixed;
  inset: 18px auto 18px 18px;
  width: 260px;
  border-radius: 26px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.side-head { display: flex; gap: 12px; align-items: center; }
.side-head strong { display: block; }
.side-head span { display: block; color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 10px; }
.nav-item {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}
.nav-item.active, .nav-item:hover { background: rgba(68,168,255,.12); color: var(--text); border-color: var(--line); }
.theme-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.toggle { width: 58px; height: 32px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,.08); padding: 3px; cursor: pointer; }
.toggle span { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); transition: transform .2s ease; }
body[data-theme="light"] .toggle span { transform: translateX(25px); }
.logout { color: var(--muted); text-decoration: none; }

.content { grid-column: 2; padding: 18px 18px 40px 0; }
.topbar {
  border-radius: 26px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.topbar h1 { font-size: 32px; }
.top-actions { display: flex; gap: 12px; width: min(560px, 50%); }
.search { flex: 1; }
.select { width: 220px; }
.status-line {
  margin: 16px 0;
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.file-card {
  border-radius: 22px;
  padding: 16px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: start;
  transition: transform .18s ease, border-color .18s ease;
}
.file-card:hover { transform: translateY(-3px); border-color: rgba(68,168,255,.42); }
.icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  display: grid;
  place-items: center;
  font-size: 28px;
  overflow: hidden;
}
.file-icon { max-width: 38px; max-height: 38px; }
.file-info { min-width: 0; }
.file-info h3 { margin: 4px 0 6px; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.file-meta { margin: 0; color: var(--muted); font-size: 13px; min-height: 34px; }
.download-btn { grid-column: 1 / -1; margin-top: 6px; }
.empty { grid-column: 1 / -1; padding: 28px; border-radius: 22px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .dashboard-page { display: block; }
  .sidebar { position: static; width: auto; margin: 12px; }
  .content { padding: 0 12px 30px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .top-actions { width: 100%; flex-direction: column; }
  .select { width: 100%; }
}


/* Artics fixes */
.login-logo {
  width: 108px;
  height: 108px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 0 28px rgba(68,168,255,.32));
}
.side-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 0 18px rgba(68,168,255,.28));
}
select option {
  background: #111827;
  color: #f2f6ff;
}
body[data-theme="light"] select option {
  background: #e8eef6;
  color: #121926;
}
.category-header {
  grid-column: 1 / -1;
  border-radius: 18px;
  padding: 13px 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  letter-spacing: .02em;
  margin-top: 4px;
}
.category-header b {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.grouped-grid .file-card {
  min-height: 178px;
}
.file-card .download-btn {
  align-self: end;
}
