/* Lettus Riders — Estilos base */

:root {
    --green: #006761;
    --green-light: #00897b;
    --green-dark: #004d40;
    --orange: #ff6f00;
    --red: #d32f2f;
    --gray: #f5f5f5;
    --gray-dark: #616161;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray);
    color: #212121;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--white);
    position: relative;
}

.header {
    background: var(--green);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
}

.header .badge {
    background: var(--orange);
    color: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.content {
    padding: 16px;
}

/* ── Botones ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    gap: 8px;
}

.btn-primary {
    background: var(--green);
    color: var(--white);
}
.btn-primary:active { background: var(--green-dark); }

.btn-orange {
    background: var(--orange);
    color: var(--white);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--green);
    border: 2px solid var(--green);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Cards ── */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

/* ── Status badges ── */

.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-new { background: #e3f2fd; color: #1565c0; }
.status-assigned { background: #fff3e0; color: #e65100; }
.status-accepted { background: #fff3e0; color: #e65100; }
.status-picked_up { background: #f3e5f5; color: #7b1fa2; }
.status-in_transit { background: #e8f5e9; color: #2e7d32; }
.status-delivered { background: #e0f2f1; color: var(--green); }
.status-cancelled { background: #ffebee; color: var(--red); }

/* ── Toggle switch ── */

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.toggle-label {
    font-size: 16px;
    font-weight: 600;
}

.toggle {
    position: relative;
    width: 56px;
    height: 30px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle .slider:before {
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .slider {
    background: var(--green);
}

.toggle input:checked + .slider:before {
    transform: translateX(26px);
}

/* ── Inputs ── */

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

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

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--green);
}

/* ── Task list ── */

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    border-left: 4px solid var(--green);
    cursor: pointer;
    transition: transform 0.1s;
}

.task-item:active { transform: scale(0.98); }

.task-item.urgent { border-left-color: var(--red); }

.task-info { flex: 1; }
.task-info .channel { font-size: 11px; color: var(--gray-dark); text-transform: uppercase; font-weight: 600; }
.task-info .customer { font-size: 15px; font-weight: 600; margin: 2px 0; }
.task-info .address { font-size: 13px; color: var(--gray-dark); }
.task-info .time { font-size: 12px; color: var(--orange); font-weight: 600; margin-top: 4px; }

.task-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}

/* ── Rider list (leader view) ── */

.rider-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.rider-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.rider-avatar.offline { background: #bdbdbd; }

.rider-info { flex: 1; }
.rider-info .name { font-weight: 600; font-size: 15px; }
.rider-info .meta { font-size: 12px; color: var(--gray-dark); }

.online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
}
.online-dot.offline { background: #bdbdbd; }

/* ── Empty state ── */

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-dark);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ── Login ── */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 24px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}

.login-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.login-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
}

.login-box .btn {
    margin-top: 8px;
}

/* ── Bottom nav (leader) ── */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    text-decoration: none;
    color: var(--gray-dark);
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s;
}

.bottom-nav a.active { color: var(--green); }
.bottom-nav a .nav-icon { font-size: 22px; margin-bottom: 2px; }

/* ── Misc ── */

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-dark); }
.flex { display: flex; }
.gap-2 { gap: 12px; }
.flex-1 { flex: 1; }

/* ── Animations ── */

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

.animate-in { animation: slideIn 0.3s ease-out; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }
