:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --accent-pink: #f472b6;
  --accent-sky: #38bdf8;
  --accent-mint: #34d399;
  --accent-peach: #fb923c;
  --accent-lilac: #a78bfa;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --sidebar-bg: #f4f8ff;
  --sidebar-text: #334155;
  --sidebar-text-strong: #0f172a;
  --sidebar-hover: rgba(37, 99, 235, 0.08);
  --sidebar-active: #2563eb;
  --logo-yellow: #f6e27a;
  --logo-pink: #f5b6d8;
  --sidebar-width: 268px;
  --header-height: 88px;
  --body-bg: #f3f7fd;
  --card-bg: #ffffff;
  --surface-muted: #f8fafc;
  --table-head: #f1f5f9;
  --border: #e6eaf0;
  --border-strong: #d5dbe6;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.1);
  --font: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.2);
  --page-pad: 28px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(circle at 12% 8%, rgba(59, 130, 246, 0.12), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(14, 165, 233, 0.1), transparent 26%),
    var(--body-bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 400;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}
.skip-link:focus { top: 12px; color: #fff; }

img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  color: #334155;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.14), transparent 40%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 200;
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.04);
  transition: transform 0.28s var(--ease);
}

.sidebar-header {
  min-height: 0;
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover { color: var(--primary); }

.sidebar .brand {
  width: 100%;
  padding: 8px 0 6px;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.sidebar .brand::before,
.sidebar .brand::after {
  content: none;
}

.wordmark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.78;
  font-weight: 800;
  letter-spacing: -0.07em;
  user-select: none;
}
.wm-nat,
.wm-drive {
  display: block;
  font-size: 34px;
}
.wm-nat {
  color: #1d4ed8;
}
.wm-drive {
  font-size: 28px;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wordmark-lg .wm-nat { font-size: 52px; }
.wordmark-lg .wm-drive { font-size: 42px; }

.brand-mark,
.brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 220px;
  margin: 0 auto;
  object-fit: contain;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.sidebar .brand-logo {
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.18));
}
.brand-logo-lg { height: 64px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.brand-text span { font-size: 11px; color: #64748b; font-weight: 500; }

.sidebar-toggle,
.mobile-menu-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--sidebar-text-strong);
  border-radius: 8px;
  display: none;
  place-items: center;
  cursor: pointer;
}

.mobile-menu-btn {
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.sidebar-nav {
  padding: 8px 12px 16px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.nav-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 12px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin-bottom: 2px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}

.nav-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

.nav-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: transparent;
  color: inherit;
}

.nav-ico .icon { width: 15px; height: 15px; }

.nav-home .nav-ico,
.nav-folders .nav-ico,
.nav-files .nav-ico,
.nav-org .nav-ico,
.nav-team .nav-ico,
.nav-activity .nav-ico,
.nav-bell .nav-ico,
.nav-recycle .nav-ico,
.nav-admin .nav-ico,
.nav-share .nav-ico,
.nav-star .nav-ico { background: transparent; color: inherit; }

.nav-link .badge {
  margin-left: auto;
}

.sidebar-storage {
  margin: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
}
.storage-ring-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.storage-ring {
  --p: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(#2563eb calc(var(--p) * 1%), #dbeafe 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.storage-ring::after {
  content: attr(data-label);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #1e293b;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.btn-upgrade {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: 0;
  height: 40px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
}
.btn-upgrade:hover { background: var(--primary-hover); color: #fff; }

.storage-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0;
}

.progress-bar-bg {
  height: 7px;
  background: #e9e4f7;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.card .progress-bar-bg { background: #e2e8f0; }

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: inherit;
  transition: width 0.4s var(--ease);
}

.storage-meta { font-size: 11px; color: #64748b; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 150;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

.canvas-bg {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.canvas-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.7;
}
.canvas-blob-a {
  width: 420px;
  height: 420px;
  top: -140px;
  right: 8%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 68%);
}
.canvas-blob-b {
  width: 360px;
  height: 360px;
  top: 18%;
  left: -80px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.2), transparent 70%);
}
.canvas-blob-c {
  width: 480px;
  height: 480px;
  bottom: -160px;
  right: -60px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 68%);
}
.canvas-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(109, 94, 252, 0.12);
}
.canvas-ring-a {
  width: 220px;
  height: 220px;
  top: 72px;
  right: 18%;
}
.canvas-ring-b {
  width: 140px;
  height: 140px;
  bottom: 18%;
  left: 12%;
  border-color: rgba(56, 189, 248, 0.16);
}
.canvas-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(28, 22, 51, 0.06) 1px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.35), transparent 70%);
  opacity: 0.55;
}

.top-header,
.page-content,
.app-footer {
  position: relative;
  z-index: 1;
}

.top-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left, .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.header-icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.search-box {
  position: relative;
  width: min(420px, 42vw);
}

.search-box .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 72px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: #f8fafc;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.search-box input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

.workspace-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
}

.workspace-badge-super {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eeeaff, #e8f7ff);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid var(--primary-border);
}

.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.user-role-badge,
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: #dbeafe;
  color: #1e40af;
}

.user-role-badge.super-admin { background: #fef3c7; color: #92400e; }
.user-role-badge.manager { background: #ecfdf5; color: #065f46; }
.user-role-badge.standard-user { background: #f1f5f9; color: #475569; }
.status-pill.ok { background: var(--success-soft); color: #065f46; }
.status-pill.off { background: var(--danger-soft); color: #991b1b; }
.status-dot { font-weight: 600; font-size: 13px; }
.status-dot.ok { color: var(--success); }
.status-dot.off { color: var(--danger); }

.page-content { padding: var(--page-pad) var(--page-pad) 32px; flex: 1; }

.app-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px var(--page-pad) 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 550;
  border-top: 1px solid transparent;
}

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

.page-title h2 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.5px;
}
.page-title p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.count-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: #eef2f7;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.link-quiet {
  font-size: 13px;
  font-weight: 600;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-row .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.breadcrumbs-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  font-size: 13.5px;
  box-shadow: var(--shadow-xs);
}

.breadcrumb-item, .breadcrumb-item a { color: var(--text-muted); font-weight: 500; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text); font-weight: 700; }
.breadcrumb-separator { color: #cbd5e1; }

/* Cards / stats / tables */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
}

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

.card-header h3 { font-size: 15px; font-weight: 700; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.welcome-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 32px 34px;
  margin-bottom: 22px;
  border-radius: 28px;
  color: #0f172a;
  background:
    radial-gradient(circle at 12% 18%, rgba(191, 219, 254, 0.9), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.38), transparent 28%),
    radial-gradient(circle at 72% 100%, rgba(37, 99, 235, 0.22), transparent 34%),
    linear-gradient(118deg, #f7fbff 0%, #e0edff 48%, #c7ddff 100%);
  border: 1px solid rgba(147, 197, 253, 0.7);
  box-shadow:
    0 18px 40px rgba(37, 99, 235, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.welcome-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.welcome-orb-a {
  width: 180px;
  height: 180px;
  right: 18%;
  top: -70px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45), transparent 68%);
}
.welcome-orb-b {
  width: 140px;
  height: 140px;
  left: 36%;
  bottom: -80px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.28), transparent 70%);
}
.welcome-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  transform: translateX(-40%);
  animation: welcome-shine 6.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes welcome-shine {
  0%, 55% { transform: translateX(-50%); opacity: 0; }
  70% { opacity: 0.7; }
  100% { transform: translateX(80%); opacity: 0; }
}
@keyframes welcome-float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--r, 0deg)); }
}
.welcome-copy { position: relative; z-index: 1; max-width: 520px; }
.welcome-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(147, 197, 253, 0.8);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.welcome-copy h2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.9px;
  margin-bottom: 8px;
  line-height: 1.15;
}
.welcome-copy em { font-style: normal; color: var(--primary); }
.welcome-copy p { color: #475569; font-size: 14.5px; max-width: 420px; }
.welcome-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}
.welcome-link:hover { color: var(--primary-hover); }
.welcome-actions { position: relative; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.welcome-actions .btn { height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 700; }
.welcome-actions .btn-primary {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32);
}
.btn-ghost {
  background: rgba(255,255,255,0.88);
  color: #1e293b;
  border: 1px solid rgba(147, 197, 253, 0.8);
}
.btn-ghost:hover { background: #fff; color: var(--primary); }
.welcome-art {
  position: relative;
  flex: 1 1 280px;
  min-height: 180px;
  min-width: 280px;
  pointer-events: none;
}
.welcome-hero {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 210px;
  height: 172px;
  margin: -86px 0 0 -105px;
  overflow: visible;
}
.welcome-piece {
  position: absolute;
  overflow: visible;
  filter: drop-shadow(0 10px 12px rgba(37, 99, 235, 0.18));
}
.welcome-piece-folder {
  left: 0;
  top: 54%;
  width: 86px;
  height: 76px;
  margin-top: -20px;
}
.welcome-piece-doc-a {
  left: 18%;
  top: 6px;
  width: 46px;
  height: 56px;
}
.welcome-piece-doc-b {
  right: 8px;
  top: 8px;
  width: 46px;
  height: 56px;
}
.welcome-piece-doc-c {
  right: 4px;
  bottom: 10px;
  width: 42px;
  height: 52px;
}

.page-dashboard .page-title h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 18px 18px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s var(--ease);
}
.stat-card:hover { color: inherit; }
.stat-arrow {
  margin-left: auto;
  color: #c4b5fd;
  font-size: 18px;
  font-weight: 500;
}
.page-dashboard .stat-content { min-width: 0; }
.page-dashboard .stat-content h3 { font-size: 28px; }
.page-dashboard .stat-content p { font-size: 12px; font-weight: 600; }
.stat-delta {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 8px;
}
.stat-wave-violet,
.stat-wave-sky,
.stat-wave-mint,
.stat-wave-amber {
  padding-bottom: 26px;
}
.stat-wave-violet::before,
.stat-wave-sky::before,
.stat-wave-mint::before,
.stat-wave-amber::before,
.stat-wave-violet::after,
.stat-wave-sky::after,
.stat-wave-mint::after,
.stat-wave-amber::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: 140px 100%;
  border-radius: 0 0 22px 22px;
}
.stat-wave-violet::before,
.stat-wave-sky::before,
.stat-wave-mint::before,
.stat-wave-amber::before {
  height: 32px;
  opacity: 0.55;
  animation: stat-wave 10s linear infinite reverse;
}
.stat-wave-violet::after,
.stat-wave-sky::after,
.stat-wave-mint::after,
.stat-wave-amber::after {
  animation: stat-wave 7s linear infinite;
}
@keyframes stat-wave {
  from { background-position: 0 0; }
  to { background-position: -140px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stat-wave-violet::before,
  .stat-wave-sky::before,
  .stat-wave-mint::before,
  .stat-wave-amber::before,
  .stat-wave-violet::after,
  .stat-wave-sky::after,
  .stat-wave-mint::after,
  .stat-wave-amber::after { animation: none; }
}
.stat-wave-violet::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20C35 8 35 8 70 20C105 32 105 32 140 20V40H0Z' fill='%23ddd6fe'/%3E%3C/svg%3E");
}
.stat-wave-violet::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24V40H0Z' fill='%23c4b5fd'/%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24' fill='none' stroke='%23ffffff' stroke-opacity='0.65' stroke-width='1.4'/%3E%3C/svg%3E");
}
.stat-wave-sky::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20C35 8 35 8 70 20C105 32 105 32 140 20V40H0Z' fill='%23dbeafe'/%3E%3C/svg%3E");
}
.stat-wave-sky::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24V40H0Z' fill='%2393c5fd'/%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24' fill='none' stroke='%23ffffff' stroke-opacity='0.65' stroke-width='1.4'/%3E%3C/svg%3E");
}
.stat-wave-mint::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20C35 8 35 8 70 20C105 32 105 32 140 20V40H0Z' fill='%23d1fae5'/%3E%3C/svg%3E");
}
.stat-wave-mint::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24V40H0Z' fill='%236ee7b7'/%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24' fill='none' stroke='%23ffffff' stroke-opacity='0.65' stroke-width='1.4'/%3E%3C/svg%3E");
}
.stat-wave-amber::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20C35 8 35 8 70 20C105 32 105 32 140 20V40H0Z' fill='%23ffedd5'/%3E%3C/svg%3E");
}
.stat-wave-amber::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 40' preserveAspectRatio='none'%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24V40H0Z' fill='%23fdba74'/%3E%3Cpath d='M0 24C35 14 35 14 70 24C105 34 105 34 140 24' fill='none' stroke='%23ffffff' stroke-opacity='0.65' stroke-width='1.4'/%3E%3C/svg%3E");
}
.folder-create-tile {
  flex: 1 1 210px;
  max-width: 300px;
  min-height: 142px;
  border: 1.5px dashed #d8b4fe;
  border-radius: 20px;
  background: rgba(255,255,255,0.55);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
}
.folder-create-tile .create-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3e8ff;
  color: var(--primary);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.folder-create-tile strong { font-size: 14px; }
.folder-create-tile span { font-size: 12px; color: var(--text-muted); }
.folder-create-tile:hover { background: #faf5ff; border-color: var(--primary); }

.dash-bottom {
  display: grid;
  grid-template-columns: 1.7fr 0.7fr;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}
.dash-bottom .storage-overview { margin-top: 0; }
.upgrade-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, #1d4ed8, #38bdf8 70%);
  box-shadow: var(--shadow-sm);
}
.upgrade-card:hover { color: #fff; }
.upgrade-card h3 { font-size: 18px; font-weight: 800; }
.upgrade-card p { color: #e2e8f0; font-size: 13px; margin-bottom: 8px; }

.storage-overview {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-top: 20px;
}
.storage-overview-main { padding: 22px 32px 22px 24px; }
.storage-overview-main h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin-bottom: 14px;
}
.storage-pct {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.storage-pct span { display: block; font-size: 13px; color: var(--text-muted); font-weight: 600; letter-spacing: 0; margin-top: 4px; }
.storage-overview .progress-bar-bg { height: 10px; background: #e2e8f0; margin: 14px 0 8px; }
.storage-overview .progress-bar-fill { background: linear-gradient(90deg, #2563eb, #38bdf8); }
.storage-cats {
  padding: 22px 24px 22px 32px;
  border-left: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  align-content: center;
}
.storage-cat { font-size: 13px; color: var(--text-muted); }
.storage-cat strong { display: block; color: var(--text); margin-top: 2px; }
.storage-cat i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.dot-docs { background: #7c3aed; }
.dot-imgs { background: #22c55e; }
.dot-media { background: #f59e0b; }
.dot-arch { background: #a855f7; }

.files-panel .card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-glow {
  position: absolute;
  width: 130px;
  height: 130px;
  right: -40px;
  bottom: -52px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(109, 94, 252, 0.18), transparent 70%);
  pointer-events: none;
}
.stat-card:nth-child(2) .stat-glow {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
}
.stat-card:nth-child(3) .stat-glow {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18), transparent 70%);
}
.stat-card:nth-child(4) .stat-glow {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2), transparent 70%);
}

.stat-card:hover { box-shadow: var(--shadow-sm); }

.stat-content h3 { font-size: 24px; font-weight: 750; letter-spacing: -0.5px; }
.stat-content p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.stat-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.stat-icon-blue { background: #eeeaff; color: #6d5efc; }
.stat-icon-emerald { background: #e8faf3; color: #10b981; }
.stat-icon-purple { background: #e8f7ff; color: #0ea5e9; }
.stat-icon-amber { background: #fff4e5; color: #f59e0b; }

.split-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.category-tile {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.category-tile .label { font-size: 12px; color: var(--text-muted); }
.category-tile .value { font-weight: 700; margin-top: 4px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  font-size: 14px;
}

.detail-grid .span-2 { grid-column: span 2; }
.field-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-value { font-weight: 600; margin-top: 4px; }

.table-responsive { width: 100%; overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

table.data-table th {
  padding: 10px 12px;
  background: var(--table-head);
  color: var(--text-muted);
  font-weight: 650;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: #1e293b;
  vertical-align: middle;
}

table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background 0.12s ease; }
table.data-table tbody tr:hover td { background: var(--surface-muted); }
table.data-table tbody tr.clickable-row { cursor: pointer; }
table.data-table tbody tr.clickable-row:hover td { background: var(--primary-soft); }
table.data-table tbody tr.clickable-row a.member-name-link {
  color: inherit;
  text-decoration: none;
}
table.data-table tbody tr.clickable-row a.member-name-link:hover {
  color: var(--primary, #4f46e5);
}

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Folder list */
.folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

.folder-tab-card {
  --folder-bg: #eef0fd;
  --folder-border: #dce2fa;
  flex: 1 1 230px;
  max-width: 320px;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s var(--ease);
}

.folder-tab-card:hover {
  transform: translateY(-4px);
  color: inherit;
}

.folder-tab {
  width: 46%;
  min-width: 96px;
  max-width: 140px;
  height: 16px;
  margin-bottom: -1.5px;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  background: var(--folder-bg);
  border: 1.5px solid var(--folder-border);
  border-bottom: 0;
  position: relative;
  z-index: 2;
}

.folder-tab-body {
  background: var(--folder-bg);
  border: 1.5px solid var(--folder-border);
  border-radius: 0 18px 18px 18px;
  padding: 12px 16px 14px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: box-shadow 0.2s var(--ease);
}

.folder-tab-card:hover .folder-tab-body {
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12);
}

.folder-tab-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2px;
}

.folder-tab-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
  line-height: 1.35;
  margin: 4px 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-tab-title a {
  color: inherit;
}

.folder-tab-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  margin-left: -6px;
  color: #fff;
}

.avatar-stack .avatar-pill:first-child { margin-left: 0; }
.avatar-stack .avatar-more {
  background: #f1f5f9;
  color: #475569;
  font-size: 9px;
}

.folder-item-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.folder-tab-dots {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.folder-tab-dots:hover {
  background: #fff;
  color: var(--text);
}

.folder-row {
  display: none;
}

.folder-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
}

.folder-row-main { min-width: 0; }
.folder-row-main h4 {
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.folder-row-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-muted);
  color: #475569;
}

.badge-pill.shared { background: var(--success-soft); color: #065f46; }
.badge-pill.restricted { background: var(--danger-soft); color: #991b1b; }

.file-item-flex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-item-flex a {
  font-weight: 600;
  color: var(--text);
}
.file-item-flex a:hover { color: var(--primary); }

.file-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.file-icon-pdf { background: #fee2e2; color: #dc2626; }
.file-icon-doc { background: #dbeafe; color: #2563eb; }
.file-icon-zip { background: #fef3c7; color: #d97706; }
.file-icon-img { background: #dcfce7; color: #16a34a; }
.file-icon-folder { background: #fef9c3; color: #ca8a04; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}
.activity-time { font-size: 12px; color: #94a3b8; margin-left: auto; white-space: nowrap; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
}

.empty-state h3 { color: var(--text); font-size: 17px; margin: 8px 0; }
.empty-state p { max-width: 420px; margin: 0 auto 16px; font-size: 14px; }
.empty-state.embedded {
  border: 0;
  background: transparent;
  padding: 36px 16px;
  box-shadow: none;
}
.empty-illu {
  width: 72px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 8px 12px 12px 12px;
  background: linear-gradient(180deg, #e9d5ff, #a855f7);
  position: relative;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
}
.empty-illu::before {
  content: "";
  position: absolute;
  left: 0;
  top: -10px;
  width: 28px;
  height: 14px;
  border-radius: 6px 8px 0 0;
  background: #c084fc;
}

.entity-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.entity-banner-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.entity-banner h2 { font-size: 20px; font-weight: 750; margin-bottom: 6px; }

.preview-stage {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.preview-stage iframe {
  width: 100%;
  height: 620px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.preview-stage img {
  max-height: 520px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

/* Buttons / forms / alerts */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: #f8fafc; color: var(--text); }

.btn-danger-outline { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-soft); }

.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 32px; padding: 0; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface-muted);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

textarea.form-control,
input[type="file"].form-control {
  height: auto;
  padding: 10px 12px;
}

.form-control:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.inline-field { display: flex; gap: 8px; }

.alert-container { margin-bottom: 16px; }
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeSlide 0.28s var(--ease);
}
.alert-success { background: var(--success-soft); border: 1px solid #a7f3d0; color: #065f46; }
.alert-danger, .alert-error { background: var(--danger-soft); border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-soft); border: 1px solid #fde68a; color: #92400e; }
.alert-info { background: var(--primary-soft); border: 1px solid #bfdbfe; color: #1e40af; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-wrapper { position: relative; }
.btn-three-dots, .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-three-dots:hover, .icon-btn:hover { background: #f1f5f9; color: var(--text); }

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  min-width: 196px;
  z-index: 50;
  overflow: hidden;
  padding: 6px;
}

.dropdown-menu.show { display: block; animation: fadeSlide 0.14s var(--ease); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-radius: 8px;
}

.dropdown-item:hover { background: #f8fafc; color: var(--text); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { background: var(--danger-soft); }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.modal-overlay.show, .modal-overlay[style*="flex"] { display: flex; }

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeSlide 0.2s var(--ease);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close-btn {
  border: 0;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: fadeSlide 0.2s var(--ease);
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(109, 94, 252, 0.22), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(56, 189, 248, 0.18), transparent 28%),
    radial-gradient(circle at 80% 90%, rgba(244, 114, 182, 0.16), transparent 30%),
    #f4f0fb;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.auth-showcase {
  padding: 40px 48px 48px;
  display: flex;
  flex-direction: column;
}

.auth-brand { margin-bottom: 48px; }

.auth-kicker {
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  margin-bottom: 16px;
}

.auth-showcase-copy h1 {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.12;
  max-width: 520px;
  margin-bottom: 14px;
}

.auth-showcase-copy p {
  max-width: 440px;
  color: var(--text-muted);
  font-size: 16px;
}

.auth-preview {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 40px;
}

.auth-preview .folder-tab-card {
  flex: 1 1 160px;
  max-width: 210px;
  min-width: 150px;
  pointer-events: none;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(109, 94, 252, 0.12);
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-card h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.auth-subtitle {
  color: var(--text-muted);
  margin: 6px 0 22px;
}

.auth-form .form-group { margin-bottom: 16px; }

.auth-input {
  height: 48px;
  border-radius: 14px;
  background: #f7f5ff;
  border-color: #e6e0f5;
}

.auth-submit {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  margin-top: 8px;
  font-size: 15px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.login-screen { min-height: 100vh; }

.plan-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.member-profile-nav { margin-bottom: 8px; }
.member-back {
  display: inline-block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.member-back:hover { color: var(--primary); }
.member-profile-nav .page-title h2 { font-size: 22px; }
.member-profile-nav .page-title p { margin: 0; }

.member-hero,
.member-info-card,
.member-folders-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
  overflow: hidden;
}

.member-hero-top {
  height: 92px;
  background:
    linear-gradient(135deg, rgba(109, 94, 252, 0.92), rgba(56, 189, 248, 0.75) 55%, rgba(244, 114, 182, 0.7));
}

.member-hero-body {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 0 24px 18px;
  margin-top: -36px;
}

.member-avatar-xl {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background: #fff;
  color: var(--primary);
  font-size: 32px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(109, 94, 252, 0.2);
  flex-shrink: 0;
}

.member-hero-copy { min-width: 0; padding-bottom: 4px; }
.member-hero-copy h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.member-hero-copy p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 4px 0 10px;
}
.member-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.member-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 18px 18px;
}
.member-stat {
  background: #f8f6ff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.member-stat-value {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.member-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.member-info-card,
.member-folders-card { padding: 18px 22px 20px; }
.member-info-card .card-header,
.member-folders-card .card-header { margin-bottom: 14px; }

.member-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.member-info-item {
  background: #faf9ff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 76px;
}
.member-info-item .field-label { margin-bottom: 6px; }
.member-info-item .field-value { font-size: 15px; word-break: break-word; }
.member-email { font-weight: 650; color: var(--primary); }

.member-folder-grid { margin-bottom: 0; }
.member-folder-grid .folder-tab-card { text-decoration: none; color: inherit; }

@media (max-width: 900px) {
  .member-stat-row,
  .member-info-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .member-hero-body { flex-direction: column; align-items: flex-start; padding-top: 8px; }
  .member-stat-row,
  .member-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .dash-bottom { grid-template-columns: 1fr; }
  .welcome-art { display: none; }
  .welcome-banner { flex-wrap: wrap; }
  .storage-overview { grid-template-columns: 1fr; }
  .storage-cats { border-left: 0; border-top: 1px solid var(--border); }
  .split-grid, .category-grid { grid-template-columns: 1fr 1fr; }
  .search-box { width: 240px; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { margin-left: 0; }
  .mobile-menu-btn { display: grid; }
  .user-info, .search-kbd, .workspace-badge { display: none; }
  .search-box { width: min(100%, 220px); }
  .page-content { padding: 18px 14px 36px; }
  .split-grid, .form-row, .detail-grid, .auth-shell, .login-screen { grid-template-columns: 1fr; }
  .folder-tab-card { max-width: none; min-width: 0; flex: 1 1 calc(50% - 10px); }
  .auth-showcase { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-panel { min-height: 100vh; padding: 20px; }
  .auth-card { padding: 28px 22px; }
  .category-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .top-header { padding: 0 12px; }
  .page-title h2 { font-size: 20px; }
  .folder-tab-card { flex: 1 1 100%; }
  .page-content, .app-footer { padding-left: 14px; padding-right: 14px; }
  .app-footer { flex-direction: column; gap: 4px; }
}

.dash-stage { position: relative; }
.dash-floaters {
  pointer-events: none;
  position: absolute;
  inset: -12px 0 auto 0;
  height: 220px;
  z-index: 0;
}
.dash-chip {
  position: absolute;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 30px rgba(109, 94, 252, 0.08);
  backdrop-filter: blur(8px);
}
.dash-chip-1 {
  width: 72px;
  height: 72px;
  top: 8px;
  right: 8%;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(238, 234, 255, 0.9), rgba(232, 247, 255, 0.7));
}
.dash-chip-2 {
  width: 46px;
  height: 46px;
  top: 58px;
  right: 22%;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(253, 242, 248, 0.9), rgba(255, 237, 213, 0.7));
}
.dash-chip-3 {
  width: 28px;
  height: 28px;
  top: 18px;
  right: 31%;
  border-radius: 10px;
  transform: rotate(18deg);
  background: linear-gradient(145deg, rgba(224, 231, 255, 0.95), rgba(204, 251, 241, 0.7));
}
.page-dashboard .page-header,
.page-dashboard .stats-grid {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .dash-floaters, .canvas-ring { display: none; }
}

.error-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.error-wrap {
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.error-brand { margin: 0 auto 28px; display: inline-flex; }
.error-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-md);
}
.error-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 8px;
}
.error-code {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 8px 0 10px;
}
.error-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  color: var(--text);
}
.error-copy {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 38ch;
  margin: 0 auto 24px;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.error-hint {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
