/* ============================================================
   SEFOMEC Gestion Tareas PWA — CSS
   Light theme default, mobile-first, standalone (sin Tailwind)
   ============================================================ */

/* -- Fuentes locales (offline-first) ------------------------------ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('../../../assets/fonts/material-symbols-outlined.woff2') format('woff2');
}
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  user-select: none;
}

/* -- Custom properties (Light theme) ----------------------------- */
:root {
  /* Green palette */
  --primary:        #166534;
  --primary-light:  #22c55e;
  --primary-dark:   #14532d;
  --primary-50:     #f0fdf4;
  --primary-100:    #dcfce7;
  --primary-200:    #bbf7d0;
  --primary-500:    #22c55e;
  --primary-600:    #16a34a;
  --primary-700:    #166534;
  --primary-800:    #14532d;
  --primary-900:    #052e16;

  /* Neutrals */
  --bg:             #f8fafc;
  --bg-card:        #ffffff;
  --bg-input:       #ffffff;
  --bg-hover:       #f1f5f9;
  --border:         #e2e8f0;
  --border-focus:   #22c55e;
  --shadow-sm:      0 1px 2px rgba(0,0,0,.05);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

  /* Text */
  --text-1:         #0f172a;
  --text-2:         #475569;
  --text-3:         #94a3b8;
  --text-inverse:   #ffffff;

  /* Semantic */
  --success:        #16a34a;
  --success-bg:     #f0fdf4;
  --warning:        #f59e0b;
  --warning-bg:     #fffbeb;
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --info:           #3b82f6;
  --info-bg:        #eff6ff;

  /* Layout */
  --header-h:       56px;
  --bottom-nav-h:   64px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-full:    9999px;
  --safe-top:       env(safe-area-inset-top, 0px);
  --safe-bottom:    env(safe-area-inset-bottom, 0px);
  --safe-left:      env(safe-area-inset-left, 0px);
  --safe-right:     env(safe-area-inset-right, 0px);

  /* Transitions */
  --transition:     150ms ease;
  --transition-slow: 300ms ease;
}

/* -- Dark mode --------------------------------------------------- */
body.dark {
  --bg:             #0f1a0f;
  --bg-card:        #1a2e1a;
  --bg-input:       #1e331e;
  --bg-hover:       #253525;
  --border:         #2d4a2d;
  --border-focus:   #22c55e;
  --shadow-sm:      0 1px 2px rgba(0,0,0,.3);
  --shadow-md:      0 4px 6px rgba(0,0,0,.3);
  --shadow-lg:      0 10px 15px rgba(0,0,0,.4);
  --text-1:         #e2e8f0;
  --text-2:         #94a3b8;
  --text-3:         #64748b;
  --text-inverse:   #0f172a;
  --success-bg:     #052e16;
  --warning-bg:     #451a03;
  --danger-bg:      #450a0a;
  --info-bg:        #172554;
}
body.dark .material-symbols-outlined {
  color: inherit;
}

/* -- Reset / Base ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-1);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* -- Skip link (accessibility) ----------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: .5rem 1rem;
  background: var(--primary);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: .5rem;
}

/* -- Header ------------------------------------------------------ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 1rem;
  padding-top: var(--safe-top);
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
}
.app-header__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text-inverse);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: background var(--transition);
  margin-right: .25rem;
  flex-shrink: 0;
}
.app-header__back:hover,
.app-header__back:focus-visible {
  background: rgba(255,255,255,.15);
}
.app-header__title {
  font-size: 1.125rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Title group for pages that show a datetime subtitle */
.app-header__title-group {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.app-header__title-group .app-header__title {
  flex: none;
  line-height: 1.2;
}
.app-header__datetime {
  font-size: .6875rem;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  letter-spacing: .01em;
}
.app-header__actions {
  display: flex;
  gap: .25rem;
  align-items: center;
  flex-shrink: 0;
}
.app-header__actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text-inverse);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: background var(--transition);
}
.app-header__actions button:hover,
.app-header__actions button:focus-visible {
  background: rgba(255,255,255,.15);
}

/* -- Main content area ------------------------------------------- */
main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-bottom) + 1rem);
}

/* -- Sidebar drawer ---------------------------------------------- */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 270px;
  z-index: 300;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-sidebar.open {
  transform: translateX(0);
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 1rem .875rem .75rem;
  border-bottom: 1px solid var(--border);
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}
.sidebar-brand {
  flex: 1;
  font-size: .875rem;
  font-weight: 800;
  color: var(--primary);
}
.sidebar-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: .25rem;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.sidebar-close:hover { background: var(--bg-hover); }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem .875rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.sidebar-user .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--text-3);
}
.sidebar-nav {
  list-style: none;
  padding: .5rem 0;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .875rem;
  margin: .125rem .5rem;
  text-decoration: none;
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  border-radius: 10px;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar-nav__item .material-symbols-outlined {
  font-size: 1.375rem;
  flex-shrink: 0;
}
.sidebar-nav__item:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.sidebar-nav__item.active {
  background: rgba(22,101,52,.1);
  color: var(--primary);
  font-weight: 700;
}
.sidebar-nav__item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
body.dark .sidebar-nav__item.active {
  background: rgba(34,197,94,.12);
}
.sidebar-nav__badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: .625rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: .5rem;
  border-top: 1px solid var(--border);
}
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .75rem .875rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--danger);
  font-size: .875rem;
  font-weight: 600;
  border-radius: 10px;
  transition: background var(--transition);
}
.sidebar-logout:hover { background: var(--danger-bg); }

/* -- Hamburger button in header ---------------------------------- */
.btn-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: background var(--transition);
  margin-right: .125rem;
}
.btn-menu:hover { background: rgba(255,255,255,.15); }

/* -- Cards ------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card--clickable {
  cursor: pointer;
}
.card--clickable:active {
  transform: scale(.99);
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
}
.card__title {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-1);
}
.card__body {
  padding: 1rem;
}
.card__footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* -- Task card (dashboard) --------------------------------------- */
.task-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  padding: .875rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition);
}
.task-card:hover {
  box-shadow: var(--shadow-md);
}
.task-card:active {
  transform: scale(.985);
}
.task-card--critica   { border-left-color: var(--danger); }
.task-card--alta      { border-left-color: #f97316; }
.task-card--media     { border-left-color: var(--warning); }
.task-card--baja      { border-left-color: var(--primary-light); }
.task-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .375rem;
}
.task-card__numero {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .02em;
}
.task-card__titulo {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  margin-bottom: .25rem;
}
.task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  font-size: .75rem;
  color: var(--text-2);
}
.task-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.task-card__meta .material-symbols-outlined {
  font-size: 14px;
  color: var(--text-3);
}
.task-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}
.task-card__categoria {
  font-size: .6875rem;
  padding: .125rem .5rem;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 500;
}
body.dark .task-card__categoria {
  background: var(--primary-900);
  color: var(--primary-200);
}

/* -- Badges (estado) --------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .125rem .5rem;
  border-radius: var(--radius-full);
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-pendiente      { background: #fef3c7; color: #92400e; }
.badge-en_progreso    { background: #dbeafe; color: #1e40af; }
.badge-en_revision    { background: #e0e7ff; color: #3730a3; }
.badge-completada     { background: #dcfce7; color: #166534; }
.badge-aprobada       { background: #bbf7d0; color: #14532d; }
.badge-rechazada      { background: #fecaca; color: #7f1d1d; }
.badge-vencida        { background: #fed7aa; color: #9a3412; }
.badge-cancelada      { background: #fee2e2; color: #991b1b; }
.badge-bloqueada      { background: #f1f5f9; color: #475569; }

/* dark mode badges */
body.dark .badge-pendiente   { background: #451a03; color: #fbbf24; }
body.dark .badge-en_progreso { background: #172554; color: #60a5fa; }
body.dark .badge-en_revision { background: #1e1b4b; color: #818cf8; }
body.dark .badge-completada  { background: #052e16; color: #4ade80; }
body.dark .badge-aprobada    { background: #052e16; color: #86efac; }
body.dark .badge-rechazada   { background: #450a0a; color: #fca5a5; }
body.dark .badge-vencida     { background: #431407; color: #fdba74; }
body.dark .badge-cancelada   { background: #450a0a; color: #f87171; }
body.dark .badge-bloqueada   { background: #1e293b; color: #94a3b8; }

/* -- Badges (prioridad) ------------------------------------------ */
.badge-prioridad-critica { background: #fee2e2; color: #991b1b; }
.badge-prioridad-alta    { background: #ffedd5; color: #9a3412; }
.badge-prioridad-media   { background: #fef3c7; color: #92400e; }
.badge-prioridad-baja    { background: #dcfce7; color: #166534; }

body.dark .badge-prioridad-critica { background: #450a0a; color: #f87171; }
body.dark .badge-prioridad-alta    { background: #431407; color: #fb923c; }
body.dark .badge-prioridad-media   { background: #451a03; color: #fbbf24; }
body.dark .badge-prioridad-baja    { background: #052e16; color: #4ade80; }

/* -- Tabs (horizontal filter) ------------------------------------ */
.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 .5rem;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: .75rem 1rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition);
}
.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: .5rem;
  right: .5rem;
  height: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background var(--transition);
}
.tab.active {
  color: var(--primary);
  font-weight: 600;
}
.tab.active::after {
  background: var(--primary);
}
.tab:hover {
  color: var(--primary-light);
}
.tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: .625rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--border);
  color: var(--text-2);
}
.tab.active .tab__count {
  background: var(--primary-100);
  color: var(--primary);
}
body.dark .tab.active .tab__count {
  background: var(--primary-900);
  color: var(--primary-light);
}

/* -- Tab panels -------------------------------------------------- */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* -- Forms ------------------------------------------------------- */
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: .375rem;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: .625rem .75rem;
  font-size: .9375rem;
  font-family: inherit;
  color: var(--text-1);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-3);
}
.form-textarea {
  min-height: 80px;
  resize: vertical;
}
.form-select {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23475569' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
}

/* -- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: .625rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active:not(:disabled) {
  transform: scale(.97);
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn .material-symbols-outlined {
  font-size: 18px;
}
.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}
.btn-secondary {
  background: var(--bg);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}
.btn-ghost {
  background: none;
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
}
.btn-sm {
  padding: .375rem .75rem;
  font-size: .8125rem;
}
.btn-lg {
  padding: .75rem 1.5rem;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* -- Login page -------------------------------------------------- */
.login-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--primary);
  position: relative;
  overflow: hidden;
}
.login-bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}
.login-bg-circle--1 {
  width: 300px; height: 300px;
  top: -80px; right: -60px;
}
.login-bg-circle--2 {
  width: 200px; height: 200px;
  bottom: -50px; left: -40px;
}
.login-bg-circle--3 {
  width: 120px; height: 120px;
  top: 40%; left: 10%;
  background: rgba(255,255,255,.03);
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.5rem;
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}
.login-logo img {
  width: 80px;
  height: auto;
  margin-bottom: .75rem;
}
.login-logo__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
}
.login-logo__subtitle {
  font-size: .8125rem;
  color: var(--text-3);
  margin-top: .25rem;
}
.login-version {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
  font-size: .6875rem;
  color: rgba(255,255,255,.5);
  text-align: center;
}

/* -- Loading overlay --------------------------------------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(2px);
}
.loading-overlay.visible {
  display: flex;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -- Skeleton loading -------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}
.skeleton-card {
  height: 100px;
  margin-bottom: .75rem;
  border-radius: var(--radius-md);
}
.skeleton-line {
  height: .875rem;
  margin-bottom: .5rem;
  width: 80%;
}
.skeleton-line--short { width: 50%; }
.skeleton-line--full  { width: 100%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -- Toast notifications ----------------------------------------- */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  max-width: calc(100vw - 2rem);
  padding: .625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .8125rem;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s ease;
  text-align: center;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-warning { background: var(--warning); color: #0f172a; }
.toast-info    { background: var(--info); }
.toast-offline { background: #475569; }
.toast.hiding {
  animation: toast-out .3s ease forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* -- Pull to refresh --------------------------------------------- */
.pull-indicator {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) - 40px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.pull-indicator.visible {
  opacity: 1;
}
.pull-indicator .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary);
}
.pull-indicator.refreshing .material-symbols-outlined {
  animation: spin .7s linear infinite;
}

/* -- Empty state ------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  gap: .75rem;
  color: var(--text-3);
}
.empty-state .material-symbols-outlined {
  font-size: 3rem;
  opacity: .5;
}
.empty-state__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
}
.empty-state__text {
  font-size: .8125rem;
  max-width: 280px;
}

/* -- Error state ------------------------------------------------- */
.error-state {
  padding: 2rem 1.5rem;
  text-align: center;
}

/* -- Photo gallery grid ------------------------------------------ */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .5rem;
}
.photo-gallery__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}
.photo-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.photo-gallery__item:hover img {
  transform: scale(1.05);
}
.photo-gallery__item .photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.photo-gallery__add {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  font-size: .6875rem;
}
.photo-gallery__add:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.photo-gallery__add .material-symbols-outlined {
  font-size: 28px;
}

/* -- Comment timeline -------------------------------------------- */
.comment-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.comment-item {
  display: flex;
  gap: .75rem;
  padding: .875rem 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}
body.dark .comment-avatar {
  background: var(--primary-900);
  color: var(--primary-light);
}
.comment-content {
  flex: 1;
  min-width: 0;
}
.comment-header {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .25rem;
}
.comment-author {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-1);
}
.comment-time {
  font-size: .6875rem;
  color: var(--text-3);
}
.comment-body {
  font-size: .8125rem;
  color: var(--text-2);
  line-height: 1.5;
  word-break: break-word;
}
.comment-input-area {
  display: flex;
  gap: .5rem;
  padding: .75rem 0;
  align-items: flex-end;
}
.comment-input-area .form-textarea {
  min-height: 40px;
  max-height: 120px;
  flex: 1;
}

/* -- Subtask list ------------------------------------------------ */
.subtask-list {
  list-style: none;
}
.subtask-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  color: var(--text-1);
}
.subtask-item:last-child {
  border-bottom: none;
}
.subtask-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.subtask-check.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.subtask-check.checked .material-symbols-outlined {
  font-size: 14px;
}
.subtask-item.completed .subtask-text {
  text-decoration: line-through;
  color: var(--text-3);
}

/* -- Section headers --------------------------------------------- */
.section-title {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .75rem 1rem .375rem;
}

/* -- Info rows --------------------------------------------------- */
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row__label {
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: .375rem;
}
.info-row__label .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-3);
}
.info-row__value {
  font-weight: 500;
  color: var(--text-1);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

/* -- Responsive grid --------------------------------------------- */
.grid {
  display: grid;
  gap: .75rem;
  padding: .75rem 1rem;
}
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 640px) {
  .sm\:grid-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .md\:grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* -- Offline banner ---------------------------------------------- */
.offline-banner {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: .375rem .75rem;
  font-size: .75rem;
  font-weight: 500;
  color: #fff;
  background: #475569;
}
.offline-banner.visible {
  display: flex;
}
.offline-banner .material-symbols-outlined {
  font-size: 16px;
}

/* -- Confirm modal (overlay) ------------------------------------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .2s ease;
  padding: 1rem;
}
.confirm-overlay.open { opacity: 1; }
.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  transform: scale(.95);
  transition: transform .2s ease;
}
.confirm-overlay.open .confirm-dialog { transform: scale(1); }
.confirm-icon { margin-bottom: .75rem; }
.confirm-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .375rem;
  color: var(--text-1);
}
.confirm-text {
  font-size: .8125rem;
  color: var(--text-2);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: .5rem;
  justify-content: center;
}
.confirm-btn { flex: 1; }

/* -- Misc utilities ---------------------------------------------- */
.hidden   { display: none !important; }
.text-sm  { font-size: .8125rem; }
.text-xs  { font-size: .6875rem; }
.text-center  { text-align: center; }
.text-muted   { color: var(--text-3); }
.text-secondary { color: var(--text-2); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1  { margin-top: .25rem; }
.mt-2  { margin-top: .5rem; }
.mt-3  { margin-top: .75rem; }
.mt-4  { margin-top: 1rem; }
.mb-2  { margin-bottom: .5rem; }
.mb-3  { margin-bottom: .75rem; }
.mb-4  { margin-bottom: 1rem; }
.font-semi { font-weight: 600; }
.px-4  { padding-left: 1rem; padding-right: 1rem; }
.py-2  { padding-top: .5rem; padding-bottom: .5rem; }
.py-4  { padding-top: 1rem; padding-bottom: 1rem; }
.p-4   { padding: 1rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap  { flex-wrap: wrap; }
.flex-1     { flex: 1; }
.w-full     { width: 100%; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -- Action buttons row ------------------------------------------ */
.action-row {
  display: flex;
  gap: .5rem;
  padding: .75rem 1rem;
}
.action-row .btn { flex: 1; }

/* -- Stat card (dashboard) --------------------------------------- */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .75rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-1);
}
.stat-card__label {
  font-size: .6875rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* -- Divider ----------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: .75rem 0;
}

/* -- Animations -------------------------------------------------- */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fade-in .3s ease;
}
.animate-slide-up {
  animation: slide-up .3s ease;
}

/* -- Task list container ----------------------------------------- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .75rem 1rem;
}

/* -- Filters row ------------------------------------------------- */
.filters-row {
  display: flex;
  gap: .5rem;
  padding: .5rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .375rem .75rem;
  font-size: .75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.filter-chip:hover,
.filter-chip.active {
  background: var(--primary-100);
  border-color: var(--primary-light);
  color: var(--primary);
}
body.dark .filter-chip:hover,
body.dark .filter-chip.active {
  background: var(--primary-900);
  color: var(--primary-light);
}

/* -- Deadline indicator ------------------------------------------ */
.deadline-overdue {
  color: var(--danger);
  font-weight: 600;
}
.deadline-soon {
  color: var(--warning);
  font-weight: 500;
}
.deadline-ok {
  color: var(--text-3);
}

/* -- Progress bar ------------------------------------------------ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width var(--transition-slow);
}

/* -- FAB (floating action button) -------------------------------- */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
  right: 1rem;
  z-index: 80;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.fab:hover { background: var(--primary-dark); }
.fab:active { transform: scale(.92); }
.fab .material-symbols-outlined { font-size: 28px; }

/* -- Icon link (header actions) ---------------------------------- */
.btn-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--text-inverse, #fff);
  text-decoration: none;
  opacity: .85;
  transition: opacity var(--transition), background var(--transition);
}
.btn-icon-link:hover,
.btn-icon-link:active {
  opacity: 1;
  background: rgba(255,255,255,.15);
}
.btn-icon-link .material-symbols-outlined {
  font-size: 22px;
}

/* -- Version footer ---------------------------------------------- */
.version-footer {
  padding: 1rem;
  text-align: center;
  font-size: .6875rem;
  color: var(--text-3);
}

/* -- Dashboard section title ------------------------------------- */
.dash-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--primary-100);
}
.dash-section-title .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--primary);
}

/* -- KPI grid ---------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .625rem;
}
.kpi-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .875rem .75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.kpi-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.kpi-card__label {
  font-size: .6875rem;
  color: var(--text-2);
  margin-top: .25rem;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.kpi-card--success .kpi-card__value { color: var(--success); }
.kpi-card--warning .kpi-card__value { color: var(--warning); }
.kpi-card--danger .kpi-card__value  { color: var(--danger); }
.kpi-card--info .kpi-card__value    { color: var(--info); }

/* -- Stacked bar ------------------------------------------------- */
.stacked-bar-wrap {
  padding: .75rem 1rem;
}
.stacked-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--border);
}
.stacked-bar__seg {
  height: 100%;
  transition: width .4s ease;
  min-width: 4px;
}
.stacked-bar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin-top: .5rem;
}
.stacked-bar__legend-item {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .6875rem;
  color: var(--text-2);
}
.stacked-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* -- Mini list --------------------------------------------------- */
.mini-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  gap: .5rem;
}
.mini-list__item:last-child {
  border-bottom: none;
}
a.mini-list__item:active {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
}
.mini-list__left {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 0;
}
.mini-list__left > div {
  min-width: 0;
  overflow: hidden;
}
/* Horizontal padding when mini-list lives inside a card */
.card .mini-list {
  padding: 0 1rem;
}
.mini-list__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mini-list__dot.pri-urgente { background: #DC2626; }
.mini-list__dot.pri-alta    { background: #F59E0B; }
.mini-list__dot.pri-media   { background: #3B82F6; }
.mini-list__dot.pri-baja    { background: #9CA3AF; }
.mini-list__title {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-list__meta {
  font-size: .6875rem;
  color: var(--text-3);
}
.mini-list__right {
  flex-shrink: 0;
  text-align: right;
}
.mini-list__right--with-icon {
  display: flex;
  align-items: center;
  gap: .25rem;
}
a.mini-list__item {
  transition: background var(--transition, .15s ease);
}
a.mini-list__item:hover {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
}

/* -- Date navigator (Operaciones section) ------------------------ */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .375rem .5rem;
}
.date-nav__btn {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.date-nav__btn:hover { background: var(--bg-hover); color: var(--primary); }
.date-nav__btn:disabled { opacity: .35; cursor: default; }
.date-nav__label {
  flex: 1;
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}
.date-nav__label--today { color: var(--primary); }

/* -- Progress bar wrapper ---------------------------------------- */
.progress-bar-wrap {
  padding: .75rem 1rem;
}

/* -- Card header ------------------------------------------------- */
.card__header {
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}

/* -- Module cards (Dashboard landing hub) ------------------------ */
.module-card {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: .75rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.module-card--disabled {
  cursor: default;
  opacity: .7;
}
.module-card:not(.module-card--disabled):hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-1px);
}
.module-card__accent {
  width: 4px;
  flex-shrink: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.module-card__body {
  flex: 1;
  padding: .875rem 1rem;
  min-width: 0;
}
.module-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .625rem;
}
.module-card__title-group {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.module-card__icon {
  font-size: 1.375rem;
  line-height: 1;
}
.module-card__title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text-1);
}
.module-card__badge {
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .125rem .4rem;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.module-card__stats {
  display: flex;
  gap: 1.25rem;
  margin-bottom: .625rem;
}
.module-card__stat {
  display: flex;
  flex-direction: column;
}
.module-card__stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-1);
}
.module-card__stat-label {
  font-size: .6875rem;
  color: var(--text-3);
  margin-top: .125rem;
}
.module-card__progress {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: .25rem;
}
.module-card__progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
}
.module-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .5rem;
}
.module-card__meta {
  font-size: .6875rem;
  color: var(--text-3);
}
.module-card__arrow {
  color: var(--text-3);
  font-size: 1.125rem;
  line-height: 1;
}
.module-card__skeleton .module-card__stat-value {
  width: 3rem;
  height: 1.375rem;
  background: var(--border);
  border-radius: var(--radius-sm);
}

/* -- Modal (confirmation dialogs) -------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  transform: scale(.95);
  transition: transform .2s ease;
}
.modal-backdrop.visible .modal-dialog {
  transform: scale(1);
}

/* -- Responsive (tablet+ adjustments) ---------------------------- */
@media (min-width: 640px) {
  .login-card {
    padding: 2.5rem 2rem;
  }
}
