﻿/* ======================================================
   BASE & VARIABLES
   ====================================================== */
:root {
    --color-bg: #f3f4f6;
    --color-bg-card: #ffffff;
    --color-header: #0b1120;
    --color-header-secondary: #111827;
    --color-nav: #111827;
    --color-nav-hover: #1f2937;
    --color-nav-border: #4b5563;

    --color-text-main: #111827;
    --color-text-muted: #6b7280;
    --color-text-light: #f9fafb;

    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-soft: #e0edff;

    --color-border: #d1d5db;
    --color-border-soft: #e5e7eb;

    --shadow-soft: 0 14px 30px -18px rgba(15, 23, 42, 0.75);
    --shadow-card: 0 12px 28px -18px rgba(15, 23, 42, 0.5);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    --transition-fast: 150ms ease-out;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}


html { 
  overflow-y: scroll !important; 
}


/* ======================================================
   BODY
   ====================================================== */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e5e7eb 0, #f3f4f6 36%, #e5e7eb 100%);
    color: var(--color-text-main);
}

/* ======================================================
   LAYOUT GENERAL
   ====================================================== */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ======================================================
   HEADER
   ====================================================== */
.app-header {
    background: radial-gradient(circle at top left, #1f2937 0, var(--color-header) 55%);
    color: var(--color-text-light);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 30px -20px rgba(15, 23, 42, 0.9);
    position: sticky;
    top: 0;
    z-index: 40;
}

.app-header h1 {
    font-size: 18px;
    margin: 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}

.app-header-subtitle {
    font-size: 12px;
    margin-top: 2px;
    color: rgba(209, 213, 219, 0.9);
}

.app-header-left {
    display: flex;
    flex-direction: column;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-user {
    font-size: 13px;
    opacity: 0.9;
}

.app-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.65);
    font-size: 12px;
}

.app-user-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
}

/* ======================================================
   NAV SUPERIOR ESTILO APPLE (SIN SUBRAYADOS NI ANIMACIÓN)
   ====================================================== */
.app-nav {
    background: #1D1D1F;  /* tono Apple (casi negro, neutro) */
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    padding: 0 32px;
    height: 44px;

    display: flex;
    align-items: left;
    justify-content: left;   /* enlaces centrados */
    gap: 24px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);

    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Enlaces del menú */
.app-nav a {
    position: relative;
    color: #f5f5f7;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;

    padding: 0 8px;
    line-height: 44px;      /* centra verticalmente */
    border-radius: 0;
    border: none;

    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    gap: 6px;

    transition:
        opacity .18s ease,
        color .18s ease;
}

/* IMPORTANTE: sin subrayado pseudo-elemento */
.app-nav a::after {
    content: none;
}

/* Hover: solo aclarar un poco el texto */
.app-nav a:hover {
    opacity: 1;
    color: #ffffff;
}

/* Enlace activo (sección actual) */
.app-nav a.active {
    opacity: 1;
    color: #ffffff;
}

/* Usuario a la derecha */
.app-nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e5e7eb;
    font-size: 0.85rem;
    opacity: 0.9;
    justify-content: right;
}

.app-nav-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1f4fd4, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.app-nav-user-name {
    max-width: 160px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Botón Cerrar sesión */
.app-nav-logout {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(248, 250, 252, 0.28);
    font-size: 0.8rem;
    text-decoration: none;
    color: #e5e7eb;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.app-nav-logout:hover {
    background: #ffda44;
    color: #111827;
    transform: translateY(-1px);
    justify-content: right;
}


.app-nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: right;
    align: right;
    margin-left: auto;
}

/* Logo de la app en el menú */
.app-nav-logo {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0,95rem;
    color: #e5e7eb;
    margin-right: 18px;
    opacity: 0.9;
}


/* Versión responsive */
@media (max-width: 768px) {
    .app-nav {
        justify-content: space-between;
        gap: 12px;
        padding: 0 16px;
    }

    .app-nav a {
        font-size: 12px;
        padding: 0 6px;
    }
}


/* Versión responsive */
@media (max-width: 768px) {
    .app-nav {
        justify-content: space-between;
        gap: 12px;
        padding: 0 16px;
    }

    .app-nav a {
        font-size: 12px;
        padding: 0 6px;
    }
}


/* ======================================================
   CONTENIDO
   ====================================================== */
.app-content {
    padding: 22px 24px 28px;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
}

/* Bloque título de página */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: #020617;
}

.page-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ======================================================
   TARJETAS
   ====================================================== */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(148, 163, 184, 0.35);
    max-width: 1180px;
}

.card h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #020617;
}

.card-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Distribución en columnas dentro de la card */
.card-grid-2 {
    display: grid;
    grid-template-columns: 1.7fr 1.3fr;
    gap: 18px;
}

/* ======================================================
   FORMULARIOS
   ====================================================== */
form {
    margin: 0;
}

label {
    font-size: 13px;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
    color: #374151;
}

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

.form-group {
    margin-bottom: 10px;
}

/* Inputs & selects */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    font-size: 14px;
    outline: none;
    background: #f9fafb;
    color: var(--color-text-main);
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast);
}

/* Elimina límite de 400px para un layout más limpio */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
input[type="number"],
select {
    max-width: 100%;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
    background: #ffffff;
    transform: translateY(-0.5px);
}

/* Texto de ayuda pequeño */
.form-help {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ======================================================
   BOTONES
   ====================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    border: none;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast),
        opacity var(--transition-fast);
}

/* Botón primario */
.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 12px 26px -16px rgba(37, 99, 235, 0.8);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -18px rgba(37, 99, 235, 0.9);
}

/* Botón secundario (gris) */
.btn-secondary {
    background: #e5e7eb;
    color: var(--color-text-main);
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Botón fantasma / enlace suave */
.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.18);
}

.btn[disabled],
.btn:disabled {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
    transform: none;
}

/* Grupo de botones alineados a la derecha */
.btn-group-right {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Enlaces de acción pequeños */
.action-link {
    font-size: 13px;
    text-decoration: none;
    color: var(--color-primary);
    transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

.action-link:hover {
    text-decoration: underline;
    color: var(--color-primary-hover);
}

/* ======================================================
   TABLAS
   ====================================================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #ffffff;
    width: 100%;
    max-width: 1180px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
    overflow: hidden;
    max-width: 1180px;
}

table thead {
    background: #f3f4f6;
}

th, td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--color-border-soft);
    text-align: left;
}

th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.06em;
}

tbody tr:nth-child(2n) td {
    background: #fbfbfb;
    font-size: 12px;
}

tr td {
    background: #f9fafb;
    font-size: 12px;
}

tr:hover td {
    background: #f9fafb;
    font-size: 12px;
}

/* ======================================================
   LOGIN ESTILO APPLE
   ====================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    
    background: radial-gradient(circle at top,
        #ffffff 0,
        #f5f5f7 38%,
        #e5e7eb 100%);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Segoe UI", system-ui, sans-serif;
}

/* Tarjeta principal */
.login-card {
    width: 100%;
    max-width: 380px;

    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 32px 28px 26px;

    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(148, 163, 184, 0.32);
    border: 1px solid rgba(229, 231, 235, 0.9);

    color: #111827;
}

/* Título */
.login-card h2 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Subtítulo / texto descriptivo */
.login-card p {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

/* Bloque de error */
.login-error {
    margin-bottom: 14px;
    padding: 9px 11px;
    font-size: 13px;
    line-height: 1.4;

    background: #fef2f2;
    color: #b91c1c;
    border-radius: 10px;
    border: 1px solid #fecaca;
}

/* (Opcional) separador superior en la tarjeta, como en Apple ID */
.login-card::before {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    border-radius: 999px;
    margin: 0 auto 18px;
    background: linear-gradient(to right, #9ca3af, #d1d5db);
    opacity: 0.6;
}


/* ======================================================
   TEXTOS PEQUEÑOS / UTILIDADES
   ====================================================== */
.text-muted {
    color: var(--color-text-muted);
    font-size: 13px;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 1200px) {
  .app-content {
    padding: 18px 16px 24px;
    width: 100%;
    max-width: 1180px;
  }

  .card {
    padding: 16px 14px;
    width: 100%;
    max-width: 1180px;
  }

  .form-row-2 { grid-template-columns: 1fr; }
  .card-grid-2 { grid-template-columns: 1fr; }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .app-nav { padding-inline: 16px; }
}

@media (max-width: 480px) {
  .app-header h1 { font-size: 16px; }
  .page-title { font-size: 19px; }
  .login-card { padding: 20px 18px; }
}

/* ======================================================
   TABLAS FIJAS (clientes) - fuera del @media
   ====================================================== */
.table-fixed-1200 {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: auto;
}

.table-fixed-1200 .tabla-clientes {
  width: 1180px;
  min-width: 1180px;
  max-width: 1180px;
  table-layout: fixed;
  border-collapse: collapse;
}

.table-fixed-1200 .tabla-clientes th,
.table-fixed-1200 .tabla-clientes td {
  padding: 6px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-fixed-1200 .tabla-clientes th:nth-child(1),
.table-fixed-1200 .tabla-clientes td:nth-child(1) { width: 40%; }
.table-fixed-1200 .tabla-clientes th:nth-child(2),
.table-fixed-1200 .tabla-clientes td:nth-child(2) { width: 10%; }
.table-fixed-1200 .tabla-clientes th:nth-child(3),
.table-fixed-1200 .tabla-clientes td:nth-child(3) { width: 15%; }
.table-fixed-1200 .tabla-clientes th:nth-child(4),
.table-fixed-1200 .tabla-clientes td:nth-child(4) { width: 15%; }
.table-fixed-1200 .tabla-clientes th:nth-child(5),
.table-fixed-1200 .tabla-clientes td:nth-child(5) { width: 10%; }

.tabla-clientes .col-nombre   { width: 40%; font-size: 12px; }
.tabla-clientes .col-nif      { width: 10%; font-size: 12px; }
.tabla-clientes .col-email    { width: 15%; font-size: 12px; }
.tabla-clientes .col-telefono { width: 15%; font-size: 12px; }
.tabla-clientes .col-acciones { width: 10%; text-align: center; font-size: 12px; }

/* ======================================================
   MODALES
   ====================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px 22px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  font-size: 0.95rem;
}

.modal-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #111827;
}

.modal-box p { margin: 6px 0; color: #374151; }
.modal-box small { color: #6b7280; }

.modal-buttons {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-btn-cancel {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
}

.modal-btn-confirm {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #b91c1c;
  background: #dc2626;
  color: #ffffff;
  cursor: pointer;
}

/* Badge ID expediente (si lo usas) */
.exp-title-block .exp-id {
  font-size: 0.9rem;
  color: #1e40af;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

/* =========================
   COLORES POR ESTADO (tabla-mini)
   ========================= */
.tabla-mini tr.abierto td   { background: #ECFDF3; }
.tabla-mini tr.inicio td    { background: #D1FAE5; }
.tabla-mini tr.tramite td   { background: #A7F3D0; }
.tabla-mini tr.juzgado td   { background: #EAF2FF; }
.tabla-mini tr.pendiente-cobro td { background: #E9D5FF; }

.tabla-mini tr.cerrado td,
.tabla-mini tr.finalizado td,
.tabla-mini tr.eliminado td,
.tabla-mini tr.destruido td,
.tabla-mini tr.archivado td { background: #F7C6C6; }

/* Resaltar la celda ESTADO (última columna) - corregido */
.tabla-mini tr.abierto td:last-child,
.tabla-mini tr.inicio td:last-child,
.tabla-mini tr.tramite td:last-child,
.tabla-mini tr.juzgado td:last-child,
.tabla-mini tr.cerrado td:last-child,
.tabla-mini tr.finalizado td:last-child,
.tabla-mini tr.eliminado td:last-child,
.tabla-mini tr.destruido td:last-child,
.tabla-mini tr.archivado td:last-child,
.tabla-mini tr.pendiente-cobro td:last-child{
  font-weight: 800;
}

.tabla-mini tr.eliminado td:last-child{
  font-weight: 800;
  color: #7A1111;
}

/* ===== Detalles: 2 columnas ===== */
.details-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px){
  .details-grid{ grid-template-columns: 1fr; }
}

.info-card{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.info-card h4{
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: #111827;
  display:flex;
  align-items:center;
  gap:8px;
}
.info-dl{ margin:0; }
.info-row{
  display:grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
}
.info-row:first-child{ border-top: 0; padding-top: 0; }
.info-row dt{ margin:0; color:#6b7280; font-weight:600; }
.info-row dd{ margin:0; color:#111827; }
.info-multiline{ white-space: pre-line; color:#374151; }
.muted-empty{ color:#9ca3af; }



@keyframes navTwinkleA{
  0%, 100%{ opacity: .82; filter: drop-shadow(0 2px 2px rgba(0,0,0,.14)) brightness(1); }
  50%     { opacity: .96; filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)) brightness(1.08); }
}
@keyframes navTwinkleB{
  0%, 100%{ opacity: .50; filter: drop-shadow(0 2px 2px rgba(0,0,0,.10)) brightness(1); }
  45%     { opacity: .62; filter: drop-shadow(0 2px 2px rgba(0,0,0,.14)) brightness(1.06); }
}

/* Accesibilidad (ahora SÍ cerrado correctamente) */
@media (prefers-reduced-motion: reduce){
  .app-nav.festive-nav .nav-lights,
  .app-nav.festive-nav .nav-lights::after{
    animation: none;
  }
}

/* ===== Acciones en tabla ===== */
.td-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* ===== Botón eliminar documento ===== */
.btn-doc-del{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(220,38,38,0.35);
  background: linear-gradient(180deg, rgba(220,38,38,0.12), rgba(220,38,38,0.05));
  color:#b91c1c;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
  box-shadow:
    0 10px 22px rgba(15,23,42,0.10),
    inset 0 1px 0 rgba(255,255,255,0.85);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.btn-doc-del:hover{
  transform: translateY(-1px);
  border-color: rgba(185,28,28,0.55);
  background: linear-gradient(180deg, rgba(220,38,38,0.16), rgba(220,38,38,0.07));
  box-shadow:
    0 14px 28px rgba(15,23,42,0.14),
    inset 0 1px 0 rgba(255,255,255,0.90);
}
.btn-doc-del:active{ transform: translateY(0) scale(0.98); }

/* =========================
   PANEL: GLOBOS ESTADOS EXPEDIENTES (ESTRECHOS + CENTRADOS)
   ========================= */

.card.panel-states-card{
  padding: 22px 22px 24px;
}

.state-badges{
  display:flex;
  flex-wrap:nowrap;
  gap:12px;
  align-items:stretch;

  padding: 10px 2px 6px;
  min-height: 76px;

  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Globo más estrecho y centrado */
.state-badge{
  flex: 0 0 auto;

  display:flex;
  flex-direction:column;
  align-items:center;         /* ✅ centra horizontal */
  justify-content:center;     /* ✅ centra vertical */
  text-align:center;          /* ✅ texto centrado */

  text-decoration:none;

  width: 124px;               /* ✅ más estrecho (ajústalo si quieres 118/130) */
  min-height: 62px;
  padding: 12px 10px;

  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);

  color: var(--color-text-main);
  position:relative;
  overflow:hidden;

  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              filter var(--transition-fast);
}

.state-badge::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0));
  opacity:.55;
  pointer-events:none;
}

.state-badge:hover{
  transform: translateY(-2px);
  filter: saturate(1.06);
  box-shadow: 0 18px 40px -26px rgba(15, 23, 42, 0.65);
}
.state-badge:active{ transform: translateY(0); }

.state-badge-count{
  font-size:22px;
  font-weight:800;
  line-height:1.05;
  position:relative;
  z-index:1;
}

.state-badge-label{
  margin-top:4px;
  font-size:11px;            /* ✅ cabe mejor en globos estrechos */
  font-weight:800;
  letter-spacing:.07em;
  text-transform:uppercase;
  opacity:.86;
  position:relative;
  z-index:1;
  white-space:nowrap;        /* ✅ evita salto de línea */
}

/* Colores por estado */
.state-badge.badge-abierto{ background:#ECFDF3; }
.state-badge.badge-inicio{ background:#D1FAE5; }
.state-badge.badge-tramite{ background:#A7F3D0; }

.state-badge.badge-juzgado{ background:#EAF2FF; }
.state-badge.badge-apelacion{ background:#EAF2FF; }  /* ✅ APELACIÓN mismo azul claro */

.state-badge.badge-pendiente-cobro{ background:#E9D5FF; }
.state-badge.badge-archivado{ background:#F7C6C6; }
.state-badge.badge-finalizado{ background:#F7C6C6; }

.state-badge.badge-default{ background:#f3f4f6; }
