/* ============================================================
   Androlab Suite — Doctor → Script Manager
============================================================ */

/* Wrapper */
.androlab-script-manager-wrapper {
    padding: 20px;
}

/* Heading */
.androlab-heading {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #222;
}

/* ============================================================
   TOOLBAR
============================================================ */
.script-manager-toolbar {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#script-manager-search {
    padding: 8px 12px;
    width: 350px;
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

#script-manager-limit {
    padding: 8px;
    width: 130px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.script-manager-toolbar .androlab-btn {
    padding: 8px 14px;
    background: #242321;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.script-manager-toolbar .androlab-btn:hover {
    background: #000;
}

/* ============================================================
   TABLE
============================================================ */
.script-manager-table-container {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow-x: auto;
}

#script-manager-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

#script-manager-table th,
#script-manager-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

#script-manager-table th {
    background: #f7f7f7;
    font-weight: 600;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Loading row */
#script-manager-table .loading {
    text-align: center;
    padding: 25px;
    font-style: italic;
    color: #777;
}

/* Error row */
#script-manager-table .error {
    text-align: center;
    padding: 25px;
    color: #c00;
    font-weight: 600;
}

/* Hover highlight */
#script-manager-table tbody tr:hover {
    background: #fafafa;
}

/* ============================================================
   ADDRESS SHORTENING + TOOLTIP
============================================================ */
td.address-cell {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

td.address-cell:hover {
    background: #f2f2f2;
}

/* ============================================================
   INPUTS
============================================================ */
.inject-field,
.cream-field {
    width: 60px !important;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
}

/* Medications select */
.medications-select,
td .medications-select {
    width: 260px !important;
    min-width: 260px !important;
}

/* Force Select2 container full width */
.select2-container {
    width: 100% !important;
}

/* ============================================================
   ACTION BUTTONS
============================================================ */
.save-script,
.preview-script {
    padding: 6px 10px;
    background: #242321;
    border: none;
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    text-align: center;
}

.save-script:hover,
.preview-script:hover {
    background: #000;
}

/* ============================================================
   SELECT2 TAG / DROPDOWN STYLING
============================================================ */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #242321 !important;
    border-color: #242321 !important;
    color: #fff !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    margin-top: 4px !important;
}

.select2-container--default .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 5px;
}

.select2-container--default .select2-results__option--highlighted {
    background: #242321 !important;
    color: #fff !important;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {

    .script-manager-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    #script-manager-search,
    #script-manager-limit {
        width: 100%;
    }

    #script-manager-table th,
    #script-manager-table td {
        font-size: 12px;
        padding: 8px 6px;
    }

    .inject-field,
    .cream-field {
        width: 60px !important;
    }
}

/* ============================================================
   PAGINATION
============================================================ */
.script-manager-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}
