/* ============================================================
   NIMBUS CLOUD STORAGE — MASTER STYLESHEET
   ============================================================ */

/* ---- CSS RESET & BASE ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   CSS VARIABLES — DESIGN TOKENS
   ============================================================ */
:root {
  /* Primary palette */
  --clr-primary: #6C63FF;
  --clr-primary-hover: #5a52d9;
  --clr-primary-glow: rgba(108, 99, 255, 0.35);
  --clr-primary-subtle: rgba(108, 99, 255, 0.10);

  /* Accent */
  --clr-accent: #48BB78;
  --clr-accent-hover: #38a163;

  /* Danger */
  --clr-danger: #FC5C65;
  --clr-danger-hover: #e04450;
  --clr-danger-subtle: rgba(252, 92, 101, 0.10);

  /* Warning */
  --clr-warning: #F6AD55;

  /* Greyscale — Dark theme */
  --clr-bg: #0f1117;
  --clr-surface: #171923;
  --clr-surface-elevated: #1e2230;
  --clr-surface-raised: #252a3a;
  --clr-border: rgba(255, 255, 255, 0.07);
  --clr-border-focus: rgba(108, 99, 255, 0.5);

  /* Text */
  --clr-text: #eaedf2;
  --clr-text-secondary: #8b9099;
  --clr-text-tertiary: #5c6170;
  --clr-text-on-primary: #ffffff;

  /* File type icon colors */
  --clr-file-image: #F6AD55;
  --clr-file-video: #FC5C65;
  --clr-file-audio: #6C63FF;
  --clr-file-document: #48BB78;
  --clr-file-archive: #F6AD55;
  --clr-file-code: #4FC3F7;
  --clr-file-default: #8b9099;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.25);

  /* Layout */
  --sidebar-width: 248px;
  --topbar-height: 68px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Typography */
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
  --transition-base: 250ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 400ms cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   BASE ELEMENTS
   ============================================================ */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }

img, svg { display: block; max-width: 100%; }

/* ============================================================
   AUTH PAGES (INDEX + RESET)
   ============================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--clr-surface-raised);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.auth-tab {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--clr-text-secondary);
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.auth-tab--active {
  background: var(--clr-surface-elevated);
  color: var(--clr-text);
  box-shadow: var(--shadow-sm);
}

.auth-panel { display: none; }
.auth-panel--active { display: block; }

.auth-helper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--clr-text-secondary);
}

.inline-link {
  color: var(--clr-primary);
  font-weight: 600;
}
.inline-link:hover { color: var(--clr-primary-hover); text-decoration: underline; }

/* ============================================================
   TOAST / NOTIFICATION
   ============================================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  width: 90vw;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--clr-surface-elevated);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-lg);
  color: var(--clr-text);
  font-size: 0.875rem;
  line-height: 1.45;
  animation: toastSlideIn 0.35s cubic-bezier(.4,0,.2,1) forwards;
  position: relative;
  overflow: hidden;
}
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--clr-primary);
  animation: toastProgress 3s linear forwards;
}
.toast--success::after { background: var(--clr-accent); }
.toast--error::after { background: var(--clr-danger); }
.toast--warning::after { background: var(--clr-warning); }

.toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast--success .toast__icon { background: rgba(72, 187, 120, 0.15); color: var(--clr-accent); }
.toast--error .toast__icon { background: rgba(252, 92, 101, 0.15); color: var(--clr-danger); }
.toast--warning .toast__icon { background: rgba(246, 173, 85, 0.15); color: var(--clr-warning); }
.toast--info .toast__icon { background: var(--clr-primary-subtle); color: var(--clr-primary); }

.toast__content { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; color: var(--clr-text); }
.toast__msg { color: var(--clr-text-secondary); }

.toast.toast--exit {
  animation: toastSlideOut 0.3s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(110%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); max-height: 200px; margin-bottom: 10px; }
  to   { opacity: 0; transform: translateX(110%); max-height: 0; margin-bottom: 0; padding: 0; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ============================================================
   AUTH SCREENS
   ============================================================ */
.auth-screens {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overflow-y: auto;
  padding: 32px 16px;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background: var(--clr-bg);
  overflow: hidden;
}
.auth-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}
.auth-bg__orb--1 {
  width: 520px; height: 520px;
  background: var(--clr-primary);
  top: -180px; left: -140px;
}
.auth-bg__orb--2 {
  width: 400px; height: 400px;
  background: var(--clr-accent);
  bottom: -100px; right: -80px;
  opacity: 0.2;
}
.auth-bg__orb--3 {
  width: 280px; height: 280px;
  background: var(--clr-danger);
  top: 50%; left: 60%;
  opacity: 0.12;
}
.auth-bg__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Auth Screen transitions */
.auth-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  transform: translateY(12px);
}
.auth-screen--active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  position: relative;
  inset: auto;
}

/* Auth Card */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-lg);
  animation: cardFadeUp 0.5s cubic-bezier(.4,0,.2,1) both;
}
@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-card__brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--clr-text);
}
.auth-card__icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.auth-card__title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-card__subtitle {
  color: var(--clr-text-secondary);
  font-size: 0.88rem;
  margin-bottom: 28px;
}
.auth-card__footer {
  text-align: center;
  margin-top: 24px;
  color: var(--clr-text-secondary);
  font-size: 0.85rem;
}

/* ============================================================
   FORM COMPONENTS
   ============================================================ */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--clr-text-tertiary);
  pointer-events: none;
  transition: color var(--transition-fast);
  z-index: 1;
}
.form-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background: var(--clr-surface-raised);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  color: var(--clr-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.form-input::placeholder { color: var(--clr-text-tertiary); }
.form-input:focus {
  border-color: var(--clr-border-focus);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
  background: var(--clr-surface-elevated);
}
.form-input:focus + .input-toggle-pw ~ .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--clr-primary);
}

/* Password toggle */
.input-toggle-pw {
  position: absolute;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--clr-text-tertiary);
  transition: color var(--transition-fast), background var(--transition-fast);
  z-index: 2;
}
.input-toggle-pw:hover { color: var(--clr-text); background: rgba(255,255,255,0.05); }
.input-toggle-pw svg { width: 18px; height: 18px; }

/* Password strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.password-strength__bar {
  flex: 1;
  height: 3px;
  background: var(--clr-surface-raised);
  border-radius: 2px;
  overflow: hidden;
}
.password-strength__fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width var(--transition-base), background var(--transition-base);
}
.password-strength__fill[data-level="1"] { width: 25%; background: var(--clr-danger); }
.password-strength__fill[data-level="2"] { width: 50%; background: var(--clr-warning); }
.password-strength__fill[data-level="3"] { width: 75%; background: var(--clr-accent); }
.password-strength__fill[data-level="4"] { width: 100%; background: var(--clr-accent); }
.password-strength__label {
  font-size: 0.75rem;
  color: var(--clr-text-tertiary);
  min-width: 42px;
  text-align: right;
  transition: color var(--transition-fast);
}
.password-strength__label[data-level="1"] { color: var(--clr-danger); }
.password-strength__label[data-level="2"] { color: var(--clr-warning); }
.password-strength__label[data-level="3"],
.password-strength__label[data-level="4"] { color: var(--clr-accent); }

/* Remember + Forgot row */
.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check__input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--clr-surface-raised);
  border: 1.5px solid var(--clr-border);
  border-radius: 4px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}
.form-check__input:checked {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3 3 7-7' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px;
}
.form-check__label { font-size: 0.84rem; color: var(--clr-text-secondary); user-select: none; }

/* Auth link */
.auth-link {
  color: var(--clr-primary);
  font-size: 0.84rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.auth-link:hover { color: var(--clr-primary-hover); text-decoration: underline; }

/* Form error */
.form-error {
  font-size: 0.82rem;
  color: var(--clr-danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--clr-danger-subtle);
  border: 1px solid rgba(252, 92, 101, 0.2);
  display: none;
  animation: shakeError 0.4s ease;
}
.form-error--visible { display: block; }

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1.5px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--primary {
  background: var(--clr-primary);
  color: var(--clr-text-on-primary);
  box-shadow: 0 2px 12px var(--clr-primary-glow);
}
.btn--primary:hover { background: var(--clr-primary-hover); box-shadow: 0 4px 18px var(--clr-primary-glow); }

.btn--secondary {
  background: var(--clr-surface-raised);
  color: var(--clr-text);
  border-color: var(--clr-border);
}
.btn--secondary:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); }

.btn--danger {
  background: transparent;
  color: var(--clr-danger);
  border-color: rgba(252,92,101,0.3);
}
.btn--danger:hover { background: var(--clr-danger-subtle); border-color: var(--clr-danger); }

.btn--full { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 0.8rem; }

.btn svg { flex-shrink: 0; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--transition-base);
  will-change: transform;
}
.sidebar--open { transform: translateX(0) !important; }

.sidebar__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--clr-border);
}
.sidebar__brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.02em;
}
.sidebar__close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--clr-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar__close:hover { background: rgba(255,255,255,0.06); color: var(--clr-text); }
.sidebar__close svg { width: 18px; height: 18px; }

/* Nav */
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 20px 12px;
  flex: 1;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--clr-text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
}
.sidebar__link svg { width: 19px; height: 19px; flex-shrink: 0; transition: color var(--transition-fast); }
.sidebar__link:hover { background: rgba(255,255,255,0.04); color: var(--clr-text); }
.sidebar__link--active {
  background: var(--clr-primary-subtle);
  color: var(--clr-primary);
}
.sidebar__link--active svg { color: var(--clr-primary); }

/* Storage meter */
.sidebar__storage {
  padding: 16px 20px;
  border-top: 1px solid var(--clr-border);
}
.sidebar__storage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--clr-text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.sidebar__storage-bar {
  height: 4px;
  background: var(--clr-surface-raised);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.sidebar__storage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  border-radius: 2px;
  transition: width var(--transition-slow);
}
.sidebar__storage-info { font-size: 0.73rem; color: var(--clr-text-tertiary); }

/* User section */
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--clr-border);
}
.sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}
.sidebar__user-info { min-width: 0; flex: 1; }
.sidebar__user-name { font-size: 0.82rem; font-weight: 600; color: var(--clr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-email { font-size: 0.72rem; color: var(--clr-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__logout {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--clr-text-tertiary);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.sidebar__logout:hover { color: var(--clr-danger); background: var(--clr-danger-subtle); }
.sidebar__logout svg { width: 18px; height: 18px; }

/* ---- MAIN CONTENT ---- */
.dashboard__main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar__left { display: flex; align-items: center; gap: 16px; }
.topbar__hamburger {
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--clr-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.topbar__hamburger:hover { background: rgba(255,255,255,0.05); color: var(--clr-text); }
.topbar__hamburger svg { width: 20px; height: 20px; }
.topbar__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.02em;
}
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
}

/* ---- CONTENT AREA ---- */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ---- VIEWS ---- */
.view { display: none; animation: viewFadeIn 0.3s ease forwards; }
.view--active { display: block; }
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FILES VIEW
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  font-size: 0.9rem;
}
.breadcrumb::-webkit-scrollbar { height: 4px; }
.breadcrumb::-webkit-scrollbar-track { background: transparent; }
.breadcrumb::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }
.breadcrumb::-webkit-scrollbar-thumb:hover { background: var(--clr-text-tertiary); }
.breadcrumb__path-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  margin: 0;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--clr-primary);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  font-weight: 500;
}
.breadcrumb__path-item:hover {
  background: var(--clr-primary-subtle);
  color: #ffffff;
}
.breadcrumb__separator {
  display: inline-flex;
  align-items: center;
  color: var(--clr-text-tertiary);
  margin: 0 2px;
  font-size: 0.9rem;
  user-select: none;
  pointer-events: none;
}

.view__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.view__count { font-size: 0.82rem; color: var(--clr-text-tertiary); font-weight: 500; }

.view-toggle {
  display: flex;
  background: var(--clr-surface-raised);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.view-toggle__btn {
  width: 34px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--clr-text-tertiary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.view-toggle__btn:hover { color: var(--clr-text); }
.view-toggle__btn--active { background: var(--clr-surface-elevated); color: var(--clr-text); box-shadow: var(--shadow-sm); }
.view-toggle__btn svg { width: 16px; height: 16px; }

/* ---- GRID VIEW ---- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.file-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
  position: relative;
}
.file-card:hover {
  border-color: var(--clr-primary-glow);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.file-card--folder {
  border-color: rgba(108, 99, 255, 0.25);
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.05) 0%, rgba(108, 99, 255, 0.02) 100%);
}
.file-card--folder:hover {
  border-color: var(--clr-primary);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
}
.file-card.drag-over {
  border-color: var(--clr-primary);
  background: rgba(108, 99, 255, 0.15);
  box-shadow: inset 0 0 10px rgba(108, 99, 255, 0.25);
  transform: scale(1.02);
}
.file-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-card__icon--folder {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.2) 0%, rgba(108, 99, 255, 0.1) 100%);
}
.file-card__icon svg { width: 26px; height: 26px; }
.file-card__name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--clr-text);
  word-break: break-word;
  line-height: 1.35;
  max-height: 2.7rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.file-card__size { font-size: 0.72rem; color: var(--clr-text-tertiary); }
.file-card__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  gap: 4px;
}
.file-card:hover .file-card__actions { display: flex; }
.file-card__action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--clr-surface-raised);
  color: var(--clr-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.file-card__action-btn:hover { background: var(--clr-surface-elevated); color: var(--clr-text); }
.file-card__action-btn.btn-delete:hover { color: var(--clr-danger); background: var(--clr-danger-subtle); }
.file-card__action-btn.btn-folder-delete:hover { color: var(--clr-danger); background: var(--clr-danger-subtle); }
.file-card__action-btn svg { width: 14px; height: 14px; }

/* ---- LIST VIEW ---- */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.file-list-header {
  display: grid;
  grid-template-columns: 40px 1fr 100px 120px;
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--clr-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 4px;
}
.file-list-item {
  display: grid;
  grid-template-columns: 40px 1fr 100px 120px;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--clr-surface);
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  gap: 0 12px;
}
.file-list-item:hover {
  background: var(--clr-surface-elevated);
  border-color: var(--clr-border);
}
.file-list-item--folder {
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.05) 0%, transparent 100%);
  border-color: rgba(108, 99, 255, 0.15);
  cursor: pointer;
}
.file-list-item--folder:hover {
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.12) 0%, rgba(108, 99, 255, 0.05) 100%);
  border-color: var(--clr-primary);
}
.file-list-item.drag-over {
  background: rgba(108, 99, 255, 0.15);
  border-color: var(--clr-primary);
  box-shadow: inset 0 0 8px rgba(108, 99, 255, 0.25);
}
.file-list-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-list-item__icon--folder {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.2) 0%, rgba(108, 99, 255, 0.1) 100%);
}
.file-list-item__icon svg { width: 18px; height: 18px; }
.file-list-item__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-list-item__size { font-size: 0.8rem; color: var(--clr-text-secondary); }
.file-list-item__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.file-list-item__actions .file-card__action-btn { width: 32px; height: 32px; }

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  gap: 12px;
}
.empty-state__title { font-family: var(--font-display); font-size: 1.3rem; color: var(--clr-text); font-weight: 600; }
.empty-state__desc { color: var(--clr-text-secondary); font-size: 0.87rem; max-width: 320px; }

/* ============================================================
   UPLOAD VIEW
   ============================================================ */
.upload-page { max-width: 680px; margin: 0 auto; }
.upload-page__header { text-align: center; margin-bottom: 32px; }
.upload-page__title { font-family: var(--font-display); font-size: 1.6rem; color: var(--clr-text); font-weight: 700; margin-bottom: 6px; }
.upload-page__subtitle { color: var(--clr-text-secondary); font-size: 0.88rem; }

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed var(--clr-border);
  border-radius: var(--radius-xl);
  background: var(--clr-surface);
  padding: 56px 24px;
  text-align: center;
  transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
}
.dropzone:hover, .dropzone--dragover {
  border-color: var(--clr-primary);
  background: var(--clr-primary-subtle);
  box-shadow: 0 0 0 4px var(--clr-primary-glow);
}
.dropzone--dragover .dropzone__content { transform: scale(1.04); }
.dropzone__content { transition: transform var(--transition-base); }
.dropzone__icon { margin: 0 auto 18px; }
.dropzone__title { font-family: var(--font-display); font-size: 1.25rem; color: var(--clr-text); font-weight: 600; margin-bottom: 6px; }
.dropzone__subtitle { color: var(--clr-text-secondary); font-size: 0.87rem; margin-bottom: 10px; }
.dropzone__browse { color: var(--clr-primary); font-weight: 600; }
.dropzone__info { font-size: 0.75rem; color: var(--clr-text-tertiary); }
.dropzone__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Upload queue */
.upload-queue { margin-top: 32px; }
.upload-queue__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.upload-queue__header h3 { font-size: 0.95rem; font-weight: 600; color: var(--clr-text); }
.upload-queue__count { font-size: 0.78rem; color: var(--clr-text-tertiary); background: var(--clr-surface-raised); padding: 3px 9px; border-radius: 20px; }
.upload-queue__list { display: flex; flex-direction: column; gap: 8px; }

.upload-folder-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(108, 99, 255, 0.1);
  border-left: 3px solid var(--clr-primary);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--clr-text-secondary);
  margin-bottom: 12px;
  animation: slideDown 0.3s ease;
}
.upload-folder-context strong {
  color: var(--clr-primary);
  font-weight: 600;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.upload-item {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: itemSlideIn 0.3s ease forwards;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.upload-item:hover {
  border-color: var(--clr-primary-glow);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
@keyframes itemSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.upload-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.upload-item__icon svg { width: 20px; height: 20px; }
.upload-item__info { flex: 1; min-width: 0; }
.upload-item__name { font-size: 0.84rem; font-weight: 500; color: var(--clr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.upload-item__bar-wrap {
  height: 5px;
  background: var(--clr-surface-raised);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.upload-item__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  border-radius: 3px;
  width: 0%;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 6px rgba(108, 99, 255, 0.4);
}
.upload-item__meta { font-size: 0.72rem; color: var(--clr-text-tertiary); margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.upload-item__size { font-weight: 500; }
.upload-item__status-text { opacity: 0.8; }
.upload-item__status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}
.upload-item__status--uploading { color: var(--clr-primary); }
.upload-item__status--done { 
  color: var(--clr-accent);
  font-size: 1rem;
  min-width: auto;
}
.upload-item__status--error { color: var(--clr-danger); }

/* ============================================================
   SETTINGS VIEW
   ============================================================ */
.settings-page { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.settings-page__header { margin-bottom: 4px; }
.settings-page__title { font-family: var(--font-display); font-size: 1.5rem; color: var(--clr-text); font-weight: 700; }

.settings-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.settings-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: 20px;
}
.settings-card__title--danger { color: var(--clr-danger); }
.settings-card__desc { font-size: 0.84rem; color: var(--clr-text-secondary); margin-bottom: 16px; }

/* Profile row */
.settings-card__head { display: flex; align-items: center; gap: 16px; }
.settings-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}
.settings-card__info h3 { font-size: 1rem; font-weight: 600; color: var(--clr-text); margin-bottom: 2px; }
.settings-card__info span { font-size: 0.82rem; color: var(--clr-text-secondary); }

.settings-card--danger { border-color: rgba(252,92,101,0.2); }

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--clr-text-tertiary);
  font-size: 0.68rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
}
.bottom-nav__link:hover { color: var(--clr-text-secondary); }
.bottom-nav__link--active { color: var(--clr-primary); }
.bottom-nav__link svg { width: 20px; height: 20px; }

/* ============================================================
   MODAL DIALOGS
   ============================================================ */
.modal {
  display: flex;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn var(--transition-base);
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.modal__content {
  position: relative;
  background: var(--clr-surface-elevated);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 420px;
  width: 100%;
  animation: slideUp var(--transition-base);
  z-index: 1001;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--clr-border);
}
.modal__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clr-text);
  margin: 0;
}
.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--clr-text-secondary);
  font-size: 24px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.modal__close:hover {
  background: var(--clr-surface-raised);
  color: var(--clr-text);
}
.modal__form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--clr-border);
}
.modal__actions .btn { flex: 1; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-overlay--visible { display: block; animation: overlayFade 0.25s ease forwards; }
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar__close { display: flex; }
  .dashboard__main { margin-left: 0; }
  .topbar__hamburger { display: flex; }

  .file-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .file-list-header,
  .file-list-item { grid-template-columns: 40px 1fr 80px 100px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤640px)
   ============================================================ */
@media (max-width: 640px) {
  .content-area { padding: 16px; padding-bottom: 80px; }
  .bottom-nav { display: flex; }

  .file-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .file-card { padding: 16px 12px 14px; }
  .file-card__actions { display: flex; top: auto; bottom: 10px; right: 10px; }

  .file-list-header { display: none; }
  .file-list-item { grid-template-columns: 40px 1fr auto; }
  .file-list-item__size { display: none; }

  .upload-page { padding: 0; }
  .dropzone { padding: 40px 16px; }

  .settings-page { padding: 0; }
  .settings-card { padding: 18px; }

  .view__toolbar { flex-direction: column; align-items: flex-start; }
  .view__toolbar-right { width: 100%; justify-content: space-between; }

  .toast-container { top: 12px; right: 12px; left: 12px; max-width: none; }

  .auth-card { padding: 30px 22px 24px; }
  .auth-card__title { font-size: 1.45rem; }

  .topbar { padding: 0 14px; }
  .topbar__title { font-size: 1rem; }
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-surface-raised); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-border); }

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
