/* Mobile Responsive Upgrade */

* {
    box-sizing: border-box;
}

body {
    font-size: 16px;
}

.card {
    width: 100%;
    overflow-x: auto;
}

form p {
    margin-bottom: 14px;
}

input,
select,
textarea,
button,
.btn {
    max-width: 100%;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    font-size: 16px;
}

textarea {
    min-height: 120px;
}

.btn,
button {
    display: inline-block;
    padding: 10px 14px;
    margin: 4px 4px 6px 0;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

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

th,
td {
    padding: 8px;
    vertical-align: top;
}

/* Mobile layout */
@media screen and (max-width: 768px) {
    body {
        padding: 8px;
        font-size: 15px;
    }

    .card {
        padding: 12px !important;
        margin-bottom: 14px;
        border-radius: 12px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }

    .btn,
    button {
        width: 100%;
        display: block;
        text-align: center;
        margin-bottom: 8px;
        font-size: 16px;
    }

    input,
    select,
    textarea {
        width: 100%;
        font-size: 16px;
    }

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

    tr {
        margin-bottom: 12px;
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 8px;
        background: #fff;
    }

    th {
        display: none;
    }

    td {
        border: none;
        padding: 6px 4px;
    }

    td::before {
        font-weight: bold;
        display: block;
        color: #374151;
        margin-bottom: 2px;
    }

    .mobile-action-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media screen and (max-width: 768px) {
    td[data-label]::before {
        content: attr(data-label);
    }
}
