:root {
    --color-brand: #003363;
    --color-brand-dark: #002244;
    --color-brand-light: #00508a;
    --color-brand-bg: #e8f0f8;
    --color-brand-ring: rgba(0, 51, 99, 0.2);
}


.form-input{width:100%;padding:0.5rem 0.75rem;border:1px solid #d1d5db;border-radius:0.5rem;font-size:0.875rem;transition:all .2s;outline:none;box-sizing:border-box}
.form-input:focus{border-color:var(--color-brand);box-shadow:0 0 0 3px var(--color-brand-ring)}
select.form-input{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em;padding-right:2.5rem}
.pagination{display:flex;gap:.25rem;justify-content:center;margin-top:1rem}
.pagination a,.pagination span{padding:.375rem .75rem;border:1px solid #d1d5db;border-radius:.375rem;font-size:.875rem;color:#374151;text-decoration:none}
.pagination a:hover{background:#f3f4f6}
.pagination .current{background:#003363;color:#fff;border-color:#003363}

/* ========================================
   DOCUMENT GRID - Premium Card Style
   ======================================== */
.doc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:1.15rem;position:relative}

.doc-card{background:#fff;border:1px solid #e5e7eb;border-radius:0.85rem;overflow:hidden;transition:all 0.3s cubic-bezier(0.4,0,0.2,1);cursor:pointer;position:relative;will-change:transform}
.doc-card::before{content:'';position:absolute;inset:0;border-radius:inherit;opacity:0;transition:opacity 0.3s ease;background:linear-gradient(135deg,rgba(0,51,99,0.03),transparent 60%);pointer-events:none;z-index:1}
.doc-card:hover{transform:translateY(-5px);box-shadow:0 15px 40px rgba(0,0,0,0.1),0 4px 12px rgba(0,0,0,0.06);border-color:#c9cdd2}
.doc-card:hover::before{opacity:1}

/* ===== Thumbnail Area with gradient backgrounds ===== */
.doc-card-thumb{height:150px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}
.doc-card-thumb.pdf{background:linear-gradient(135deg,#fef2f2 0%,#fee2e2 100%)}
.doc-card-thumb.word{background:linear-gradient(135deg,#eff6ff 0%,#dbeafe 100%)}
.doc-card-thumb.imagen{background:linear-gradient(135deg,#e8f0f8 0%,#d0e2f0 100%)}
.doc-card-thumb.otro{background:linear-gradient(135deg,#f8f9fa 0%,#e5e7eb 100%)}
.doc-card-thumb::after{content:'';position:absolute;inset:0;background:linear-gradient(to bottom,transparent 65%,rgba(255,255,255,0.7) 100%);pointer-events:none}
.doc-card-thumb img{width:100%;height:100%;object-fit:cover;transition:transform 0.5s cubic-bezier(0.4,0,0.2,1)}
.doc-card:hover .doc-card-thumb img{transform:scale(1.1)}

/* Image thumbnail with loading placeholder */
.doc-card-thumb .img-wrapper{width:100%;height:100%;position:relative;overflow:hidden}
.doc-card-thumb .img-wrapper img{width:100%;height:100%;object-fit:cover}
.doc-card-thumb .img-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#f0f0f0;transition:opacity 0.4s ease}
.doc-card-thumb .img-placeholder.loaded{opacity:0;pointer-events:none}
.doc-card-thumb .img-placeholder svg{width:28px;height:28px;color:#d1d5db}

.doc-card-thumb .file-icon{width:62px;height:62px;border-radius:16px;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,0.08);position:relative;z-index:1;transition:transform 0.3s ease,box-shadow 0.3s ease}
.doc-card:hover .doc-card-thumb .file-icon{transform:scale(1.08) translateY(-2px);box-shadow:0 8px 20px rgba(0,0,0,0.12)}
.doc-card-thumb .file-icon svg{width:30px;height:30px}
.doc-card-thumb .file-icon.pdf{background:#fff;color:#dc2626}
.doc-card-thumb .file-icon.word{background:#fff;color:#2563eb}
.doc-card-thumb .file-icon.imagen{background:#fff;color:#16a34a}
.doc-card-thumb .file-icon.otro{background:#fff;color:#6b7280}

.doc-card-body{padding:0.85rem 0.9rem 0.7rem;position:relative;z-index:1}
.doc-card-body .doc-name{font-size:0.85rem;font-weight:600;color:#111827;line-height:1.4;display:block;white-space:normal;overflow:visible;min-height:1.4em}
.doc-card-body .doc-cat{margin-bottom:0.35rem}
.doc-card-body .doc-desc{font-size:0.7rem;color:#9ca3af;margin-top:0.2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.doc-card-body .doc-meta{display:flex;align-items:center;justify-content:space-between;margin-top:0.45rem;padding-top:0.45rem;border-top:1px solid #f0f0f0;font-size:0.68rem;color:#a0aec0}
.doc-card-body .doc-meta span{display:flex;align-items:center;gap:0.3rem}

.doc-card-actions{position:absolute;top:0.6rem;right:0.6rem;display:flex;gap:0.3rem;opacity:0;transition:all 0.25s ease;z-index:3;transform:translateY(-4px)}
.doc-card:hover .doc-card-actions{opacity:1;transform:translateY(0)}
.doc-card-actions a,.doc-card-actions button{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,0.95);border:1px solid #e5e7eb;color:#6b7280;transition:all 0.2s;cursor:pointer;backdrop-filter:blur(4px)}
.doc-card-actions a:hover,.doc-card-actions button:hover{background:#fff;box-shadow:0 4px 12px rgba(0,0,0,0.12);transform:scale(1.05)}
.doc-card-actions .action-view:hover{color:#003363;border-color:#003363}
.doc-card-actions .action-download:hover{color:#16a34a;border-color:#16a34a}
.doc-card-actions .action-delete:hover{color:#dc2626;border-color:#dc2626}

/* File type badge on card - glass morphism style */
.doc-type-badge{position:absolute;top:0.6rem;left:0.6rem;padding:0.2rem 0.55rem;border-radius:6px;font-size:0.6rem;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;z-index:2;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.doc-type-badge.pdf{background:rgba(220,38,38,0.15);color:#dc2626}
.doc-type-badge.word{background:rgba(37,99,235,0.15);color:#2563eb}
.doc-type-badge.imagen{background:rgba(0,0,0,0.45);color:#fff}
.doc-type-badge.otro{background:rgba(107,114,128,0.15);color:#6b7280}

/* ========================================
   UPLOAD MODAL - Premium Redesign
   ======================================== */
.upload-modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,0.7);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);z-index:100;display:flex;align-items:center;justify-content:center;padding:1rem;animation:fadeIn 0.25s ease}

.upload-modal{background:#fff;border-radius:1.15rem;width:100%;max-width:33rem;max-height:90vh;overflow-y:auto;box-shadow:0 35px 80px rgba(0,0,0,0.3),0 0 0 1px rgba(255,255,255,0.05);animation:scaleIn 0.35s cubic-bezier(0.34,1.56,0.64,1)}

/* ===== Header ===== */
.upload-modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1.35rem 1.5rem 1.15rem;border-bottom:1px solid #f0f0f0}
.upload-modal-title{display:flex;align-items:flex-start;gap:0.85rem}
.upload-title-icon{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#e8f0f8,#d0e2f0);color:#003363;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.upload-modal-title h3{font-size:1.05rem;font-weight:700;color:#111827;margin-bottom:0.15rem}
.upload-modal-subtitle{font-size:0.78rem;color:#9ca3af;line-height:1.4}
.upload-modal-close{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;color:#6b7280;cursor:pointer;transition:all 0.2s;flex-shrink:0}
.upload-modal-close:hover{background:#fee2e2;color:#dc2626;border-color:#fecaca;transform:rotate(90deg)}

.upload-modal-body{padding:1.25rem 1.5rem}

/* ===== Drop Zone - Cloud Upload Style ===== */
.upload-drop-area{border:2px dashed #d1d5db;border-radius:1rem;padding:2.5rem 1.5rem;text-align:center;cursor:pointer;transition:all 0.3s ease;margin-bottom:1rem;position:relative;background:#fafbfc}
.upload-drop-area::before{content:'';position:absolute;inset:-1px;border-radius:inherit;background:linear-gradient(135deg,var(--color-brand),rgba(0,51,99,0.3) 40%,transparent 70%);opacity:0;transition:opacity 0.4s ease;z-index:0;pointer-events:none}
.upload-drop-area:hover{background:#f0f5ff;border-color:var(--color-brand);transform:translateY(-2px)}
.upload-drop-area:hover::before{opacity:0.2}
.upload-drop-area.drag-over{background:linear-gradient(135deg,#e8f0f8,#f0f5ff);border-color:var(--color-brand);border-style:solid;transform:translateY(-3px) scale(1.01);box-shadow:0 12px 30px rgba(0,51,99,0.12)}
.upload-drop-area.drag-over::before{opacity:0.3}
.upload-drop-area > *{position:relative;z-index:1}

.upload-drop-cloud{width:70px;height:70px;border-radius:20px;background:linear-gradient(135deg,#e8f0f8 0%,#d0e2f0 100%);color:var(--color-brand);display:flex;align-items:center;justify-content:center;margin:0 auto 1rem;transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);box-shadow:0 4px 12px rgba(0,51,99,0.08)}
.upload-drop-area:hover .upload-drop-cloud{transform:scale(1.12) translateY(-4px);box-shadow:0 8px 24px rgba(0,51,99,0.18)}
.upload-drop-area.drag-over .upload-drop-cloud{transform:scale(1.15) translateY(-6px);box-shadow:0 12px 32px rgba(0,51,99,0.25);background:linear-gradient(135deg,#d0e2f0,#b8d4e8)}
.upload-drop-area.drag-over .upload-drop-cloud svg{animation:cloud-bounce 0.8s ease infinite}

.upload-drop-text{font-size:0.92rem;color:#374151;margin-bottom:0.3rem;font-weight:500}
.upload-drop-link{color:var(--color-brand);font-weight:700;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:2px;text-decoration-color:rgba(0,51,99,0.3)}
.upload-drop-link:hover{text-decoration-color:var(--color-brand)}
.upload-drop-hint{font-size:0.72rem;color:#a0aec0}

/* ===== File Preview Card ===== */
.upload-file-card{display:flex;align-items:center;gap:0.85rem;padding:0.85rem 1rem;background:linear-gradient(135deg,#f0fdf4,#ecfdf5);border:1px solid #bbf7d0;border-radius:0.85rem;margin-bottom:1rem;animation:scaleIn 0.3s cubic-bezier(0.34,1.56,0.64,1)}
.upload-file-icon{width:40px;height:40px;border-radius:10px;background:#dcfce7;color:#16a34a;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.upload-file-details{flex:1;min-width:0}
.upload-file-name{display:block;font-size:0.82rem;font-weight:600;color:#166534;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.upload-file-size{display:block;font-size:0.68rem;color:#6b7280;margin-top:0.1rem}
.upload-file-remove{width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;border:none;background:rgba(239,68,68,0.1);color:#ef4444;cursor:pointer;transition:all 0.2s;flex-shrink:0}
.upload-file-remove:hover{background:#fee2e2;transform:scale(1.1)}

/* ===== Form Fields ===== */
.upload-modal-fields{display:flex;flex-direction:column;gap:0.85rem;margin-bottom:1.25rem}
.upload-field-group{display:flex;flex-direction:column;gap:0.35rem}
.upload-field-label{display:flex;align-items:center;gap:0.4rem;font-size:0.78rem;font-weight:600;color:#374151}
.upload-field-label svg{width:13px;height:13px;color:#6b7280;flex-shrink:0}
.upload-field-input .form-input{padding:0.55rem 0.75rem;border-radius:0.6rem;font-size:0.82rem;border-color:#d1d5db}
.upload-field-input .form-input:focus{border-color:var(--color-brand);box-shadow:0 0 0 3px var(--color-brand-ring)}

/* ===== Footer buttons ===== */
.upload-modal-footer{display:flex;justify-content:flex-end;gap:0.75rem;padding-top:1rem;border-top:1px solid #f0f0f0;margin:0 -1.5rem -1.25rem;padding:1rem 1.5rem 1.25rem;background:#fafbfc;border-radius:0 0 1.15rem 1.15rem}
.upload-btn{display:inline-flex;align-items:center;gap:0.5rem;padding:0.55rem 1.15rem;border-radius:0.65rem;font-size:0.82rem;font-weight:600;cursor:pointer;transition:all 0.2s;border:none;text-decoration:none}
.upload-btn-cancel{background:#f3f4f6;color:#374151}
.upload-btn-cancel:hover{background:#e5e7eb}
.upload-btn-submit{background:linear-gradient(135deg,#059669,#10b981);color:#fff;box-shadow:0 2px 8px rgba(5,150,105,0.3)}
.upload-btn-submit:hover{background:linear-gradient(135deg,#047857,#059669);box-shadow:0 4px 16px rgba(5,150,105,0.4);transform:translateY(-1px)}
.upload-btn-submit:active{transform:translateY(0)}
.upload-btn-submit:disabled{opacity:0.5;cursor:not-allowed;transform:none}

@keyframes cloud-bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}

/* ========================================
   DOCUMENT PREVIEW MODAL
   ======================================== */
.doc-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.7);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);z-index:100;display:flex;align-items:center;justify-content:center;padding:1.5rem;animation:fadeIn 0.2s ease}

.doc-modal{background:#fff;border-radius:1rem;width:100%;max-width:70rem;max-height:90vh;overflow:hidden;box-shadow:0 25px 60px rgba(0,0,0,0.35);display:flex;flex-direction:column;animation:scaleIn 0.25s ease}

.doc-modal-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.25rem;border-bottom:1px solid #e5e7eb;background:#fafbfc}
.doc-modal-header .modal-title{font-size:0.95rem;font-weight:600;color:#1f2937;display:flex;align-items:center;gap:0.5rem}
.doc-modal-header .modal-title .title-icon{width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center}
.doc-modal-header .modal-title .title-icon.pdf{background:#fef2f2;color:#dc2626}
.doc-modal-header .modal-title .title-icon.word{background:#eff6ff;color:#2563eb}
.doc-modal-header .modal-title .title-icon.imagen{background:#f0fdf4;color:#16a34a}
.doc-modal-header .modal-title .title-icon.otro{background:#f8f9fa;color:#6b7280}
.doc-modal-header .modal-actions{display:flex;gap:0.5rem;align-items:center}
.doc-modal-header .modal-actions a,.doc-modal-header .modal-actions button{width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;color:#6b7280;cursor:pointer;transition:all 0.15s;text-decoration:none}
.doc-modal-header .modal-actions a:hover,.doc-modal-header .modal-actions button:hover{background:#f3f4f6;box-shadow:0 1px 3px rgba(0,0,0,0.06)}
.doc-modal-header .modal-actions .close-btn:hover{color:#dc2626;border-color:#dc2626}
.doc-modal-header .modal-actions .download-btn:hover{color:#16a34a;border-color:#16a34a}

.doc-modal-body{flex:1;overflow:hidden;background:#f3f4f6;display:flex;align-items:center;justify-content:center;min-height:50vh}
.doc-modal-body iframe{width:100%;height:100%;border:none}
.doc-modal-body img{max-width:100%;max-height:80vh;object-fit:contain;box-shadow:0 4px 20px rgba(0,0,0,0.1);border-radius:0.5rem}
.doc-modal-body .unsupported-preview{text-align:center;padding:3rem;color:#6b7280}
.doc-modal-body .unsupported-preview .big-icon{margin-bottom:1rem}

.doc-modal-footer{padding:0.75rem 1.25rem;border-top:1px solid #e5e7eb;background:#fafbfc;display:flex;justify-content:space-between;align-items:center;font-size:0.75rem;color:#9ca3af}

/* ========================================
   UPLOAD FORM INLINE (inside grid area)
   ======================================== */
.doc-upload-card{background:#fff;border:2px dashed #d1d5db;border-radius:0.75rem;padding:1.5rem;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;transition:all 0.25s;cursor:default;min-height:180px}
.doc-upload-card:hover{border-color:#003363;background:#f8faff}

/* Label wraps the clickable upload area */
.doc-upload-card .upload-label{display:flex;flex-direction:column;align-items:center;cursor:pointer;width:100%}
.doc-upload-card .upload-icon{width:40px;height:40px;border-radius:10px;background:#e8f0f8;color:#003363;display:flex;align-items:center;justify-content:center;margin-bottom:0.5rem}
.doc-upload-card p{font-size:0.8rem;color:#6b7280}
.doc-upload-card p strong{color:#003363}
.doc-upload-card .upload-hint{font-size:0.65rem;color:#9ca3af;margin-top:0.25rem}

/* Hidden file input - accessible for label click */
.file-input-hidden{position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none}

/* ========================================
   ACTION BUTTONS (icon-based for tables)
   ======================================== */
.action-btn{display:inline-flex;align-items:center;gap:0.35rem;padding:0.35rem 0.65rem;border-radius:0.5rem;font-size:0.8rem;font-weight:500;transition:all 0.15s ease;text-decoration:none;border:1px solid transparent}
.action-btn svg{width:14px;height:14px;flex-shrink:0}

.action-btn.view{color:var(--color-brand);background:var(--color-brand-bg);border-color:transparent}
.action-btn.view:hover{background:#d0e2f0;box-shadow:0 1px 3px rgba(0,51,99,0.15)}

.action-btn.edit{color:#b45309;background:#fef3c7;border-color:transparent}
.action-btn.edit:hover{background:#fde68a;box-shadow:0 1px 3px rgba(180,83,9,0.15)}

.action-btn.delete{color:#dc2626;background:#fef2f2;border-color:transparent}
.action-btn.delete:hover{background:#fecaca;box-shadow:0 1px 3px rgba(220,38,38,0.15)}

.action-btn.download{color:#16a34a;background:#f0fdf4;border-color:transparent}
.action-btn.download:hover{background:#bbf7d0;box-shadow:0 1px 3px rgba(22,163,74,0.15)}

.action-btn.activate{color:#16a34a;background:#f0fdf4;border-color:transparent}
.action-btn.activate:hover{background:#bbf7d0;box-shadow:0 1px 3px rgba(22,163,74,0.15)}

.action-btn.deactivate{color:#dc2626;background:#fef2f2;border-color:transparent}
.action-btn.deactivate:hover{background:#fecaca;box-shadow:0 1px 3px rgba(220,38,38,0.15)}

/* ========================================
   STATUS BADGES
   ======================================== */
.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:0.35rem}
.status-dot.active{background:#22c55e;box-shadow:0 0 0 2px rgba(34,197,94,0.3)}
.status-dot.inactive{background:#ef4444;box-shadow:0 0 0 2px rgba(239,68,68,0.3)}

.role-badge{display:inline-flex;align-items:center;gap:0.3rem;padding:0.2rem 0.6rem;border-radius:999px;font-size:0.7rem;font-weight:600;line-height:1.4}
.role-badge.admin{background:#ede9fe;color:#6d28d9}
.role-badge.analyst{background:var(--color-brand-bg);color:var(--color-brand)}
.role-badge.staff{background:#f3f4f6;color:#4b5563}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes scaleIn{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}
@keyframes fadeInUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
.fade-in{animation:fadeIn 1.8s ease-out both}
.fade-in-up{animation:fadeInUp 0.8s ease-out both}
.fade-in-up-d1{animation:fadeInUp 0.7s ease-out 0.1s both}
.fade-in-up-d2{animation:fadeInUp 0.7s ease-out 0.2s both}
.fade-in-up-d3{animation:fadeInUp 0.7s ease-out 0.3s both}
.fade-in-up-d4{animation:fadeInUp 0.7s ease-out 0.4s both}

/* ========================================
   DRAG & DROP OVERLAY
   ======================================== */
.doc-drop-overlay{position:absolute;inset:0;background:rgba(0,51,99,0.08);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);border-radius:0.75rem;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity 0.25s ease;z-index:5;border:2px dashed transparent}
.doc-grid.drag-active .doc-drop-overlay{opacity:1;border-color:#003363}
.doc-grid.drag-active .doc-card,.doc-grid.drag-active .doc-upload-card,.doc-grid.drag-active .col-span-full{pointer-events:none;opacity:0.3}
.doc-drop-overlay .drop-content{text-align:center;color:#003363}
.doc-drop-overlay .drop-content svg{animation:bounce 1s ease infinite}
.doc-drop-overlay .drop-title{font-size:1.1rem;font-weight:600;margin-top:0.75rem}
.doc-drop-overlay .drop-hint{font-size:0.8rem;color:#4a7aaa;margin-top:0.25rem}

/* Upload spinner */
.doc-upload-card.uploading{cursor:wait;border-color:#003363;background:#f8faff}
.doc-upload-card.uploading .upload-icon,.doc-upload-card.uploading p,.doc-upload-card.uploading .upload-hint{pointer-events:none}
.spinner{animation:spin 1s linear infinite}

/* ========================================
   DASHBOARD CARDS ENHANCEMENTS
   ======================================== */
.stat-card{position:relative;overflow:hidden;transition:all 0.3s cubic-bezier(0.4,0,0.2,1)}
.stat-card:hover{box-shadow:0 12px 30px rgba(0,0,0,0.1)}
.stat-card .stat-accent{position:absolute;top:0;left:0;width:4px;height:100%;border-radius:0 3px 3px 0}
.stat-card .stat-icon{width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:transform 0.3s ease}
.stat-card:hover .stat-icon{transform:scale(1.1)}
.stat-card .stat-value{font-size:1.75rem;font-weight:700;line-height:1.2}
.stat-card .stat-label{font-size:0.8rem;font-weight:500;opacity:0.8}

/* ========================================
   CATEGORY BADGES - Premium
   ======================================== */
.doc-card-body .doc-cat{margin-top:0.2rem;margin-bottom:0.15rem}
.cat-badge{display:inline-block;padding:0.2rem 0.55rem;border-radius:999px;font-size:0.6rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;box-shadow:0 1px 2px rgba(0,0,0,0.05);transition:all 0.2s ease}
.doc-card:hover .cat-badge{transform:scale(1.02)}
.cat-leyes{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#92400e}
.cat-documentos{background:linear-gradient(135deg,#dbeafe,#bfdbfe);color:#1e40af}
.cat-memo{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#5b21b6}
.cat-actas{background:linear-gradient(135deg,#fef2f2,#fecaca);color:#991b1b}

/* Filter pills with shadow */
.cat-leyes.active{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#92400e;box-shadow:0 0 0 2px #f59e0b,0 2px 8px rgba(245,158,11,0.25)}
.cat-documentos.active{background:linear-gradient(135deg,#dbeafe,#bfdbfe);color:#1e40af;box-shadow:0 0 0 2px #3b82f6,0 2px 8px rgba(59,130,246,0.25)}
.cat-memo.active{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#5b21b6;box-shadow:0 0 0 2px #8b5cf6,0 2px 8px rgba(139,92,246,0.25)}
.cat-actas.active{background:linear-gradient(135deg,#fef2f2,#fecaca);color:#991b1b;box-shadow:0 0 0 2px #ef4444,0 2px 8px rgba(239,68,68,0.25)}

/* Custom scrollbar for content area */
main::-webkit-scrollbar{width:10px}
main::-webkit-scrollbar-track{background:#f1f5f9;border-radius:5px}
main::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:5px;border:2px solid #f1f5f9}
main::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* Custom scrollbar utility class for any scroll container */
.custom-scrollbar::-webkit-scrollbar{width:8px}
.custom-scrollbar::-webkit-scrollbar-track{background:#f1f5f9;border-radius:4px}
.custom-scrollbar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px;border:2px solid #f1f5f9}
.custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* Firefox scrollbar support */
main{scrollbar-width:thin;scrollbar-color:#cbd5e1 #f1f5f9}
.custom-scrollbar{scrollbar-width:thin;scrollbar-color:#cbd5e1 #f1f5f9}

/* Refined empty state */
.doc-grid .col-span-full svg{opacity:0.4}
.doc-grid .col-span-full p.text-sm{color:#9ca3af;font-weight:500}
.doc-grid .col-span-full p.text-xs{color:#d1d5db}

/* ========================================
   BÚSQUEDA GLOBAL (Ctrl+K) MODAL
   ======================================== */
.search-modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,0.75);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);z-index:200;display:flex;align-items:flex-start;justify-content:center;padding:6rem 1rem 1rem;animation:fadeIn 0.2s ease}

.search-modal{width:100%;max-width:42rem;background:#fff;border-radius:1.15rem;box-shadow:0 35px 80px rgba(0,0,0,0.3),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden;animation:scaleIn 0.25s cubic-bezier(0.34,1.56,0.64,1);max-height:calc(100vh - 8rem);display:flex;flex-direction:column}

.search-modal-header{display:flex;align-items:center;gap:0.75rem;padding:0.75rem 1rem;border-bottom:1px solid #e5e7eb}

.search-input-wrapper{flex:1;position:relative;display:flex;align-items:center}
.search-input-icon{position:absolute;left:0.75rem;color:#9ca3af;pointer-events:none;flex-shrink:0}
.search-input{width:100%;border:none;outline:none;font-size:1rem;padding:0.5rem 2.25rem 0.5rem 2.5rem;color:#111827;background:transparent;font-family:inherit}
.search-input::placeholder{color:#9ca3af}
.search-input-clear{position:absolute;right:0.25rem;width:28px;height:28px;border-radius:6px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:#9ca3af;cursor:pointer;transition:all 0.15s;flex-shrink:0}
.search-input-clear:hover{background:#f3f4f6;color:#374151}

.search-modal-close kbd{display:inline-flex;align-items:center;padding:0.2rem 0.5rem;font-size:0.7rem;font-weight:600;color:#6b7280;background:#f3f4f6;border:1px solid #e5e7eb;border-radius:6px;font-family:inherit;line-height:1.4}

.search-modal-body{flex:1;overflow-y:auto;min-height:120px;padding:0.5rem 0}

/* Loader */
.search-loader{display:flex;align-items:center;justify-content:center;gap:0.75rem;padding:2.5rem;color:#6b7280;font-size:0.88rem}
.search-loader-spinner{width:20px;height:20px;border:2.5px solid #e5e7eb;border-top-color:var(--color-brand);border-radius:50%;animation:spin 0.7s linear infinite}

/* Empty state */
.search-empty{display:flex;flex-direction:column;align-items:center;padding:3rem 1.5rem;text-align:center}
.search-empty-icon svg{color:#d1d5db;margin-bottom:0.75rem}
.search-empty-title{font-size:1rem;font-weight:600;color:#6b7280;margin-bottom:0.25rem}
.search-empty-hint{font-size:0.82rem;color:#9ca3af}

/* Results */
.search-results{padding:0.25rem 0}

/* Group */
.search-group{margin-bottom:0.25rem}
.search-group:last-child{margin-bottom:0}
.search-group-label{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem 0.35rem;font-size:0.68rem;font-weight:700;color:#6b7280;text-transform:uppercase;letter-spacing:0.05em}
.search-group-icon{display:inline-flex;color:#9ca3af}
.search-group-icon svg{width:12px;height:12px}

/* Result item */
.search-result-item{display:flex;align-items:center;gap:0.5rem;padding:0.55rem 1rem;text-decoration:none;transition:all 0.1s;border-left:3px solid transparent;cursor:pointer}
.search-result-item:hover,.search-result-item.search-item-selected{background:#f0f5ff;border-left-color:var(--color-brand)}

.search-item-content{flex:1;min-width:0}
.search-item-title{display:block;font-size:0.88rem;font-weight:500;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.search-item-subtitle{display:block;font-size:0.72rem;color:#9ca3af;margin-top:0.05rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.search-item-arrow{flex-shrink:0;color:#d1d5db}
.search-result-item:hover .search-item-arrow,.search-result-item.search-item-selected .search-item-arrow{color:var(--color-brand)}

/* Footer hints */
.search-modal-footer{padding:0.55rem 1rem;border-top:1px solid #f0f0f0;background:#fafbfc}
.search-footer-hints{display:flex;gap:1.25rem;justify-content:center}
.search-footer-hints span{display:inline-flex;align-items:center;gap:0.35rem;font-size:0.7rem;color:#9ca3af}
.search-footer-hints kbd{display:inline-flex;align-items:center;padding:0.1rem 0.4rem;font-size:0.65rem;font-weight:600;color:#6b7280;background:#f3f4f6;border:1px solid #e5e7eb;border-radius:4px;font-family:inherit;line-height:1.3}

/* Responsive */
@media(max-width:640px){
.search-modal-overlay{align-items:flex-end;padding:0}
.search-modal{border-radius:1.15rem 1.15rem 0 0;max-height:85vh;max-width:100%}
.search-input{font-size:0.92rem}
.search-footer-hints{gap:0.75rem;flex-wrap:wrap}
}

@keyframes bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}

/* ========================================
   PREMIUM FORM CARDS
   ======================================== */
.form-card{background:#fff;border-radius:1.15rem;box-shadow:0 1px 3px rgba(0,0,0,0.04),0 4px 16px rgba(0,0,0,0.03);border:1px solid #e5e7eb;overflow:hidden;animation:scaleIn 0.35s cubic-bezier(0.34,1.56,0.64,1)}

.form-card-header{display:flex;align-items:flex-start;gap:1rem;padding:1.35rem 1.5rem 1rem;border-bottom:1px solid #f0f0f0}
.form-card-header .form-header-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.form-card-header .form-header-icon.purple{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#6d28d9}
.form-card-header .form-header-icon.blue{background:linear-gradient(135deg,#e8f0f8,#d0e2f0);color:var(--color-brand)}
.form-card-header .form-header-icon.green{background:linear-gradient(135deg,#d1fae5,#a7f3d0);color:#059669}
.form-card-header .form-header-icon.yellow{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#b45309}
.form-card-header .form-header-icon.orange{background:linear-gradient(135deg,#fed7aa,#fdba74);color:#c2410c}
.form-card-header .form-header-icon.red{background:linear-gradient(135deg,#fef2f2,#fecaca);color:#dc2626}
.form-card-header .form-header-text h3{font-size:1.05rem;font-weight:700;color:#111827;margin-bottom:0.1rem}
.form-card-header .form-header-text p{font-size:0.78rem;color:#9ca3af;line-height:1.4}

.form-card-body{padding:1.35rem 1.5rem}

.form-card-body .form-section-title{font-size:0.75rem;font-weight:700;color:#6b7280;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:1rem;padding-bottom:0.5rem;border-bottom:1px solid #f0f0f0}

.form-field-group{margin-bottom:1.15rem}
.form-field-group:last-child{margin-bottom:0}
.form-field-label{display:flex;align-items:center;gap:0.4rem;font-size:0.78rem;font-weight:600;color:#374151;margin-bottom:0.4rem}
.form-field-label svg{width:13px;height:13px;color:#6b7280;flex-shrink:0}
.form-field-input .form-input{padding:0.55rem 0.75rem;border-radius:0.6rem;font-size:0.82rem;border-color:#d1d5db;background:#fff;transition:all 0.2s}
.form-field-input .form-input:hover{border-color:#9ca3af}
.form-field-input .form-input:focus{border-color:var(--color-brand);box-shadow:0 0 0 3px var(--color-brand-ring);background:#fff}
.form-field-input textarea.form-input{resize:vertical;min-height:80px}
.form-field-input .form-input[type="file"]{padding:0.35rem;font-size:0.78rem}
.form-field-error{font-size:0.72rem;color:#dc2626;margin-top:0.3rem;display:flex;align-items:center;gap:0.3rem}
.form-field-help{font-size:0.7rem;color:#a0aec0;margin-top:0.25rem}

.form-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:0.75rem;padding:1rem 1.5rem 1.25rem;background:#fafbfc;border-top:1px solid #f0f0f0;border-radius:0 0 1.15rem 1.15rem;margin-top:0.5rem}

.form-btn{display:inline-flex;align-items:center;gap:0.5rem;padding:0.55rem 1.25rem;border-radius:0.65rem;font-size:0.82rem;font-weight:600;cursor:pointer;transition:all 0.2s;border:none;text-decoration:none;line-height:1.4}
.form-btn-cancel{background:#f3f4f6;color:#374151}
.form-btn-cancel:hover{background:#e5e7eb;color:#111827}
.form-btn-submit{background:linear-gradient(135deg,var(--color-brand),var(--color-brand-light));color:#fff;box-shadow:0 2px 8px rgba(0,51,99,0.25)}
.form-btn-submit:hover{background:linear-gradient(135deg,var(--color-brand-dark),var(--color-brand));box-shadow:0 4px 16px rgba(0,51,99,0.35);transform:translateY(-1px)}
.form-btn-submit:active{transform:translateY(0)}
.form-btn-submit svg{width:15px;height:15px}

/* Inline back link in forms */
.form-back-link{display:inline-flex;align-items:center;gap:0.4rem;padding:0.35rem 0.75rem;font-size:0.8rem;font-weight:500;color:#6b7280;text-decoration:none;border-radius:0.5rem;transition:all 0.15s;margin-bottom:0.75rem}
.form-back-link:hover{color:var(--color-brand);background:var(--color-brand-bg)}
.form-back-link svg{width:15px;height:15px}

/* ========================================
   PREMIUM PLACEHOLDER / EMPTY STATE
   ======================================== */
.placeholder-card{background:#fff;border-radius:1.15rem;box-shadow:0 1px 3px rgba(0,0,0,0.04),0 4px 16px rgba(0,0,0,0.03);border:1px solid #e5e7eb;overflow:hidden;animation:scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1)}
.placeholder-body{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 2rem;text-align:center}
.placeholder-icon{width:96px;height:96px;border-radius:24px;display:flex;align-items:center;justify-content:center;margin-bottom:1.5rem;animation:float 3s ease-in-out infinite}
.placeholder-icon.purple{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#6d28d9}
.placeholder-icon svg{width:48px;height:48px}
.placeholder-body h3{font-size:1.25rem;font-weight:700;color:#374151;margin-bottom:0.5rem}
.placeholder-body p{font-size:0.88rem;color:#9ca3af;max-width:28rem;line-height:1.5}
.placeholder-badges{display:flex;gap:0.5rem;margin-top:1.5rem}
.placeholder-badge{display:inline-flex;align-items:center;gap:0.35rem;padding:0.35rem 0.85rem;border-radius:999px;font-size:0.72rem;font-weight:600}
.placeholder-badge.blue{background:var(--color-brand-bg);color:var(--color-brand)}
.placeholder-badge.green{background:#f0fdf4;color:#059669}

@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}

/* ========================================
   PAGE ENTER ANIMATION
   ======================================== */
.page-content{animation:scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1)}

/* Click feedback on action buttons */
.action-btn{transition:all 0.15s cubic-bezier(0.4,0,0.2,1)}
.action-btn:active{transform:scale(0.92)}

/* Table row click ripple */
tr.clickable-row{cursor:pointer;transition:background 0.15s,transform 0.1s}
tr.clickable-row:active{transform:scale(0.985);background:#f0f5ff!important}

/* Enhanced hover for view links */
.action-btn.view{transition:all 0.2s cubic-bezier(0.4,0,0.2,1)}
.action-btn.view:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,51,99,0.2)}
.action-btn.view:active{transform:translateY(0) scale(0.92)}

/* Card hover lift already exists, but add active press */
.doc-card:active{transform:scale(0.98);transition-duration:0.05s}

/* Smooth stat card */
.stat-card{transition:all 0.3s cubic-bezier(0.4,0,0.2,1)}
.stat-card:active{transform:scale(0.98)}

/* Sidebar active indicator animation */
nav a{transition:all 0.2s cubic-bezier(0.4,0,0.2,1)}
nav a:active{transform:scale(0.97)}

/* Animación de entrada para secciones dentro de la página */
.section-fade{animation:fadeInUp 0.5s ease-out both}
.section-fade-d1{animation:fadeInUp 0.5s ease-out 0.05s both}
.section-fade-d2{animation:fadeInUp 0.5s ease-out 0.1s both}
.section-fade-d3{animation:fadeInUp 0.5s ease-out 0.15s both}
.section-fade-d4{animation:fadeInUp 0.5s ease-out 0.2s both}

/* Responsive */
@media(max-width:640px){
.doc-grid{grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:0.7rem}
.doc-card-thumb{height:110px}
.doc-modal{padding:0;border-radius:0;max-height:100vh}
.doc-modal-overlay{padding:0}
.upload-modal{margin:0.5rem;max-height:95vh}
.doc-card-body{padding:0.7rem 0.7rem 0.6rem}
.doc-card-body .doc-name{font-size:0.78rem}
.form-card-header,.form-card-body,.form-card-actions{padding-left:1.15rem;padding-right:1.15rem}

.stat-card .stat-icon{width:40px;height:40px}
.stat-card .stat-value{font-size:1.35rem}
}

@media(min-width:641px)and(max-width:1023px){
.stat-card .stat-value{font-size:1.5rem}

}

/* ============================================
   STAT CARDS PREMIUM (added by automation)
   ============================================ */
.statcard {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    padding: 0.75rem 1rem;
    transition: box-shadow .25s cubic-bezier(.16,1,.3,1),
                transform .25s cubic-bezier(.16,1,.3,1),
                border-color .25s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}
.statcard:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px -12px rgba(0,51,99,0.18),
                0 4px 6px -4px rgba(0,51,99,0.06);
    border-color: #d1d5db;
}
.statcard::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--stat-accent, transparent);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.statcard:hover::before { opacity: 0.04; }

.statcard::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, #e5e7eb);
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    transition: opacity .35s ease, box-shadow .35s ease, height .35s ease;
}

.statcard:hover::after {
    opacity: 1;
    height: 4px;
    box-shadow: 0 0 16px 1px color-mix(in srgb, var(--stat-accent) 40%, transparent);
}

.statcard--compact {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 80px;
}

.statcard-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    background: linear-gradient(135deg, var(--stat-color-from, #2563eb), var(--stat-color-to, #1e40af));
    box-shadow: 0 4px 10px -2px rgba(0,0,0,0.15);
    flex-shrink: 0;
    transition: box-shadow .3s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}

.statcard:hover .statcard-icon {
    box-shadow: 0 0 24px -2px color-mix(in srgb, var(--stat-accent) 50%, transparent), 0 4px 10px -2px rgba(0,0,0,0.15);
    transform: scale(1.12);
}
.statcard-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
}
.statcard-value {
    font-size: 1.25rem;
    line-height: 1.1;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0;
    font-variant-numeric: tabular-nums;
}
.statcard-label {
    font-size: .75rem;
    color: #64748b;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.statcard-trend {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .625rem;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
    line-height: 1;
    height: fit-content;
    flex-shrink: 0;
}
.statcard-trend--good    { background: #dcfce7; color: #166534; }
.statcard-trend--bad     { background: #fee2e2; color: #991b1b; }
.statcard-trend--neutral { background: #f1f5f9; color: #475569; }

.statcard--blue    { --stat-color-from:#2563eb; --stat-color-to:#1e40af; --stat-accent:#2563eb; }
.statcard--indigo  { --stat-color-from:#6366f1; --stat-color-to:#4338ca; --stat-accent:#6366f1; }
.statcard--violet  { --stat-color-from:#8b5cf6; --stat-color-to:#6d28d9; --stat-accent:#8b5cf6; }
.statcard--emerald { --stat-color-from:#10b981; --stat-color-to:#047857; --stat-accent:#10b981; }
.statcard--amber   { --stat-color-from:#f59e0b; --stat-color-to:#b45309; --stat-accent:#f59e0b; }
.statcard--rose    { --stat-color-from:#f43f5e; --stat-color-to:#be123c; --stat-accent:#f43f5e; }
.statcard--slate   { --stat-color-from:#475569; --stat-color-to:#1e293b; --stat-accent:#475569; }
.statcard--cyan    { --stat-color-from:#06b6d4; --stat-color-to:#0e7490; --stat-accent:#06b6d4; }

.statcard-live {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .625rem;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
    margin-left: auto;
}
.statcard-live::before {
    content: "";
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
    animation: statcard-pulse 1.6s infinite;
}
@keyframes statcard-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
    70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.statcard { animation: statcard-fade-up .35s cubic-bezier(.16,1,.3,1) both; }
.statcard:nth-child(2) { animation-delay: .04s; }
.statcard:nth-child(3) { animation-delay: .08s; }
.statcard:nth-child(4) { animation-delay: .12s; }
.statcard:nth-child(5) { animation-delay: .16s; }
.statcard:nth-child(6) { animation-delay: .20s; }
.statcard:nth-child(7) { animation-delay: .24s; }
.statcard:nth-child(8) { animation-delay: .28s; }
@keyframes statcard-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .statcard { padding: 0.75rem 0.875rem; }
    .statcard-icon { width: 2rem; height: 2rem; }
    .statcard-icon svg { width: 1.1rem; height: 1.1rem; }
    .statcard-value { font-size: 1.15rem; }
    .statcard-label { font-size: 0.75rem; }
    .statcard-trend { padding: 0.2rem 0.5rem; font-size: 0.7rem; }
    .statcard-live { font-size: 0.625rem; }
    .statcard--compact { gap: 0.625rem; min-height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    .statcard, .statcard:hover { transform: none; animation: none; }
    .statcard-live::before { animation: none; }
}

/* ============================================
   TOPBAR PREMIUM
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}
.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.topbar-left { flex: 1 1 auto; }
.topbar-right { flex: 0 0 auto; }

/* Breadcrumb */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #4b5563;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background .15s ease, color .15s ease;
}
.breadcrumb-link:hover { background: #f3f4f6; color: #003363; }

/* Botón de bienvenida / Inicio */
.breadcrumb-home-link {
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: all .2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}
.breadcrumb-home-link:hover {
    background: linear-gradient(135deg, #003363 0%, #004a80 100%);
    border-color: #003363;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,51,99,0.25);
    transform: translateY(-1px);
}
.breadcrumb-home-link:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,51,99,0.2); }
.breadcrumb-home-icon {
    width: 16px;
    height: 16px;
    transition: transform .2s ease;
}
.breadcrumb-home-link:hover .breadcrumb-home-icon { transform: scale(1.1); }
@media (prefers-reduced-motion: reduce) {
    .breadcrumb-home-link, .breadcrumb-home-link .breadcrumb-home-icon {
        transition: none; transform: none;
    }
}

.breadcrumb-separator { color: #d1d5db; margin: 0 0.125rem; }
.breadcrumb-current { color: #111827; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-home-label { white-space: nowrap; }

/* Online indicator */
.topbar-online {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    color: #16a34a;
    background: #f0fdf4;
    border-radius: 9999px;
    white-space: nowrap;
    margin-left: 0.25rem;
}
.topbar-online-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: topbar-online-pulse 1.6s infinite;
}
@keyframes topbar-online-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70%  { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Search button */
.topbar-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    color: #6b7280;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    height: 36px;
}
.topbar-search-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.topbar-search-btn svg { width: 16px; height: 16px; stroke-width: 2; }
.topbar-search-label { white-space: nowrap; }
.topbar-kbd {
    display: inline-block;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #4b5563;
    line-height: 1.4;
}

/* Bell */
.topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
    color: #4b5563;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.topbar-bell:hover { background: #f3f4f6; color: #003363; }
.topbar-bell svg { width: 20px; height: 20px; stroke-width: 2; }
.topbar-bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 9999px;
    border: 2px solid #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* User menu */
.topbar-user { position: relative; }
.topbar-user-trigger {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 9999px;
    line-height: 0;
}
.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
    background: linear-gradient(135deg, #003363, #00234d);
    color: #ffffff;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: box-shadow .2s ease;
}
.topbar-user-trigger:hover .topbar-avatar {
    box-shadow: 0 0 0 4px rgba(0, 51, 99, 0.12);
}
.topbar-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 240px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15), 0 6px 10px -5px rgba(0,0,0,0.08);
    padding: 0.375rem;
    z-index: 50;
    animation: topbar-menu-in .15s cubic-bezier(.16,1,.3,1);
    transform-origin: top right;
}
.topbar-user-menu[hidden] { display: none; }
@keyframes topbar-menu-in {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.user-menu-header {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 0.375rem;
}
.user-menu-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.125rem 0;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.user-menu-email {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #374151;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    border-radius: 0.375rem;
    transition: background .12s ease, color .12s ease;
    cursor: pointer;
}
.user-menu-item:hover { background: #f3f4f6; color: #111827; }
.user-menu-item svg { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.user-menu-item--danger { color: #b91c1c; }
.user-menu-item--danger:hover { background: #fef2f2; color: #991b1b; }
.user-menu-divider { border-top: 1px solid #f3f4f6; margin: 0.25rem 0; }
.user-menu-form { margin: 0; padding: 0; }

/* Mobile */
@media (max-width: 640px) {
    .topbar { padding: 0 0.75rem; }
    .topbar-search-label, .topbar-kbd { display: none; }
    .topbar-search-btn { padding: 0; width: 36px; justify-content: center; gap: 0; }
    .breadcrumb-home-label { display: none; }
    .breadcrumb-home-icon { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .topbar-user-menu, .topbar-online-dot { animation: none; }
}

/* ============================================
   LOGIN SPLIT-SCREEN PREMIUM (v2)
   ============================================ */

.login-body {
    margin: 0;
    min-height: 100vh;
    background: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.login-body.is-locked .login-form-panel {
    overflow-y: auto;
    align-items: flex-start;
}

.login-split-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    min-height: 100vh;
    width: 100%;
}

/* ===== Brand Panel ===== */
.login-brand-panel {
    position: relative;
    background: linear-gradient(150deg, var(--color-brand-dark) 0%, var(--color-brand) 45%, var(--color-brand-light) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5rem 3rem;
    overflow: hidden;
    animation: login-brand-in 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-blobs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.login-blobs .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    will-change: transform;
}
.login-blobs .blob-1 {
    top: -10%;
    left: -15%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(0, 185, 247, 0.8) 0%, rgba(0, 185, 247, 0) 70%);
    animation: login-blob-float-a 14s ease-in-out infinite;
}
.login-blobs .blob-2 {
    bottom: -20%;
    right: -10%;
    width: 540px;
    height: 540px;
    background: radial-gradient(circle, rgba(99, 179, 237, 0.85) 0%, rgba(99, 179, 237, 0) 70%);
    animation: login-blob-float-b 18s ease-in-out infinite;
}
.login-blobs .blob-3 {
    top: 40%;
    left: 35%;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(56, 178, 172, 0.5) 0%, rgba(56, 178, 172, 0) 70%);
    animation: login-blob-float-c 22s ease-in-out infinite;
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 460px;
}
.brand-logo-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    animation: login-stagger-in 700ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.brand-logo {
    height: 64px;
    width: auto;
    display: block;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3)) brightness(1.1);
    position: relative;
    z-index: 2;
}
.brand-logo-ring {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 185, 247, 0.25) 0%, transparent 70%);
    animation: login-logo-glow 4s ease-in-out infinite;
    z-index: 1;
}

.brand-heading {
    font-size: 2.75rem;
    font-weight: 800;
    margin: 0 0 0.75rem 0;
    line-height: 1.05;
    letter-spacing: -0.02em;
    animation: login-stagger-in 700ms 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.brand-heading-accent {
    background: linear-gradient(135deg, #00b9f7 0%, #38b2ac 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.brand-tagline {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 2.5rem 0;
    line-height: 1.5;
    animation: login-stagger-in 700ms 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.brand-highlight {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: login-stagger-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.brand-highlight:nth-child(1) { animation-delay: 400ms; }
.brand-highlight:nth-child(2) { animation-delay: 500ms; }
.brand-highlight:nth-child(3) { animation-delay: 600ms; }
.brand-highlight-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 185, 247, 0.18);
    color: #00b9f7;
    border-radius: 10px;
}
.brand-highlight-icon svg {
    width: 22px;
    height: 22px;
}
.brand-highlight strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
}
.brand-highlight span {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
}

.brand-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.brand-version {
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Form Panel ===== */
.login-form-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(circle at top right, rgba(0, 185, 247, 0.06) 0%, transparent 50%),
        radial-gradient(circle at bottom left, rgba(56, 178, 172, 0.05) 0%, transparent 50%),
        #f8fafc;
    overflow-y: auto;
}

.login-skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-brand);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 0 8px 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 100;
    transition: top 200ms ease;
}
.login-skip-link:focus {
    top: 0;
    outline: 3px solid rgba(0, 185, 247, 0.5);
    outline-offset: 2px;
}

/* ===== Glass Card ===== */
.login-glass-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 20px;
    padding: 2.5rem 2.25rem;
    box-shadow:
        0 20px 60px -10px rgba(0, 51, 99, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.08);
    animation: login-card-in 700ms 150ms cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
}
.login-glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, transparent 50%);
}

.card-header {
    text-align: center;
    margin-bottom: 1.75rem;
}
.card-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
}
.card-subheading {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0;
}

/* ===== Alerts ===== */
.login-alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    animation: login-shake 400ms;
}
.login-alert svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}
.login-alert-warn {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.login-alert-warn svg { color: #d97706; }
.login-alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.login-alert-error svg { color: #dc2626; }

/* ===== Form ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.02em;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(247, 250, 252, 0.7);
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 200ms ease;
}
.input-wrapper:focus-within {
    border-color: var(--color-brand);
    background: white;
    box-shadow: 0 0 0 4px var(--color-brand-ring);
}
.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.875rem;
    color: #94a3b8;
    transition: color 200ms ease;
}
.input-icon svg {
    width: 18px;
    height: 18px;
}
.input-wrapper:focus-within .input-icon {
    color: var(--color-brand);
}
.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 0.5rem 0.75rem 0;
    font-size: 0.9375rem;
    color: #0f172a;
    outline: none;
    min-width: 0;
}
.input-wrapper input::placeholder {
    color: #94a3b8;
}
.input-wrapper input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.btn-toggle-pass {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0 0.875rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 200ms ease;
}
.btn-toggle-pass:hover:not(:disabled) {
    color: var(--color-brand);
}
.btn-toggle-pass:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
.btn-toggle-pass svg {
    width: 18px;
    height: 18px;
}
/* Eye icons: shown/hidden by aria-pressed state, not inline style */
.btn-toggle-pass .icon-eye-closed { display: none; }
.btn-toggle-pass[aria-pressed="true"] .icon-eye-open { display: none; }
.btn-toggle-pass[aria-pressed="true"] .icon-eye-closed { display: block; }

/* ===== Submit Button (with spinner) ===== */
.btn-submit {
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 51, 99, 0.25);
    transition: all 250ms ease;
}
.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 51, 99, 0.35);
    background: linear-gradient(135deg, var(--color-brand-dark) 0%, var(--color-brand) 100%);
}
.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}
.btn-submit:focus-visible {
    outline: 3px solid var(--color-brand-ring);
    outline-offset: 2px;
}
.btn-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
.btn-submit-spinner {
    display: none;
    align-items: center;
}
.btn-submit-spinner svg {
    width: 18px;
    height: 18px;
    animation: login-spin 0.9s linear infinite;
}
.btn-submit.is-loading .btn-submit-text { display: none; }
.btn-submit.is-loading .btn-submit-spinner { display: inline-flex; }
.btn-submit-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0s;
}
.btn-submit:hover:not(:disabled) .btn-submit-shimmer {
    transform: translateX(100%);
    transition: transform 700ms ease;
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
}
.card-footer-tagline {
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

/* ===== Toasts ===== */
#toast-container,
.toast-wrapper {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: calc(100vw - 2.5rem);
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.85rem;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 6px 12px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    min-width: 300px;
    max-width: 440px;
    animation: toast-in 350ms cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.15;
}

.toast-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.toast-content {
    flex: 1;
    min-width: 0;
    padding-right: 0.5rem;
}

.toast-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.15rem;
}

.toast-text {
    font-size: 0.875rem;
    color: #4b5563;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.45rem;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
    padding: 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.2;
    animation: toast-progress 4s linear forwards;
    border-radius: 0 0 0 0.85rem;
}

.toast-out {
    animation: toast-out 350ms forwards;
}

.toast-error { border-left-color: #ef4444; color: #991b1b; }
.toast-error .toast-icon { background: #fef2f2; color: #ef4444; }

.toast-warning { border-left-color: #f59e0b; color: #92400e; }
.toast-warning .toast-icon { background: #fffbeb; color: #f59e0b; }

.toast-success { border-left-color: #10b981; color: #065f46; }
.toast-success .toast-icon { background: #f0fdf4; color: #10b981; }

.toast-info { border-left-color: #3b82f6; color: #1e40af; }
.toast-info .toast-icon { background: #eff6ff; color: #3b82f6; }

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ===== Animations ===== */
@keyframes login-brand-in {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes login-stagger-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes login-card-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes login-blob-float-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 60px) scale(1.12); }
}
@keyframes login-blob-float-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-100px, -80px) scale(1.18); }
}
@keyframes login-blob-float-c {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, -90px) scale(0.88); }
}
@keyframes login-logo-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}
@keyframes login-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
@keyframes login-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ===== Responsive: collapse to single column ===== */
@media (max-width: 900px) {
    .login-split-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: 100vh;
    }
    .login-brand-panel {
        padding: 1.5rem 1.25rem;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        animation: none;
    }
    .brand-content {
        flex: 1;
        max-width: none;
        display: flex;
        align-items: center;
        gap: 0.875rem;
        flex-wrap: wrap;
    }
    .brand-logo-wrap {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .brand-logo {
        height: 44px;
    }
    .brand-heading {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
        flex: 1;
    }
    .brand-tagline {
        font-size: 0.8125rem;
        margin-bottom: 0;
        flex-basis: 100%;
        margin-top: 0.25rem;
    }
    .brand-highlights,
    .brand-footer {
        display: none;
    }
    .login-blobs .blob { filter: blur(40px); }
    .login-blobs .blob-1 { width: 280px; height: 280px; }
    .login-blobs .blob-2 { width: 320px; height: 320px; }
    .login-blobs .blob-3 { display: none; }

    .login-form-panel {
        padding: 1.5rem;
        align-items: flex-start;
    }
    .login-glass-card {
        padding: 1.75rem 1.5rem;
        animation-duration: 500ms;
    }
    .card-heading { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .login-brand-panel { padding: 1.25rem 1rem; }
    .brand-heading { font-size: 1.25rem; }
    .login-glass-card { padding: 1.5rem 1.25rem; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    .login-body *,
    .login-body *::before,
    .login-body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .login-blobs .blob { animation: none; }
    .brand-logo-ring { animation: none; }
}

/* ============================================
   PERSONAL LIST ACTION ICONS
   ============================================ */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.action-icon:hover { transform: translateY(-1px); }
.action-icon.view { background-color: #e8f0f8; color: #003363; }
.action-icon.view:hover { background-color: #d0e2f0; }
.action-icon.edit { background-color: #fef3c7; color: #b45309; }
.action-icon.edit:hover { background-color: #fde68a; }
.action-icon.qr { background-color: #003363; color: #fff; }
.action-icon.qr:hover { background-color: #004a80; }
.action-icon.delete { background-color: #fee2e2; color: #dc2626; }
.action-icon.delete:hover { background-color: #fecaca; }
.action-icon svg { width: 1rem; height: 1rem; }

.action-icon-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 3.5rem;
    padding: 0.375rem 0.25rem;
    border-radius: 0.5rem;
    font-size: 0.625rem;
    line-height: 1;
    font-weight: 500;
    transition: all 0.15s ease;
}
.action-icon-label.view { background-color: #e8f0f8; color: #003363; }
.action-icon-label.view:hover { background-color: #d0e2f0; }
.action-icon-label.edit { background-color: #fef3c7; color: #b45309; }
.action-icon-label.edit:hover { background-color: #fde68a; }
.action-icon-label.qr { background-color: #003363; color: #fff; }
.action-icon-label.qr:hover { background-color: #004a80; }
.action-icon-label.delete { background-color: #fee2e2; color: #dc2626; }
.action-icon-label.delete:hover { background-color: #fecaca; }
.action-icon-label svg { width: 1rem; height: 1rem; }
