:root {
    --primary: #1b4332;
    --primary-light: #2d6a4f;
    --primary-gradient: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
    --bg-color: #f0f4f8;
    --text-main: #2d3748;
    --text-muted: #718096;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --error: #e53e3e;
    --warning: #ed8936;
    --success: #38a169;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Header Premium */
.app-header {
    background: var(--primary-gradient);
    color: white;
    position: relative;
    padding-bottom: 40px; 
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px;
    position: relative;
    z-index: 2;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    background: rgba(255,255,255,0.15);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.1;
}

.logo span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.status-indicator.offline {
    background: var(--error);
    border-color: transparent;
}

/* Botón Sincronizar en Header */
.btn-sync-header {
    position: relative;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.btn-sync-header:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.35);
}

.btn-sync-header.syncing {
    animation: pulse-sync 1s infinite;
}

@keyframes pulse-sync {
    0%, 100% { box-shadow: 0 0 0 0 rgba(246,194,62,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(246,194,62,0); }
}

.pending-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(229,62,62,0.4);
}

.header-curve {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 40px;
    background: var(--bg-color);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    z-index: 1;
}

/* Main Area */
.app-main {
    padding: 0 20px;
    max-width: 600px;
    margin: -15px auto 0;
    position: relative;
    z-index: 3;
}

/* View Section Control */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Banner Sync */
.sync-banner {
    background: white;
    border-left: 5px solid var(--warning);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sync-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-content i {
    color: var(--warning);
    font-size: 1.5rem;
}

.sync-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sync-content strong {
    color: var(--text-main);
    font-size: 1.1rem;
}

.btn-sync {
    background: var(--warning);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(237, 137, 54, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-sync:active {
    transform: translateY(2px);
    box-shadow: 0 2px 5px rgba(237, 137, 54, 0.3);
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Formulario Moderno */
.registro-form {
    background: var(--card-bg);
    padding: 30px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.5);
    margin-bottom: 20px;
}

.form-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.form-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.half {
    flex: 1;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input con Iconos */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    color: #a0aec0;
    font-size: 1rem;
    transition: color 0.3s;
    pointer-events: none;
}

input, select {
    width: 100%;
    padding: 14px 14px 14px 42px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    background: #f8fafc;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    color: #a0aec0;
    pointer-events: none;
}

select {
    appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(27, 67, 50, 0.1);
}

input:focus + i, select:focus + i,
.input-with-icon:focus-within i {
    color: var(--primary);
}

/* Divider Asistencia */
.divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 25px 0;
}

.asistencias-list {
    margin-top: 15px;
}
.asistencia-item {
    padding: 10px;
    background: #f0fdf4;
    border-left: 3px solid var(--success);
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
    animation: fadeIn 0.3s ease-out;
}

/* Botón Guardar Premium */
.btn-submit {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(27, 67, 50, 0.3);
    transition: all 0.3s ease;
}

.btn-submit:hover {
    box-shadow: 0 15px 30px rgba(27, 67, 50, 0.4);
    transform: translateY(-2px);
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(27, 67, 50, 0.3);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* Toast moderno */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(27, 67, 50, 0.95);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.error {
    background: rgba(229, 62, 62, 0.95);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
