:root {
    --bg: #f5f7fb;
    --white: #ffffff;
    --text: #2f3b52;
    --muted: #8a98b2;
    --line: #e3ebf6;
    --primary: #2d66f5;
    --primary-soft: #edf3ff;
    --green: #22c55e;
    --green-soft: #e9fbef;
    --amber: #f59e0b;
    --amber-soft: #fff5db;
    --purple: #8b5cf6;
    --purple-soft: #f1ebff;
    --red: #ef4444;
    --red-soft: #fdecec;
    --shadow: 0 10px 35px rgba(31, 56, 102, 0.06);
    --radius: 18px;
    --motion: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
}

body.is-busy {
    cursor: progress;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    transition: border-color var(--motion), box-shadow var(--motion), transform var(--motion), background-color var(--motion), color var(--motion), opacity var(--motion);
}

button {
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    background: var(--white);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #b6cdfd;
    box-shadow: 0 0 0 3px rgba(45, 102, 245, 0.09);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: grid;
    gap: 8px;
}

label span {
    font-size: 13px;
    font-weight: 700;
    color: #485a78;
}

label span em {
    font-style: normal;
    color: var(--red);
}

small {
    color: var(--muted);
}

.field-help {
    display: block;
    font-size: 12px;
    line-height: 1.5;
}

.field-error {
    display: block;
    color: var(--red);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 700;
}

.file-meta {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.field-help a {
    color: var(--primary);
    font-weight: 700;
}

code {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f7faff;
    border: 1px solid var(--line);
    font-size: 12px;
    word-break: break-all;
}

.shell {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--white);
    border-right: 1px solid var(--line);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand-panel {
    padding: 22px 20px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.brand strong {
    display: block;
    color: var(--primary);
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
    font-size: 16px;
    line-height: 1.2;
}

.brand small {
    display: block;
    margin-top: 4px;
}

.nav-list {
    display: grid;
    gap: 6px;
    padding: 14px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #7383a1;
    font-weight: 700;
}

.nav-item:hover,
.nav-item.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-icon,
.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line);
}

.logout-link {
    color: var(--red);
    font-weight: 700;
}

.content-shell {
    padding: 0;
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.subtle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.topbar-meta {
    display: flex;
    align-items: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eef2f9;
    color: #5f6f8a;
    font-size: 12px;
    font-weight: 700;
}

.pill.accent {
    background: var(--primary-soft);
    color: var(--primary);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.user-chip strong {
    display: block;
    font-size: 14px;
}

.user-chip small {
    display: block;
    font-size: 12px;
}

.page-grid {
    padding: 28px;
    display: grid;
    gap: 22px;
}

.module-screen,
.stack-column {
    display: grid;
    gap: 20px;
}

.module-screen.narrow {
    max-width: 980px;
}

.screen-head,
.screen-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.screen-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}

.toolbar-filters.short {
    flex: 0 1 720px;
}

.toolbar-filters > * {
    min-width: 150px;
}

.search-input {
    min-width: 280px;
    flex: 1;
}

.back-link {
    color: #7383a1;
    font-weight: 700;
    transition: color var(--motion), transform var(--motion);
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-2px);
}

.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.form-panel {
    max-width: 100%;
}

.page-block__header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.page-block__header h3 {
    margin: 0;
    font-size: 18px;
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
}

.panel__header h3 {
    margin: 0;
    font-size: 18px;
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
}

.page-block__header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.panel__header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.notice-box {
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--primary-soft);
    border: 1px solid #ccdcff;
    margin-bottom: 18px;
}

.notice-box strong {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--primary);
}

.notice-box p {
    margin: 0;
    color: #5f7495;
    line-height: 1.6;
    font-size: 13px;
}

.validation-summary {
    padding: 16px 18px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #ffd8b0;
    margin-bottom: 18px;
}

.validation-summary strong {
    display: block;
    margin-bottom: 6px;
    color: #b45309;
    font-size: 13px;
}

.validation-summary p {
    margin: 0;
    color: #9a5b16;
    font-size: 13px;
    line-height: 1.6;
}

.summary-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.summary-card__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.summary-card__icon.blue { background: var(--primary-soft); }
.summary-card__icon.green { background: var(--green-soft); }
.summary-card__icon.amber { background: var(--amber-soft); }
.summary-card__icon.purple { background: var(--purple-soft); }

.summary-card strong {
    display: block;
    font-size: 18px;
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
}

.summary-card span {
    color: var(--muted);
    font-size: 13px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-grid,
.split-screen {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
    gap: 20px;
}

.slim-panel {
    align-self: start;
}

.alert-list,
.message-log,
.api-guide {
    display: grid;
    gap: 12px;
}

.alert-row,
.message-log__row {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffdf7;
    padding: 14px 16px;
}

.alert-row strong,
.message-log__meta strong {
    display: block;
    font-size: 14px;
}

.alert-row small,
.message-log__meta span {
    display: block;
    margin-top: 4px;
}

.alert-row__meta {
    color: #b78007;
    font-weight: 700;
    font-size: 13px;
}

.message-log__meta {
    margin-bottom: 8px;
}

.message-log__row p {
    margin: 0;
    line-height: 1.6;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #edf2fa;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.table-title strong {
    display: block;
    margin-bottom: 3px;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-link {
    border: none;
    padding: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
}

.inline-link.danger {
    color: var(--red);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-chip.success {
    background: var(--green-soft);
    color: var(--green);
}

.status-chip.warning {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-chip.danger {
    background: var(--red-soft);
    color: var(--red);
}

.status-chip.info {
    background: #eef5ff;
    color: var(--primary);
}

.status-chip.neutral {
    background: #f3f5f9;
    color: #6f7f99;
}

.text-danger {
    color: var(--red);
    font-weight: 700;
}

.text-success {
    color: var(--green);
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.detail-grid div {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafcff;
    padding: 14px;
    display: grid;
    gap: 6px;
}

.detail-grid strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.detail-grid .status-chip {
    width: fit-content;
    justify-self: start;
}

.section-space {
    margin-top: 22px;
}

.bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fbff;
    margin-bottom: 18px;
}

.bulk-actions__meta {
    display: grid;
    gap: 8px;
}

.bulk-actions__meta strong {
    font-size: 14px;
    color: var(--text);
}

.bulk-actions__buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #485a78;
}

.selection-cell {
    width: 52px;
    text-align: center !important;
}

.selection-cell input[type="checkbox"],
.check-pill input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.pagination-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 6px;
}

.pagination-summary {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.pagination-summary strong {
    color: var(--text);
    font-size: 14px;
}

.pagination-nav {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-link,
.pagination-separator {
    min-width: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--white);
    color: #5f6f8a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--motion), box-shadow var(--motion), border-color var(--motion), background-color var(--motion), color var(--motion), opacity var(--motion);
}

.pagination-link:hover {
    transform: translateY(-1px);
    border-color: #ccdbfb;
    box-shadow: 0 12px 26px rgba(45, 102, 245, 0.08);
}

.pagination-link.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 14px 26px rgba(45, 102, 245, 0.18);
}

.pagination-link.is-disabled {
    background: #f8fafc;
    color: #a1acc1;
    cursor: default;
}

.pagination-separator {
    border-style: dashed;
    background: #f9fbff;
}

.section-space h4 {
    margin: 0 0 12px;
    font-size: 16px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form.is-submitting .primary-button {
    opacity: .82;
    pointer-events: none;
}

.two-field,
.three-field,
.form-actions {
    display: grid;
    gap: 14px;
}

.two-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-field {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-actions {
    grid-template-columns: 180px 220px;
    justify-content: end;
}

.form-field {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 10px 12px 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    transition: transform var(--motion), box-shadow var(--motion), border-color var(--motion), background-color var(--motion);
}

.form-field:focus-within {
    transform: translateY(-2px);
    border-color: #dbe6ff;
    box-shadow: 0 10px 25px rgba(45, 102, 245, 0.08);
}

.form-field.has-open-picker {
    z-index: 30;
}

.form-field.has-error {
    border-color: #f8c7c7;
    background: #fffafb;
}

.form-field.has-error:focus-within {
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.08);
}

.async-picker {
    position: relative;
    display: grid;
    gap: 10px;
}

.async-picker__selected {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: start;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.async-picker__selected.is-selected {
    border-color: #c9dafc;
    background: #eef5ff;
}

.async-picker__selected-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
}

.async-picker__toggle {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #5e7090;
    background: rgba(214, 227, 250, 0.52);
    transition: transform .18s ease, background-color .18s ease, color .18s ease;
}

.async-picker__toggle svg {
    width: 18px;
    height: 18px;
}

.async-picker.is-open .async-picker__selected {
    border-color: #9ebcff;
    box-shadow: 0 0 0 3px rgba(45, 102, 245, 0.12);
    background: #fdfefe;
}

.async-picker.is-open .async-picker__toggle {
    transform: rotate(180deg);
    color: #2d66f5;
    background: rgba(208, 222, 255, 0.9);
}

.async-picker__selected strong,
.async-picker__option strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
}

.async-picker__selected small,
.async-picker__option small,
.async-picker__status,
.async-picker__empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.async-picker__panel {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 80;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 44px rgba(20, 36, 58, 0.16);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.async-picker__panel[hidden] {
    display: none !important;
}

.async-picker__search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.async-picker__search {
    width: 100%;
}

.async-picker__clear {
    white-space: nowrap;
    align-self: stretch;
}

.async-picker__results {
    max-height: 260px;
    overflow-y: auto;
    display: grid;
    gap: 8px;
    padding-inline-end: 4px;
}

.async-picker__option,
.async-picker__empty {
    width: 100%;
    border: 1px solid #e5edf8;
    border-radius: 14px;
    background: #fbfcff;
    padding: 12px 13px;
    text-align: start;
}

.async-picker__option:hover {
    border-color: #bfd0ef;
    background: #f7faff;
}

.async-picker__option.is-selected {
    border-color: #9ebcff;
    background: #eff5ff;
}

.form-field.is-checkbox {
    align-content: center;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: 16px;
    height: 16px;
}

.primary-button,
.ghost-button,
.icon-button,
.danger-button,
.danger-outline {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--motion), box-shadow var(--motion), background-color var(--motion), border-color var(--motion), color var(--motion), opacity var(--motion);
}

.primary-button {
    background: var(--primary);
    color: white;
    box-shadow: 0 14px 28px rgba(45, 102, 245, 0.16);
}

.ghost-button,
.icon-button,
.danger-outline {
    background: var(--white);
    color: #5f6f8a;
    border-color: var(--line);
}

.danger-button {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    box-shadow: 0 14px 28px rgba(239, 68, 68, 0.18);
}

.danger-outline {
    color: var(--red);
    border-color: #f4c4c4;
    background: #fff6f6;
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.danger-button:hover,
.danger-outline:hover,
.nav-item:hover,
.inline-link:hover {
    transform: translateY(-1px);
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.danger-button:active,
.danger-outline:active,
.inline-link:active,
.nav-item:active {
    transform: translateY(1px) scale(0.99);
}

.primary-button:hover {
    box-shadow: 0 18px 32px rgba(45, 102, 245, 0.2);
}

.danger-button:hover {
    box-shadow: 0 18px 32px rgba(239, 68, 68, 0.22);
}

.danger-button:disabled,
.danger-outline:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: #f19999;
    background: #fffafb;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

input[type="file"] {
    padding: 10px 12px;
    background: #f9fbff;
}

input[type="file"]::file-selector-button {
    border: 1px solid #cfdcf9;
    border-radius: 10px;
    padding: 9px 12px;
    margin-right: 12px;
    background: #edf3ff;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--motion), transform var(--motion), border-color var(--motion);
}

input[type="file"]::file-selector-button:hover {
    background: #e3edff;
}

.file-preview {
    display: none;
    width: 100%;
    min-height: 132px;
    border: 1px dashed #d6def0;
    border-radius: 16px;
    background: #f8fbff;
    padding: 10px;
}

.file-preview.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview img {
    width: 100%;
    max-height: 210px;
    border-radius: 12px;
    object-fit: cover;
}

.full-width {
    width: 100%;
}

.tab-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.tab-stat {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 12px;
    text-align: center;
}

.tab-stat strong {
    display: block;
    font-size: 18px;
    margin-bottom: 6px;
}

.tab-stat span {
    font-size: 13px;
    color: var(--muted);
}

.tab-stat.is-active {
    border-color: #9ab8ff;
    background: #f1f6ff;
}

.split-screen {
    align-items: start;
}

.alert {
    margin: 0 28px 0;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 700;
}

.login-card .alert {
    margin: 0 0 16px;
}

.alert.success {
    background: var(--green-soft);
    color: var(--green);
}

.alert.danger {
    background: var(--red-soft);
    color: var(--red);
}

.detail-hero-media {
    margin-bottom: 20px;
}

.detail-hero-media img {
    max-width: 220px;
    width: 100%;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.detail-media {
    display: grid;
    gap: 8px;
}

.detail-media img {
    width: 100%;
    max-width: 180px;
    border-radius: 14px;
    border: 1px solid var(--line);
    object-fit: cover;
}

.login-body {
    background: linear-gradient(180deg, #2157d4 0%, #1745b8 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 420px);
    gap: 40px;
    align-items: center;
    padding: 40px;
}

.login-showcase {
    color: white;
}

.login-showcase h1 {
    margin: 18px 0 14px;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.08;
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
}

.login-showcase p,
.showcase-card p {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.showcase-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 18px;
}

.login-card {
    background: var(--white);
    border-radius: 22px;
    padding: 30px;
}

.login-card__header h2 {
    margin: 10px 0 0;
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand strong,
.summary-card strong,
.tab-stat strong,
.table-title strong,
.login-showcase h1,
.login-card__header h2 {
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
    font-weight: 500;
}

.login-card__header p {
    color: var(--muted);
}

.page-loader[hidden] {
    display: none;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(245, 247, 251, 0.76);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.page-loader.is-visible {
    opacity: 1;
}

.page-loader__card {
    width: min(100%, 320px);
    padding: 26px 24px 22px;
    border-radius: 24px;
    border: 1px solid rgba(227, 235, 246, 0.9);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(31, 56, 102, 0.14);
    text-align: center;
}

.page-loader__card strong {
    display: block;
    color: var(--text);
    font-size: 20px;
    font-family: "Lama Sans", "IBM Plex Sans Arabic", sans-serif;
}

.page-loader__card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.page-loader__spinner {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 58px;
    margin-bottom: 16px;
}

.page-loader__spinner span {
    width: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #8ab0ff 0%, var(--primary) 100%);
    animation: loader-pulse 0.85s ease-in-out infinite;
}

.page-loader__spinner span:nth-child(1) {
    height: 24px;
    animation-delay: 0s;
}

.page-loader__spinner span:nth-child(2) {
    height: 38px;
    animation-delay: 0.12s;
}

.page-loader__spinner span:nth-child(3) {
    height: 30px;
    animation-delay: 0.24s;
}

.login-footnote {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.icon-button {
    width: 44px;
    height: 44px;
    padding: 0;
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

body.ui-ready .screen-head,
body.ui-ready .panel,
body.ui-ready .alert {
    animation: fade-slide-up .42s var(--motion) both;
}

body.ui-ready .stack-form .form-field,
body.ui-ready .stack-form .form-actions {
    animation: fade-slide-up .36s var(--motion) both;
    animation-delay: calc(var(--stagger, 0) * 28ms);
}

@keyframes fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loader-pulse {
    0%, 100% {
        transform: translateY(0) scaleY(0.88);
        opacity: 0.65;
    }
    50% {
        transform: translateY(-3px) scaleY(1.08);
        opacity: 1;
    }
}

.mobile-only {
    display: none;
}

@media (max-width: 1180px) {
    .metrics-grid,
    .dashboard-grid,
    .split-screen,
    .showcase-grid,
    .tab-stats {
        grid-template-columns: 1fr 1fr;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 260px);
        transform: translateX(-105%);
        transition: transform .25s ease;
        z-index: 30;
    }

    .shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .mobile-only {
        display: inline-flex;
    }

    .topbar {
        padding: 16px 18px;
    }

    .page-grid {
        padding: 18px;
    }

    .metrics-grid,
    .dashboard-grid,
    .split-screen,
    .detail-grid,
    .two-field,
    .three-field,
    .form-actions,
    .showcase-grid,
    .tab-stats {
        grid-template-columns: 1fr;
    }

    .toolbar-filters {
        width: 100%;
    }

    .bulk-actions,
    .bulk-actions__buttons {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .search-input,
    .toolbar-filters > * {
        min-width: 100%;
    }

    .panel {
        padding: 16px;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .subtle {
        font-size: 12px;
    }

    .login-shell {
        padding: 18px;
    }

    .pagination-shell,
    .pagination-nav {
        width: 100%;
    }

    .pagination-nav {
        justify-content: flex-start;
    }
}

.hierarchy-panel {
    display: grid;
    gap: 1rem;
}

.hierarchy-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.count-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, .18);
    background: #f8fbff;
    color: #1d4ed8;
    padding: .38rem .72rem;
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
}

.hierarchy-list {
    display: grid;
    gap: .9rem;
}

.hierarchy-category {
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .04);
}

.hierarchy-category[open] {
    border-color: rgba(37, 99, 235, .24);
}

.hierarchy-category__summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.2rem;
    cursor: pointer;
}

.hierarchy-category__summary::-webkit-details-marker {
    display: none;
}

.hierarchy-category__summary::marker {
    content: '';
}

.hierarchy-category__title {
    display: grid;
    gap: .35rem;
}

.hierarchy-category__title strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.hierarchy-category__title small {
    color: var(--text-muted);
    line-height: 1.4;
}

.hierarchy-category__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
}

.hierarchy-category__body {
    border-top: 1px solid rgba(148, 163, 184, .16);
    background: linear-gradient(180deg, rgba(248, 250, 252, .82), #fff 30%);
    padding: 1rem 1.2rem 1.2rem;
}

.hierarchy-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .9rem;
}

.hierarchy-catalog {
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 16px;
    background: #fff;
    padding: .95rem;
    display: grid;
    gap: .65rem;
}

.hierarchy-catalog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.hierarchy-catalog__head strong {
    display: block;
    color: var(--text-primary);
    font-size: .98rem;
}

.hierarchy-catalog__head small {
    display: block;
    margin-top: .2rem;
    color: var(--text-muted);
}

.hierarchy-catalog__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    color: var(--text-muted);
    font-size: .84rem;
}

.hierarchy-product-list {
    display: grid;
    gap: .55rem;
}

.hierarchy-product-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    background: #f8fafc;
    border-radius: 12px;
    padding: .7rem .8rem;
}

.hierarchy-product-row strong {
    display: block;
    color: var(--text-primary);
    font-size: .88rem;
}

.hierarchy-product-row small {
    display: block;
    margin-top: .18rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.hierarchy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.hierarchy-empty {
    padding: .9rem 1rem;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: .9rem;
}

@media (max-width: 900px) {
    .hierarchy-category__summary {
        flex-direction: column;
    }

    .hierarchy-category__meta {
        justify-content: flex-start;
    }
}
