@font-face {
    font-family: "Vazirmatn";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/vendor/vazirmatn/files/vazirmatn-arabic-400.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: "Vazirmatn";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/vendor/vazirmatn/files/vazirmatn-latin-400.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Vazirmatn";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/assets/vendor/vazirmatn/files/vazirmatn-arabic-500.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: "Vazirmatn";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/assets/vendor/vazirmatn/files/vazirmatn-latin-500.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Vazirmatn";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/vendor/vazirmatn/files/vazirmatn-arabic-700.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: "Vazirmatn";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/vendor/vazirmatn/files/vazirmatn-latin-700.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light;
    --color-ink: #38255c;
    --color-ink-soft: #516c82;
    --color-muted: #516c82;
    --color-primary: #38255c;
    --color-primary-dark: #271943;
    --color-primary-soft: #f6eeff;
    --color-teal: #516c82;
    --color-border: #e5d9ef;
    --color-surface: #fff;
    --color-accent: #fb6596;
    --color-page: #f6eeff;
    --color-error: #bd3450;
    --color-error-soft: #fff0f2;
    --color-success: #12866f;
    --color-success-soft: #eaf8f4;
    --color-warning: #9d6812;
    --color-warning-soft: #fff7e6;
    --shadow-card: 0 18px 46px rgb(56 37 92 / 7%);
    --shadow-soft: 0 8px 24px rgb(56 37 92 / 5%);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--color-page);
    color: var(--color-ink);
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.75;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 3px solid rgb(56 37 92 / 48%);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--color-ink);
    color: #fff;
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

/* Shared controls */
.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.3;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button--primary { background: var(--color-primary); color: #fff; box-shadow: 0 6px 14px rgb(56 37 92 / 18%); }
.button--primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.button--quiet { border-color: var(--color-border); background: #fff; color: var(--color-ink-soft); }
.button--quiet:hover:not(:disabled) { border-color: #b8a3ca; background: #fcf7ff; }
.button--small { min-height: 38px; padding: 7px 14px; font-size: 13px; }
.button--block { width: 100%; }
.button__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / 40%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--color-muted); }
.eyebrow { margin: 0 0 7px; color: var(--color-primary); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.text-ltr { direction: ltr; text-align: right; font-family: Arial, sans-serif; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--color-primary); font-weight: 700; }
.text-link:hover { color: var(--color-primary-dark); }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px 20px;
    background:
        radial-gradient(ellipse at 12% 12%, rgb(251 101 150 / 13%), transparent 34%),
        radial-gradient(ellipse at 88% 83%, rgb(56 37 92 / 9%), transparent 30%),
        var(--color-page);
}

.login-shell { width: min(100%, 460px); }
.login-card {
    padding: 38px;
    border: 1px solid rgb(229 217 239 / 90%);
    border-radius: var(--radius-lg);
    background: rgb(255 255 255 / 96%);
    box-shadow: var(--shadow-card);
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand--login { margin-block-end: 36px; }
.brand__mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #674888, #38255c);
    box-shadow: 0 8px 20px rgb(56 37 92 / 24%);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

.brand__copy { display: grid; line-height: 1.45; }
.brand__copy strong { font-size: 16px; font-weight: 700; }
.brand__copy span { color: var(--color-muted); font-size: 11px; }
.login-heading { margin-block-end: 22px; }
.login-heading h1 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 27px); line-height: 1.4; }
.login-heading p:last-child { margin: 0; }
.form-stack { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field__label { color: #38255c; font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #d9cbe5;
    border-radius: 10px;
    background: #fff;
    color: var(--color-ink);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input::placeholder, .field textarea::placeholder { color: #657a8c; opacity: 1; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: #b8a3ca; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgb(56 37 92 / 10%); outline: none; }
.field input[aria-invalid="true"] { border-color: var(--color-error); }
.field__hint { color: var(--color-muted); font-size: 11px; line-height: 1.55; }
.login-security { display: flex; align-items: center; gap: 9px; margin: 22px 0 0; color: var(--color-muted); font-size: 11px; }
.login-security span { color: var(--color-teal); font-size: 9px; }
.login-footer { padding-block-start: 18px; color: #516c82; font-size: 11px; text-align: center; }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 30;
    inset-block: 0;
    inset-inline-start: 0;
    display: flex;
    width: 258px;
    flex-direction: column;
    padding: 24px 17px 18px;
    border-inline-end: 1px solid var(--color-border);
    background: #fff;
    transition: transform 200ms ease;
}

.sidebar .brand { padding-inline: 8px; }
.sidebar__section-label { margin: 36px 12px 12px; color: #657a8c; font-size: 11px; font-weight: 700; }
.side-nav { display: grid; gap: 5px; }
.side-nav__link {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #516c82;
    font-weight: 500;
}

a.side-nav__link:hover { background: #f6eeff; color: var(--color-ink); }
.side-nav__link.is-active { background: var(--color-primary-soft); color: var(--color-primary-dark); font-weight: 700; }
.nav-icon { display: grid; width: 22px; place-items: center; color: #657a8c; font-size: 19px; line-height: 1; }
.side-nav__link.is-active .nav-icon { color: var(--color-primary); }
.side-nav__link--disabled { color: #a4afbd; cursor: not-allowed; font-size: 12px; }
.side-nav__link--disabled .nav-icon { color: #b5bfcc; }
.nav-soon { margin-inline-start: auto; color: #a0aaba; font-size: 9px; white-space: nowrap; }
.sidebar__bottom { display: grid; gap: 15px; margin-block-start: auto; }
.sidebar__note { padding: 12px; border: 1px solid #e5d9ef; border-radius: 10px; background: #fcf7ff; color: #516c82; font-size: 10px; line-height: 1.7; }
.app-main { min-height: 100vh; margin-inline-start: 258px; }
.topbar {
    position: sticky;
    z-index: 20;
    inset-block-start: 0;
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 16px;
    padding: 12px clamp(22px, 4vw, 56px);
    border-block-end: 1px solid rgb(229 217 239 / 80%);
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(14px);
}

.topbar__title { display: grid; gap: 1px; }
.topbar__eyebrow { color: #516c82; font-size: 10px; }
.topbar h1 { margin: 0; font-size: 17px; line-height: 1.5; }
.topbar__actions { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.role-badge { display: inline-flex; min-height: 26px; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.role-badge--admin { background: #fff4e4; color: #9c6815; }
.role-badge--user { background: #f6eeff; color: #38255c; }
.sidebar-toggle { display: none !important; }
.content-area { width: min(100%, 1500px); margin-inline: auto; padding: 32px clamp(22px, 4vw, 56px) 48px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px clamp(22px, 4vw, 56px) 24px; color: #516c82; font-size: 10px; }

/* Dashboard and profile cards */
.welcome-card {
    position: relative;
    display: flex;
    min-height: 250px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    padding: 32px clamp(25px, 4vw, 48px);
    border: 1px solid #e5d9ef;
    border-radius: var(--radius-lg);
    background: linear-gradient(112deg, #f6eeff 0%, #fffafd 54%, #ffedf4 100%);
}

.welcome-card__copy { position: relative; z-index: 2; max-width: 630px; }
.welcome-card h2 { margin: 0 0 8px; font-size: clamp(21px, 3vw, 29px); line-height: 1.5; }
.welcome-card p:not(.eyebrow) { max-width: 550px; margin: 0 0 20px; color: #516c82; }
.welcome-card__illustration { position: relative; width: 230px; height: 190px; margin-inline: 18px 40px; flex: 0 0 230px; }
.welcome-orbit { position: absolute; inset: 20px 30px; border: 1px solid rgb(56 37 92 / 17%); border-radius: 50%; transform: rotate(-28deg); }
.welcome-orbit--two { inset: 42px 2px; border-color: rgb(251 101 150 / 22%); transform: rotate(32deg); }
.welcome-core { position: absolute; inset: 50% auto auto 50%; display: grid; width: 80px; height: 80px; place-items: center; border: 7px solid rgb(255 255 255 / 70%); border-radius: 27px; background: linear-gradient(145deg, #674888, #38255c); box-shadow: 0 14px 32px rgb(56 37 92 / 26%); color: #fff; font-size: 40px; font-weight: 700; transform: translate(-50%, -50%) rotate(-7deg); }
.welcome-spark { position: absolute; color: #fb6596; font-size: 26px; }
.welcome-spark--one { inset-block-start: 7px; inset-inline-start: 24px; }
.welcome-spark--two { inset-block-end: 10px; inset-inline-end: 16px; color: #a33866; font-size: 33px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 34px 0 17px; }
.section-heading h2, .page-intro h2 { margin: 0; font-size: 17px; }
.section-heading p { margin: 3px 0 0; font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pill--neutral { background: #f3ebf7; color: #516c82; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a1acba; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { display: grid; min-height: 148px; align-content: start; gap: 10px; padding: 19px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-soft); }
.metric-card__label { color: #516c82; font-size: 11px; }
.metric-card__value { color: #516c82; font-size: 28px; font-weight: 700; line-height: 1.15; }
.metric-card__hint { color: #516c82; font-size: 10px; }
.panel-card { padding: 23px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-soft); }
.next-steps { display: flex; align-items: center; gap: 16px; margin-block-start: 18px; }
.panel-card__icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 14px; background: var(--color-success-soft); color: var(--color-success); font-size: 20px; font-weight: 700; }
.next-steps h2 { margin: 0 0 4px; font-size: 14px; }
.next-steps p { max-width: 780px; margin: 0; color: var(--color-muted); font-size: 11px; }
.next-steps .text-link { margin-inline-start: auto; white-space: nowrap; font-size: 11px; }
.page-intro { margin-block-end: 20px; }
.page-intro h2 { font-size: 22px; }
.page-intro p:last-child { margin: 6px 0 0; }
.profile-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; gap: 18px; }
.panel-card__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 17px; }
.panel-card__heading .eyebrow { margin-block-end: 2px; }
.panel-card__heading h3 { margin: 0; font-size: 15px; }
.security-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--color-primary-soft); color: var(--color-primary); font-size: 22px; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 13px 0; border-block-end: 1px solid #eee6f3; }
.detail-list > div:last-child { border-block-end: 0; }
.detail-list dt { color: var(--color-muted); font-size: 11px; }
.detail-list dd { min-width: 0; margin: 0; color: #38255c; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.password-card > .muted { margin-block: -7px 17px; font-size: 11px; }
.password-card .form-stack { gap: 14px; }
.password-card .field input { min-height: 43px; }

/* Alerts, toast and modal components */
.alert { margin-block: 13px; padding: 11px 13px; border: 1px solid transparent; border-radius: 10px; font-size: 11px; line-height: 1.7; }
.alert--error { border-color: #f2c6ce; background: var(--color-error-soft); color: var(--color-error); }
.alert--success { border-color: #bce6d9; background: var(--color-success-soft); color: var(--color-success); }
.alert--warning { border-color: #f2dfb0; background: var(--color-warning-soft); color: var(--color-warning); }
.toast-region { position: fixed; z-index: 100; inset-block-end: 20px; inset-inline-start: 20px; display: grid; width: min(390px, calc(100vw - 40px)); gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--color-border); border-inline-start: 4px solid var(--color-primary); border-radius: 12px; background: #fff; box-shadow: var(--shadow-card); color: var(--color-ink); animation: toast-in 180ms ease-out; }
.toast--error { border-inline-start-color: var(--color-error); }
.toast--success { border-inline-start-color: var(--color-success); }
.toast__text { min-width: 0; flex: 1; font-size: 12px; overflow-wrap: anywhere; }
.toast__close { border: 0; background: transparent; color: #516c82; cursor: pointer; font-size: 17px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.dialog-surface { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--color-border); border-radius: 18px; box-shadow: 0 24px 80px rgb(18 35 63 / 20%); }
.dialog-surface::backdrop { background: rgb(21 34 55 / 45%); backdrop-filter: blur(3px); }
.dialog-content { padding: 25px; }
.dialog-content h2 { margin: 0 0 8px; font-size: 18px; }
.dialog-content p { margin: 0; color: var(--color-ink-soft); }
.dialog-actions { display: flex; justify-content: flex-start; gap: 9px; margin-block-start: 22px; }

/* Reusable tables and tabs */
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--color-border); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; text-align: start; }
.data-table th, .data-table td { min-width: 110px; padding: 12px 15px; border-block-end: 1px solid #eee6f3; font-size: 11px; text-align: start; vertical-align: middle; }
.data-table th { background: #fcf7ff; color: var(--color-ink-soft); font-weight: 700; white-space: nowrap; }
.data-table td { color: var(--color-ink-soft); }
.data-table tbody tr:last-child td { border-block-end: 0; }
.data-table tbody tr:hover td { background: #fdfaff; }
.data-table__empty { padding: 28px !important; color: var(--color-muted) !important; text-align: center !important; }
.tab-list { display: flex; gap: 5px; overflow-x: auto; padding: 4px; border-block-end: 1px solid var(--color-border); }
.tab-button { min-height: 40px; padding: 8px 14px; border: 0; border-block-end: 2px solid transparent; background: transparent; color: var(--color-muted); cursor: pointer; font-weight: 500; white-space: nowrap; }
.tab-button[aria-selected="true"] { border-block-end-color: var(--color-primary); color: var(--color-primary); font-weight: 700; }
.tab-panel { padding-block: 18px; }

/* Responsive navigation */
.sidebar-backdrop { position: fixed; z-index: 25; inset: 0; background: rgb(19 32 52 / 34%); }
.empty-page-card { text-align: center; }
.empty-page-card h1 { margin: 0 0 8px; font-size: 22px; }
.empty-page-card p { margin: 0 0 20px; }
.empty-page-code { display: block; margin-block-end: 15px; color: #b8a3ca; font-size: 54px; font-weight: 700; line-height: 1.2; }

@media (max-width: 1120px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .welcome-card__illustration { margin-inline-end: 5px; }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(110%); }
    .sidebar.is-open { transform: translateX(0); box-shadow: 0 0 45px rgb(19 32 52 / 14%); }
    .app-main { margin-inline-start: 0; }
    .sidebar-toggle { display: inline-grid !important; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; color: var(--color-ink-soft); cursor: pointer; }
    .topbar { min-height: 72px; }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .login-page { padding-inline: 13px; }
    .login-card { padding: 28px 23px; border-radius: 20px; }
    .brand--login { margin-block-end: 27px; }
    .content-area { padding-block-start: 21px; }
    .topbar { gap: 10px; padding-inline: 15px; }
    .topbar__actions { gap: 7px; }
    .role-badge { padding-inline: 8px; font-size: 9px; }
    .topbar__title h1 { font-size: 15px; }
    .app-footer { padding-inline: 16px; }
    .welcome-card { min-height: 0; padding: 23px; }
    .welcome-card__illustration { position: absolute; inset-inline-start: -67px; inset-block-end: -35px; width: 170px; height: 150px; opacity: .45; transform: scale(.8); }
    .welcome-card__copy { max-width: 100%; }
    .welcome-card__copy > * { position: relative; }
    .welcome-card h2 { font-size: 21px; }
    .welcome-card p:not(.eyebrow) { font-size: 12px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .metric-grid { gap: 10px; }
    .metric-card { min-height: 130px; padding: 14px; }
    .metric-card__value { font-size: 24px; }
    .metric-card__hint { font-size: 9px; }
    .next-steps { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
    .next-steps .text-link { width: 100%; margin-inline-start: 58px; }
    .detail-list > div { grid-template-columns: minmax(80px, .6fr) minmax(0, 1.4fr); }
    .panel-card { padding: 18px; }
    .toast-region { inset-inline-start: 12px; inset-block-end: 12px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Phase 2.3 user administration and session controls */
.user-filters { display: grid; grid-template-columns: minmax(220px, 1.7fr) minmax(130px, .7fr) minmax(130px, .7fr) auto; align-items: end; gap: 12px; margin-block: 5px 20px; }
.field--compact { gap: 6px; }
.field--compact input, .field--compact select { min-height: 40px; }
.user-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block-start: 15px; }
.user-row-actions { min-width: 265px !important; white-space: nowrap; }
.user-row-actions .button { margin: 2px; }
.user-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 820px); overflow: auto; }
.user-dialog .dialog-content { padding: 22px; }
.user-detail-list { margin-block: 0 22px; }
.user-detail-list li { padding-block: 8px; }
.session-list { display: grid; gap: 10px; }
.session-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; }
.session-item > div { display: grid; min-width: 0; gap: 4px; }
.session-item strong { overflow-wrap: anywhere; color: var(--color-ink); font-size: 12px; }
.session-item span, .session-item time, .session-item small { color: var(--color-muted); font-size: 10px; }
.profile-name-card, .profile-sessions-card { margin-block-start: 18px; }
.profile-name-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; max-width: 680px; }
.status-pill--success { background: #eaf8f2; color: #1c8060; }

@media (max-width: 760px) {
    .user-filters { grid-template-columns: 1fr 1fr; }
    .user-filters .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .user-filters { grid-template-columns: 1fr; }
    .user-filters .field:first-child { grid-column: auto; }
    .profile-name-form { grid-template-columns: 1fr; }
    .session-item { align-items: flex-start; flex-direction: column; }
    .user-pagination { align-items: flex-start; flex-direction: column; }
}

/* Projects and service management */
.page-stack { display: grid; gap: 22px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.page-heading h2, .page-heading h3, .page-heading h4 { margin: 0; }
.page-heading p { margin: 5px 0 0; }
.page-heading--compact { align-items: center; }
.panel-card { min-width: 0; padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-soft); }
.panel-card > h3 { margin: 0 0 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid__wide { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: 7px; color: var(--color-ink-soft); font-weight: 600; }
.field input, .field textarea, .field select, .variable-panel textarea, .routing-preview + textarea {
    width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #d9cbe5; border-radius: 10px; background: #fff; color: var(--color-ink); font-weight: 400;
}
.field textarea, .variable-panel textarea { resize: vertical; }
.field small { color: var(--color-muted); font-weight: 400; }
.field [dir="ltr"], .text-ltr { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }
.check-list { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 0; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 12px; }
.check-list legend { padding: 0 8px; color: var(--color-ink-soft); font-weight: 700; }
.check-field { display: inline-flex; align-items: center; gap: 9px; min-height: 34px; color: var(--color-ink-soft); }
.check-field input { width: 18px; height: 18px; accent-color: var(--color-primary); }
.notice { padding: 12px 16px; border-radius: 10px; }
.notice--success { border: 1px solid #b8e7d9; background: var(--color-success-soft); color: #126b59; }
.notice--error { border: 1px solid #f0c2cb; background: var(--color-error-soft); color: var(--color-error); }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: right; }
.data-table th, .data-table td { min-width: 90px; padding: 12px 13px; border-bottom: 1px solid #eee6f3; vertical-align: middle; }
.data-table th { color: var(--color-muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.data-table td { color: var(--color-ink-soft); }
.data-table__empty { padding: 30px !important; color: var(--color-muted) !important; text-align: center; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 2px 9px; border-radius: 999px; background: #f3ebf7; color: var(--color-ink-soft); font-size: 12px; white-space: nowrap; }
.status-pill--success { background: var(--color-success-soft); color: var(--color-success); }
.status-pill--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.status-pill--neutral { background: #f3ebf7; color: var(--color-ink-soft); }
.project-admin-settings { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--color-border); }
.project-admin-settings > h3 { margin: 0 0 16px; }
.secret-value { display: block; max-height: 180px; overflow-wrap: anywhere; margin: 16px 0; padding: 13px; border-radius: 10px; background: #f6eeff; color: #38255c; font-size: 13px; user-select: all; }
.dialog-surface { width: min(calc(100% - 32px), 560px); padding: 0; border: 1px solid var(--color-border); border-radius: 18px; box-shadow: 0 24px 70px rgb(16 30 56 / 25%); }
.dialog-surface::backdrop { background: rgb(16 30 56 / 45%); backdrop-filter: blur(3px); }
.dialog-content { padding: 24px; }
.dialog-content h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.service-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 7px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; }
.service-tabs [role="tab"] { min-height: 42px; padding: 8px 16px; border: 0; border-radius: 10px; background: transparent; color: var(--color-ink-soft); cursor: pointer; font-weight: 700; }
.service-tabs [role="tab"][aria-selected="true"] { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.service-tab-panel { min-height: 320px; }
.slot-list { display: grid; gap: 13px; margin-top: 20px; }
.slot-card { padding: 17px; border: 1px solid var(--color-border); border-radius: 13px; background: #fdfaff; }
.slot-card h4 { margin: 0; }
.slot-card code { color: var(--color-muted); }
.variable-panel { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.variable-panel h4, .preview-panel h4 { margin: 0; }
.variable-panel p { margin: 5px 0 0; }
.preview-panel { margin-top: 18px; padding: 18px; border: 1px solid #ddcde9; border-radius: 12px; background: #fcf7ff; }
.preview-panel pre { max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #38255c; }
.preview-panel ul { color: var(--color-error); }
.prompt-history-heading { margin-top: 30px; }
.routing-preview { display: grid; gap: 8px; padding-inline-start: 28px; }
.routing-preview__item { padding: 10px 13px; border: 1px solid var(--color-border); border-radius: 10px; background: #fdfaff; }
@media (max-width: 700px) {
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading--compact { align-items: flex-start; }
    .form-grid, .variable-panel { grid-template-columns: 1fr; }
    .panel-card { padding: 18px; }
    .service-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .service-tabs [role="tab"] { padding-inline: 7px; font-size: 12px; }
}
.route-add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.route-add-row select { min-width: min(100%, 340px); min-height: 42px; padding: 8px 12px; border: 1px solid #d9cbe5; border-radius: 10px; background: #fff; }

.system-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0.75rem;
    margin: 1rem 0 0;
}

.system-fact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    background: #fcf7ff;
}

.system-fact dt,
.system-fact dd {
    margin: 0;
}

.system-fact__value.is-available {
    color: var(--success, #15803d);
}

.system-fact__value.is-unavailable {
    color: var(--danger, #b91c1c);
}

.system-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.status-pill--danger { background: #fff0ef; color: #b3453e; }
@media (max-width: 600px) { .system-intro { align-items: flex-start; flex-direction: column; } }
.notice--warning { margin-block: 10px; padding: 10px 12px; border-radius: 10px; background: #fff6df; color: #805800; font-size: 12px; }

/* Synchronous service playground */
.page-heading__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.playground-input, .playground-variable { margin-block: 8px; }
.playground-result { display: grid; gap: 14px; border-top: 1px solid var(--color-border); padding-top: 18px; }
.playground-result__images { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.playground-result__image { margin: 0; padding: 10px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; }
.playground-result__image img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; }
.playground-result__image figcaption { padding-top: 8px; color: var(--color-ink-soft); direction: ltr; text-align: left; }
.playground-compare { width: min(100%, 680px); }
.playground-compare__frame { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; margin: 0; border-radius: 12px; background: #f4f5f7; }
.playground-compare__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.playground-compare__frame [data-compare-clipped] { z-index: 2; }
.playground-compare [data-compare-range] { direction: ltr; }
.playground-attempts { border-top: 1px solid var(--color-border); padding-top: 8px; }
@media (max-width: 720px) {
    .page-heading__actions { width: 100%; justify-content: space-between; }
    .playground-compare__frame { aspect-ratio: 4 / 5; }
}
.playground-input__previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.playground-input__previews img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--color-border); }

/* Brand refinements: keep functional status colours distinct from the brand accent. */
.welcome-card { box-shadow: var(--shadow-soft); }
.side-nav__link.is-active { box-shadow: inset -3px 0 var(--color-accent); }
.field input:focus, .field textarea:focus, .field select:focus,
.variable-panel textarea:focus, .route-add-row select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(56 37 92 / 12%);
}

/* Project processing history */
.history-note { font-size: .875rem; }
.history-service-slug { display: block; direction: ltr; text-align: right; color: #516c82; margin-top: .25rem; }
.history-pagination { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; margin-top: 1rem; color: #516c82; }
.history-dialog { width: min(960px, calc(100% - 2rem)); max-width: 960px; max-height: 90vh; }
.history-dialog__heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.history-dialog__heading h2 { margin-top: 0; }
.history-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin: 1.25rem 0 2rem; }
.history-facts > div { background: #f6eeff; border: 1px solid #e9dff3; border-radius: .7rem; padding: .8rem; min-width: 0; }
.history-facts dt { color: #516c82; font-size: .8rem; margin-bottom: .35rem; }
.history-facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.history-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.history-image { margin: 0; border: 1px solid #e9dff3; border-radius: .75rem; overflow: hidden; background: #faf8fd; }
.history-image img { display: block; width: 100%; height: 180px; object-fit: contain; background: #f6eeff; }
.history-image figcaption { display: grid; gap: .5rem; padding: .7rem; font-size: .8rem; overflow-wrap: anywhere; }
.history-attempt { background: #f6eeff; border-radius: .5rem; padding: .7rem; overflow-wrap: anywhere; }
.history-json { border-top: 1px solid #e9dff3; padding: .8rem 0; }
.history-json summary { cursor: pointer; font-weight: 600; }
.history-json pre { direction: ltr; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; background: #f6eeff; padding: .75rem; border-radius: .5rem; }
@media (max-width: 600px) { .history-dialog__heading { align-items: center; } .history-pagination { justify-content: center; } }

/* Panel help and integration guide */
.help-heading { align-items: flex-end; }
.help-nav { display: flex; flex-wrap: wrap; gap: .6rem; }
.help-nav a { padding: .5rem .8rem; border: 1px solid var(--color-border); border-radius: 999px; background: #fff; color: var(--color-primary); text-decoration: none; font-weight: 600; }
.help-nav a:hover, .help-nav a:focus-visible { border-color: var(--color-accent); }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.help-card { scroll-margin-top: 1rem; line-height: 1.9; min-width: 0; }
.help-card h3 { margin-top: .25rem; }
.help-card--wide { grid-column: 1 / -1; }
.help-card li + li { margin-top: .45rem; }
.help-card__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.help-note { background: var(--color-primary-soft); border-right: 3px solid var(--color-accent); border-radius: .6rem; padding: .8rem 1rem; }
.help-code { direction: ltr; text-align: left; overflow-x: auto; padding: 1rem; border-radius: .75rem; background: #38255c; color: #fff; line-height: 1.6; }
.help-endpoints { display: flex; flex-wrap: wrap; gap: .5rem; }
.help-endpoints code { background: #f6eeff; color: #38255c; border-radius: .5rem; padding: .35rem .55rem; overflow-wrap: anywhere; }
@media (max-width: 700px) { .help-grid { grid-template-columns: 1fr; } .help-card--wide { grid-column: auto; } }
