@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --black:       #020405;
  --white:       #ffffff;
  --gold:        #b57d1a;
  --gold-light:  #d4a843;
  --gold-dark:   #8a5e13;
  --gold-muted:  #f5ead8;
  --gray-50:     #f8f8f8;
  --gray-100:    #f0f0f0;
  --gray-200:    #e2e2e2;
  --gray-300:    #c8c8c8;
  --gray-400:    #9a9a9a;
  --gray-500:    #707070;
  --gray-700:    #3a3a3a;
  --danger:      #c0392b;
  --danger-light:#fdf0ef;
  --success:     #1e7e4e;
  --success-light:#edfaf3;
  --warning:     #c47d08;
  --warning-light:#fef9ec;
  --info:        #1a5b8a;
  --info-light:  #edf4fb;

  --sidebar-w:   260px;
  --header-h:    64px;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 4px rgba(2,4,5,.08);
  --shadow:      0 2px 12px rgba(2,4,5,.1);
  --shadow-lg:   0 8px 32px rgba(2,4,5,.16);
  --transition:  all 0.2s ease;

  --font-sans:   'Montserrat', sans-serif;
  --font-serif:  'EB Garamond', serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
button { cursor: pointer; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }
img { max-width: 100%; }
ul, ol { list-style: none; }

/* ── Typography ────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-weight: 600; }
small { font-size: 0.8rem; }

/* ── Utility classes ───────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--gray-500); }
.text-gold { color: var(--gold); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-semibold { font-weight: 600; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }
.grid { display: grid; }

/* ── Login Page ────────────────────────────────────────────────────────────── */
#page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  position: relative;
  overflow: hidden;
}
#page-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(181,125,26,.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(181,125,26,.08) 0%, transparent 60%);
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .firm-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--black);
  display: block;
  line-height: 1.2;
}
.login-logo .firm-sub {
  font-size: 0.75rem;
  color: var(--gray-400);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  display: block;
}
.login-logo .gold-bar {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 0.75rem auto 0;
}

.login-card h2 {
  font-size: 1.1rem;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--black);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(181,125,26,.12);
}
.form-group input.error,
.form-group select.error {
  border-color: var(--danger);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--gold);
  color: var(--white);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(181,125,26,.3);
}
.btn-dark {
  background: var(--black);
  color: var(--white);
}
.btn-dark:hover:not(:disabled) {
  background: var(--gray-700);
}
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover:not(:disabled) {
  background: var(--gold-muted);
}
.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--black);
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) {
  background: #a93226;
}
.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.8rem 2rem;
  font-size: 1rem;
}
.btn-icon {
  padding: 0.4rem;
  background: transparent;
  border: none;
  color: var(--gray-400);
  border-radius: var(--radius);
}
.btn-icon:hover { background: var(--gray-100); color: var(--black); }

/* ── App layout ────────────────────────────────────────────────────────────── */
#app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--white);
  line-height: 1.2;
}
.sidebar-logo span {
  display: block;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  color: var(--gray-400);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}
.sidebar-gold {
  width: 32px;
  height: 1.5px;
  background: var(--gold);
  margin-top: 0.5rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 0.75rem 1.25rem 0.35rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,.65);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: var(--white);
}
.nav-item.active {
  background: rgba(181,125,26,.15);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-info .user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info .user-role {
  font-size: 0.7rem;
  color: var(--gray-400);
  text-transform: capitalize;
}
.logout-btn {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
}
.logout-btn:hover { color: var(--danger); background: rgba(192,57,43,.15); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--black);
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Search */
.search-container {
  position: relative;
}
.search-input {
  padding: 0.5rem 0.9rem 0.5rem 2.2rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  width: 240px;
  outline: none;
  transition: var(--transition);
  background: var(--gray-50);
}
.search-input:focus {
  border-color: var(--gold);
  background: var(--white);
  width: 300px;
  box-shadow: 0 0 0 3px rgba(181,125,26,.1);
}
.search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.9rem;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
}
.search-result-item {
  padding: 0.7rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--gray-50); }
.search-result-item .result-name { font-weight: 600; font-size: 0.9rem; }
.search-result-item .result-meta { font-size: 0.75rem; color: var(--gray-500); }

/* Page content */
.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
}
.card-body {
  padding: 1.25rem 1.5rem;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}
.stat-card .stat-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--black);
  line-height: 1;
}
.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}
.stat-card.gold .stat-value { color: var(--gold); }
.stat-card.success .stat-value { color: var(--success); }

/* ── Table ─────────────────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: var(--white);
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody td {
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  color: var(--black);
  vertical-align: middle;
}

/* ── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-gold { background: var(--gold-muted); color: var(--gold-dark); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: var(--gray-100); color: var(--gray-500); }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
  gap: 0;
}
.tab-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--black); }
.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,4,5,.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 720px; }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-family: var(--font-serif);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--gray-400);
  padding: 0.25rem;
  border-radius: 4px;
  line-height: 1;
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: var(--danger-light); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ── Alert / Toast ─────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  background: var(--black);
  color: var(--white);
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--gold);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Alert inline ──────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(192,57,43,.2); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(30,126,78,.2); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(196,125,8,.2); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid rgba(26,91,138,.2); }

/* ── File manager ──────────────────────────────────────────────────────────── */
.file-folders {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.folder-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-700);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
}
.folder-chip.active {
  background: var(--gold-muted);
  color: var(--gold-dark);
  border-color: var(--gold);
}
.folder-chip:hover:not(.active) { background: var(--gray-200); }

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.file-item {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  transition: var(--transition);
  cursor: default;
}
.file-item:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.file-icon { font-size: 2.5rem; }
.file-name {
  font-size: 0.75rem;
  font-weight: 500;
  word-break: break-all;
  max-height: 2.4em;
  overflow: hidden;
}
.file-meta { font-size: 0.68rem; color: var(--gray-400); }
.file-actions { display: flex; gap: 0.35rem; margin-top: 0.25rem; }

/* ── Upload zone ───────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--gray-500);
  transition: var(--transition);
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-muted);
  color: var(--gold-dark);
}
.upload-zone input[type="file"] { display: none; }

/* ── Reminders ─────────────────────────────────────────────────────────────── */
.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.reminder-item:last-child { border-bottom: none; }
.reminder-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.reminder-check.done {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
  font-size: 0.7rem;
}
.reminder-text { flex: 1; }
.reminder-text .title { font-size: 0.9rem; font-weight: 500; }
.reminder-text .due {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.15rem;
}
.reminder-text .due.overdue { color: var(--danger); font-weight: 600; }

/* ── History timeline ──────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--gray-200);
}
.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--gold);
}
.timeline-item .tl-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timeline-item .tl-desc { font-size: 0.875rem; margin-top: 0.15rem; }
.timeline-item .tl-meta { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.25rem; }

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray-400);
  gap: 0.75rem;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--black);
  padding: 0.25rem;
  cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .menu-toggle { display: block; }
  .search-input { width: 180px; }
  .search-input:focus { width: 220px; }
  .page-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 1.25rem 0;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--black);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
  margin-left: 0.5rem;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.page-info { font-size: 0.8rem; color: var(--gray-500); flex: 1; }

/* ── Page transitions ──────────────────────────────────────────────────────── */
.page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Casillero / Expediente ────────────────────────────────────────────────── */
.expediente-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.expediente-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.expediente-tipo-badge {
  background: var(--gold-muted);
  color: var(--gold-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Casillero table */
.casillero-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.casillero-table th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.casillero-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.casillero-table tr:last-child td { border-bottom: none; }
.casillero-table tr:hover td { background: var(--gray-50); }

/* Casillero cell */
.casillero-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 80px;
}
.casillero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.casillero-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold-muted);
}
.casillero-btn.stamped {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
  cursor: default;
}
.casillero-btn.stamped-immutable {
  border-color: var(--gold);
  background: var(--gold-muted);
  color: var(--gold-dark);
  cursor: default;
}
.casillero-btn.reverted {
  border-color: var(--gray-300);
  background: var(--gray-50);
  color: var(--gray-400);
  text-decoration: line-through;
  cursor: default;
}
.casillero-meta {
  font-size: 0.65rem;
  color: var(--gray-400);
  line-height: 1.2;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.casillero-alert {
  font-size: 0.7rem;
  color: var(--warning);
  font-weight: 600;
}

/* Pedido badge */
.pedido-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--info-light);
  color: var(--info);
}

/* Acta section */
.acta-section {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.acta-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.acta-section-title {
  font-weight: 600;
  font-size: 0.875rem;
  flex: 1;
}

/* Bitácora */
.bitacora-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.bitacora-item {
  background: var(--gray-50);
  border-left: 3px solid var(--gold);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.bitacora-text {
  font-size: 0.9rem;
  white-space: pre-wrap;
  margin-bottom: 0.35rem;
}
.bitacora-meta {
  font-size: 0.72rem;
  color: var(--gray-400);
}

/* Turno consular */
.turno-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.turno-field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
  display: block;
  margin-bottom: 0.25rem;
}
.turno-field input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.turno-field input:focus {
  outline: none;
  border-color: var(--gold);
}

/* Alert banners inside expediente */
.exp-alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.exp-alert-warn { background: var(--warning-light); color: var(--warning); }
.exp-alert-info { background: var(--info-light); color: var(--info); }
.exp-alert-success { background: var(--success-light); color: var(--success); }

/* ── File preview — lightbox & PDF viewer ──────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,4,5,.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-inner img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lightbox-inner iframe,
.lightbox-inner .pdf-viewer {
  width: 80vw;
  height: 82vh;
  border: none;
  border-radius: var(--radius);
  background: var(--white);
}
.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-caption {
  color: rgba(255,255,255,.6);
  font-size: 0.8rem;
  margin-top: 0.6rem;
  text-align: center;
}

/* Servicio contratado badge in client list */
.servicio-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--gold-muted);
  color: var(--gold-dark);
  white-space: nowrap;
}

/* ── Acta compacta (tabla nueva) ───────────────────────────────────────────── */
.acta-compact-list {
  display: flex;
  flex-direction: column;
}
.acta-compact {
  border-bottom: 1px solid var(--gray-100);
}
.acta-compact:last-child { border-bottom: none; }
.acta-compact-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.acta-compact-row:hover { background: var(--gray-50); }
.acta-compact.expanded .acta-compact-row { background: var(--gold-muted); }
.acta-chevron {
  font-size: 0.7rem;
  color: var(--gray-400);
  width: 16px;
  flex-shrink: 0;
}
.acta-compact-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.acta-compact-title {
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.acta-compact-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
}
.acta-compact-progress { flex-shrink: 0; }
.acta-compact-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Progress bar (puntos) */
.progress-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.progress-dots {
  display: flex;
  gap: 3px;
}
.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-200);
}
.progress-dot.done { background: var(--success); }
.progress-dot.pending { background: var(--gray-200); }
.progress-container.in-progress .progress-count { color: var(--warning); }
.progress-container.done .progress-count { color: var(--success); font-weight: 600; }
.progress-count {
  font-size: 0.72rem;
  color: var(--gray-500);
  font-weight: 500;
  min-width: 32px;
  text-align: right;
}

/* Panel expandido con casilleros */
.acta-expanded-panel {
  padding: 0.5rem 1.25rem 1rem 2.25rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.casillero-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.casillero-row-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-700);
  min-width: 160px;
  padding-top: 0.6rem;
}
.casillero-row-fields {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}
.stamp-box {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  min-width: 170px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.stamp-box.done {
  border-color: var(--success);
  background: var(--success-light);
  cursor: default;
}
.stamp-box.pending:hover:not([disabled]) {
  border-color: var(--gold);
  background: var(--gold-muted);
}
.stamp-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.stamp-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--black);
  flex: 1;
}
.stamp-box.done .stamp-label { color: var(--success); }
.stamp-meta {
  font-size: 0.7rem;
  color: var(--gray-500);
}

/* ── Badges extra ──────────────────────────────────────────────────────────── */
.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-success {
  background: var(--success-light);
  color: var(--success);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ── Tag chips (gestores) ──────────────────────────────────────────────────── */
.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius);
  min-height: 40px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--gold-muted);
  color: var(--gold-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.tag-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gold-dark);
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
}
.tag-chip button:hover { color: var(--danger); }

/* ── Árbol genealógico ─────────────────────────────────────────────────────── */
.arbol-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.arbol-card {
  display: flex;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.arbol-card::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
}
.arbol-card-rol {
  padding: 1rem 0.75rem 1rem 1.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-dark);
  min-width: 140px;
  border-right: 1px solid var(--gray-100);
  background: var(--gold-muted);
}
.arbol-card-body {
  padding: 0.75rem 1rem;
  flex: 1;
  min-width: 0;
}
.arbol-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.arbol-card-nombre {
  font-weight: 600;
  font-size: 1rem;
  font-family: var(--font-serif);
}
.arbol-card-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--gray-700);
}
.arbol-dato {
  display: inline-block;
}

/* ── Sugerencias modal ─────────────────────────────────────────────────────── */
.sugerencias-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.3rem;
}
.sugerencia-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
}
.sugerencia-item:hover { background: var(--gray-50); }

/* ── Comunicaciones ────────────────────────────────────────────────────────── */
.comm-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.comm-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
}
.comm-item-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.comm-item-body {
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.comm-item-actions {
  margin-top: 0.4rem;
}

/* ── Modo migración badge (dashboard) ──────────────────────────────────────── */
.migration-badge {
  background: linear-gradient(90deg, #f08c00 0%, #e76f00 100%);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(240,140,0,0.25);
}
.migration-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240,140,0,0.35);
}

/* ── Toggles de notificaciones en expediente ──────────────────────────────── */
.email-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.88rem;
}
.email-toggle-row:last-child { border-bottom: none; }
.email-toggle-row .switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.email-toggle-row .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.email-toggle-row .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-300);
  border-radius: 22px;
  transition: 0.2s;
}
.email-toggle-row .slider:before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.email-toggle-row input:checked + .slider { background: var(--gold); }
.email-toggle-row input:checked + .slider:before { transform: translateX(18px); }
.email-toggle-row .sent-tag {
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 600;
  margin-left: 0.5rem;
}

/* ── Pagos — lista de cuotas ───────────────────────────────────────────────── */
.cuotas-list {
  display: flex;
  flex-direction: column;
}
.cuota-item {
  border-bottom: 1px solid var(--gray-100);
  padding: 0.9rem 1.25rem;
}
.cuota-item:last-child { border-bottom: none; }
.cuota-item.cobrada { background: rgba(30,126,78,0.04); }
.cuota-item.vencida { background: rgba(196,125,8,0.06); border-left: 3px solid var(--warning); }
.cuota-main {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1rem;
  align-items: center;
}
.cuota-num {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cuota-num-label {
  font-weight: 700;
  font-family: var(--font-serif);
  font-size: 1rem;
}
.cuota-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cuota-monto {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--black);
  font-family: var(--font-sans);
}
.cuota-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cuota-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cuota-upload {
  margin-top: 0.5rem;
  margin-left: 156px;
}
.cuota-docs {
  margin-top: 0.5rem;
  margin-left: 156px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cuota-docs:empty { display: none; }
@media (max-width: 640px) {
  .cuota-main { grid-template-columns: 1fr; }
  .cuota-upload, .cuota-docs { margin-left: 0; }
}

/* ── Alertas de pagos en dashboard ─────────────────────────────────────────── */
.pago-alert {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--warning);
  background: var(--warning-light);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.4rem;
}
.pago-alert:hover { transform: translateX(2px); }
.pago-alert:last-child { margin-bottom: 0; }
.pago-alert.danger {
  border-left-color: var(--danger);
  background: var(--danger-light);
}
.pago-alert-icon { font-size: 1.1rem; flex-shrink: 0; padding-top: 2px; }
.pago-alert-body { flex: 1; min-width: 0; }
.pago-alert-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.pago-alert-meta {
  font-size: 0.78rem;
  color: var(--gray-700);
}

.stat-card.danger {
  background: var(--danger-light);
  border-left: 4px solid var(--danger);
}
.stat-card.success {
  background: var(--success-light);
  border-left: 4px solid var(--success);
}
.stat-card.gold {
  background: var(--gold-muted);
  border-left: 4px solid var(--gold);
}

/* ── Documentos inline dentro de un stamp-box ──────────────────────────────── */
.stamp-docs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--gray-200);
}
.stamp-docs:empty {
  display: none;
}
.stamp-doc-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.3rem;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 4px;
  font-size: 0.75rem;
}
.stamp-doc-icon { flex-shrink: 0; }
.stamp-doc-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stamp-doc-actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}
.stamp-doc-actions button {
  padding: 0.1rem 0.3rem !important;
  font-size: 0.7rem !important;
}

/* ── Documentos de acta en panel expandido ─────────────────────────────────── */
.acta-docs-section {
  grid-column: span 2;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}
.acta-docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.acta-docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.acta-doc-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
}
.acta-doc-icon { font-size: 1.1rem; flex-shrink: 0; }
.acta-doc-info { flex: 1; min-width: 0; }
.acta-doc-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acta-doc-meta {
  font-size: 0.7rem;
  color: var(--gray-500);
}
.acta-doc-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* ── Importar árbol desde Word ─────────────────────────────────────────────── */
.import-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.import-card {
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.import-card.import-excluded {
  border-color: var(--gray-200);
  opacity: 0.55;
}
.import-card-header {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--gold-muted);
  border-bottom: 1px solid var(--gray-200);
}
.import-excluded .import-card-header { background: var(--gray-100); }
.import-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
}
.import-grid .form-group { margin-bottom: 0; }
.import-grid .form-group label {
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}
.import-grid .form-group input {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

/* Tabs (reutilizados por el inner de expedientes) */
.tab-panel:not(.active) { display: none; }
.tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tab-btn {
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.tab-btn:hover { color: var(--black); }
.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
