* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #222;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.login-box h1 {
    margin: 0 0 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 30px;
}

.login-box label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
    font-weight: bold;
}

.login-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

.login-box input:focus {
    outline: none;
    border-color: #555;
}

.login-box button {
    width: 100%;
    margin-top: 25px;
    padding: 13px;
    border: 0;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #444;
}


/* =========================================================
   MENSAJES
   ========================================================= */

.message {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    background: #f1f1f1;
}

.message.success {
    background: #e8f5e9;
    color: #256029;
    border: 1px solid #b7dfb9;
}

.message.error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}


/* =========================================================
   CABECERA
   ========================================================= */

.topbar {
    width: 100%;
    background: #fff;
    min-height: 60px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.topbar > div:first-child {
    font-size: 16px;
}

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

.user-area a {
    text-decoration: none;
    color: #222;
}

.user-area a:hover {
    text-decoration: underline;
}

.role {
    color: #666;
    font-size: 14px;
}


/* =========================================================
   CONTENIDO GENERAL
   ========================================================= */

.dashboard {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}


/* =========================================================
   PANEL PRINCIPAL
   ========================================================= */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.menu-item {
    min-height: 150px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: #222;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.menu-item span {
    font-size: 40px;
}


/* =========================================================
   CABECERA DE PÁGINAS
   ========================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 30px;
}

.page-header p {
    margin: 0;
    color: #666;
}


/* =========================================================
   BOTONES
   ========================================================= */

.button {
    display: inline-block;
    padding: 11px 18px;
    background: #222;
    color: #fff;
    text-decoration: none;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.button:hover {
    background: #444;
}

.button-secondary {
    background: #777;
}

.button-secondary:hover {
    background: #555;
}

.button-delete {
    padding: 8px 12px;
    background: #c62828;
    color: #fff;
    border: 0;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.button-delete:hover {
    background: #a51f1f;
}


/* =========================================================
   TABLA DE VEHÍCULOS
   ========================================================= */

.table-container {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.vehicles-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.vehicles-table th {
    background: #222;
    color: #fff;
    padding: 13px 12px;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
}

.vehicles-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 14px;
    vertical-align: middle;
}

.vehicles-table tbody tr:hover {
    background: #f7f7f7;
}

.vehicles-table tbody tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   FORMULARIOS
   ========================================================= */

.form-container {
    width: 100%;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

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

.form-group label {
    margin-bottom: 7px;
    font-weight: bold;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}


/* =========================================================
   ESTADO VACÍO
   ========================================================= */

.empty-state {
    background: #fff;
    padding: 50px 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.empty-state h2 {
    margin-top: 0;
}

.empty-state p {
    color: #666;
    margin-bottom: 25px;
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 650px) {

    .topbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
    }

    .user-area {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dashboard {
        padding: 20px 12px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .menu-item {
        min-height: 100px;
        flex-direction: row;
        justify-content: flex-start;
        padding-left: 30px;
    }

    .menu-item span {
        font-size: 32px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .page-header .button {
        width: 100%;
        text-align: center;
    }

    .form-container {
        padding: 20px 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
        text-align: center;
    }

    .table-container {
        border-radius: 8px;
    }
}
