/* ============================================================
   Sistema Hotel Escuela UASD - Estilos Globales
   Paleta: Azul UASD #003082 + Dorado #F5A800
   ============================================================ */

:root {
    /* Colores UASD */
    --uasd-azul:          #003082;
    --uasd-azul-oscuro:   #001f5a;
    --uasd-azul-claro:    #0e4fc4;
    --uasd-dorado:        #F5A800;
    --uasd-dorado-oscuro: #d48c00;
    --uasd-dorado-claro:  #ffc233;

    /* Colores sistema */
    --color-exito:        #16a34a;
    --color-advertencia:  #d97706;
    --color-error:        #dc2626;
    --color-info:         #0284c7;

    /* Fondos */
    --bg-app:             #f0f4f8;
    --bg-sidebar:         #001f5a;
    --bg-card:            #ffffff;
    --bg-header:          #003082;

    /* Texto */
    --texto:              #1e293b;
    --texto-claro:        #64748b;
    --texto-sidebar:      rgba(255,255,255,0.85);
    --texto-sidebar-hover:#ffffff;

    /* Layout */
    --sidebar-ancho:      260px;
    --navbar-altura:      64px;
    --border-radius:      10px;
    --border-radius-sm:   6px;
    --shadow:             0 2px 12px rgba(0,48,130,0.10);
    --shadow-lg:          0 8px 32px rgba(0,48,130,0.14);
    --border:             #e2e8f0;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--texto);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--uasd-azul); text-decoration: none; transition: color .2s; }
a:hover { color: var(--uasd-azul-claro); }

img { max-width: 100%; height: auto; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-ancho);
    background: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .3s ease;
    box-shadow: 2px 0 20px rgba(0,0,0,0.25);
}

.sidebar-brand {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 80px;
}

.sidebar-brand-logo {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 4px;
}

.sidebar-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand-text {
    flex: 1;
}

.sidebar-brand-name {
    font-size: 13px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.sidebar-brand-sub {
    font-size: 10px;
    color: var(--uasd-dorado);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar-section {
    padding: 6px 16px 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-top: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--texto-sidebar);
    font-size: 13.5px;
    font-weight: 500;
    transition: all .18s;
    margin: 1px 8px;
    border-radius: 7px;
    cursor: pointer;
    position: relative;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-item.active {
    background: var(--uasd-dorado);
    color: var(--uasd-azul-oscuro);
    font-weight: 600;
}

.sidebar-item.active svg {
    stroke: var(--uasd-azul-oscuro);
}

.sidebar-item svg {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    stroke: rgba(255,255,255,0.65);
    transition: stroke .18s;
}

.sidebar-item:hover svg {
    stroke: white;
}

.sidebar-item-badge {
    margin-left: auto;
    background: var(--uasd-dorado);
    color: var(--uasd-azul-oscuro);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.5;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--uasd-dorado);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--uasd-azul-oscuro);
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-role {
    font-size: 10.5px;
    color: rgba(255,255,255,0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   NAVBAR SUPERIOR
   ============================================================ */
.main-layout {
    margin-left: var(--sidebar-ancho);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    height: var(--navbar-altura);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 8px rgba(0,48,130,0.06);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--texto-claro);
    border-radius: 6px;
    transition: background .2s;
}

.navbar-toggle:hover { background: var(--bg-app); }

.navbar-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--texto-claro);
}

.navbar-breadcrumb-current {
    font-weight: 600;
    color: var(--texto);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texto-claro);
    transition: all .2s;
    position: relative;
}

.navbar-btn:hover {
    background: var(--bg-app);
    color: var(--uasd-azul);
    border-color: var(--uasd-azul);
}

.navbar-btn .badge-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background: var(--color-error);
    border-radius: 50%;
    border: 2px solid white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .2s;
}

.navbar-user:hover {
    background: var(--bg-app);
    border-color: var(--uasd-azul);
}

.navbar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--uasd-azul);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.navbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--texto);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.main-content {
    flex: 1;
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--texto);
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title svg {
    flex-shrink: 0;
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--texto-claro);
    margin-top: 3px;
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--texto);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: #fafafa;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue   { background: #eff6ff; color: var(--uasd-azul); }
.stat-icon.gold   { background: #fffbeb; color: var(--uasd-dorado-oscuro); }
.stat-icon.green  { background: #f0fdf4; color: var(--color-exito); }
.stat-icon.red    { background: #fef2f2; color: var(--color-error); }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }
.stat-icon.teal   { background: #f0fdfa; color: #0d9488; }

.stat-info {}
.stat-number {
    font-size: 26px;
    font-weight: 800;
    color: var(--texto);
    line-height: 1;
}
.stat-label {
    font-size: 12.5px;
    color: var(--texto-claro);
    margin-top: 3px;
    font-weight: 500;
}
.stat-change {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 600;
}
.stat-change.positive { color: var(--color-exito); }
.stat-change.negative { color: var(--color-error); }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--uasd-azul);
    color: white;
    box-shadow: 0 2px 8px rgba(0,48,130,0.3);
}
.btn-primary:hover { background: var(--uasd-azul-claro); color: white; box-shadow: 0 4px 14px rgba(0,48,130,0.35); }

.btn-gold {
    background: var(--uasd-dorado);
    color: var(--uasd-azul-oscuro);
    box-shadow: 0 2px 8px rgba(245,168,0,0.35);
}
.btn-gold:hover { background: var(--uasd-dorado-oscuro); color: var(--uasd-azul-oscuro); }

.btn-success {
    background: var(--color-exito);
    color: white;
    box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}
.btn-success:hover { background: #15803d; color: white; }

.btn-danger {
    background: var(--color-error);
    color: white;
    box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.btn-danger:hover { background: #b91c1c; color: white; }

.btn-warning {
    background: var(--color-advertencia);
    color: white;
    box-shadow: 0 2px 8px rgba(217,119,6,0.25);
}
.btn-warning:hover { background: #b45309; color: white; }

.btn-secondary {
    background: #64748b;
    color: white;
}
.btn-secondary:hover { background: #475569; color: white; }

.btn-outline {
    background: transparent;
    color: var(--uasd-azul);
    border: 1.5px solid var(--uasd-azul);
}
.btn-outline:hover { background: var(--uasd-azul); color: white; }

.btn-outline-gray {
    background: transparent;
    color: var(--texto-claro);
    border: 1.5px solid var(--border);
}
.btn-outline-gray:hover { background: var(--bg-app); color: var(--texto); }

.btn-ghost {
    background: transparent;
    color: var(--texto-claro);
    padding: 7px 12px;
}
.btn-ghost:hover { background: var(--bg-app); color: var(--texto); }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 15px;
}

.btn-icon {
    padding: 8px;
    border-radius: 7px;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--color-error);
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    font-size: 14px;
    color: var(--texto);
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--border-radius-sm);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    line-height: 1.5;
}

.form-control:focus {
    border-color: var(--uasd-azul);
    box-shadow: 0 0 0 3px rgba(0,48,130,0.12);
}

.form-control:disabled {
    background: #f8fafc;
    color: var(--texto-claro);
    cursor: not-allowed;
}

.form-control.error {
    border-color: var(--color-error);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 11.5px;
    color: var(--texto-claro);
    margin-top: 4px;
}

.form-error {
    font-size: 11.5px;
    color: var(--color-error);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Checkbox y Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--uasd-azul);
    cursor: pointer;
}

.form-check-label {
    font-size: 13.5px;
    color: var(--texto);
    cursor: pointer;
}

/* Input group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child { border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm); }
.input-group .form-control:last-child  { border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0; }

.input-group-addon {
    padding: 9px 14px;
    background: #f1f5f9;
    border: 1.5px solid var(--border);
    font-size: 13.5px;
    color: var(--texto-claro);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.input-group-addon:first-child {
    border-right: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.input-group-addon:last-child {
    border-left: none;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* ============================================================
   TABLAS
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    background: #f8fafc;
    color: var(--texto-claro);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--texto);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8faff;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(even) {
    background: #fafbfc;
}

.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-primary   { background: #dbeafe; color: var(--uasd-azul); }
.badge-success   { background: #dcfce7; color: #166534; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-gold      { background: #fffbeb; color: #78350f; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.alert-success  { background: #f0fdf4; border-color: var(--color-exito); color: #166534; }
.alert-danger   { background: #fef2f2; border-color: var(--color-error); color: #991b1b; }
.alert-warning  { background: #fffbeb; border-color: var(--color-advertencia); color: #92400e; }
.alert-info     { background: #eff6ff; border-color: var(--color-info); color: #075985; }

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: .6;
    line-height: 1;
    padding: 0 2px;
    transition: opacity .2s;
    color: inherit;
    flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* ============================================================
   PAGINACION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--texto);
    transition: all .2s;
}

.pagination a:hover {
    background: var(--bg-app);
    border-color: var(--uasd-azul);
    color: var(--uasd-azul);
}

.pagination .active {
    background: var(--uasd-azul);
    color: white;
    border-color: var(--uasd-azul);
    font-weight: 600;
}

.pagination .disabled {
    opacity: .4;
    pointer-events: none;
}

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}

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

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform .25s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--texto);
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--texto-claro);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    line-height: 1;
}

.modal-close:hover { background: var(--bg-app); color: var(--texto); }

.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   PAGINA DE LOGIN
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #001f5a 0%, #003082 40%, #0e4fc4 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(245,168,0,0.08);
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -60px;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    z-index: 1;
}

.login-left-content {
    max-width: 420px;
    text-align: center;
}

.login-logo-wrap {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 24px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    padding: 16px;
}

.login-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-institution {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--uasd-dorado);
    margin-bottom: 10px;
}

.login-title {
    font-size: 32px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 14px;
}

.login-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 36px;
    text-align: left;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.75);
    font-size: 13.5px;
}

.login-feature-icon {
    width: 34px;
    height: 34px;
    background: rgba(245,168,0,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--uasd-dorado);
}

.login-right {
    width: 480px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
}

.login-form-wrap {
    width: 100%;
    max-width: 360px;
}

.login-form-header {
    margin-bottom: 32px;
}

.login-form-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--texto);
    margin-bottom: 8px;
}

.login-form-sub {
    font-size: 14px;
    color: var(--texto-claro);
}

.login-input-group {
    position: relative;
    margin-bottom: 18px;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--texto-claro);
    pointer-events: none;
}

.login-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14.5px;
    color: var(--texto);
    background: #f8fafc;
    transition: all .2s;
    outline: none;
}

.login-input:focus {
    border-color: var(--uasd-azul);
    background: white;
    box-shadow: 0 0 0 4px rgba(0,48,130,0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--uasd-azul);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(0,48,130,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.login-btn:hover {
    background: var(--uasd-azul-claro);
    box-shadow: 0 6px 20px rgba(0,48,130,0.4);
    transform: translateY(-1px);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    color: var(--texto-claro);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-footer-text {
    font-size: 12px;
    color: var(--texto-claro);
    text-align: center;
    margin-top: 28px;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all .2s;
    overflow: hidden;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13.5px;
    color: var(--texto);
    transition: background .15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-app);
    color: var(--uasd-azul);
}

.dropdown-item.danger { color: var(--color-error); }
.dropdown-item.danger:hover { background: #fef2f2; }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--texto-claro);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    text-decoration: none;
}

.tab:hover { color: var(--uasd-azul); }
.tab.active { color: var(--uasd-azul); border-bottom-color: var(--uasd-azul); }

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(0,48,130,0.2);
    border-top-color: var(--uasd-azul);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--texto-claro);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 13.5px;
    max-width: 300px;
    margin: 0 auto 20px;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.text-primary  { color: var(--uasd-azul) !important; }
.text-gold     { color: var(--uasd-dorado-oscuro) !important; }
.text-success  { color: var(--color-exito) !important; }
.text-danger   { color: var(--color-error) !important; }
.text-warning  { color: var(--color-advertencia) !important; }
.text-muted    { color: var(--texto-claro) !important; }

.bg-primary    { background: var(--uasd-azul) !important; color: white !important; }
.bg-gold       { background: var(--uasd-dorado) !important; }

.fw-bold       { font-weight: 700; }
.fw-semibold   { font-weight: 600; }
.text-sm       { font-size: 12.5px; }
.text-xs       { font-size: 11px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }

.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1         { gap: 6px; }
.gap-2         { gap: 12px; }
.gap-3         { gap: 18px; }
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.w-full        { width: 100%; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-layout {
        margin-left: 0;
    }
    .navbar-toggle {
        display: flex;
    }
    .sidebar-overlay {
        display: block;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

@media (max-width: 768px) {
    .login-page { flex-direction: column; }
    .login-left { padding: 32px 24px; display: none; }
    .login-right { width: 100%; min-height: 100vh; padding: 32px 24px; }

    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 12px; }
    .page-actions { width: 100%; }
    .modal { margin: 0; border-radius: 0; max-height: 100vh; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .btn-lg { padding: 11px 20px; }
}

/* ============================================================
   GALERÍA DE FOTOS (GestorArchivos::renderGaleria)
   ============================================================ */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.galeria-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border);
    aspect-ratio: 4/3;
    background: #f1f5f9;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
}

.galeria-item:hover {
    border-color: var(--uasd-azul);
    transform: scale(1.02);
}

.galeria-item.principal {
    border-color: var(--uasd-dorado);
    border-width: 2.5px;
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.galeria-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--uasd-dorado);
    color: #78350f;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.galeria-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    padding: 20px 8px 8px;
    display: flex;
    gap: 6px;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.galeria-item:hover .galeria-actions {
    opacity: 1;
}

.galeria-actions button {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.galeria-actions button:hover       { background: white; }
.galeria-actions button.danger      { color: var(--color-error); }
.galeria-actions button.danger:hover{ background: #fee2e2; }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #fafafa;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--uasd-azul);
    background: #eff6ff;
    color: var(--uasd-azul);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone-icon {
    color: #94a3b8;
    margin-bottom: 10px;
}

.upload-zone-text {
    font-size: 13.5px;
    color: #64748b;
    font-weight: 500;
}

.upload-zone-hint {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Preview de archivos antes de subir */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.upload-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--border);
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(220,38,38,.85);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar, .navbar, .page-actions, .btn { display: none !important; }
    .main-layout { margin-left: 0; }
    .main-content { padding: 0; }
}
