/* ============================================================
   SG Cloud · Design System
   ============================================================ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:           #080d1a;
  --bg-2:         #0e1525;
  --bg-card:      rgba(255,255,255,0.04);
  --bg-card-h:    rgba(255,255,255,0.07);
  --border:       rgba(255,255,255,0.08);
  --border-h:     rgba(255,255,255,0.16);
  --primary:      #6366f1;
  --primary-h:    #5254cc;
  --primary-glow: rgba(99,102,241,0.3);
  --accent:       #06b6d4;
  --success:      #10b981;
  --danger:       #ef4444;
  --danger-h:     #dc2626;
  --warning:      #f59e0b;
  --text:         #f1f5f9;
  --text-muted:   #64748b;
  --text-soft:    #94a3b8;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:       12px;
  --radius-lg:    20px;
  --radius-full:  9999px;
  --shadow:       0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.5);
  --sidebar-w:    260px;
  --topbar-h:     60px;
  --transition:   .2s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, select, textarea { font-family: var(--font); }
ul, ol { list-style: none; }

/* ── Utilidades ─────────────────────────────────────────── */
.sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.hidden  { display: none !important; }
.mt-2    { margin-top: .5rem; }
.mb-1    { margin-bottom: 1rem; }
.py-lg   { padding-top: 2rem; padding-bottom: 3rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Fondo animado ──────────────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .18;
  animation: orb-float 20s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: #6366f1; top: -200px; left: -150px; animation-delay: 0s; }
.orb-2 { width: 500px; height: 500px; background: #06b6d4; bottom: -200px; right: -100px; animation-delay: -7s; }
.orb-3 { width: 400px; height: 400px; background: #8b5cf6; top: 40%; left: 40%; animation-delay: -14s; }

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -60px) scale(1.05); }
  66%       { transform: translate(-30px, 40px) scale(.95); }
}

/* ── Layout público ─────────────────────────────────────── */
.layout-public { display: flex; flex-direction: column; }
.layout-public .topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,13,26,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
}
.layout-public .topbar .container {
  height: 100%;
  display: flex;
  align-items: center;
}
.layout-public .main {
  position: relative;
  z-index: 1;
  flex: 1;
}

/* ── Layout admin ───────────────────────────────────────── */
.layout-admin { display: flex; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(14,21,37,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: .75rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .875rem;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--bg-card-h); }
.nav-item.active { color: var(--primary); background: rgba(99,102,241,.12); }
.icon-ext { margin-left: auto; opacity: .5; }

.sidebar-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.user-info { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name  { font-size: .8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: .6875rem; color: var(--text-muted); }
.btn-logout {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,.1); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 199;
}

.admin-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.admin-topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(8,13,26,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.sidebar-toggle {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-soft);
  transition: all var(--transition);
}
.sidebar-toggle svg { width: 20px; height: 20px; }
.sidebar-toggle:hover { color: var(--text); background: var(--bg-card-h); }

.topbar-right { display: flex; align-items: center; gap: 1rem; }
.client-badge {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8125rem; font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: .375rem .875rem;
  border-radius: var(--radius-full);
}
.client-badge svg { width: 14px; height: 14px; color: var(--primary); }

.admin-content .main { flex: 1; }

/* ── Brand ──────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: .625rem;
  font-size: 1.0625rem; font-weight: 700;
  color: var(--text);
}
.brand-icon { width: 26px; height: 26px; color: var(--primary); }

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500;
  transition: all var(--transition);
  line-height: 1;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 0 var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-h);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-h); transform: translateY(-1px); }

.btn-ghost {
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-card-h); border-color: var(--border-h); }

.btn-outline {
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: rgba(99,102,241,.1); }

.btn-full { width: 100%; }
.btn-lg   { padding: .8125rem 1.5rem; font-size: .9375rem; }
.btn-sm   { padding: .4375rem .875rem; font-size: .8125rem; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ── Iconos de acción ───────────────────────────────────── */
.btn-icon {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: all var(--transition);
  color: var(--text-muted);
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-download:hover { color: var(--accent); background: rgba(6,182,212,.1); }
.btn-delete:hover   { color: var(--danger); background: rgba(239,68,68,.1); }

/* ── Formularios ────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-label  { font-size: .8125rem; font-weight: 500; color: var(--text-soft); }
.input-wrapper { position: relative; }
.input-icon  {
  position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.form-input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9375rem;
  padding: .75rem 1rem .75rem 2.75rem;
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:hover  { border-color: var(--border-h); }
.form-input:focus  { border-color: var(--primary); background: rgba(99,102,241,.06); box-shadow: 0 0 0 3px var(--primary-glow); }

.toggle-password {
  position: absolute; right: .875rem; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--text-muted); transition: color var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.toggle-password svg { width: 16px; height: 16px; }
.toggle-password:hover { color: var(--text); }

/* ── Alertas ─────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  animation: slide-down .2s ease;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.25);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25); color: #6ee7b7; }

/* ── Login ──────────────────────────────────────────────── */
.login-section {
  min-height: calc(100vh - var(--topbar-h));
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
  position: relative; z-index: 1;
}

.login-card {
  width: 100%; max-width: 420px;
  background: rgba(14,21,37,.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px var(--primary-glow);
}
.login-logo svg { width: 30px; height: 30px; color: #fff; }

.login-title    { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: .375rem; }
.login-subtitle { color: var(--text-muted); text-align: center; font-size: .875rem; margin-bottom: 1.75rem; }

/* ── Cabecera de página ─────────────────────────────────── */
.page-header {
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.page-header-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(6,182,212,.2));
  border: 1px solid rgba(99,102,241,.3);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.page-header-icon svg { width: 24px; height: 24px; color: var(--primary); }
.page-title    { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.page-subtitle { color: var(--text-muted); font-size: .875rem; margin-top: .2rem; }
.page-header-actions { margin-left: auto; }

/* ── Zona de carga ──────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  margin-bottom: 1.5rem;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99,102,241,.06);
  transform: translateY(-1px);
}
.upload-zone.drag-over { box-shadow: 0 0 0 4px var(--primary-glow); }

.upload-zone-content { pointer-events: none; }
.upload-zone-icon {
  width: 56px; height: 56px;
  background: rgba(99,102,241,.12);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  transition: all var(--transition);
}
.upload-zone:hover .upload-zone-icon,
.upload-zone.drag-over .upload-zone-icon {
  background: rgba(99,102,241,.22);
}
.upload-zone-icon svg { width: 26px; height: 26px; color: var(--primary); }
.upload-title { font-size: 1rem; font-weight: 600; margin-bottom: .375rem; }
.upload-hint  { font-size: .8125rem; color: var(--text-muted); }
.upload-zone label { pointer-events: all; }

/* ── Cola de subida ─────────────────────────────────────── */
.upload-queue {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.upload-item {
  padding: .875rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  border-bottom: 1px solid var(--border);
  animation: slide-down .2s ease;
}
.upload-item:last-child { border-bottom: none; }

.upload-item-name { flex: 1; font-size: .875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-size { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }
.upload-item-status { flex-shrink: 0; font-size: .75rem; font-weight: 500; }
.upload-item-status.uploading { color: var(--accent); }
.upload-item-status.done      { color: var(--success); }
.upload-item-status.error     { color: var(--danger); }

.upload-progress-bar {
  height: 3px; background: var(--border); border-radius: var(--radius-full);
  overflow: hidden; flex: 1;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: width .1s linear;
  width: 0%;
}

/* ── Sección / cabecera de tabla ────────────────────────── */
.section-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; gap: .625rem;
}
.badge {
  background: rgba(99,102,241,.15);
  color: var(--primary);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius-full);
  padding: .125rem .625rem;
  font-size: .75rem; font-weight: 600;
}
#refresh-btn { margin-left: auto; }

/* ── Cuadrícula de archivos (público) ───────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .875rem;
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .75rem;
  transition: all var(--transition);
  animation: fade-in .25s ease;
  position: relative;
}
.file-card:hover {
  background: var(--bg-card-h);
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.file-card-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.file-card-icon svg { width: 36px; height: 36px; }
.file-card-info { width: 100%; }
.file-name {
  display: block; font-size: .8125rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  width: 100%;
}
.file-meta { font-size: .7rem; color: var(--text-muted); display: block; margin-top: .2rem; }

/* ── Tabla de archivos (admin) ──────────────────────────── */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.file-table { width: 100%; border-collapse: collapse; }
.file-table thead th {
  background: rgba(255,255,255,.03);
  color: var(--text-muted);
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  padding: .875rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.th-size, .td-size { width: 90px; }
.th-date, .td-date { width: 140px; }
.th-actions, .td-actions { width: 100px; text-align: right; }

.file-row {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  animation: fade-in .2s ease;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg-card-h); }

.file-row td { padding: .875rem 1.25rem; font-size: .875rem; vertical-align: middle; }
.td-size  { color: var(--text-muted); font-size: .8125rem; }
.td-date  { color: var(--text-muted); font-size: .8125rem; }
.td-actions { display: flex; align-items: center; justify-content: flex-end; gap: .25rem; }

.file-cell { display: flex; align-items: center; gap: .875rem; }
.file-cell-icon { flex-shrink: 0; }
.file-cell-info { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.file-cell-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }

.file-ext-badge {
  font-size: .625rem; font-weight: 700; letter-spacing: .04em;
  padding: .1875rem .5rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ── Estado vacío ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.empty-state svg { width: 48px; height: 48px; opacity: .3; }
.empty-state p   { font-weight: 500; font-size: .9375rem; }
.empty-state span { font-size: .8125rem; }

/* ── Toast notifications ─────────────────────────────────── */
.toast-container {
  position: fixed; top: 1.25rem; right: 1.25rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: .625rem;
  pointer-events: none;
}

.toast {
  pointer-events: all;
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1.125rem;
  background: rgba(14,21,37,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 400px;
  font-size: .875rem;
  animation: toast-in .25s ease;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.toast-out { opacity: 0; transform: translateX(20px); }

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: .125rem; line-height: 1;
  transition: color var(--transition);
}
.toast-close:hover { color: var(--text); }
.toast-close svg { width: 14px; height: 14px; }

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  }
.toast-info    { border-left: 3px solid var(--primary);  }
.toast-warning { border-left: 3px solid var(--warning);  }

.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger);  }
.toast-info    .toast-icon { color: var(--primary);  }
.toast-warning .toast-icon { color: var(--warning);  }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }

.modal {
  background: #0e1525;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%; max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(.95);
  transition: transform var(--transition);
}
.modal-overlay.visible .modal { transform: scale(1); }

.modal-icon {
  width: 56px; height: 56px;
  background: rgba(239,68,68,.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}
.modal-icon svg { width: 26px; height: 26px; color: var(--danger); }
.modal-title  { font-size: 1.125rem; font-weight: 700; margin-bottom: .5rem; }
.modal-body   { color: var(--text-soft); font-size: .875rem; margin-bottom: 1.5rem; line-height: 1.6; }
.modal-actions { display: flex; gap: .75rem; justify-content: center; }
.modal-actions .btn { flex: 1; max-width: 160px; }

/* ── Error page ──────────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.error-code    { font-size: 6rem; font-weight: 800; opacity: .15; line-height: 1; }
.error-message { color: var(--text-soft); margin: .5rem 0 1.5rem; }

/* ── Animaciones ─────────────────────────────────────────── */
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in   { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Botón volver ────────────────────────────────────────── */
.back-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.back-btn svg { width: 18px; height: 18px; }
.back-btn:hover { color: var(--text); background: var(--bg-card-h); border-color: var(--border-h); }

/* ── Agrupación por mes ──────────────────────────────────── */
.month-group { margin-bottom: 2.5rem; }
.month-header {
  display: flex; align-items: center; gap: .75rem;
  font-size: .8125rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 1rem;
}
.month-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Dashboard de clientes ───────────────────────────────── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: all var(--transition);
  animation: fade-in .2s ease;
}
.client-card:hover { background: var(--bg-card-h); border-color: var(--border-h); transform: translateY(-2px); box-shadow: var(--shadow); }
.client-card--inactive { opacity: .6; }

.client-card-header { display: flex; align-items: center; justify-content: space-between; }

.client-avatar {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(6,182,212,.25));
  border: 1px solid rgba(99,102,241,.3);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: .8125rem; font-weight: 700; color: var(--primary);
  letter-spacing: .05em;
}

.client-status { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--text-muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot--active   { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot--inactive { background: var(--text-muted); }

.client-name { font-size: 1rem; font-weight: 600; line-height: 1.3; }

.client-meta { display: flex; flex-direction: column; gap: .375rem; }
.meta-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8125rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.meta-item code {
  font-family: 'Courier New', monospace;
  font-size: .75rem;
  color: var(--accent);
  background: rgba(6,182,212,.1);
  padding: .1rem .4rem;
  border-radius: 4px;
}

.client-card-footer { display: flex; align-items: center; gap: .5rem; margin-top: auto; }
.client-card-footer .btn-primary { flex: 1; }

/* ── Código en badge del topbar ──────────────────────────── */
.badge-code {
  font-family: 'Courier New', monospace;
  font-size: .6875rem;
  opacity: .7;
  margin-left: .25rem;
}

/* ── Truncar nombre en nav ───────────────────────────────── */
.nav-item-truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 140px;
}

/* ── Botón copiar enlace ─────────────────────────────────── */
.btn-copy-link { color: var(--text-muted); }
.btn-copy-link:hover { color: var(--success); background: rgba(16,185,129,.1); }

/* ── Responsive dashboard ────────────────────────────────── */
@media (max-width: 768px) {
  .client-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.visible { display: block; }
  .sidebar-toggle { display: flex; }
  .admin-content { margin-left: 0; }

  .page-header { gap: .875rem; }
  .page-header-actions { width: 100%; order: 3; }

  .file-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .th-date, .td-date { display: none; }
  .th-size, .td-size { display: none; }

  .file-cell-name { max-width: 180px; }

  .login-card { padding: 1.75rem; }

  .toast-container { right: .75rem; left: .75rem; }
  .toast { min-width: unset; max-width: unset; }
}
