body {
    margin: 0;
    padding: 20px;
    background-color: #eaf4ff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #0f2742;
}

* {
    box-sizing: border-box;
}

.header {
    background: linear-gradient(135deg, #0b4f8a, #1976c9);
    color: white;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(11, 79, 138, 0.18);
}

.container {
    width: 100%;
    margin: auto;
    max-width: 1200px;
    display: flex;
    gap: 25px;
}

.list {
    list-style-type: none;
    background: #ffffff;
    border: 1px solid #cfe5fb;
    border-radius: 8px;
    flex: 0 0 250px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 4px 10px rgba(25, 118, 201, 0.08);
}

.list h4,
.article h4 {
    color: #0b4f8a;
}

.list ul {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #dbeafe;
    cursor: pointer;
    transition: 0.3s;
}

.list li:hover {
    color: #0b6fba;
    transform: translateX(5px);
}

.article {
    padding: 25px;
    background: #ffffff;
    border: 1px solid #cfe5fb;
    border-radius: 8px;
    flex: 1;
    box-shadow: 0 4px 10px rgba(25, 118, 201, 0.08);
    overflow-x: auto;
}


.table {
    border-radius: 8px;
    overflow: hidden;
    vertical-align: middle;
}

.table thead {
    --bs-table-bg: #0b4f8a;
    --bs-table-color: #ffffff;
    color: white;
}

.table tbody tr:hover {
    --bs-table-bg: #f0f8ff;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-success,
.btn-primary {
    background-color: #168a3a;
    border-color: #168a3a;
    color: #ffffff;
}

.btn-success:hover,
.btn-primary:hover {
    background-color: #0f6f2d;
    border-color: #0f6f2d;
}

.btn-danger {
    background-color: #d62828;
    border-color: #d62828;
}

.btn-danger:hover {
    background-color: #ad1f1f;
    border-color: #ad1f1f;
}

.modal-header {
    background: #0b4f8a;
    color: #ffffff;
}

.modal-content {
    border: 1px solid #cfe5fb;
    border-radius: 8px;
}

.form-control:focus {
    border-color: #1976c9;
    box-shadow: 0 0 0 0.25rem rgba(25, 118, 201, 0.16);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 15px;
    color: #24577f;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .header {
        padding: 20px 14px;
        margin-bottom: 16px;
    }

    .header h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }

    .header p {
        font-size: 0.95rem;
    }

    .container {
        flex-direction: column;
        gap: 16px;
        padding-left: 0;
        padding-right: 0;
    }

    .list {
        flex: auto;
        padding: 16px;
    }

    .list ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .list li {
        border: 1px solid #dbeafe;
        border-radius: 6px;
        padding: 10px;
        min-height: 46px;
    }

    .list li:hover {
        transform: none;
    }

    .article {
        padding: 16px;
        overflow-x: visible;
    }

    #modalInsert {
        width: 100%;
        justify-content: center;
    }

    .table {
        border-collapse: separate;
        border-spacing: 0 12px;
        margin-bottom: 0;
    }

    .table thead {
        display: none;
    }

    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tbody tr {
        background: #ffffff;
        border: 1px solid #cfe5fb;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(25, 118, 201, 0.08);
        overflow: hidden;
    }

    .table tbody tr:hover {
        --bs-table-bg: #ffffff;
    }

    .table td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) 1fr;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid #e3f0fd;
        padding: 12px;
        text-align: right;
        word-break: break-word;
    }

    .table td::before {
        content: attr(data-label);
        color: #0b4f8a;
        font-weight: 700;
        text-align: left;
    }

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

    .table td[data-label="Actualizar"],
    .table td[data-label="Eliminar"] {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .table td[data-label="Actualizar"]::before,
    .table td[data-label="Eliminar"]::before {
        display: none;
    }

    .table .btn,
    .table form,
    .table form .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-dialog {
        margin: 12px;
    }
}

@media (max-width: 430px) {
    .list ul {
        grid-template-columns: 1fr;
    }

    .article,
    .list {
        padding: 14px;
    }

    .table td {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .btn {
        min-height: 42px;
    }
}
