:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --navy-900: #0b132b;
    --navy-800: #1c2541;
    --navy-700: #3a506b;
    --accent: #06b6d4;
    --accent-warm: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* TOP NAVBAR */
.navbar {
    background: #0f172a;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.brand-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-sub {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.user-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* LAYOUT CONTAINER */
.app-container {
    max-width: 1380px;
    margin: 24px auto;
    padding: 0 24px;
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-accent {
    background: #0ea5e9;
    color: #ffffff;
}

.btn-accent:hover {
    background: #0284c7;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: rgba(37, 99, 235, 0.05);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

.stat-val {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* DATA TABLE */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #f8fafc;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-version {
    background: #e0e7ff;
    color: #4338ca;
    font-family: monospace;
    font-size: 12px;
}

.badge-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-completed {
    background: #f1f5f9;
    color: #475569;
}

.badge-plate {
    background: #0284c7;
    color: #ffffff;
    font-family: monospace;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.5px;
}

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label .req {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-helper {
    font-size: 12px;
    color: var(--text-muted);
}

/* BLOCK HIGHLIGHTS FOR SPECIFIC DECA BLOCKS */
.block-cargador {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.block-transportista {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.block-header-tag {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* AUDIT TIMELINE */
.timeline {
    position: relative;
    padding-left: 28px;
    margin-top: 16px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primary);
}

.timeline-dot.success { border-color: #10b981; }
.timeline-dot.amber { border-color: #f59e0b; }
.timeline-dot.info { border-color: #0ea5e9; }

.timeline-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.timeline-time {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.diff-box {
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-family: monospace;
}

.diff-old {
    color: #ef4444;
    text-decoration: line-through;
}

.diff-new {
    color: #10b981;
    font-weight: 700;
}

/* ALERTS */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    padding: 24px;
    box-shadow: var(--shadow-xl);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .col-12, .col-8, .col-6, .col-4, .col-3 { grid-column: span 1; }
    .navbar-container { flex-direction: column; gap: 12px; }
}
