:root {
    --sidebar-bg: #2f3a4f;
    --sidebar-text: #a6b0cf;
    --sidebar-active: #3b4a63;
    --primary-color: #556ee6;
    --success-color: #34c38f;
    --danger-color: #f46a6a;
    --warning-color: #f1b44c;
    --info-color: #50a5f1;
    --pacs-btn-color: #74c0e8;
    --light-bg: #f8f9fa;
    --border-color: #eff2f7;
    --text-muted: #74788d;
    --header-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
}

/* ──────────────────────────────────────
   Layout
────────────────────────────────────── */
.modalities-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    background-color: #f8f9fa;
    overflow-y: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.content-area {
    padding: 30px;
    width: 100%;
    max-width: 100%;
}

/* ──────────────────────────────────────
   Page Header
────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 15px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ──────────────────────────────────────
   Buttons
────────────────────────────────────── */
.btn {
    padding: 9px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s ease;
    font-weight: 500;
    white-space: nowrap;
}

.btn-cancel {
    background-color: #6c757d;
    color: #fff;
}

.btn-cancel:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.35);
}

.btn-save {
    background-color: var(--success-color);
    color: #fff;
}

.btn-save:hover {
    background-color: #2ca87f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 195, 143, 0.35);
}

.btn-test-pacs {
    background-color: var(--pacs-btn-color);
    color: #fff;
}

.btn-test-pacs:hover {
    background-color: #55acd8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(116, 192, 232, 0.4);
}

/* ──────────────────────────────────────
   Section Cards (collapsible)
────────────────────────────────────── */
.section-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.section-header:hover {
    background: #f0f2f5;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.section-icon.blue   { background-color: var(--primary-color); }
.section-icon.teal   { background-color: #1abc9c; }
.section-icon.orange { background-color: var(--warning-color); }

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #343a40;
    margin: 0;
}

.section-toggle-icon {
    color: #74788d;
    font-size: 13px;
    transition: transform 0.25s ease;
}

.section-card.collapsed .section-toggle-icon {
    transform: rotate(-90deg);
}

.section-body {
    padding: 24px 22px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.section-card.collapsed .section-body {
    display: none;
}

/* ──────────────────────────────────────
   Form Controls
────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.form-group label small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
}

.form-control {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(85, 110, 230, 0.12);
}

.form-control::placeholder {
    color: #adb5bd;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

/* ──────────────────────────────────────
   Service Information — Two-column layout
────────────────────────────────────── */
.service-info-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.service-left {
    flex: 0 0 calc(50% - 14px);
    min-width: 0;
}

.service-right {
    flex: 0 0 calc(50% - 14px);
    min-width: 0;
}

/* ──────────────────────────────────────
   Service Search Bar
────────────────────────────────────── */
.service-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.service-search-bar .search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.service-search-bar .search-input-wrap .form-control {
    padding-right: 36px;
}

.service-search-bar .search-icon {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
    font-size: 13px;
}

.btn-select-all {
    background-color: #fff;
    border: 2px solid var(--success-color);
    color: var(--success-color);
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-select-all:hover {
    background-color: var(--success-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52, 195, 143, 0.3);
}

.btn-deselect-all {
    background-color: #fff;
    border: 2px solid var(--warning-color);
    color: var(--warning-color);
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-deselect-all:hover {
    background-color: var(--warning-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(241, 180, 76, 0.3);
}

/* ──────────────────────────────────────
   Services Checkbox Grid
────────────────────────────────────── */
.services-checkboxes {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    background: #fafbfe;
}

.services-checkboxes::-webkit-scrollbar {
    width: 5px;
}

.services-checkboxes::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.checkbox-row {
    display: flex;
    gap: 6px;
}

.checkbox-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background 0.15s;
    min-width: 0;
}

.checkbox-item:hover {
    background-color: #eef0f7;
}

.checkbox-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-item label {
    font-size: 13px;
    font-weight: 400;
    color: #495057;
    cursor: pointer;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.services-placeholder {
    color: #adb5bd;
    font-size: 13px;
    text-align: center;
    padding: 30px 0;
}

.no-services-msg {
    color: #d32f2f;
    font-size: 13px;
    background: #ffebee;
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
    padding: 12px 14px;
}

/* ──────────────────────────────────────
   Menu Toggle (burger - mobile)
────────────────────────────────────── */
.menu-toggle {
    display: none;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    background-color: #4458d4;
}

.menu-toggle i {
    font-size: 18px;
}

/* ──────────────────────────────────────
   Responsive
────────────────────────────────────── */
@media (max-width: 900px) {
    .service-info-layout {
        flex-direction: column;
    }

    .service-left,
    .service-right {
        flex: 0 0 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-flex;
    }

    .content-area {
        padding: 20px 15px;
    }

    .page-header-actions {
        flex-wrap: wrap;
    }

    .form-row {
        flex-direction: column;
    }
}

/* ══════════════════════════════════════
   LIST PAGE additions
════════════════════════════════════════ */

/* ── Back / Edit buttons (form page header) ── */
.btn-back {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 7px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-back:hover { background: #f0f2f5; border-color: #adb5bd; }

.btn-edit {
    background-color: var(--primary-color);
    color: #fff;
    padding: 9px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-edit:hover { background-color: #4458d4; transform: translateY(-1px); }

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    padding: 9px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-primary:hover { background-color: #4458d4; transform: translateY(-1px); }

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    padding: 9px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-secondary:hover { background-color: #5a6268; transform: translateY(-1px); }

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
    padding: 9px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-danger:hover { background-color: #e05555; }

/* ── Required star ── */
.required-star { color: var(--danger-color); }

/* ── Field info icon ── */
.field-info {
    color: #74788d;
    cursor: help;
    font-size: 12px;
    margin-left: 3px;
}

/* ── Form loading overlay ── */
.form-loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--primary-color);
    font-size: 14px;
}

/* ── Status badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.status-badge.active   { background: #d4edda; color: #155724; }
.status-badge.inactive { background: #f8d7da; color: #721c24; }
.status-badge .fa-circle { font-size: 6px; }

/* ── Action buttons ── */
.action-buttons { display: flex; gap: 6px; align-items: center; }

.btn-action {
    width: 30px; height: 30px;
    border: none; border-radius: 5px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
}
.btn-action.view   { background: #e8f0fe; color: var(--primary-color); }
.btn-action.edit   { background: #fff3cd; color: #856404; }
.btn-action.delete { background: #fde8e8; color: var(--danger-color); }
.btn-action.view:hover   { background: var(--primary-color); color: #fff; }
.btn-action.edit:hover   { background: var(--warning-color); color: #fff; }
.btn-action.delete:hover { background: var(--danger-color); color: #fff; }

/* ── Mono font for IP addresses ── */
.text-mono { font-family: 'Courier New', monospace; font-size: 13px; }

/* ── Modal overlay ── */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%; max-width: 480px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}
.modal-small { max-width: 420px; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    background: #f8f9fa;
    border-bottom: 1px solid #eff2f7;
}
.modal-header h2 { font-size: 16px; font-weight: 600; margin: 0; color: #333; }
.close-btn {
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: #74788d; line-height: 1;
}
.close-btn:hover { color: #333; }
.modal-body  { padding: 22px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #eff2f7;
    background: #f8f9fa;
}
.text-muted { color: #74788d; font-size: 13px; }

/* ── Pagination (if not already from radiology.css) ── */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 4px;
    gap: 12px;
    flex-wrap: wrap;
}
.pagination-info { font-size: 13px; color: #74788d; }
.pagination-controls { display: flex; align-items: center; gap: 6px; }
.pagination-nav-btn {
    padding: 6px 14px;
    font-size: 13px;
}
.page-buttons { display: flex; gap: 4px; }
.page-btn {
    min-width: 32px; height: 32px;
    padding: 0 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    transition: all 0.15s;
}
.page-btn:hover  { background: #f0f2f5; }
.page-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.page-ellipsis   { padding: 0 4px; color: #74788d; line-height: 32px; font-size: 13px; }

/* ── Loading state ── */
.loading-state {
    padding: 30px;
    text-align: center;
    color: #74788d;
}
.loading-state p { margin-top: 10px; font-size: 14px; }

/* ── Inline table empty state (matches screenshot style) ── */
.table-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 20px;
    gap: 10px;
}
.table-empty-icon {
    width: 56px;
    height: 56px;
    opacity: 0.45;
    margin-bottom: 4px;
}
.table-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
}
.table-empty-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    max-width: 420px;
    text-align: center;
    line-height: 1.5;
}

/* ── Responsive table ── */
@media (max-width: 1100px) {
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    .data-table th:nth-child(7),
    .data-table td:nth-child(7) { display: none; }
}
@media (max-width: 768px) {
    .pagination-container { flex-direction: column; align-items: flex-start; }
}
