:root {
    --azul: #14345c;
    --azul-claro: #1f5a96;
    --gris-fondo: #f2f4f7;
    --gris-borde: #dde1e6;
    --texto: #222;
    --verde: #1c7c3e;
    --rojo: #b3261e;
    --amarillo: #a86a00;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--gris-fondo);
    color: var(--texto);
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--azul);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 20px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav { display: flex; flex-direction: column; padding: 12px 0; flex: 1; }
.sidebar-nav a {
    color: #d9e4f2;
    text-decoration: none;
    padding: 10px 18px;
    font-size: .92rem;
}
.sidebar-nav a:hover { background: var(--azul-claro); color: #fff; }

.sidebar-user {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: .85rem;
}
.rol-badge { font-size: .7rem; opacity: .8; margin: 2px 0 8px; }
.logout-link { color: #ffb4b4; text-decoration: none; font-size: .8rem; }

.content { flex: 1; padding: 24px 32px; max-width: 1400px; }
.content-full { flex: 1; }

.content-header h1 { margin: 0 0 16px; font-size: 1.4rem; color: var(--azul); }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: #e4f5e9; color: var(--verde); border: 1px solid #b6e3c4; }
.alert-error { background: #fbe7e6; color: var(--rojo); border: 1px solid #f2b8b5; }

.card {
    background: #fff;
    border: 1px solid var(--gris-borde);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table th, table td { padding: 8px 10px; border-bottom: 1px solid var(--gris-borde); text-align: left; }
table th { background: #eef1f5; color: var(--azul); }
table tr:hover { background: #f8fafc; }

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: var(--azul-claro);
    color: #fff;
    cursor: pointer;
    font-size: .88rem;
    text-decoration: none;
}
.btn:hover { background: var(--azul); }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #52585f; }
.btn-danger { background: var(--rojo); }
.btn-danger:hover { background: #8f1d17; }
.btn-sm { padding: 4px 9px; font-size: .78rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: .82rem; font-weight: 600; color: #444; }
.form-field input, .form-field select, .form-field textarea {
    padding: 8px 10px;
    border: 1px solid var(--gris-borde);
    border-radius: 6px;
    font-size: .9rem;
    font-family: inherit;
}
.form-field textarea { resize: vertical; min-height: 60px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: .75rem; font-weight: 600; }
.badge-pendiente { background: #fdf0d5; color: var(--amarillo); }
.badge-confirmado { background: #dbeafe; color: #1e50a2; }
.badge-en-curso { background: #e0e7ff; color: #4338ca; }
.badge-realizado { background: #dcfce7; color: var(--verde); }
.badge-suspendido { background: #fde2e1; color: var(--rojo); }
.badge-cancelado { background: #e5e7eb; color: #4b5563; }

.tabla-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.tabla-toolbar .filtros { display: flex; gap: 8px; flex-wrap: wrap; }

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--azul), #0a1c33);
}
.login-box {
    background: #fff;
    padding: 34px 38px;
    border-radius: 10px;
    width: 360px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.login-box h2 { color: var(--azul); margin-top: 0; text-align: center; }
.login-box .form-field { margin-bottom: 14px; }
.login-box .btn { width: 100%; padding: 10px; font-size: .95rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--gris-borde); border-radius: 8px; padding: 16px; text-align: center; }
.stat-card .valor { font-size: 1.8rem; font-weight: 700; color: var(--azul); }
.stat-card .etiqueta { font-size: .8rem; color: #666; margin-top: 4px; }

.equip-tag { display: inline-block; background: #eef1f5; border-radius: 5px; padding: 2px 8px; margin: 2px; font-size: .8rem; }

@media print {
    .sidebar, .content-header, .no-print { display: none !important; }
    .content { padding: 0; }
}
