/* Shared FEM theme. Add .fem-theme to a page to opt in. */
:root {
    --fem-blue: #1976d2;
    --fem-blue-dark: #1565c0;
    --fem-blue-soft: #edf4fc;
    --fem-gradient: linear-gradient(135deg, var(--fem-blue) 0%, var(--fem-blue-dark) 100%);
    --fem-page: #f5f5f5;
    --fem-surface: #ffffff;
    --fem-surface-soft: #f8fbff;
    --fem-text: #243c56;
    --fem-heading: #173e6b;
    --fem-muted: #63758a;
    --fem-border: #d9e4f0;
    --fem-radius: 10px;
    --fem-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    --fem-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.fem-theme { color: var(--fem-text); font-family: var(--fem-font); }
.fem-theme.fem-page { background: var(--fem-page); min-height: calc(100vh - 72px); }
.fem-theme.fem-page > .container { padding-bottom: 30px; }
.fem-theme .fem-panel {
    background: var(--fem-surface);
    border: 0;
    border-radius: var(--fem-radius);
    box-shadow: var(--fem-shadow);
    margin-top: 12px;
    overflow: hidden;
}
.fem-theme .fem-panel-header {
    background: var(--fem-gradient);
    border: 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    padding: 18px 20px;
}
.fem-theme .fem-page-title { color: inherit; font: inherit; margin: 0; }
.fem-theme .fem-page-subtitle { color: #ffffff; font-size: 13px; font-weight: 400; margin: 4px 0 0; opacity: 0.9; }
.fem-theme .fem-panel-body { background: var(--fem-surface-soft); padding: 20px; }
.fem-theme .fem-panel-body + .fem-panel-body { border-top: 1px solid var(--fem-border); }
.fem-theme .fem-section + .fem-section { margin-top: 22px; }
.fem-theme .fem-section-heading { color: var(--fem-heading); font-size: 18px; font-weight: 600; line-height: 1.4; margin: 0; }
.fem-theme .fem-muted { color: var(--fem-muted); font-size: 13px; line-height: 1.5; margin: 4px 0 0; }
.fem-theme .fem-count { background: var(--fem-blue-soft); border-radius: 12px; color: var(--fem-blue-dark); display: inline-block; font-size: 12px; font-weight: 600; margin-left: 6px; padding: 2px 8px; vertical-align: middle; }

.fem-theme .fem-nav { background: var(--fem-surface); border-bottom: 1px solid var(--fem-border); display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; }
.fem-theme .fem-nav a { border-radius: 6px; color: var(--fem-muted); font-size: 13px; font-weight: 600; padding: 8px 12px; text-decoration: none; }
.fem-theme .fem-nav a:hover { background: var(--fem-surface-soft); color: var(--fem-blue-dark); }
.fem-theme .fem-nav a[aria-current="page"] { background: var(--fem-blue-soft); color: var(--fem-blue-dark); }

.fem-theme .fem-toolbar { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; }
.fem-theme .fem-toolbar-title { flex: 1 1 240px; }
.fem-theme .fem-field { flex: 1 1 150px; min-width: 0; }
.fem-theme .fem-field-wide { flex: 2 1 240px; }
.fem-theme .fem-field label { color: var(--fem-text); display: block; font-size: 12px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; }
.fem-theme .fem-field .form-control { background: var(--fem-surface); border: 1px solid var(--fem-border); border-radius: 6px; box-shadow: none; color: var(--fem-text); font-size: 14px; height: 36px; padding: 6px 9px; width: 100%; }
.fem-theme .fem-field select[multiple] { height: 76px; padding: 3px 6px; }
.fem-theme .fem-field .form-control:focus { border-color: var(--fem-blue); box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.15); }
.fem-theme .fem-field-help { color: var(--fem-muted); display: block; font-size: 11px; margin-top: 4px; }
.fem-theme .fem-form-grid { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.fem-theme .fem-form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fem-theme .fem-form-actions .btn { margin-bottom: 0; }
.fem-theme .fem-field .select2-container { max-width: 100%; width: 100% !important; }
.fem-theme .fem-field .select2-selection--single { border-color: var(--fem-border); border-radius: 6px; height: 36px; }
.fem-theme .fem-field .select2-selection__rendered { color: var(--fem-text); font-size: 14px; line-height: 34px; }
.fem-theme .fem-field .select2-selection__arrow { height: 34px; }

.fem-theme .btn { border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.4; padding: 7px 12px; width: auto; }
.fem-theme .btn-primary { background: var(--fem-blue); border-color: var(--fem-blue); color: #ffffff; }
.fem-theme .btn-primary:hover, .fem-theme .btn-primary:focus { background: var(--fem-blue-dark); border-color: var(--fem-blue-dark); }
.fem-theme .btn-default { background: var(--fem-surface); border-color: var(--fem-border); color: var(--fem-blue-dark); }
.fem-theme .btn-default:hover { background: var(--fem-blue-soft); }
.fem-theme a:focus-visible, .fem-theme button:focus-visible, .fem-theme summary:focus-visible, .fem-theme [tabindex="0"]:focus-visible { outline: 2px solid var(--fem-blue); outline-offset: 3px; }
.fem-theme .fem-icon-action { align-items: center; display: inline-flex; height: 32px; justify-content: center; padding: 0; vertical-align: middle; width: 32px; }
.fem-theme .fem-icon-action .fa { font-size: 14px !important; height: auto; padding: 0 !important; width: auto; }
.fem-theme .fem-icon-action icon { font-size: 14px; line-height: 1; }
.fem-theme .fem-action-danger { background: #fff5f3; border-color: #f0d1cb; color: #a43d31; }
.fem-theme .fem-action-danger:hover { background: #fbe5e0; color: #8b2e23; }
.fem-theme .fem-actions { white-space: nowrap; }
.fem-theme .fem-actions > .btn + .btn { margin-left: 4px; }

.fem-theme .fem-table-wrap { background: var(--fem-surface); border: 1px solid var(--fem-border); border-radius: 8px; margin: 0; overflow-x: auto; }
.fem-theme table.fem-table { background: var(--fem-surface); border-collapse: collapse; margin: 0; min-width: 680px; width: 100%; }
.fem-theme .fem-table th, .fem-theme .fem-table td { display: table-cell; font-size: 13px; line-height: 1.5; padding: 10px 12px; text-align: left; vertical-align: middle; white-space: normal; }
.fem-theme .fem-table > thead > tr > th { background: #eaf2fc; border: 0; color: var(--fem-heading); font-size: 12px; font-weight: 600; }
.fem-theme .fem-table > tbody > tr { background: var(--fem-surface); }
.fem-theme .fem-table > tbody > tr:nth-child(4n+3) { background: #fbfdff; }
.fem-theme .fem-table > tbody > tr:hover { background: var(--fem-surface-soft); }
.fem-theme .fem-table > tbody > tr > td { border-bottom: 1px solid #edf2f7; border-top: 0; color: var(--fem-text); }
.fem-theme .fem-table td:before { content: none; display: none; }
.fem-theme .fem-table a { color: var(--fem-blue-dark); }
.fem-theme .fem-table a.btn-primary { color: #ffffff; }
.fem-theme .fem-table a.fem-action-danger { color: #a43d31; }
.fem-theme .fem-table .text-right { text-align: right !important; }
.fem-theme .fem-table .fem-nowrap { white-space: nowrap; }
.fem-theme .fem-table .fem-record-name { font-weight: 600; }
.fem-theme .fem-table .fem-record-detail { color: var(--fem-muted); display: block; font-size: 12px; margin-top: 3px; }
.fem-theme .fem-table .subrow { background: var(--fem-blue-soft); padding: 10px; }
.fem-theme .fem-table .fem-table { min-width: 850px; }
.fem-theme .fem-table .form-control { border-color: var(--fem-border); border-radius: 5px; font-size: 13px; min-width: 180px; }
.fem-theme .fem-status { background: var(--fem-blue-soft); border: 1px solid var(--fem-border); border-radius: 12px; color: var(--fem-heading); display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.4; padding: 3px 8px; white-space: nowrap; }
.fem-theme .fem-status-muted { background: #f2f4f7; border-color: #e0e5eb; color: #657284; }
.fem-theme .fem-status-success { background: #edf8f1; border-color: #cfe5d7; color: #286441; }
.fem-theme .fem-empty { background: var(--fem-surface); border: 1px dashed var(--fem-border); border-radius: 8px; color: var(--fem-muted); padding: 28px 20px; text-align: center; }
.fem-theme .fem-empty h3 { color: var(--fem-heading); font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.fem-theme .fem-empty p { font-size: 13px; margin: 0; }

@media (max-width: 767px) {
    .fem-theme .fem-panel-header, .fem-theme .fem-panel-body { padding: 14px; }
    .fem-theme .fem-panel-header { font-size: 20px; }
    .fem-theme .fem-field .form-control { font-size: 16px; height: 40px; }
    .fem-theme .fem-field select[multiple] { height: 84px; }
    .fem-theme .fem-field .select2-selection--single { height: 40px; }
    .fem-theme .fem-field .select2-selection__rendered { font-size: 16px; line-height: 38px; }
    .fem-theme .fem-field .select2-selection__arrow { height: 38px; }
    .fem-theme .fem-icon-action { height: 36px; width: 36px; }
    .fem-theme .fem-table th, .fem-theme .fem-table td { padding: 9px 10px; }
}
