/* ==========================================================================
   Concepto Docs & Firmas — Corporate Navy & Coral Design System
   Azul marino corporativo como identidad principal + coral como acento
   ========================================================================== */

:root {
    /* Superficies y Fondos (tinte azul muy sutil) */
    --bg-body: #f4f7fb;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.96);
    --bg-card: #ffffff;
    --bg-card-hover: #fbfcfe;
    --bg-surface: #eaf0f7;
    --bg-input: #ffffff;
    
    /* Identidad Principal: Azul Marino */
    --primary: #1b2f55;              /* Azul marino corporativo */
    --primary-hover: #12213f;        /* Marino profundo hover */
    --primary-light: rgba(27, 47, 85, 0.07);
    --primary-glow: 0 4px 14px rgba(27, 47, 85, 0.22);
    --primary-gradient: linear-gradient(135deg, #1b2f55 0%, #2c4a7e 100%);

    /* Acento: Coral */
    --accent: #ff6f61;               /* Coral */
    --accent-hover: #f0533f;
    --accent-light: rgba(255, 111, 97, 0.12);
    --accent-glow: 0 4px 14px rgba(255, 111, 97, 0.30);

    /* Acentos Funcionales de Estado */
    --teal: #0f766e;
    --teal-light: rgba(15, 118, 110, 0.10);

    --emerald: #059669;              /* Verde éxito / firmado digital */
    --emerald-light: rgba(5, 150, 105, 0.10);

    --amber: #d97706;                /* Ámbar pendiente */
    --amber-light: rgba(217, 119, 6, 0.10);

    --rose: #dc2626;                 /* Rojo alerta (distinto del coral) */
    --rose-light: rgba(220, 38, 38, 0.10);

    --purple: #6366f1;               /* Índigo suave */
    --purple-light: rgba(99, 102, 241, 0.10);

    --cyan: #0284c7;
    --cyan-light: rgba(2, 132, 199, 0.10);

    /* Textos & Bordes Nítidos */
    --text-main: #14213d;            /* Marino casi negro */
    --text-muted: #4a5a75;           /* Gris azulado legible */
    --text-subtle: #94a3b8;          /* Gris slate claro */

    --border-subtle: #dfe6f0;        /* Borde azul frío */
    --border-hover: #1b2f55;         /* Borde marino al interactuar */

    /* Radios & Sombras */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 3px -1px rgba(15, 23, 42, 0.03);
    --shadow-dropdown: 0 15px 30px rgba(15, 23, 42, 0.12);

    /* Tipografía */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ==========================================================================
   Layout Principal (Sidebar + Main Wrapper)
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Barra Lateral */
.sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    height: 74px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: var(--primary-glow);
    border-bottom: 3px solid var(--accent);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-text small {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: var(--primary);
    background: var(--primary-light);
    transform: translateX(3px);
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
    border-left: 3px solid var(--accent);
}

.sidebar-link-icon {
    font-size: 1.15rem;
    width: 24px;
    display: inline-flex;
    justify-content: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    background: #f7f9fc;
}

.portal-switch-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.portal-switch-card:hover {
    border-color: var(--accent);
    background: #fff6f5;
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar */
.topbar {
    height: 74px;
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.topbar-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(22, 163, 74, 0.08);
    color: var(--emerald);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 6px var(--emerald);
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.user-avatar-bubble {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

/* Page Container */
.page-container {
    flex: 1;
    padding: 2.25rem 2rem;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

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

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Tarjetas & Grid Systems (Estilo Dermotienda)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -3px rgba(27, 47, 85, 0.10);
    border-color: var(--accent);
}

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-top: 0.15rem;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up { color: var(--emerald); }
.trend-down { color: var(--amber); }

/* Temas de Fondo para Iconos */
.bg-indigo { background: var(--primary-light); color: var(--primary); }
.bg-coral { background: var(--accent-light); color: var(--accent-hover); }
.bg-emerald { background: var(--emerald-light); color: var(--emerald); }
.bg-amber { background: var(--amber-light); color: var(--amber); }
.bg-purple { background: var(--purple-light); color: var(--purple); }
.bg-rose { background: var(--rose-light); color: var(--rose); }
.bg-cyan { background: var(--cyan-light); color: var(--cyan); }

/* Grids */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tarjeta Principal */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #ffffff;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-body {
    padding: 1.75rem;
}

.card-body.p-0 {
    padding: 0;
}

/* ==========================================================================
   Botones & Acciones
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.88rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(27, 47, 85, 0.30);
}

.btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: var(--accent-glow);
}
.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-emerald {
    background: var(--emerald);
    color: white;
}
.btn-emerald:hover {
    background: #15803d;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: #f4f7fb;
    border-color: var(--primary);
}

.btn-danger {
    background: var(--rose);
    color: white;
}
.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--rose);
    color: var(--rose);
}
.btn-outline-danger:hover {
    background: var(--rose);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.85rem;
    font-size: 0.98rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.98) !important;
}

/* ==========================================================================
   Formularios & Controles
   ========================================================================== */
.form-grid {
    display: grid;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.15rem;
    color: var(--text-main);
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231b2f55' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Barra de Búsqueda */
.search-wrapper {
    position: relative;
    max-width: 380px;
    width: 100%;
}

.search-input {
    padding-left: 2.75rem;
    border-radius: var(--radius-full);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    pointer-events: none;
}

/* ==========================================================================
   Tablas & Presentación de Datos
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background: #eef2f8;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.table td {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    font-size: 0.92rem;
    background: #ffffff;
}

.table tbody tr:hover td {
    background: #f6f8fc;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.avatar-bubble {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: capitalize;
}

.badge-success { background: var(--emerald-light); color: var(--emerald); border: 1px solid rgba(5, 150, 105, 0.2); }
.badge-amber { background: var(--amber-light); color: var(--amber); border: 1px solid rgba(217, 119, 6, 0.25); }
.badge-danger { background: var(--rose-light); color: var(--rose); border: 1px solid rgba(220, 38, 38, 0.2); }
.badge-purple { background: var(--purple-light); color: var(--purple); border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-indigo { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(27, 47, 85, 0.18); }
.badge-coral { background: var(--accent-light); color: var(--accent-hover); border: 1px solid rgba(255, 111, 97, 0.3); }
.badge-gray { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border-subtle); }

.badge-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}

/* Alertas */
.alert {
    padding: 1.1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.alert-close:hover { opacity: 1; }

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 33, 63, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow-dropdown);
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 1.35rem 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
}

/* Login Page (Limpia y con identidad fresca) */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 85% 10%, rgba(255, 111, 97, 0.14) 0%, transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(27, 47, 85, 0.12) 0%, transparent 45%),
        #f4f7fb;
    padding: 1.5rem;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px -15px rgba(27, 47, 85, 0.18);
    border-top: 4px solid var(--accent);
}

.login-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.25rem;
    box-shadow: var(--primary-glow);
    border-bottom: 3px solid var(--accent);
    color: white;
}

.login-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.25rem;
}

/* ==========================================================================
   Selector de Portales (Diseño aprobado idéntico a Humioza)
   ========================================================================== */
.portal-selection-body {
    min-height: 100vh;
    background-color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
}

.portal-selection-container {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

.portal-selection-header {
    text-align: center;
    margin-bottom: 3rem;
}

.portal-selection-title {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    font-size: 2.45rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    margin-bottom: 0.65rem;
}

.portal-selection-subtitle {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.5;
}

.portal-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.portal-choice-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 2.75rem 2.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    cursor: pointer;
}

.portal-choice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(27, 47, 85, 0.12), 0 8px 10px -6px rgba(27, 47, 85, 0.06);
    border-color: var(--accent);
}

.portal-choice-icon-wrap {
    width: 52px;
    height: 52px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
    color: #ffffff;
    transition: transform 0.2s ease;
}

.portal-choice-card:hover .portal-choice-icon-wrap {
    transform: scale(1.06);
    background: var(--accent);
}

.portal-choice-tag {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}

.portal-choice-heading {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.portal-choice-desc {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    min-height: 48px;
}

.portal-choice-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bg-surface);
    color: var(--primary);
    border: 1px solid var(--border-subtle);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
    width: fit-content;
    margin-bottom: 2rem;
}

.portal-choice-action {
    margin-top: auto;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-hover);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.2s ease;
}

.portal-choice-card:hover .portal-choice-action {
    gap: 0.75rem;
}

/* Footer */
.app-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    background: #ffffff;
}

.footer-tech {
    display: flex;
    gap: 0.5rem;
}

.tech-chip {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block;
    }
    .grid-2col, .grid-3col, .portal-selection-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-container {
        padding: 1.25rem 1rem;
    }
    .topbar {
        padding: 0 1rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}