/* Hoja de estilo siguiendo los colores generales IIEc-UNAM */

/* Reset y base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Open Sans', 'Roboto', Arial, sans-serif;
    background: #f0f0f0;
    margin: 20px;
    color: #1a1a1a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: solid 1px #face78;
}

.container-narrow {
    max-width: 600px;
}

/* Flash messages */
.flash {
    padding: 10px;
    margin: 10px 0;
    border: 2px solid;
    border-radius: 0;
}

.flash-error {
    background: #fee;
    color: #c00;
    border-color: #dc3545;
}

.flash-success {
    background: #e6f5e6;
    color: #0a0;
    border-color: #28a745;
}

.flash-notice {
    background: #eef;
    color: #0056b3;
    border-color: #6a8fc2;
}

/* Menú */
.menu {
    background: #597fb1;
    padding: 0;
    border-bottom: solid 2px #6a8fc2;
    margin: -20px -20px 20px -20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.menu a {
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    margin: 0;
    border-radius: 0;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
}

.menu a:hover {
    background: #6a8fc2;
    color: white;
}

.menu a:last-child {
    margin-left: auto;
    background: #6a8fc2;
}

.menu a:last-child:hover {
    background: #7a9fd2;
}

/* Títulos */
h1, h2, h3 {
    color: #1a1a1a;
    text-align: center;
    font-weight: 600;
}

h1 { font-size: 1.8em; }
h2 { font-size: 1.4em; }

.welcome {
    text-align: center;
    color: #597fb1;
    margin: 20px 0;
    padding: 1em;
    background: #fff7e2;
    border: solid 1px #face78;
}

/* Formularios */
label {
    display: block;
    margin: 10px 0 5px;
    color: #333;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', 'Roboto', Arial, sans-serif;
    background: white;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: #597fb1;
    outline: 1px solid #597fb1;
}

input[type="text"].small,
input[type="password"].small {
    width: auto;
    display: inline-block;
}

input[type="submit"],
.btn {
    padding: 8px 24px;
    background: #597fb1;
    color: white;
    border: 1px solid #6a8fc2;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Open Sans', 'Roboto', Arial, sans-serif;
    margin: 5px 5px 5px 0;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

input[type="submit"]:hover,
.btn:hover {
    background: #6a8fc2;
    border-color: #7a9fd2;
}

.btn-danger {
    background: #dc3545;
    border-color: #c82333;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.btn-block {
    width: 100%;
    display: block;
    text-align: center;
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse;
    border: solid #face78 2px;
    margin: 0.5em 0;
}

th {
    background: #fff7e2;
    padding: 8px 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px solid #face78;
}

td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee6d1;
}

tr:nth-child(even) {
    background: #f5f0e8;
}

tr:nth-child(odd) {
    background: white;
}

tr:hover {
    background: #fff7e2 !important;
}

/* Controles de tabla */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff7e2;
    padding: 8px 12px;
    border: 1px solid #face78;
}

.controls a {
    color: #597fb1;
    text-decoration: none;
    padding: 4px 8px;
}

.controls a:hover {
    background: #e8edf5;
}

.controls .current {
    font-weight: bold;
    color: #1a1a1a;
}

/* Filtro de letras */
.letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 15px 0;
    background: #fff7e2;
    padding: 8px 12px;
    border: 1px solid #face78;
}

.letters a,
.letters span {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    text-decoration: none;
    color: #597fb1;
    background: white;
    font-weight: bold;
}

.letters a:hover {
    background: #597fb1;
    color: white;
    border-color: #597fb1;
}

.letters .current {
    background: #597fb1;
    color: white;
    border-color: #597fb1;
}

/* Acciones de admin */
.admin-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.admin-actions a {
    color: #597fb1;
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid #d1d5db;
    font-size: 12px;
    background: white;
}

.admin-actions a:hover {
    background: #e8edf5;
    border-color: #597fb1;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dashboard-card {
    background: #fff7e2;
    padding: 20px;
    text-align: center;
    border: 1px solid #face78;
}

.dashboard-card a {
    color: #597fb1;
    text-decoration: none;
    font-weight: bold;
    display: block;
    padding: 10px;
}

.dashboard-card a:hover {
    background: #e8edf5;
}

/* Warnings */
.warning {
    background: #fff7e2;
    padding: 15px;
    border: 2px solid #dc3545;
    margin: 15px 0;
    color: #1a1a1a;
}

.warning p {
    margin: 5px 0;
}

.warning strong {
    color: #dc3545;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    color: #666;
    font-size: 12px;
    border-top: 1px solid #eee6d1;
}

.footer a {
    color: #597fb1;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Helpers */
.text-muted {
    color: #666;
    font-size: 12px;
}

.inline {
    display: inline-block;
}

.flex {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.my-10 { margin: 10px 0; }

/* Login pages */
#loginreq {
    background-color: #fff7e2;
    padding: 2em;
    border: solid 2px #face78;
    max-width: 500px;
    margin: 0 auto;
}

/* Paginador */
.paginador {
    width: auto;
    text-align: center;
    background: #fff7e2;
    border: solid #face78 1px;
    margin-top: 1.5em;
    margin-left: auto;
    margin-right: auto;
    padding: 0.3em 1em;
    display: inline-block;
}

/* Ajustes para login */
.login-container {
    max-width: 500px;
}

/* Responsive */
@media (max-width: 768px) {
    .menu {
        flex-direction: column;
        align-items: stretch;
        margin: -20px -20px 20px -20px;
    }
    
    .menu a {
        padding: 10px 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .menu a:last-child {
        margin-left: 0;
    }
    
    .container {
        padding: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 14px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
}
