* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.hidden { display: none !important; }

.toolbar-filter-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.toolbar-inline-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
}

.header-inline-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.twofa-message {
    margin-bottom: 1rem;
    color: #374151;
}

.btn-muted {
    margin-top: 0.5rem !important;
    background: #e5e7eb !important;
    color: #111827 !important;
}

.btn-muted:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
}

.ui-lang-indicator-login {
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #374151;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 4px 8px;
}

.ui-lang-indicator-main {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #1f2937;
    background: #e5e7eb;
}

.ui-lang-indicator-visible {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lang-flag-sm {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border: 1px solid #d1d5db;
    border-radius: 2px;
}

.lang-code-strong {
    font-weight: 600;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: help;
}

.language-badge-code {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
}

.inline-icon-svg {
    vertical-align: middle;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
}

.status-dot-neutral {
    background: #6b7280;
}

.status-dot-danger {
    background: #dc2626;
}

.status-dot-warning {
    background: #f59e0b;
}

.status-dot-success {
    background: #15803d;
}

.text-center {
    text-align: center;
}

.sortable-header {
    cursor: pointer;
}

.text-alert-strong {
    color: #dc2626;
    font-weight: bold;
}

.text-success-strong {
    color: #16a34a;
    font-weight: bold;
}

.mark-ok,
.mark-bad {
    font-weight: bold;
    font-size: 1.2rem;
}

.mark-ok {
    color: #16a34a;
}

.mark-bad {
    color: #dc2626;
}

.case-row-alert {
    background: #fee2e2;
}

.case-row-stale {
    background: #fff7ed;
}

.location-row-orphan {
    background: #dcfce7;
}

.meta-pill-row {
    display: flex;
    gap: 2px;
}

.meta-pill {
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

.meta-pill-risk {
    background: #fee2e2;
    color: #991b1b;
}

.meta-pill-disability {
    background: #dcfce7;
    color: #166534;
}

.meta-pill-warning {
    background: #fef9c3;
    color: #854d0e;
}

.inline-code-pill {
    background: #f3f4f6;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.inline-code-chip {
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
}

.markdown-pre {
    background: #111827;
    color: #f9fafb;
    padding: 0.75rem;
    border-radius: 6px;
    overflow: auto;
}

.markdown-quote {
    border-left: 4px solid #d1d5db;
    margin: 0;
    padding: 0.25rem 0.75rem;
    color: #374151;
}

.markdown-viewer {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    background: #fff;
    line-height: 1.5;
    color: #111827;
}

.admin-photo-thumb {
    height: 50px;
    border-radius: 4px;
}

.case-note-snippet-cell {
    max-width: 460px;
}

.env-badge-login {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 1rem;
}

.env-badge-main {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.env-badge-theme-dev {
    background: #eab308;
}

.env-badge-theme-prod {
    background: #2563eb;
}

.env-badge-theme-uat {
    background: #3b82f6;
}

.env-badge-theme-default {
    background: #6b7280;
}

.section-gap-top {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.status-card-neutral {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    color: #1f2937;
    font-size: 0.95rem;
}

.status-card-danger {
    padding: 0.75rem;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #7f1d1d;
    font-size: 0.95rem;
}

.status-card-warning {
    padding: 0.75rem;
    border: 1px solid #fde68a;
    border-radius: 6px;
    background: #fffbeb;
    color: #78350f;
    font-size: 0.95rem;
}

.status-card-slate {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #111827;
    font-size: 0.95rem;
}

.btn-danger {
    background: #b91c1c !important;
}

.btn-warning {
    background: #b45309 !important;
}

.btn-dark {
    background: #1f2937 !important;
}

.btn-blue {
    background: #2563eb !important;
    color: #fff !important;
}

.btn-slate {
    background: #4b5563 !important;
    color: #fff !important;
}

.btn-green {
    background: #059669 !important;
    color: #fff !important;
}

.btn-teal {
    background: #0f766e !important;
    color: #fff !important;
}

.info-panel {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
}

.vulcan-report-status {
    margin-bottom: 0.75rem;
    color: #1f2937;
    font-weight: 600;
}

.vulcan-report-generated {
    margin-bottom: 0.75rem;
    color: #4b5563;
}

.mb-4 {
    margin-bottom: 1rem;
}

.totp-step {
    margin-bottom: 0.75rem;
    color: #374151;
}

.totp-qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.totp-qr-image {
    max-width: 240px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.totp-secret {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.totp-code-input {
    margin-top: 4px;
}

.modal-entry-card {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    background: #fafafa;
    position: relative;
}

.modal-entry-remove {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    padding: 2px 6px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.modal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.input-no-margin {
    margin: 0 !important;
}

.input-mb-2 {
    margin-bottom: 0.5rem !important;
}

.input-mt-2 {
    margin-top: 0.5rem !important;
}

.modal-mt-2 {
    margin-top: 0.5rem;
}

.photo-preview-thumb {
    max-width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 2px;
}

.modal-mt-1 {
    margin-top: 4px;
}

.address-entry-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.address-entry-left {
    min-width: 0;
}

.address-entry-right {
    min-width: 0;
}

.address-entry-actions {
    margin-top: 0.55rem;
    display: flex;
    justify-content: flex-end;
}

.address-entry-remove-btn {
    padding: 0.32rem 0.62rem;
}

.address-postcode-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    align-items: center;
}

.address-geocode-wrap {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 6px;
    padding: 0.55rem;
    margin-bottom: 0.55rem;
}

.address-geocode-toolbar {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.address-geocode-toolbar .address-geocode-query {
    margin: 0;
}

.address-geocode-toolbar .address-geocode-search-btn {
    margin: 0;
    white-space: nowrap;
}

.address-geocode-hint {
    margin-top: 0.1rem;
    color: #475569;
    font-size: 0.78rem;
}

.address-geocode-results {
    margin-top: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 150px;
    overflow-y: auto;
}

.address-geocode-result-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
}

.address-geocode-result-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.address-mini-map {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 240px;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
}

@media (max-width: 940px) {
    .address-entry-layout {
        grid-template-columns: 1fr;
    }

    .address-mini-map {
        min-height: 200px;
    }

    .address-postcode-row {
        grid-template-columns: 1fr;
    }
}

.modal-add-entry-btn {
    margin-top: 0.5rem !important;
    width: 100%;
}

.modal-textarea-lg {
    min-height: 120px;
}

.readonly-input {
    background: #f3f4f6;
    cursor: not-allowed;
}

.device-manual-input {
    margin-top: 4px;
}

.modal-file-input-mt {
    margin-top: 4px !important;
}

.image-preview-wrap {
    margin: 0.25rem 0 0.9rem 0;
}

.image-preview-logo {
    display: block;
    height: 88px;
    max-width: 260px;
    width: auto;
    object-fit: contain;
}

.modal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.modal-checkbox-input {
    width: auto !important;
    margin: 0 !important;
}

.photo-entry-card {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    border-radius: 4px;
    background: #fafafa;
    position: relative;
    text-align: center;
    display: inline-block;
    width: 170px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.photo-entry-remove {
    position: absolute;
    right: 2px;
    top: 2px;
    padding: 0 4px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 10px;
}

.photo-entry-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    margin-bottom: 2px;
    cursor: pointer;
}

.photo-entry-caption {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-card {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.settings-card-mt {
    margin-top: 1rem;
}

.settings-card-title {
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 0.5rem;
}

.settings-card-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.settings-card-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.settings-card-actions-inline {
    display: flex;
    gap: 0.5rem;
}

.settings-card-note {
    font-size: 0.75rem;
    color: #6b7280;
}

.settings-card-note-tight {
    margin: 0 0 0.5rem 0;
}

.settings-card-note-mt {
    margin-top: 0.5rem;
}

.badge-sm {
    font-size: 0.875rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-neutral {
    background: #f3f4f6;
    color: #374151;
}

.case-notes-panel {
    margin-top: 0.5rem;
}

.case-notes-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.case-notes-empty {
    padding: 0.5rem 0;
    color: #6b7280;
}

.case-note-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
    background: #fafafa;
    margin-bottom: 0.75rem;
}

.case-note-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.case-note-meta {
    font-size: 0.8rem;
    color: #374151;
}

.case-note-badge-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.case-note-type-badge {
    font-size: 0.75rem;
    background: #e5e7eb;
    color: #111827;
}

.case-note-body {
    font-size: 0.875rem;
    color: #111827;
    line-height: 1.45;
}

.case-note-updated {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.case-notes-admin-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.view { min-height: 100vh; }

.org-logo-main {
    display: none;
    height: 48px;
    max-width: 160px;
    width: auto;
    object-fit: contain;
}

.org-logo-main-large {
    height: 88px;
    max-width: 260px;
    width: auto;
    object-fit: contain;
}

.user-name-clickable {
    cursor: pointer;
    text-decoration: none;
}

.password-warning {
    margin-top: -0.6rem;
    margin-bottom: 0.75rem;
    color: #dc2626;
    font-size: 0.8rem;
}

.password-strength-indicator {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.password-strength-weak {
    color: #dc2626;
}

.password-strength-medium {
    color: #f59e0b;
}

.password-strength-strong {
    color: #16a34a;
}

.input-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12) !important;
}

.required-indicator {
    color: #dc2626;
    font-weight: 700;
    margin-left: 0.15rem;
}

.modal-validation-message {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 6px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

#login-view,
#twofa-view {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 300px;
}

.login-box h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-box button {
    width: 100%;
    padding: 0.75rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-box button:hover { background: #1d4ed8; }

.error { color: #dc2626; margin-top: 0.5rem; text-align: center; }

#main-view header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.user-info { display: flex; gap: 1rem; align-items: center; }

#logout-btn {
    padding: 0.5rem 1rem;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Navigation & Dropdowns */
nav {
    background: white;
    padding: 0 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-group {
    position: relative;
    display: inline-block;
}

.nav-group-btn {
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-group-btn::after {
    content: '▾';
    font-size: 0.75rem;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
}

.nav-group:hover .nav-dropdown {
    display: block;
}

.nav-dropdown .tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: none;
}

.nav-dropdown .tab-btn:hover {
    background: #f3f4f6;
}

.nav-dropdown .tab-btn.active {
    background: #eff6ff;
    color: #2563eb;
    border-left: 3px solid #2563eb;
}

.tab-btn {
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
}

.tab-btn.active {
    border-bottom-color: #2563eb;
    color: #2563eb;
}

.nav-link {
    padding: 1rem;
    color: #2563eb;
    text-decoration: none;
}

.push-right {
    margin-left: auto;
}

@media (max-width: 900px) {
    .org-logo-main {
        height: 40px;
        max-width: 130px;
    }
}


.tab-content {
    padding: 2rem;
    display: none;
}

.tab-content.active {
    display: block;
}

.toolbar { 
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}


.toolbar button {
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th { 
    background: #f9fafb; 
    font-weight: 600; 
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:hover { background: #f3f4f6; }

th .sort-icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-left: 0.25rem;
    vertical-align: middle;
}

th.asc .sort-icon::after { content: '↑'; }
th.desc .sort-icon::after { content: '↓'; }

td button {
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.edit-btn { background: #f59e0b; color: white; }
.delete-btn { background: #dc2626; color: white; }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    gap: 1rem;
}

.modal-tabs-sticky {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    background: #fff;
    padding: 0.35rem 0 0.35rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-tabs-scroll {
    margin-bottom: 0;
    border-bottom: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 0.1rem;
}

.modal-tabs-save-btn {
    flex: 0 0 auto;
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.46rem 0.82rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.05rem;
}

.modal-tabs-save-btn:hover {
    background: #1e40af;
}

.toolbar-help-text {
    font-size: 0.8rem;
    color: #4b5563;
}

.modal-tabs-close-btn {
    flex: 0 0 auto;
    border: none;
    border-radius: 4px;
    background: #e5e7eb;
    color: #111827;
    padding: 0.46rem 0.82rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.05rem;
}

.modal-tabs-close-btn:hover {
    background: #d1d5db;
}

.modal-tab-btn {
    padding: 0.5rem 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
}

.modal-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

.modal-tab-content-scroll {
    display: block;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-tab-content-scroll:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-section-title {
    margin: 0 0 0.65rem 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.modal-inline-save-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.8rem;
}

.modal-inline-save-btn {
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.95rem;
    cursor: pointer;
    font-weight: 600;
}

.modal-inline-save-btn:hover {
    background: #1e40af;
}

@media (max-width: 760px) {
    .modal-tabs-sticky {
        flex-wrap: wrap;
        align-items: center;
    }

    .modal-tabs-save-btn,
    .modal-tabs-close-btn {
        margin-left: auto;
    }
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 450px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-content.modal-content-wide {
    width: min(1180px, 96vw);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.modal-content h2 { margin-bottom: 0; }

.modal-close-top {
    border: none;
    border-radius: 4px;
    background: #e5e7eb;
    color: #111827;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-close-top:hover {
    background: #d1d5db;
}

.modal-content form input,
.modal-content form select,
.modal-content form textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#modal-cancel { background: #e5e7eb; }
#modal-save { background: #2563eb; color: white; }

.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.pagination button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.pagination button:hover:not(.active) {
    background: #f9fafb;
}

.pagination button.nav-btn {
    min-width: 2.2rem;
    font-weight: 600;
}

.pagination button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #6b7280;
    padding: 0.5rem 0.1rem;
    font-size: 0.9rem;
}

.pagination-meta {
    color: #4b5563;
    font-size: 0.85rem;
    margin-left: 0.35rem;
    margin-right: 0.15rem;
}

.pagination-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.pagination-jump input {
    width: 4.5rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.85rem;
}

.multi-select-container {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    border-radius: 4px;
    max-height: 160px;
    overflow-y: auto;
    margin-top: 4px;
    margin-bottom: 1rem;
    background: #fff;
}

.multi-select-container-large {
    max-height: 420px;
    min-height: 280px;
    overflow: auto;
    padding: 0.35rem;
}

.multi-select-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.multi-select-item input[type="checkbox"] {
    width: auto !important;
    margin: 4px 0 0 0 !important;
    cursor: pointer;
}

.multi-select-item label {
    margin: 0 !important;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #374151;
    text-align: left;
}

.entitlement-scope-item {
    display: block;
    margin-bottom: 0.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #f1f5f9;
}

.entitlement-scope-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.entitlement-scope-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.entitlement-scope-main input[type="checkbox"] {
    width: auto !important;
    margin: 4px 0 0 0 !important;
}

.entitlement-scope-main label {
    margin: 0 !important;
    font-size: 0.875rem;
    line-height: 1.35;
    color: #374151;
}

.entitlement-scope-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0 0 1.75rem;
}

.entitlement-scope-controls span {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.entitlement-scope-controls select {
    width: 180px;
    min-width: 180px;
    margin: 0;
    padding: 0.32rem 0.45rem;
    font-size: 0.8rem;
}

.badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #374151;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: zoom-out;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    cursor: default;
}

