/* ========================================
   CONTROL TRUCK 1.0 - ESTILOS MODERNOS
   Transportes Astros Limitada
   ======================================== */

/* ----- VARIABLES Y RESET ----- */
:root {
    --primary: #FF6B35;
    --primary-dark: #E54E1E;
    --primary-light: #FF8C5A;
    --secondary: #2C3E50;
    --secondary-dark: #1E2B37;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ----- UTILIDADES ----- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 2.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }

/* ----- LOGIN PAGE ----- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
   height: 85px;
    width: 220px;
    margin-bottom: 15px;
    background-color: white;
    padding: 5px 5px 5px 5px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
    text-shadow: var(--shadow-sm);
}

.login-header p {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 8px 32px rgb(0 0 0 / 53%);
    animation: slideUp 0.5s ease;
}

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

.login-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 25px;
    text-align: center;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: var(--primary);
}

.checkbox-group label {
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-block {
    display: block;
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

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

.alert {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.alert-danger {
    background: #FEE;
    color: var(--danger);
    border: 1px solid #FCC;
}

.alert-success {
    background: #DFF0D8;
    color: var(--success);
    border: 1px solid #C1E2B3;
}

.alert-warning {
    background: #FFF3CD;
    color: var(--warning);
    border: 1px solid #FFEEBA;
}

.alert-info {
    background: #D1ECF1;
    color: var(--info);
    border: 1px solid #BEE5EB;
}

.alert img {
    width: 20px;
    height: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.login-footer p {
    margin-bottom: 5px;
}

.login-footer .copyright {
    font-size: 12px;
    opacity: 0.8;
}

/* ----- DASHBOARD LAYOUT ----- */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: white;
    box-shadow: var(--shadow-lg);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .logo img {
    height: 40px;
    width: auto;
}

.sidebar-header .logo span {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--gray-200);
}

.sidebar-toggle i {
    color: var(--gray-600);
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    gap: 12px;
}

.sidebar-nav a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.sidebar-nav li.active a {
    background: var(--primary);
    color: white;
}

.sidebar-nav i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar.collapsed .sidebar-nav span {
    display: none;
}

.sidebar-nav .submenu {
    padding-left: 52px;
    display: none;
}

.sidebar-nav .submenu.show {
    display: block;
}

.sidebar-nav .submenu a {
    padding: 8px 20px;
    font-size: 14px;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    background: var(--gray-100);
    min-height: 100vh;
    transition: var(--transition);
}

.main-content.expanded {
    margin-left: 80px;
}

.top-bar {
    background: white;
    padding: 15px 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-800);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu .notifications {
    position: relative;
    cursor: pointer;
}

.user-menu .notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
}

.user-menu .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-menu .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.content-wrapper {
    padding: 30px;
}

/* ----- TABLAS MODERNAS ----- */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--gray-100);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
    border-bottom: 2px solid var(--gray-300);
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.table tr:hover td {
    background: var(--gray-100);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-actions button:hover {
    background: var(--primary);
    color: white;
}

/* Estados de filas */
.table tr.success td {
    background: #DFF0D8;
}

.table tr.warning td {
    background: #FFF3CD;
}

.table tr.danger td {
    background: #FEE;
}

.table tr.info td {
    background: #D1ECF1;
}

/* ----- CARDS ----- */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    color: var(--gray-700);
}

/* ----- GRID SYSTEM ----- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { flex: 0 0 8.333%; }
.col-2 { flex: 0 0 16.666%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333%; }
.col-5 { flex: 0 0 41.666%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.333%; }
.col-8 { flex: 0 0 66.666%; }
.col-9 { flex: 0 0 75%; }
.col-10 { flex: 0 0 83.333%; }
.col-11 { flex: 0 0 91.666%; }
.col-12 { flex: 0 0 100%; }

/* ----- MODALS ----- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.3s ease;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

/* ----- ANIMACIONES ----- */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ----- ICONOS ----- */
[class^="icon-"] {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-edit { background-image: url('../img/ico/application_edit.png'); }
.icon-delete { background-image: url('../img/ico/delete.png'); }
.icon-activate { background-image: url('../img/ico/accept.png'); }
.icon-print { background-image: url('../img/ico/printer.png'); }
.icon-add { background-image: url('../img/ico/application_form_add.png'); }
.icon-money { background-image: url('../img/ico/dinero.png'); }
.icon-truck { background-image: url('../img/ico_truck.png'); }