:root {
    --bg-main: #f0f2f5;
    --sidebar-dark: #1e293b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* LAYOUT GRID */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* LEFT MAIN MENU */
.main-menu {
    width: 240px;
    background-color: var(--sidebar-dark);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    flex-shrink: 0;
}

.menu-brand {
    padding: 0 1.5rem 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
}

.menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #94a3b8;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: #334155;
    color: white;
}

.menu-item.active {
    background-color: #334155;
    color: white;
    border-left-color: var(--primary);
}

/* CONTENT AREA */
.content-area {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.view-section {
    display: none;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PLANNER VIEW LAYOUT */
.planner-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

.planner-sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    z-index: 10;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

#map {
    flex-grow: 1;
    height: 100%;
    width: 100%;
    min-width: 0;
    z-index: 1;
    position: relative;
}

/* TABS (Planner) */
.tabs-nav {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
}

/* FORMS COMPACT */
.form-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.form-row {
    display: flex;
    gap: 0.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-row input,
.form-row select {
    flex: 1;
}

input,
select {
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
}

.input-action {
    display: flex;
    gap: 0.5rem;
}

.input-action button {
    padding: 0 0.8rem;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    cursor: pointer;
}

.input-action button:hover {
    background: #cbd5e1;
}

.btn-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.35rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-action:hover {
    background: var(--primary-hover);
}

/* LISTS */
.list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    background: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-main {
    font-weight: 600;
    font-size: 0.85rem;
}

.item-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-delete {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

.btn-delete:hover {
    opacity: 1;
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.stat-item {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.stat-item .val {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary.full-width,
.btn-secondary.full-width {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* RECORRIDOS VIEW */
.view-header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.view-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.view-header p {
    margin: 0.5rem 0 0;
    color: var(--text-secondary);
}

.report-container {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.route-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.route-header h3 {
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.capacity-tag {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.route-badge {
    background: #eff6ff;
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-item {
    padding: 0.75rem 0;
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
    position: relative;
    font-size: 0.9rem;
    color: #475569;
}

.step-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 1.1rem;
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
}

.step-item:last-child {
    border-left-color: transparent;
}


/* CUSTOM ICONS */
.custom-icon {
    background: transparent !important;
    border: none !important;
}

.icon-contrast-circle {
    background: white;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.icon-marker-truck {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* HIDE SPINNERS */
/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

.icon-marker-client {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* INPUT ADJUSTMENTS */
#truck-avg-speed,
#truck-disposal-time,
#client-service-time {
    flex: 0 0 60px !important;
    width: 60px !important;
}

/* HINTS */
.hint {
    font-size: 0.7rem;
    color: #94a3b8;
    display: block;
    margin-top: -0.25rem;
}

/* CSV ACTIONS */
.csv-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.btn-csv {
    flex: 1;
    padding: 0.6rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.btn-csv:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* CAPACITY/DEMAND GRID */
.capacity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.capacity-grid input {
    font-size: 0.8rem;
}

/* TYPE SELECTOR (CHECKBOXES) */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.type-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.type-checkbox:hover {
    background: #e9ecef;
    border-color: var(--primary);
}

.type-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* TYPE BADGE */
.type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-right: 0.25rem;
}