@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600;700&display=swap');

:root {
    --plum: #793b90;
    --deep: #34273e;
    --muted: #82748a;
    --line: #e6deed;
    --bg: #faf8fc;
    --lilac: #efe7f5;
    --side: #f5eff8;
    --white: #fff;
    --green: #227647;
    --red: #c52e36;
    --amber: #9a6b22;
    --sidebar: 224px
}

* {
    box-sizing: border-box
}

html {
    font-family: Calibri, 'Carlito', 'Segoe UI', Arial, sans-serif;
    color: var(--deep);
    font-size: 16px;
    background: var(--bg)
}

html[lang=ar] {
    font-family: 'Noto Kufi Arabic', Tahoma, Arial, sans-serif;
    font-size: 13px
}

body {
    margin: 0
}

button, input, select, textarea {
    font: inherit;
    color: inherit
}

button, a, input, select {
    outline-offset: 3px
}

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

button {
    cursor: pointer
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--plum)
}

.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar);
    background: var(--side);
    border-inline-end: 1px solid var(--line);
    padding: 30px 16px;
    overflow: auto;
    z-index: 20
}

.brand {
    display: block;
    font-weight: 700;
    font-size: 20px;
    margin: 0 6px 26px
}

.brand small, .sidebar-profile small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    margin-block-start: 5px
}

.brand small {
    color: var(--plum);
    font-weight: 600
}

.nav-link {
    display: block;
    padding: 12px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    margin-block: 3px;
    font-size: 14px;
    color: #66576f
}

.nav-link:hover, .nav-link.active {
    background: #eadef1;
    border-color: #c9b0d7;
    color: var(--plum)
}

.sidebar-profile {
    margin-block: 28px 20px;
    border-top: 1px solid var(--line);
    padding: 16px 8px
}

.screen-index {
    font-size: 12px;
    padding: 8px;
    color: var(--muted)
}

.screen-index a {
    display: block;
    padding: 7px 0
}

.shell {
    margin-inline-start: var(--sidebar);
    min-height: 100vh
}

.topbar {
    min-height: 76px;
    background: white;
    border-bottom: 1px solid #f1ebf5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 36px
}

.breadcrumb {
    font-size: 13px;
    color: var(--muted)
}

.top-actions, .actions, .language {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.role {
    color: var(--plum);
    font-size: 12px
}

.global-search {
    width: 205px;
    border: 0;
    background: transparent;
    padding: 9px;
    font-size: 13px
}

.language button {
    border: 1px solid var(--line);
    background: white;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 12px
}

.language button[aria-pressed=true] {
    color: white;
    background: var(--plum)
}

.menu-toggle {
    display: none
}

.content {
    max-width: 1600px;
    margin: auto;
    padding: 32px 38px 48px
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-block-end: 23px
}

h1 {
    font-size: 32px;
    line-height: 1.2;
    margin: 0 0 10px;
    font-weight: 700
}

html[lang=ar] h1 {
    font-size: 24px
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 15px;
    background: #fff;
    font-weight: 600;
    font-size: 14px;
    white-space: normal;
    text-align: center
}

.button:hover {
    border-color: var(--plum);
    color: var(--plum)
}

.button.primary {
    background: var(--plum);
    color: white;
    border-color: var(--plum)
}

.button.small {
    font-size: 12px;
    min-height: 32px;
    padding: 6px 11px
}

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 24px
}

.tab {
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 11px 15px;
    color: var(--muted);
    font-size: 14px
}

.tab:hover {
    background: var(--lilac)
}

.tab.selected {
    color: white;
    background: var(--plum)
}

.stats {
    display: grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 24px
}

.stat {
    border: 1px solid var(--line);
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: grid;
    gap: 10px;
    min-height: 128px
}

.stat small {
    font-size: 14px
}

.stat strong {
    font-size: 32px;
    line-height: 1
}

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

.tone-0, .tone-1, .tone-2 {
    background: #fff3d8;
    border-color: #d6b77d;
    color: var(--amber)
}

.tone-3 {
    background: #fff;
    border-color: var(--line)
}

.page-heading:has(+.tabs+.stats) {
}

.blocks {
    display: grid;
    grid-template-columns:minmax(0, 1.8fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start
}

.panel {
    min-width: 0;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 21px
}

.panel h2 {
    font-size: 20px;
    margin: 0 0 15px;
    line-height: 1.35
}

html[lang=ar] .panel h2 {
    font-size: 16px
}

.record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere
}

.record:first-child {
    padding-top: 4px
}

.record:last-child {
    border: 0;
    padding-bottom: 0
}

.record strong {
    font-size: 14px;
    display: block;
    font-weight: 600
}

.record span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px
}

.kind-notice {
    background: var(--lilac);
    grid-column: 1/-1
}

.kind-notice h2 {
    font-size: 15px
}

.kind-notice .record {
    border: 0
}

.kind-notice .record strong {
    font-weight: 400
}

.kind-table, .kind-filters, .kind-timeline {
    grid-column: 1/-1
}

.table-scroll {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    text-align: start
}

th, td {
    text-align: start;
    padding: 15px 11px;
    border-bottom: 1px solid var(--line);
    font-size: 13px
}

th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    background: #faf8fc
}

tbody tr:last-child td {
    border-bottom: 0
}

tbody tr:hover {
    background: #faf7fc
}

input[type=checkbox] {
    accent-color: var(--plum)
}

.field-grid {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 17px
}

.field {
    min-width: 0
}

.field label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 7px;
    text-transform: uppercase
}

.field strong {
    font-weight: 500;
    overflow-wrap: anywhere
}

.field input, .field select, .local-search {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 11px;
    min-height: 40px
}

.local-search {
    margin-bottom: 20px
}

.page-profile-editor, .page-advanced-search, .page-bulk-reassignment, .page-bulk-results {
    grid-template-columns:1fr
}

.page-profile-editor .field-grid, .page-advanced-search .field-grid {
    grid-template-columns:repeat(3, minmax(0, 1fr))
}

.page-create-task .field-grid, .page-user-chat .field-grid, .page-suggestion-review .field-grid {
    grid-template-columns:1fr
}

.kind-chat .record {
    background: #e2f2e7;
    border: 0;
    margin: 0 0 12px;
    border-radius: 8px;
    padding: 16px
}

.kind-chat .record:nth-child(even) {
    background: var(--lilac)
}

.kind-timeline .records {
    display: grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap: 12px
}

.kind-timeline .record {
    border: 0;
    border-top: 3px solid #c5aad3;
    padding: 12px 0
}

.page-my-day .panel-1 {
    grid-row: span 2
}

.page-team-operations .panel-1 {
    grid-row: span 1
}

.page-user-workspace .panel-2 {
    grid-row: span 1
}

.page-smart-notes .panel-6 {
    background: #fce5e5
}

.page-assessments .panel-1, .page-matchmakers .panel-1 {
    grid-column: 1/-1
}

.page-reports .panel-3 {
    grid-column: 1/-1
}

.page-introduction-detail .panel-5, .page-introduction-detail .panel-6 {
    grid-column: 1/-1
}

footer {
    margin-top: 28px;
    font-size: 12px;
    color: var(--muted)
}

.toast {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    max-width: calc(100% - 48px);
    background: var(--deep);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 40
}

.overlay {
    position: fixed;
    inset: 0;
    background: #24172d66;
    z-index: 19
}

.empty-result {
    padding: 16px;
    color: var(--muted)
}

[hidden] {
    display: none !important
}

@media (max-width: 1100px) {
    .topbar {
        padding: 12px 22px
    }

    .content {
        padding: 25px
    }

    .global-search {
        width: 150px
    }

    .role {
        display: none
    }

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

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

@media (max-width: 800px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .2s ease
    }

    html[dir=rtl] .sidebar {
        transform: translateX(105%)
    }

    .sidebar.open {
        transform: translateX(0) !important
    }

    .shell {
        margin: 0
    }

    .menu-toggle {
        display: block;
        border: 1px solid var(--line);
        background: white;
        border-radius: 6px;
        padding: 8px;
        white-space: nowrap
    }

    .topbar {
        flex-wrap: wrap;
        gap: 8px
    }

    .breadcrumb {
        flex: 1
    }

    .top-actions {
        margin-inline-start: auto
    }

    .global-search {
        display: none
    }

    .content {
        padding: 20px
    }

    .blocks {
        grid-template-columns:1fr
    }

    .page-heading {
        flex-direction: column
    }

    .panel {
        padding: 17px
    }

    .page-my-day .panel-1 {
        grid-row: auto
    }

    .kind-timeline .records {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }
}

@media (max-width: 480px) {
    .content {
        padding: 14px
    }

    .topbar {
        padding: 10px 12px
    }

    .breadcrumb {
        font-size: 11px
    }

    .stats {
        gap: 8px
    }

    .stat {
        padding: 12px;
        min-height: 108px
    }

    .stat strong {
        font-size: 26px
    }

    .stat small {
        font-size: 12px
    }

    .field-grid, .page-profile-editor .field-grid, .page-advanced-search .field-grid {
        grid-template-columns:1fr
    }

    .record {
        align-items: flex-start;
        flex-wrap: wrap
    }

    .actions {
        width: 100%
    }

    .actions .button {
        flex: 1
    }

    .tabs {
        gap: 3px
    }

    .tab {
        padding: 8px 10px;
        font-size: 12px
    }

    h1 {
        font-size: 27px
    }

    .kind-timeline .records {
        grid-template-columns:1fr
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important
    }
}
