* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    background: #111827;
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-title {
    font-size: 20px;
    font-weight: bold;
}

.topbar-links a {
    color: white;
    margin-left: 18px;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.card-panel {
    background: white;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
}

.page-title {
    margin-top: 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
}

.summary-label {
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 30px;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
}

input,
select,
textarea {
    width: 100%;
    max-width: 520px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}

input[type="color"] {
    width: 70px;
    height: 42px;
    padding: 2px;
}

input[type="checkbox"] {
    width: auto;
}

button,
.button {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    background: #111827;
    color: white;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

button:hover,
.button:hover {
    opacity: 0.9;
    text-decoration: none;
}

.button-secondary {
    background: #6b7280;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #eef2ff;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.actions a {
    margin-right: 10px;
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .topbar-links a {
        margin-left: 0;
        margin-right: 12px;
    }

    .page {
        padding: 20px 14px;
    }

    table {
        font-size: 14px;
    }
}

/*
|--------------------------------------------------------------------------
| Status Badges
|--------------------------------------------------------------------------
*/

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-active,
.status-approved,
.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #f3f4f6;
    color: #4b5563;
}

.status-suspended,
.status-rejected,
.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending,
.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-blocked {
    background: #ffedd5;
    color: #9a3412;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}

/*
|--------------------------------------------------------------------------
| Responsive Tables
|--------------------------------------------------------------------------
*/

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 760px;
}

/*
|--------------------------------------------------------------------------
| Responsive Filters
|--------------------------------------------------------------------------
*/

.filter-grid {
    display: grid;
    grid-template-columns:
        minmax(220px, 2fr)
        minmax(150px, 1fr)
        minmax(150px, 1fr)
        auto;
    gap: 12px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/*
|--------------------------------------------------------------------------
| Better Action Groups
|--------------------------------------------------------------------------
*/

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.actions .button {
    margin: 0;
}

/*
|--------------------------------------------------------------------------
| Mobile Responsive Improvements
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {

    .filter-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .filter-actions {
        grid-column:
            1 / -1;
    }

}

@media (max-width: 620px) {

    .app-main {
        padding:
            18px 14px 36px;
    }

    .card-panel {
        padding:
            18px;
    }

    .page-title {
        font-size:
            26px;
    }

    /*
    |--------------------------------------------------------------------------
    | Filters Stack
    |--------------------------------------------------------------------------
    */

    .filter-grid {
        grid-template-columns:
            1fr;
    }

    .filter-actions {
        grid-column:
            auto;
        width:
            100%;
    }

    .filter-actions button,
    .filter-actions .button {
        flex:
            1 1 auto;
        text-align:
            center;
    }

    /*
    |--------------------------------------------------------------------------
    | Management Buttons
    |--------------------------------------------------------------------------
    */

    .actions {
        display:
            grid;
        grid-template-columns:
            1fr;
        gap:
            8px;
    }

    .actions .button {
        display:
            block;
        width:
            100%;
        text-align:
            center;
    }

    /*
    |--------------------------------------------------------------------------
    | Summary Cards
    |--------------------------------------------------------------------------
    */

    .summary-grid {
        grid-template-columns:
            1fr;
    }

    /*
    |--------------------------------------------------------------------------
    | Tables
    |--------------------------------------------------------------------------
    */

    .table-responsive {
        margin:
            0 -4px;
        padding-bottom:
            4px;
    }

    .table-responsive table {
        min-width:
            720px;
    }

    /*
    |--------------------------------------------------------------------------
    | Form Controls
    |--------------------------------------------------------------------------
    */

    input,
    select,
    textarea {
        width:
            100%;
        max-width:
            none;
    }

    button,
    .button {
        min-height:
            44px;
    }

}

/*
|--------------------------------------------------------------------------
| Invoice Modal
|--------------------------------------------------------------------------
*/

.invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.invoice-modal.is-open {
    display: flex;
}

.invoice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(
        15,
        23,
        42,
        0.55
    );
}

.invoice-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    padding: 26px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow:
        0 24px 70px
        rgba(
            0,
            0,
            0,
            0.25
        );
}

.invoice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.invoice-modal-header h2 {
    margin:
        0 0 4px;
}

.invoice-modal-header p {
    margin: 0;
    color: #6b7280;
}

.invoice-modal-close {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 26px;
    line-height: 1;
}

.invoice-modal-dialog textarea {
    min-height: 120px;
    resize: vertical;
}

.invoice-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

body.invoice-modal-open {
    overflow: hidden;
}

@media (
    max-width: 620px
) {

    .invoice-modal {
        padding: 14px;
    }

    .invoice-modal-dialog {
        padding: 20px;
    }

    .invoice-modal-actions {
        display: grid;
        grid-template-columns:
            1fr;
    }

    .invoice-modal-actions button {
        width: 100%;
    }

}