/* =====================================
   OIS PAGE
===================================== */

.ois-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}


/* =====================================
   PAGE HEADER
===================================== */

.ois-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.ois-page-header__info h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 26px;
}

.ois-page-header__info p {
    max-width: 760px;
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.ois-page-total {
    min-width: 140px;
    padding: 12px 16px;

    border: 1px solid var(--card-border);
    border-radius: 14px;

    background: var(--card-bg);
    color: var(--text-primary);

    box-shadow: var(--shadow-md);
    font-weight: 600;
}

.ois-page-total span {
    margin-left: 5px;
    color: var(--accent);
}


/* =====================================
   PAGE ACTIONS
===================================== */

.ois-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* =====================================
   BUTTONS
===================================== */

.ois-page .btn {
    min-height: 40px;
    padding: 0 15px;

    border: 1px solid var(--card-border);
    border-radius: 10px;

    background: var(--bg-secondary);
    color: var(--text-primary);

    font-weight: 600;
    cursor: pointer;

    transition:
            background-color 0.18s ease,
            border-color 0.18s ease,
            transform 0.18s ease;
}

.ois-page .btn:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.ois-page .btn:active {
    transform: translateY(1px);
}

.ois-page .btn-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.ois-page .btn-primary:hover {
    border-color: var(--accent);
    background: var(--accent);
    filter: brightness(1.08);
}


/* =====================================
   TABLE CARD
===================================== */

.ois-table-card {
    width: 100%;
    overflow: hidden;

    border: 1px solid var(--card-border);
    border-radius: 18px;

    background: var(--card-bg);

    box-shadow: var(--shadow-lg);
}

.ois-table-scroll {
    width: 100%;
    overflow-x: auto;
}


/* =====================================
   TABLE
===================================== */

.ois-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.ois-table th,
.ois-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
    white-space: nowrap;
}

.ois-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ois-table td {
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.ois-table tbody tr:hover td {
    background: var(--bg-hover);
}

.ois-table tbody tr:last-child td {
    border-bottom: none;
}


/* =====================================
   TABLE COLUMNS
===================================== */

.ois-table .ois-column-selected,
.ois-table th:first-child,
.ois-table td:first-child {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    text-align: center;
}

.ois-table .ois-column-actions,
.ois-table th:last-child,
.ois-table td:last-child {
    width: 180px;
    min-width: 180px;
    text-align: center;
}


/* =====================================
   CHECKBOX
===================================== */

.ois-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;

    accent-color: var(--accent);
    cursor: pointer;
}


/* =====================================
   EMPTY ROW
===================================== */

.ois-table .ois-table-empty {
    padding: 36px 16px;
    color: var(--text-muted);
    text-align: center;
}


/* =====================================
   ACTION BUTTONS IN ROW
===================================== */

.ois-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ois-edit-btn,
.ois-delete-btn {
    min-height: 34px;
    padding: 0 11px;

    border: 1px solid var(--card-border);
    border-radius: 9px;

    background: var(--bg-secondary);
    color: var(--text-primary);

    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ois-edit-btn:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.ois-delete-btn {
    color: var(--danger);
}

.ois-delete-btn:hover {
    border-color: var(--danger);
    background: color-mix(
            in srgb,
            var(--danger) 10%,
            transparent
    );
}


/* =====================================
   EDIT INPUTS IN TABLE
===================================== */

.ois-table-edit-input {
    width: 100%;
    min-width: 90px;
    min-height: 34px;
    padding: 0 9px;

    border: 1px solid var(--card-border);
    border-radius: 8px;
    outline: none;

    background: var(--bg-secondary);
    color: var(--text-primary);
}

.ois-table-edit-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}


/* =====================================
   MODAL OVERLAY
===================================== */

.ois-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(5px);
}

.ois-modal-overlay.hidden {
    display: none;
}


/* =====================================
   MODAL
===================================== */

.ois-modal {
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    border: 1px solid var(--card-border);
    border-radius: 20px;

    background: var(--card-bg);
    color: var(--text-primary);

    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}


/* =====================================
   MODAL HEADER
===================================== */

.ois-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding: 22px 24px;
    border-bottom: 1px solid var(--card-border);
}

.ois-modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 21px;
}

.ois-modal-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.ois-modal-close {
    width: 38px;
    height: 38px;
    flex-shrink: 0;

    display: grid;
    place-items: center;

    padding: 0;

    border: 1px solid var(--card-border);
    border-radius: 10px;

    background: var(--bg-secondary);
    color: var(--text-primary);

    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.ois-modal-close:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}


/* =====================================
   MODAL BODY
===================================== */

.ois-modal-body {
    padding: 24px;
}

.ois-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ois-form-group {
    min-width: 0;
}

.ois-form-group label {
    display: block;
    margin-bottom: 7px;

    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.ois-form-group input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;

    border: 1px solid var(--card-border);
    border-radius: 10px;
    outline: none;

    background: var(--bg-secondary);
    color: var(--text-primary);
}

.ois-form-group input::placeholder {
    color: var(--text-muted);
}

.ois-form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

body.theme-dark .ois-form-group input[type="date"] {
    color-scheme: dark;
}

body.theme-light .ois-form-group input[type="date"] {
    color-scheme: light;
}


/* =====================================
   MODAL FOOTER
===================================== */

.ois-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;

    padding: 18px 24px;
    border-top: 1px solid var(--card-border);
}


/* =====================================
   MOBILE
===================================== */

@media (max-width: 768px) {

    .ois-page-header {
        flex-direction: column;
    }

    .ois-page-total {
        width: 100%;
    }

}


@media (max-width: 640px) {

    .ois-page-actions,
    .ois-page-actions .btn {
        width: 100%;
    }

    .ois-form-grid {
        grid-template-columns: 1fr;
    }

    .ois-modal-overlay {
        align-items: flex-start;
        padding: 12px;
        overflow-y: auto;
    }

    .ois-modal {
        max-height: none;
        margin: 12px 0;
        border-radius: 16px;
    }

    .ois-modal-header,
    .ois-modal-body,
    .ois-modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ois-modal-footer {
        flex-direction: column-reverse;
    }

    .ois-modal-footer .btn {
        width: 100%;
    }

}

.ois-table-input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 10px;

    border: 1px solid transparent;
    border-radius: 8px;

    background: transparent;
    color: var(--text-primary);

    font: inherit;
    text-align: left;
    outline: none;
}

.ois-table-input:disabled {
    opacity: 1;
    cursor: default;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

.ois-table-input:not(:disabled) {
    border-color: var(--card-border);
    background: var(--bg-secondary);
}

.ois-table-input:not(:disabled):focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}


.ois-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.ois-table th,
.ois-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.ois-table th:nth-child(1),
.ois-table td:nth-child(1) {
    width: 110px;
}

.ois-table th:nth-child(2),
.ois-table td:nth-child(2) {
    width: 160px;
}

.ois-table th:nth-child(3),
.ois-table td:nth-child(3) {
    width: 130px;
}

.ois-table th:nth-child(4),
.ois-table td:nth-child(4) {
    width: 150px;
}

.ois-table th:nth-child(5),
.ois-table td:nth-child(5),
.ois-table th:nth-child(6),
.ois-table td:nth-child(6) {
    width: 130px;
    text-align: center;
}