/* --- VARIABLES APPLE --- */
:root {
    --apple-bg: #F5F5F7;
    --apple-sidebar: rgba(250, 250, 252, 0.8);
    --apple-card: #FFFFFF;
    --apple-accent: #007AFF;
    --apple-text: #1D1D1F;
    --apple-text-sec: #86868B;
    --apple-gray-light: #E5E5EA;
    --apple-red: #FF3B30;
    --apple-green: #34C759;
    --apple-orange: #FF9500;
    --blur: blur(20px);
}

/* --- RESET Y BASE --- */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--apple-bg);
    color: var(--apple-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- LAYOUT PRINCIPAL --- */
nav {
    width: 260px;
    height: 100vh;
    background: var(--apple-sidebar);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

main {
    flex: 1;
    padding: 40px 50px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* --- COMPONENTES: BARRA LATERAL --- */
nav h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--apple-text-sec);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    padding-left: 10px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--apple-text);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

nav a:hover {
    background: rgba(0, 0, 0, 0.04);
}

nav a.activo {
    background: var(--apple-accent);
    color: white;
}

/* --- COMPONENTES: TARJETAS --- */
.tarjeta {
    background: var(--apple-card);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 20px;
}

/* --- COMPONENTES: BOTONES --- */
.boton-apple {
    background: var(--apple-accent);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.boton-apple:hover {
    opacity: 0.9;
    transform: scale(0.98);
}

.boton-apple:active {
    transform: scale(0.95);
}

/* --- COMPONENTES: TABLAS --- */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-size: 11px;
    font-weight: 600;
    color: var(--apple-text-sec);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--apple-gray-light);
}

td {
    padding: 14px 10px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

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

/* --- COMPONENTES: FORMULARIOS --- */
input, select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--apple-gray-light);
    background: #FFF;
    font-size: 14px;
    transition: border 0.2s;
    outline: none;
}

input:focus {
    border-color: var(--apple-accent);
}

/* --- UTILIDADES --- */
.oculto { display: none !important; }
.text-red { color: var(--apple-red); }
.text-green { color: var(--apple-green); }
.text-blue { color: var(--apple-accent); }

/* --- ICONOS --- */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--apple-text-sec);
    border-radius: 8px;
    transition: 0.2s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--apple-accent);
}

/* --- ESTILOS DE IMPRESIÓN --- */
@media print {
    nav, .no-print, .paginador { display: none !important; }
    main { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .tarjeta { box-shadow: none !important; border: 1px solid #EEE !important; }
    body { background: white !important; }
}
