@font-face {
    font-family: Vazir;
    src: url("../fonts/Vazir/Vazir.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Vazir;
    src: url("../fonts/Vazir/Vazir-Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: IranSans;
    src: url("../fonts/iranSans/IRANSans(FaNum).ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: IranSans;
    src: url("../fonts/iranSans/IRANSans(FaNum)_Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #181a3b;
    --ink-soft: #51536c;
    --brand: #2b2168;
    --brand-dark: #17133f;
    --brand-light: #eeeafd;
    --green: #00a12a;
    --green-soft: #e8f7ed;
    --line: #e8e7ef;
    --paper: #ffffff;
    --canvas: #f6f7fb;
    --shadow: 0 28px 70px rgba(28, 24, 76, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: IranSans, Vazir, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(480px, 1.05fr);
    overflow: hidden;
    position: relative;
    direction: ltr;
}

.login-brand {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    padding: 64px clamp(40px, 7vw, 112px);
    color: #fff;
    background: radial-gradient(circle at 18% 16%, rgba(126, 113, 255, 0.28), transparent 27%), linear-gradient(143deg, #211952 0%, var(--brand) 56%, #3c3185 100%);
    direction: rtl;
}

    .login-brand::before,
    .login-brand::after {
        content: "";
        position: absolute;
        z-index: -1;
        pointer-events: none;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 50%;
    }

    .login-brand::before {
        width: 460px;
        height: 460px;
        left: -248px;
        bottom: -192px;
    }

    .login-brand::after {
        width: 290px;
        height: 290px;
        right: -146px;
        top: 10%;
        box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.035), 0 0 0 68px rgba(255, 255, 255, 0.025);
    }

.brand-content {
    width: min(100%, 480px);
    margin-inline: auto;
}

.brand-logo {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    margin-bottom: 34px;
    padding: 13px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 14px 30px rgba(11, 7, 46, 0.22);
}

    .brand-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    color: #c9c4ff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

    .eyebrow::before {
        content: "";
        width: 24px;
        height: 3px;
        border-radius: 99px;
        background: #8fe7a8;
    }

.brand-content h1 {
    max-width: 440px;
    margin: 0;
    font-size: clamp(2rem, 3.4vw, 3.15rem);
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: -0.04em;
}

.brand-content > p:not(.eyebrow) {
    max-width: 390px;
    margin: 20px 0 0;
    color: #d5d3e7;
    font-size: 0.98rem;
    line-height: 2.1;
}

.brand-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 52px;
    color: #dad8ed;
    font-size: 0.86rem;
}

.brand-note-icon {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #aaf0bc;
    background: rgba(142, 232, 168, 0.14);
}

    .brand-note-icon svg {
        width: 17px;
        height: 17px;
    }

.login-panel {
    display: grid;
    place-items: center;
    padding: 40px clamp(24px, 6vw, 92px);
    background: var(--paper);
    direction: rtl;
}

.login-card {
    width: min(100%, 455px);
}

.mobile-brand {
    display: none;
}

.login-heading {
    margin-bottom: 34px;
}

    .login-heading h2 {
        margin: 0 0 10px;
        color: var(--ink);
        font-size: clamp(1.55rem, 2.6vw, 2rem);
        font-weight: 700;
        letter-spacing: -0.03em;
    }

    .login-heading p {
        margin: 0;
        color: var(--ink-soft);
        font-size: 0.9rem;
        line-height: 1.95;
    }

    .login-heading.compact {
        margin-bottom: 26px;
    }

        .login-heading.compact p {
            max-width: 390px;
        }

.login-form {
    display: grid;
    gap: 20px;
}

.login-error {
    margin-bottom: 20px;
    padding: 12px 14px;
    color: #a12635;
    border: 1px solid #f1b8c0;
    border-radius: 12px;
    background: #fff2f3;
    font-size: 0.86rem;
    line-height: 1.8;
}

.field {
    display: grid;
    gap: 9px;
}

    .field label {
        color: var(--ink);
        font-size: 0.86rem;
        font-weight: 700;
    }

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 17px;
    width: 19px;
    height: 19px;
    color: #9393a8;
    pointer-events: none;
    transform: translateY(-50%);
}

    .input-icon svg {
        width: 100%;
        height: 100%;
    }

.field input {
    width: 100%;
    height: 56px;
    padding: 0 52px 0 17px;
    outline: 0;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfbfd;
    font-size: 0.9rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

    .field input::placeholder {
        color: #b4b3c1;
    }

    .field input:focus {
        border-color: #8e83db;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(97, 79, 206, 0.11);
    }

    .field input[type="tel"] {
        direction: ltr;
        text-align: right;
    }

.password-toggle {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #8e8fa5;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 180ms ease, background 180ms ease;
}

    .password-toggle:hover,
    .password-toggle:focus-visible {
        color: var(--brand);
        outline: 0;
        background: var(--brand-light);
    }

    .password-toggle svg {
        width: 18px;
        height: 18px;
    }

    .password-toggle .eye-off {
        display: none;
    }

    .password-toggle.is-visible .eye {
        display: none;
    }

    .password-toggle.is-visible .eye-off {
        display: block;
    }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: -2px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    cursor: pointer;
}

    .remember input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: var(--brand);
    }

.forgot-link {
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 700;
    transition: color 180ms ease;
}

    .forgot-link:hover {
        color: var(--green);
    }

.submit-button {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    padding: 0 20px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #2e236d 0%, #49389e 100%);
    box-shadow: 0 13px 26px rgba(52, 38, 126, 0.2);
    cursor: pointer;
    font-size: 0.94rem;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

    .submit-button:hover {
        filter: brightness(1.06);
        box-shadow: 0 16px 30px rgba(52, 38, 126, 0.27);
        transform: translateY(-2px);
    }

    .submit-button:focus-visible {
        outline: 4px solid rgba(97, 79, 206, 0.18);
        outline-offset: 2px;
    }

    .submit-button svg {
        width: 18px;
        height: 18px;
    }

.secondary-action {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.back-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 180ms ease;
}

.login-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 12px 13px;
    border: 1px solid #ccebd8;
    border-radius: 10px;
    color: #2c9760;
    background: #eaf8ef;
    font-size: 0.72rem;
    line-height: 1.8;
    text-align: center;
}

.login-success svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
}

    .back-login:hover {
        color: var(--brand);
    }

    .back-login svg {
        width: 16px;
        height: 16px;
    }

.form-helper {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: -4px;
    color: #8f8e9f;
    font-size: 0.76rem;
    line-height: 1.8;
}

    .form-helper svg {
        width: 16px;
        height: 16px;
        flex: 0 0 auto;
        margin-top: 3px;
        color: var(--green);
    }

.code-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 12px 13px;
    border: 1px solid #e5e1fb;
    border-radius: 12px;
    color: #686187;
    background: #f8f7ff;
    font-size: 0.8rem;
    line-height: 1.8;
}

    .code-message svg {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
        color: var(--brand);
    }

.otp-inputs {
    display: flex;
    direction: ltr;
    justify-content: space-between;
    gap: 9px;
}

.field .otp-input {
    width: 100%;
    height: 58px;
    min-width: 0;
    padding: 0;
    outline: 0;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfbfd;
    font-family: IranSans, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.otp-input:focus {
    border-color: #8e83db;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(97, 79, 206, 0.11);
}

.resend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 1px;
    color: #9291a1;
    font-size: 0.79rem;
}

.resend-link {
    padding: 0;
    border: 0;
    color: var(--brand);
    background: transparent;
    cursor: pointer;
    font-size: inherit;
    font-weight: 700;
}

    .resend-link:hover {
        color: var(--green);
    }

.login-footer {
    margin: 32px 0 0;
    color: #a1a0b0;
    font-size: 0.76rem;
    line-height: 1.9;
    text-align: center;
}

    .login-footer span {
        color: var(--green);
    }

@media (max-width: 900px) {
    .login-page {
        display: block;
        overflow-x: hidden;
        background: var(--canvas);
    }

    .login-brand {
        min-height: 248px;
        align-items: end;
        padding: 28px 22px 34px;
    }

    .brand-content {
        width: 100%;
        margin: 0;
    }

    .brand-logo {
        /* position: absolute;
        top: 22px;
        right: 22px; */
        width: 58px;
        height: 58px;
        margin: 0;
        padding: 9px;
        border-radius: 17px;
    }

    .eyebrow {
        gap: 7px;
        margin-bottom: 10px;
        font-size: 0.72rem;
    }

    .eyebrow::before {
        width: 18px;
        height: 2px;
    }

    .brand-content h1 {
        max-width: calc(100% - 44px);
        font-size: clamp(1.55rem, 7vw, 1.95rem);
        line-height: 1.48;
    }

    .brand-content > p:not(.eyebrow) {
        max-width: 500px;
        margin-top: 8px;
        font-size: 0.76rem;
        line-height: 1.85;
    }

    .brand-note {
        display: none;
    }

    .login-panel {
        display: block;
        padding: 0 16px 30px;
        background: var(--canvas);
    }

    .login-card {
        position: relative;
        z-index: 1;
        max-width: 560px;
        margin: -20px auto 0;
        padding: 24px 20px 22px;
        border: 1px solid rgba(232, 231, 239, 0.9);
        border-radius: 24px;
        background: var(--paper);
        box-shadow: 0 16px 36px rgba(28, 24, 76, 0.1);
    }

    .login-heading {
        margin-bottom: 24px;
    }

    .login-heading h2 {
        font-size: 1.45rem;
    }

    .login-heading p {
        font-size: 0.82rem;
        line-height: 1.85;
    }

    .login-form {
        gap: 17px;
    }

    .field {
        gap: 7px;
    }

    .field label {
        font-size: 0.8rem;
    }

    .field input {
        height: 52px;
        padding-inline: 14px 48px;
        border-radius: 12px;
        font-size: 0.84rem;
    }

    .input-icon {
        right: 15px;
        width: 18px;
        height: 18px;
    }

    .password-toggle {
        left: 11px;
    }

    .form-options {
        gap: 10px;
    }

    .remember,
    .forgot-link {
        font-size: 0.78rem;
    }

    .submit-button {
        min-height: 53px;
        border-radius: 12px;
        font-size: 0.88rem;
    }

    .secondary-action {
        padding-top: 16px;
        margin-top: 17px;
        border-top: 1px solid #f0eff5;
    }

    .login-footer {
        margin-top: 21px;
        font-size: 0.7rem;
        line-height: 1.85;
    }
}

@media (max-width: 480px) {
    .login-brand {
        min-height: 230px;
        padding: 24px 18px 29px;
    }

    .brand-content h1 {
        max-width: calc(100% - 34px);
        font-size: 1.5rem;
    }

    .brand-content > p:not(.eyebrow) {
        max-width: 340px;
        font-size: 0.72rem;
    }

    .brand-logo {
        top: 18px;
        right: 18px;
        width: 52px;
        height: 52px;
        padding: 8px;
        border-radius: 15px;
    }

    .login-panel {
        padding: 0 12px 24px;
    }

    .login-card {
        margin-top: -16px;
        padding: 21px 16px 19px;
        border-radius: 21px;
    }

    .login-heading {
        margin-bottom: 22px;
    }

    .login-heading h2 {
        font-size: 1.32rem;
    }

    .login-heading p {
        font-size: 0.78rem;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .otp-inputs {
        gap: clamp(4px, 1.7vw, 7px);
    }

    .field .otp-input {
        height: 52px;
        border-radius: 10px;
        font-size: 1.1rem;
    }

    .code-message {
        gap: 8px;
        margin-bottom: 18px;
        padding: 10px 11px;
        font-size: 0.74rem;
    }

    .resend-row {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.74rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* =========================================================
   Dashboard layout
   ========================================================= */

.container {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 278px minmax(0, 1fr);
    direction: rtl;
}

.page-container {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.dashboard-sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 18px;
    overflow: hidden;
    border-left: 1px solid rgba(31, 28, 76, 0.08);
    background: radial-gradient(circle at 110% 0%, rgba(94, 74, 201, 0.14), transparent 28%), linear-gradient(180deg, #fff 0%, #fafaff 100%);
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 2px 5px 24px;
    border-bottom: 1px solid #ecebf3;
}

.dashboard-brand-mark {
    width: 43px;
    height: 43px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    padding: 7px;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(26, 19, 80, 0.1);
}

    .dashboard-brand-mark img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.dashboard-brand-copy {
    min-width: 0;
}

    .dashboard-brand-copy strong,
    .dashboard-brand-copy span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-brand-copy strong {
        color: var(--ink);
        font-size: 0.93rem;
    }

    .dashboard-brand-copy span {
        margin-top: 3px;
        color: #9694a8;
        font-size: 0.7rem;
    }

.sidebar-label {
    margin: 24px 9px 11px;
    color: #a6a4b5;
    font-size: 0.68rem;
    font-weight: 700;
}

.sidebar-menu {
    display: grid;
    gap: 5px;
    overflow-y: auto;
}

.sidebar-label-secondary {
    margin-top: 24px;
}

.sidebar-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #6b6b80;
    font-size: 0.82rem;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

    .sidebar-link svg {
        width: 19px;
        height: 19px;
        flex: 0 0 auto;
        color: #9897aa;
        transition: color 180ms ease;
    }

    .sidebar-link:hover {
        color: var(--brand);
        background: #f5f3ff;
        transform: translateX(-2px);
    }

        .sidebar-link:hover svg,
        .sidebar-link.is-active svg {
            color: var(--brand);
        }

    .sidebar-link.is-active {
        color: var(--brand);
        border-color: #e7e3fc;
        background: linear-gradient(90deg, #f5f3ff 0%, #eeebff 100%);
        font-weight: 700;
    }

.sidebar-footer {
    margin-top: auto;
    padding: 15px 12px 2px;
    color: #a1a0b0;
    font-size: 0.68rem;
    line-height: 1.9;
}

    .sidebar-footer strong {
        display: block;
        color: var(--green);
        font-size: 0.72rem;
    }

.dashboard-main {
    min-width: 0;
    padding: 0 34px 34px;
}

.app-header {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 34px;
    border-bottom: 1px solid #e9e8f0;
}

.app-search {
    position: relative;
    flex: 1 1 420px;
    max-width: 460px;
    min-width: 0;
}

    .app-search svg {
        position: absolute;
        top: 50%;
        right: 16px;
        width: 18px;
        height: 18px;
        color: #9998a8;
        pointer-events: none;
        transform: translateY(-50%);
    }

    .app-search input {
        width: 100%;
        height: 45px;
        padding: 0 46px 0 16px;
        border: 1px solid #e8e7f0;
        border-radius: 13px;
        outline: 0;
        color: var(--ink);
        background: #fff;
        box-shadow: 0 5px 16px rgba(43, 33, 104, 0.03);
        transition: border-color 180ms ease, box-shadow 180ms ease;
        font-size: .8rem;
    }

        .app-search input::placeholder {
            color: #a4a3b1;
        }

        .app-search input:focus {
            border-color: #c7c0f1;
            box-shadow: 0 0 0 4px rgba(91, 76, 183, 0.09);
        }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-button {
    position: relative;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid #e8e7f0;
    border-radius: 12px;
    color: #727188;
    background: #fff;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

    .notification-button:hover {
        color: var(--brand);
        border-color: #dcd7fa;
        box-shadow: 0 8px 20px rgba(43, 33, 104, 0.09);
        transform: translateY(-1px);
    }

    .notification-button svg {
        width: 19px;
        height: 19px;
    }

.notification-count {
    position: absolute;
    top: -7px;
    left: -7px;
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #f5f6fb;
    border-radius: 99px;
    color: #fff;
    background: #e54a56;
    font-family: IranSans, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

.user-menu {
    position: relative;
}

.user-menu-state {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.user-trigger {
    min-height: 49px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    text-align: right;
    transition: border-color 180ms ease, background 180ms ease;
}

    .user-trigger:hover,
    .user-menu:has(.user-menu-state:checked) .user-trigger {
        border-color: #e8e5f7;
        background: #fff;
    }

    .user-menu-state:focus-visible + .user-trigger {
        outline: 2px solid var(--brand);
        outline-offset: 3px;
    }

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #6f5bd4 0%, #332371 100%);
    font-size: 0.84rem;
    font-weight: 700;
}

.user-copy {
    min-width: 110px;
}

    .user-copy strong,
    .user-copy span {
        display: block;
        white-space: nowrap;
    }

    .user-copy strong {
        font-size: 0.78rem;
    }

    .user-copy span {
        margin-top: 3px;
        color: #9a99aa;
        font-size: 0.66rem;
    }

.user-chevron {
    width: 16px;
    height: 16px;
    color: #9997a7;
    transition: transform 180ms ease;
}

.user-menu:has(.user-menu-state:checked) .user-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    z-index: 20;
    top: calc(100% + 10px);
    right: 0;
    width: 232px;
    display: none;
    padding: 8px;
    border: 1px solid #ebe9f2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(29, 26, 74, 0.15);
}

.user-menu:has(.user-menu-state:checked) .user-dropdown {
    display: block;
    animation: dropdown-in 180ms ease both;
}

.user-menu-scrim {
    display: none;
}

.user-menu:has(.user-menu-state:checked) {
    z-index: 50;
}

.user-menu:has(.user-menu-state:checked) .user-menu-scrim {
    display: block;
    position: fixed;
    z-index: 10;
    inset: 0;
    cursor: pointer;
}

.user-trigger {
    position: relative;
    z-index: 12;
}

.user-dropdown {
    z-index: 20;
}

@keyframes dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-heading {
    padding: 9px 10px 12px;
    border-bottom: 1px solid #f0eff5;
}

    .user-dropdown-heading strong,
    .user-dropdown-heading span {
        display: block;
    }

    .user-dropdown-heading strong {
        font-size: 0.78rem;
    }

    .user-dropdown-heading span {
        margin-top: 3px;
        color: #a09ead;
        font-size: 0.66rem;
    }

.dropdown-link {
    min-height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    color: #68677a;
    background: transparent;
    font-size: 0.77rem;
    font-family: inherit;
    text-align: right;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease;
}

    .dropdown-link:hover {
        color: var(--brand);
        background: #f7f5ff;
    }

    .dropdown-link svg {
        width: 17px;
        height: 17px;
        color: #9a98aa;
    }

    .dropdown-link.logout {
        color: #d04f59;
    }

        .dropdown-link.logout svg {
            color: #d04f59;
        }

.dashboard-content {
    padding-top: 30px;
}

.dashboard-content-heading {
    margin-bottom: 17px;
}

    .dashboard-content-heading h2 {
        margin: 0;
        color: var(--ink);
        font-size: 1.1rem;
    }

    .dashboard-content-heading p {
        margin: 6px 0 0;
        color: #9a99a9;
        font-size: 0.75rem;
    }

.dashboard-slot {
    min-height: calc(100vh - 182px);
    min-height: calc(100dvh - 182px);
    display: grid;
    place-items: center;
    padding: 30px;
    border: 1px dashed #d9d7e5;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
}

.dashboard-slot-inner {
    max-width: 360px;
    text-align: center;
}

.dashboard-slot-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    margin: 0 auto 17px;
    border-radius: 20px;
    color: var(--brand);
    background: #eeebff;
}

    .dashboard-slot-icon svg {
        width: 30px;
        height: 30px;
    }

.dashboard-slot h3 {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
}

.dashboard-slot p {
    margin: 9px 0 0;
    color: #9a99aa;
    font-size: 0.78rem;
    line-height: 1.9;
}

@media (max-width: 920px) {
    .container {
        display: block;
    }

    .dashboard-sidebar {
        position: relative;
        height: auto;
        padding: 15px 16px;
        border-left: 0;
        border-bottom: 1px solid rgba(31, 28, 76, 0.08);
    }

    .dashboard-brand {
        padding-bottom: 15px;
    }

    .sidebar-label,
    .sidebar-footer {
        display: none;
    }

    .sidebar-menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding-top: 14px;
    }

    .sidebar-link {
        justify-content: center;
        gap: 7px;
        padding: 0 7px;
        font-size: 0.72rem;
    }

    .dashboard-main {
        padding: 0 22px 24px;
    }

    .app-header {
        margin-right: 22px;
        margin-left: 22px;
    }
}

@media (max-width: 560px) {
    .sidebar-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-header {
        align-items: center;
        gap: 12px;
        padding: 18px 0;
    }

    .app-search {
        flex-basis: auto;
    }

        .app-search input {
            height: 40px;
            padding-right: 40px;
            font-size: 0.78rem;
        }

    .header-actions {
        gap: 5px;
    }

    .notification-button {
        width: 40px;
        height: 40px;
    }

    .user-trigger {
        padding-left: 4px;
    }

    .user-copy,
    .user-chevron {
        display: none;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
    }

    .user-dropdown {
        left: 0;
        right: auto;
    }

    .dashboard-main {
        padding-right: 16px;
        padding-left: 16px;
    }

    .app-header {
        margin-right: 16px;
        margin-left: 16px;
    }

    .dashboard-content {
        padding-top: 23px;
    }

    .dashboard-slot {
        min-height: calc(100vh - 205px);
        min-height: calc(100dvh - 205px);
        padding: 22px;
    }
}

/* =========================================================
   Sidebar refinements: dark + collapsible + mobile drawer
   ========================================================= */

a {
    color: inherit;
    text-decoration: none;
}

.dashboard-sidebar {
    background: radial-gradient(circle at 110% 0%, rgba(117, 102, 235, 0.25), transparent 31%), linear-gradient(180deg, #17143d 0%, #211a50 100%);
    border-left-color: rgba(255, 255, 255, 0.09);
}

.sidebar-state {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.sidebar-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.dashboard-brand {
    min-width: 0;
    flex: 1;
    padding: 0;
    border-bottom: 0;
}

.dashboard-brand-copy strong {
    color: #fff;
}

.dashboard-brand-copy span {
    color: #a7a2c4;
}

.sidebar-toggle,
.mobile-menu-toggle {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #bdb8dc;
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

    .sidebar-toggle:hover,
    .mobile-menu-toggle:hover {
        color: #fff;
        border-color: rgba(255, 255, 255, 0.26);
        background: rgba(255, 255, 255, 0.14);
    }

    .sidebar-toggle svg,
    .mobile-menu-toggle svg {
        width: 17px;
        height: 17px;
    }

.sidebar-label {
    color: #8f8aaf;
}

.sidebar-link {
    color: #bdb9d2;
}

    .sidebar-link svg {
        color: #8983ae;
    }

    .sidebar-link:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.08);
        transform: translateX(-2px);
    }

        .sidebar-link:hover svg,
        .sidebar-link.is-active svg {
            color: #b6aaff;
        }

    .sidebar-link.is-active {
        color: #fff;
        border-color: rgba(176, 163, 255, 0.2);
        background: linear-gradient(90deg, rgba(116, 98, 223, 0.38), rgba(104, 87, 194, 0.2));
    }

.sidebar-footer {
    color: #8f8ba8;
}

    .sidebar-footer strong {
        color: #a9e9b7;
    }

.container:has(.sidebar-state:checked) {
    grid-template-columns: 84px minmax(0, 1fr);
}

    .container:has(.sidebar-state:checked) .dashboard-sidebar {
        padding-right: 12px;
        padding-left: 12px;
    }

    .container:has(.sidebar-state:checked) .sidebar-topbar {
        justify-content: center;
        gap: 5px;
        padding-right: 0;
        padding-left: 0;
    }

    .container:has(.sidebar-state:checked) .dashboard-brand {
        flex: 0 0 auto;
    }

    .container:has(.sidebar-state:checked) .dashboard-brand-copy,
    .container:has(.sidebar-state:checked) .sidebar-label,
    .container:has(.sidebar-state:checked) .sidebar-footer,
    .container:has(.sidebar-state:checked) .sidebar-link span {
        display: none;
    }

    .container:has(.sidebar-state:checked) .sidebar-link {
        justify-content: center;
        padding-right: 0;
        padding-left: 0;
    }

    .container:has(.sidebar-state:checked) .sidebar-toggle svg {
        transform: rotate(180deg);
    }

.mobile-menu-toggle,
.sidebar-scrim {
    display: none;
}

.sidebar-state:focus-visible ~ .dashboard-sidebar .sidebar-toggle,
.sidebar-state:focus-visible ~ .page-container .mobile-menu-toggle {
    outline: 2px solid #a9e9b7;
    outline-offset: 3px;
}

/* Keep hover movement from creating a horizontal scrollbar. */
.sidebar-menu {
    overflow-x: hidden;
}

.sidebar-link.is-active {
    position: relative;
    overflow: hidden;
}

    .sidebar-link.is-active::before {
        content: "";
        position: absolute;
        top: 9px;
        right: 0;
        bottom: 9px;
        width: 3px;
        border-radius: 999px 0 0 999px;
        background: #5ca9ff;
        box-shadow: 0 0 13px rgba(92, 169, 255, 0.8);
    }

@media (max-width: 920px) {
    .container {
        display: block;
    }

    .dashboard-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        width: min(86vw, 300px);
        height: 100vh;
        height: 100dvh;
        padding: 22px 16px 18px;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: -20px 0 50px rgba(15, 11, 48, 0.28);
        transform: translateX(105%);
        transition: transform 240ms cubic-bezier(.4, 0, .2, 1);
    }

    .container:has(.sidebar-state:checked) .dashboard-sidebar {
        transform: translateX(0);
    }

    .container:has(.sidebar-state:checked) .sidebar-scrim {
        display: block;
        position: fixed;
        z-index: 35;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(15, 11, 48, 0.46);
        cursor: pointer;
    }

    .dashboard-sidebar .sidebar-topbar {
        padding-bottom: 20px;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-label,
    .sidebar-footer {
        display: block;
    }

    .sidebar-menu {
        grid-template-columns: 1fr;
    }

    .sidebar-link {
        justify-content: flex-start;
        gap: 12px;
        padding-right: 12px;
        padding-left: 12px;
        font-size: 0.82rem;
    }

        .sidebar-link span {
            display: inline;
        }

    .container:has(.sidebar-state:checked) .dashboard-sidebar {
        width: min(86vw, 300px);
        padding-right: 16px;
        padding-left: 16px;
    }

    .container:has(.sidebar-state:checked) .dashboard-brand-copy,
    .container:has(.sidebar-state:checked) .sidebar-label,
    .container:has(.sidebar-state:checked) .sidebar-footer,
    .container:has(.sidebar-state:checked) .sidebar-link span {
        display: block;
    }

    .container:has(.sidebar-state:checked) .sidebar-topbar {
        justify-content: initial;
        gap: 8px;
        padding-right: 4px;
        padding-left: 4px;
    }

    .container:has(.sidebar-state:checked) .sidebar-link {
        justify-content: flex-start;
        padding-right: 12px;
        padding-left: 12px;
    }

    .mobile-menu-toggle {
        display: grid;
    }
}

/* =========================================================
   Dashboard modules
   ========================================================= */

.dashboard-content-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.dashboard-primary-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid rgba(72, 54, 161, 0.15);
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #322675 0%, #5540ad 100%);
    box-shadow: 0 9px 18px rgba(52, 38, 126, 0.16);
    font-size: 0.76rem;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

    .dashboard-primary-action:hover {
        color: #fff;
        filter: brightness(1.07);
        box-shadow: 0 12px 22px rgba(52, 38, 126, 0.24);
        transform: translateY(-1px);
    }

    .dashboard-primary-action svg {
        width: 17px;
        height: 17px;
    }

.dashboard-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    position: relative;
    min-height: 147px;
    overflow: hidden;
    padding: 17px 18px;
    border: 1px solid #ebeaf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 9px 22px rgba(30, 26, 77, 0.045);
}

    .metric-card::after {
        content: "";
        position: absolute;
        width: 90px;
        height: 90px;
        left: -38px;
        bottom: -44px;
        border-radius: 50%;
        background: var(--metric-tint, #f0edff);
    }

.metric-card-header,
.metric-card-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.metric-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--metric-color, #6654c5);
    background: var(--metric-tint, #f0edff);
}

    .metric-icon svg {
        width: 19px;
        height: 19px;
    }

.metric-label {
    color: #858397;
    font-size: 0.75rem;
}

.metric-value {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 17px;
    color: var(--ink);
    font-family: IranSans, sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
}

.metric-card-bottom {
    margin-top: 13px;
    color: #a09ead;
    font-size: 0.66rem;
}

.metric-trend {
    color: var(--metric-color, #6654c5);
    font-weight: 700;
}

.metric-card-blue {
    --metric-color: #3989df;
    --metric-tint: #eaf4ff;
}

.metric-card-violet {
    --metric-color: #7560d8;
    --metric-tint: #f0edff;
}

.metric-card-amber {
    --metric-color: #d38b28;
    --metric-tint: #fff5df;
}

.metric-card-green {
    --metric-color: #2c9a61;
    --metric-tint: #e9f8ef;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
    gap: 18px;
}

.dashboard-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid #ebeaf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 9px 22px rgba(30, 26, 77, 0.045);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
}

    .panel-heading h3 {
        margin: 0;
        color: var(--ink);
        font-size: 0.9rem;
    }

    .panel-heading p,
    .panel-link {
        margin: 5px 0 0;
        color: #a09ead;
        font-size: 0.68rem;
    }

.panel-link {
    margin: 0;
    color: var(--brand);
    font-weight: 700;
    white-space: nowrap;
}

    .panel-link:hover {
        color: var(--green);
    }

.letter-list {
    display: grid;
    gap: 9px;
}

.letter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #f0eff5;
    border-radius: 12px;
    background: #fcfcfe;
}

.letter-type-icon {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: #6555c4;
    background: #f0edff;
}

    .letter-type-icon svg {
        width: 17px;
        height: 17px;
    }

.letter-info {
    min-width: 0;
    flex: 1;
}

    .letter-info strong,
    .letter-info span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .letter-info strong {
        color: #36354b;
        font-size: 0.74rem;
    }

    .letter-info span {
        margin-top: 4px;
        color: #a09ead;
        font-size: 0.64rem;
    }

.letter-status {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 7px;
    color: #2c9760;
    background: #eaf8ef;
    font-size: 0.61rem;
}

    .letter-status.waiting {
        color: #bb7a24;
        background: #fff5e3;
    }

.tracking-panel {
    background: radial-gradient(circle at 0 0, rgba(91, 75, 195, 0.12), transparent 42%), #fff;
}

.tracking-form {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.tracking-label {
    color: #6f6d80;
    font-size: 0.72rem;
}

.tracking-input-wrap {
    position: relative;
}

.tracking-input {
    width: 100%;
    height: 49px;
    padding: 0 14px;
    outline: 0;
    border: 1px solid #e7e5ef;
    border-radius: 11px;
    color: var(--ink);
    background: #fbfbfd;
    font-size: 0.76rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

    .tracking-input::placeholder {
        color: #b0aeba;
    }

    .tracking-input:focus {
        border-color: #8e83db;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(97, 79, 206, 0.1);
    }

.tracking-submit {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-size: 0.77rem;
    font-weight: 700;
    transition: background 180ms ease, transform 180ms ease;
}

    .tracking-submit:hover {
        background: #45359a;
        transform: translateY(-1px);
    }

    .tracking-submit svg {
        width: 17px;
        height: 17px;
    }

.tracking-hint {
    margin: 12px 0 0;
    color: #a09ead;
    font-size: 0.65rem;
    line-height: 1.8;
}

@media (max-width: 1100px) {
    .dashboard-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard-content-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-primary-action {
        justify-content: center;
    }

    .dashboard-overview {
        grid-template-columns: 1fr;
    }

    .dashboard-panel {
        padding: 16px;
    }

    .letter-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .letter-status {
        margin-right: 46px;
    }
}

/* =========================================================
   Reusable form cards and validation states
   ========================================================= */

.letter-compose-content {
    padding-top: 30px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #9896a8;
    font-size: 0.7rem;
}

    .breadcrumb a {
        color: var(--brand);
        font-weight: 700;
    }

    .breadcrumb svg {
        width: 13px;
        height: 13px;
    }

.letter-compose-heading {
    margin-bottom: 21px;
}

    .letter-compose-heading h2 {
        margin: 0;
        color: var(--ink);
        font-size: 1.35rem;
        letter-spacing: -0.03em;
    }

    .letter-compose-heading p {
        margin: 7px 0 0;
        color: #9694a6;
        font-size: 0.76rem;
        line-height: 1.9;
    }

.compose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(295px, 0.75fr);
    align-items: start;
    gap: 18px;
}

.compose-main,
.compose-side {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.ui-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #ebeaf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 9px 22px rgba(30, 26, 77, 0.045);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 32px 24px;
    border: 1px dashed rgba(117, 100, 206, 0.25);
    border-radius: 16px;
    color: #77738e;
    background: linear-gradient(145deg, rgba(117, 100, 206, 0.07), rgba(255, 255, 255, 0.82));
    text-align: center;
}

.empty-state::before {
    content: "?";
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(117, 100, 206, 0.2);
    border-radius: 50%;
    color: #7564ce;
    background: rgba(117, 100, 206, 0.11);
    font-size: 1.25rem;
    font-weight: 700;
}

.empty-state.is-error {
    border-color: rgba(202, 78, 90, 0.25);
    color: #a35e68;
    background: linear-gradient(145deg, rgba(202, 78, 90, 0.07), rgba(255, 255, 255, 0.82));
}

.empty-state.is-error::before {
    content: "!";
    border-color: rgba(202, 78, 90, 0.2);
    color: #ca4e5a;
    background: rgba(202, 78, 90, 0.1);
}

.empty-state.is-loading::before {
    content: "";
    border: 3px solid rgba(117, 100, 206, 0.16);
    border-top-color: #7564ce;
    background: transparent;
    animation: empty-state-spin 0.8s linear infinite;
}

.empty-state.is-attachment::before {
    content: none !important;
}

@keyframes empty-state-spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state h3 {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.empty-state p {
    max-width: 460px;
    margin: 0;
    color: #9290a2;
    font-size: 0.72rem;
    line-height: 2;
}

.ui-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 21px 0;
}

.ui-card-heading h3 {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
}

.ui-card-heading p {
    margin: 6px 0 0;
    color: #9b99aa;
    font-size: 0.69rem;
    line-height: 1.8;
}

.ui-card-icon {
    width: 35px;
    height: 35px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    color: var(--brand);
    background: #efedff;
}

    .ui-card-icon svg {
        width: 18px;
        height: 18px;
    }

.ui-card-body {
    padding: 21px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 15px;
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    color: #3f3e53;
    font-size: 0.76rem;
    font-weight: 700;
}

.required-mark {
    color: #d34e59;
}

.form-control {
    width: 100%;
    min-height: 48px;
    display: block;
    padding: 0 13px;
    outline: 0;
    border: 1px solid #e7e6ee;
    border-radius: 11px;
    color: var(--ink);
    background: #fbfbfd;
    font-family: IranSans, sans-serif;
    font-size: 0.78rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea.form-control {
    min-height: 142px;
    padding-top: 12px;
    padding-bottom: 12px;
    resize: vertical;
    line-height: 2;
}

select.form-control {
    cursor: pointer;
}

.form-control::placeholder {
    color: #b2b0bd;
}

.form-control:focus {
    border-color: #8f84dc;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(97, 79, 206, 0.1);
}

.form-control.invalid {
    border-color: #dc6871;
    background: #fffafa;
    box-shadow: 0 0 0 3px rgba(220, 104, 113, 0.08);
}

    .form-control.invalid:focus {
        border-color: #ca4e5a;
        box-shadow: 0 0 0 4px rgba(220, 104, 113, 0.12);
    }

.form-control.valid {
    border-color: #5db68a;
    background: #fbfffc;
}

.invalid-feedback {
    display: none;
    margin-top: 7px;
    color: #ca4e5a;
    font-size: 0.68rem;
    line-height: 1.8;
}

    .form-control.invalid + .invalid-feedback,
    .form-field:has(.form-control.invalid) .invalid-feedback,
    .invalid-feedback.is-visible {
        display: block;
    }

.form-help {
    margin: 7px 0 0;
    color: #a4a2b0;
    font-size: 0.66rem;
    line-height: 1.8;
}

.recipient-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 11px;
    border: 1px solid #e8f2ec;
    border-radius: 10px;
    color: #4d8062;
    background: #f5fcf7;
    font-size: 0.68rem;
}

    .recipient-preview svg {
        width: 16px;
        height: 16px;
        flex: 0 0 auto;
    }

.attachment-dropzone {
    display: grid;
    place-items: center;
    min-height: 132px;
    padding: 20px;
    border: 1px dashed #cfcbea;
    border-radius: 13px;
    color: #89869d;
    background: #fbfaff;
    text-align: center;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

    .attachment-dropzone:hover {
        border-color: #9589df;
        color: var(--brand);
        background: #f7f5ff;
    }

    .attachment-dropzone input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .attachment-dropzone svg {
        width: 27px;
        height: 27px;
        margin-bottom: 9px;
        color: #7768ce;
    }

    .attachment-dropzone strong,
    .attachment-dropzone span {
        display: block;
    }

    .attachment-dropzone strong {
        color: #5d5975;
        font-size: 0.75rem;
    }

    .attachment-dropzone span {
        margin-top: 5px;
        color: #aaa7b5;
        font-size: 0.65rem;
    }

.flow-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 17px;
    padding: 11px 12px;
    border: 1px solid #e6e2fb;
    border-radius: 11px;
    color: #6e6791;
    background: #faf9ff;
    font-size: 0.68rem;
    line-height: 1.9;
}

    .flow-note svg {
        width: 17px;
        height: 17px;
        flex: 0 0 auto;
        margin-top: 3px;
        color: #7464ce;
    }

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 21px;
    padding-top: 18px;
    border-top: 1px solid #f0eff5;
}

.form-submit-status {
    min-height: 21px;
    margin: 10px 0 0;
    font-size: 0.7rem;
    text-align: right;
}

    .form-submit-status.is-error {
        color: #ca4e5a;
    }

.form-submit-status.is-success {
        color: #2c9760;
    }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 18px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 0.71rem;
    line-height: 1.9;
}

    .alert::before {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 19px;
        height: 19px;
        border-radius: 50%;
        font-size: 0.7rem;
        font-weight: 700;
        line-height: 1;
    }

.alert-danger {
    color: #b94351;
    border-color: #f2d2d7;
    background: #fff7f8;
}

    .alert-danger::before {
        content: "!";
        color: #fff;
        background: #d86670;
    }

.alert-success {
    color: #2c8056;
    border-color: #d5edde;
    background: #f3fbf6;
}

    .alert-success::before {
        content: "✓";
        color: #fff;
        background: #56ad7c;
    }

.ui-button {
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-family: IranSans, sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

    .ui-button svg {
        width: 17px;
        height: 17px;
    }

.ui-button--primary {
    color: #fff;
    background: linear-gradient(135deg, #312573 0%, #5540ad 100%);
    box-shadow: 0 9px 18px rgba(52, 38, 126, 0.18);
}

    .ui-button--primary:hover {
        box-shadow: 0 12px 22px rgba(52, 38, 126, 0.26);
        transform: translateY(-1px);
    }

.ui-button--secondary {
    color: #767389;
    border: 1px solid #e6e4ed;
    background: #fff;
}

    .ui-button--secondary:hover {
        color: var(--brand);
        border-color: #d6d1f4;
        background: #faf9ff;
    }

.letter-send-success {
    overflow: hidden;
    margin-top: 2px;
    background: radial-gradient(circle at 50% 0, rgba(91, 75, 195, 0.12), transparent 35%), #fff;
}

.letter-send-success__body {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 40px 24px 31px;
    text-align: center;
}

.letter-send-success__icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border: 8px solid #f0faf4;
    border-radius: 50%;
    color: #2c9760;
    background: #e8f8ee;
    box-shadow: 0 10px 22px rgba(44, 151, 96, 0.12);
}

    .letter-send-success__icon svg {
        width: 27px;
        height: 27px;
    }

.letter-send-success__eyebrow {
    margin-top: 19px;
    color: #2c9760;
    font-size: 0.68rem;
    font-weight: 700;
}

.letter-send-success h2 {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 1.18rem;
    letter-spacing: -0.03em;
}

.letter-send-success p {
    margin: 8px 0 0;
    color: #9694a6;
    font-size: 0.73rem;
    line-height: 1.9;
}

.letter-send-success__details {
    width: min(100%, 590px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin-top: 26px;
}

.letter-send-success__detail {
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid #efedf5;
    border-radius: 11px;
    background: #fcfcfe;
    text-align: right;
}

    .letter-send-success__detail span,
    .letter-send-success__detail strong {
        display: block;
    }

    .letter-send-success__detail span {
        color: #a09ead;
        font-size: 0.63rem;
    }

    .letter-send-success__detail strong {
        overflow: hidden;
        margin-top: 6px;
        color: #4b4960;
        font-size: 0.78rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.letter-send-success__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

@media (max-width: 980px) {
    .compose-layout {
        grid-template-columns: 1fr;
    }

    .compose-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media (max-width: 560px) {
    .letter-compose-content {
        padding-top: 23px;
    }

    .letter-compose-heading h2 {
        font-size: 1.15rem;
    }

    .compose-side,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .ui-card-header,
    .ui-card-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

        .form-actions .ui-button {
            width: 100%;
        }

    .letter-send-success__details {
        grid-template-columns: 1fr;
    }

    .letter-send-success__actions,
    .letter-send-success__actions .ui-button {
        width: 100%;
    }
}

/* =========================================================
   Incoming letters / inbox
   ========================================================= */

.inbox-content {
    padding-top: 30px;
}

.inbox-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 21px;
}

    .inbox-heading h2 {
        margin: 0;
        color: var(--ink);
        font-size: 1.35rem;
        letter-spacing: -0.03em;
    }

    .inbox-heading p {
        margin: 7px 0 0;
        color: #9694a6;
        font-size: 0.76rem;
        line-height: 1.9;
    }

.inbox-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.inbox-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border: 1px solid #ebeaf2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(30, 26, 77, 0.04);
}

.inbox-stat-icon {
    width: 38px;
    height: 38px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: var(--inbox-color, var(--brand));
    background: var(--inbox-tint, #efedff);
}

    .inbox-stat-icon svg {
        width: 19px;
        height: 19px;
    }

.inbox-stat-copy strong,
.inbox-stat-copy span {
    display: block;
}

.inbox-stat-copy strong {
    color: var(--ink);
    font-family: IranSans, sans-serif;
    font-size: 1.08rem;
}

.inbox-stat-copy span {
    margin-top: 4px;
    color: #9997a8;
    font-size: 0.68rem;
}

.inbox-stat-blue {
    --inbox-color: #3989df;
    --inbox-tint: #eaf4ff;
}

.inbox-stat-amber {
    --inbox-color: #d38b28;
    --inbox-tint: #fff5df;
}

.inbox-stat-green {
    --inbox-color: #2c9a61;
    --inbox-tint: #e9f8ef;
}

.inbox-filter-card {
    margin-bottom: 18px;
}

.inbox-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.65fr) minmax(160px, 0.65fr) auto;
    align-items: end;
    gap: 13px;
}

    .inbox-filter-grid .form-label {
        margin-bottom: 7px;
    }

.inbox-search-wrap {
    position: relative;
}

    .inbox-search-wrap svg {
        position: absolute;
        top: 50%;
        right: 13px;
        width: 17px;
        height: 17px;
        color: #aaa7b6;
        pointer-events: none;
        transform: translateY(-50%);
    }

    .inbox-search-wrap .form-control {
        padding-right: 39px;
    }

.inbox-clear-button {
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #e5e3ed;
    border-radius: 11px;
    color: #77748b;
    background: #fff;
    cursor: pointer;
    font-family: IranSans, sans-serif;
    font-size: 0.72rem;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

    .inbox-clear-button:hover {
        color: var(--brand);
        border-color: #d7d2f4;
        background: #faf9ff;
    }

.inbox-list-card {
    overflow: hidden;
}

.inbox-auth-loading {
    margin-top: 18px;
}

.inbox-loading-state {
    min-height: 165px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 30px 20px;
    color: #9997a8;
    font-size: 0.75rem;
    text-align: center;
}

.inbox-auth-loading .inbox-loading-state {
    min-height: 245px;
}

.inbox-loading-state--error {
    color: #b94351;
    background: #fffafa;
}

.inbox-loading-spinner {
    width: 31px;
    height: 31px;
    display: block;
    border: 3px solid #e8e5f7;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: inbox-loading-spin 850ms linear infinite;
}

@keyframes inbox-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.inbox-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 21px 16px;
}

    .inbox-list-header h3 {
        margin: 0;
        color: var(--ink);
        font-size: 0.92rem;
    }

.inbox-result-count {
    color: #9b99aa;
    font-size: 0.68rem;
}

.inbox-table {
    overflow-x: auto;
}

.inbox-table table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    border-spacing: 0;
    direction: rtl;
}

.inbox-row {
    display: table-row;
}

    .inbox-row > th,
    .inbox-row > td {
        padding: 15px 21px;
        border-top: 1px solid #f0eff5;
        text-align: right;
        vertical-align: middle;
        white-space: nowrap;
    }

    .inbox-row.inbox-header-row > th {
        padding-top: 11px;
        padding-bottom: 11px;
        color: #9b99aa;
        background: #fbfbfd;
        font-size: 0.66rem;
    }

    .inbox-row:not(.inbox-header-row) > td {
        color: #69677a;
        font-size: 0.69rem;
        transition: background 180ms ease;
    }

        .inbox-row:not(.inbox-header-row):hover > td {
            background: #fcfbff;
        }

.inbox-number {
    color: var(--brand);
    font-family: IranSans, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
}

.inbox-subject {
    min-width: 0;
    width: 28%;
    max-width: 0;
}

    .inbox-subject strong,
    .inbox-subject span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .inbox-subject strong {
        color: #3b394f;
        font-size: 0.73rem;
    }

    .inbox-subject span {
        margin-top: 4px;
        color: #a09ead;
        font-size: 0.63rem;
    }

.inbox-sender {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
    .inbox-sender strong,
    .inbox-sender span{
        display: block;
    }

.inbox-date {
    color: #9795a6;
    font-family: IranSans, sans-serif;
    font-size: 0.66rem;
}

.inbox-status {
    width: fit-content;
    padding: 5px 8px;
    border-radius: 7px;
    color: #2c9760;
    background: #eaf8ef;
    font-size: 0.61rem;
    white-space: nowrap;
}

    .inbox-status.unread {
        color: #3c83c9;
        background: #edf6ff;
    }

    .inbox-status.waiting {
        color: #bb7a24;
        background: #fff5e3;
    }

.letter-priority-container{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

td.letter-priority-container .letter-priority-marker {
    display: inline-flex;
    width: fit-content;
    margin-top: 0;
    margin-bottom: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: visible;
}

td.letter-priority-container .letter-priority-marker.urgent {
    color: #b54747;
    background: #ffeded;
}

td.letter-priority-container .letter-priority-marker.important {
    color: #a36b1b;
    background: #fff4dc;
}

.inbox-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #918da8;
    white-space: nowrap;
}

    .inbox-attachment svg {
        width: 15px;
        height: 15px;
    }

.inbox-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e4e1f1;
    border-radius: 9px;
    color: var(--brand);
    background: #faf9ff;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

    .inbox-action:hover {
        color: #fff;
        border-color: var(--brand);
        background: var(--brand);
    }

.inbox-action-cell {
    width: 1%;
    text-align: center !important;
}

    .inbox-action svg {
        width: 16px;
        height: 16px;
    }

.inbox-empty-state {
    display: none;
    padding: 42px 20px;
    color: #9997a8;
    font-size: 0.75rem;
    text-align: center;
}

    .inbox-empty-state.is-visible {
        display: block;
    }

@media (max-width: 920px) {
    .inbox-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inbox-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .inbox-filter-grid .inbox-search-field {
            grid-column: 1 / -1;
        }
}

@media (max-width: 560px) {
    .inbox-content {
        padding-top: 23px;
    }

    .inbox-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

        .inbox-heading h2 {
            font-size: 1.15rem;
        }

    .inbox-stats {
        grid-template-columns: 1fr;
    }

    .inbox-filter-grid {
        grid-template-columns: 1fr;
    }

        .inbox-filter-grid .inbox-search-field {
            grid-column: auto;
        }

    .inbox-list-header {
        padding-right: 16px;
        padding-left: 16px;
    }

    .inbox-row > th,
    .inbox-row > td {
        padding-right: 16px;
        padding-left: 16px;
    }
}

/* =========================================================
   Letters in circulation
   ========================================================= */

.circulation-content {
    padding-top: 30px;
}

.circulation-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 21px;
}

    .circulation-heading h2 {
        margin: 0;
        color: var(--ink);
        font-size: 1.35rem;
        letter-spacing: -0.03em;
    }

    .circulation-heading p {
        margin: 7px 0 0;
        color: #9694a6;
        font-size: 0.76rem;
        line-height: 1.9;
    }

.circulation-stats .inbox-stat:nth-child(1) {
    --inbox-color: #7560d8;
    --inbox-tint: #f0edff;
}

.circulation-stats .inbox-stat:nth-child(2) {
    --inbox-color: #d38b28;
    --inbox-tint: #fff5df;
}

.circulation-stats .inbox-stat:nth-child(3) {
    --inbox-color: #3989df;
    --inbox-tint: #eaf4ff;
}

.circulation-filter-card {
    margin-bottom: 18px;
}

.circulation-filter-grid {
    display: grid;
    grid-template-columns: minmax(250px, 1.55fr) minmax(185px, 0.8fr) minmax(185px, 0.8fr) auto;
    align-items: end;
    gap: 13px;
}

.circulation-search-wrap {
    position: relative;
}

    .circulation-search-wrap svg {
        position: absolute;
        top: 50%;
        right: 13px;
        width: 17px;
        height: 17px;
        color: #aaa7b6;
        pointer-events: none;
        transform: translateY(-50%);
    }

    .circulation-search-wrap .form-control {
        padding-right: 39px;
    }

.circulation-clear {
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #e5e3ed;
    border-radius: 11px;
    color: #77748b;
    background: #fff;
    cursor: pointer;
    font-family: IranSans, sans-serif;
    font-size: 0.72rem;
}

    .circulation-clear:hover {
        color: var(--brand);
        border-color: #d7d2f4;
        background: #faf9ff;
    }

.circulation-list-card {
    overflow: hidden;
}

.circulation-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 21px 16px;
}

    .circulation-list-header h3 {
        margin: 0;
        color: var(--ink);
        font-size: 0.92rem;
    }

.circulation-result-count {
    color: #9b99aa;
    font-size: 0.68rem;
}

.circulation-table {
    overflow-x: auto;
}

.circulation-row {
    min-width: 990px;
    display: grid;
    grid-template-columns: 1.15fr 2fr 1.15fr 1.55fr 1fr 0.95fr 0.55fr;
    align-items: center;
    gap: 14px;
    padding: 15px 21px;
    border-top: 1px solid #f0eff5;
}

    .circulation-row.circulation-header-row {
        padding-top: 11px;
        padding-bottom: 11px;
        color: #9b99aa;
        background: #fbfbfd;
        font-size: 0.66rem;
    }

    .circulation-row:not(.circulation-header-row) {
        color: #69677a;
        font-size: 0.69rem;
        transition: background 180ms ease;
    }

        .circulation-row:not(.circulation-header-row):hover {
            background: #fcfbff;
        }

.circulation-number {
    color: var(--brand);
    font-family: IranSans, sans-serif;
    font-size: 0.67rem;
    font-weight: 700;
}

.circulation-subject,
.circulation-recipient {
    min-width: 0;
}

    .circulation-subject strong,
    .circulation-subject span,
    .circulation-recipient strong,
    .circulation-recipient span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .circulation-subject strong,
    .circulation-recipient strong {
        color: #3b394f;
        font-size: 0.73rem;
    }

    .circulation-subject span,
    .circulation-recipient span {
        margin-top: 4px;
        color: #a09ead;
        font-size: 0.63rem;
    }

.circulation-progress {
    min-width: 0;
}

.circulation-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    color: #9b99aa;
    font-size: 0.61rem;
}

    .circulation-progress-head strong {
        color: var(--brand);
        font-family: IranSans, sans-serif;
    }

.circulation-progress-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #eeedf4;
}

    .circulation-progress-bar span {
        display: block;
        width: var(--progress, 50%);
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #7060d2, #9a8aff);
    }

.circulation-update {
    color: #9795a6;
    font-family: IranSans, sans-serif;
    font-size: 0.64rem;
    line-height: 1.8;
}

.circulation-status {
    width: fit-content;
    padding: 5px 8px;
    border-radius: 7px;
    color: #bb7a24;
    background: #fff5e3;
    font-size: 0.61rem;
    white-space: nowrap;
}

    .circulation-status.mine {
        color: #3c83c9;
        background: #edf6ff;
    }

    .circulation-status.near-complete {
        color: #2c9760;
        background: #eaf8ef;
    }

.circulation-action {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #e4e1f1;
    border-radius: 9px;
    color: var(--brand);
    background: #faf9ff;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

    .circulation-action:hover {
        color: #fff;
        border-color: var(--brand);
        background: var(--brand);
    }

    .circulation-action svg {
        width: 16px;
        height: 16px;
    }

.circulation-empty {
    display: none;
    padding: 42px 20px;
    color: #9997a8;
    font-size: 0.75rem;
    text-align: center;
}

    .circulation-empty.is-visible {
        display: block;
    }

@media (max-width: 920px) {
    .circulation-filter-grid {
        grid-template-columns: minmax(0, 1fr) minmax(170px, 0.75fr);
    }

        .circulation-filter-grid .circulation-search-field {
            grid-column: 1 / -1;
        }
}

@media (max-width: 560px) {
    .circulation-content {
        padding-top: 23px;
    }

    .circulation-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

        .circulation-heading h2 {
            font-size: 1.15rem;
        }

    .circulation-filter-grid {
        grid-template-columns: 1fr;
    }

        .circulation-filter-grid .circulation-search-field {
            grid-column: auto;
        }

    .circulation-list-header {
        padding-right: 16px;
        padding-left: 16px;
    }

    .circulation-row {
        padding-right: 16px;
        padding-left: 16px;
    }
}

/* =========================================================
   Letter tracking
   ========================================================= */

.tracking-content {
    padding-top: 30px;
}

.tracking-heading {
    margin-bottom: 21px;
}

    .tracking-heading h2 {
        margin: 0;
        color: var(--ink);
        font-size: 1.35rem;
        letter-spacing: -0.03em;
    }

    .tracking-heading p {
        margin: 7px 0 0;
        color: #9694a6;
        font-size: 0.76rem;
        line-height: 1.9;
    }

.tracking-search-card {
    margin-bottom: 18px;
    background: radial-gradient(circle at 0 0, rgba(91, 75, 195, 0.12), transparent 34%), #fff;
}

.tracking-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 13px;
}

    .tracking-search-row .form-label {
        margin-bottom: 7px;
    }

.tracking-search-input-wrap {
    position: relative;
}

    .tracking-search-input-wrap svg {
        position: absolute;
        top: 50%;
        right: 13px;
        width: 18px;
        height: 18px;
        color: #9894b1;
        pointer-events: none;
        transform: translateY(-50%);
    }

.tracking-search-input {
    min-height: 51px;
    padding-right: 42px;
    background: #fff;
    font-family: IranSans, sans-serif;
    letter-spacing: 0.02em;
}

.tracking-search-button {
    min-height: 51px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #312573 0%, #5540ad 100%);
    box-shadow: 0 9px 18px rgba(52, 38, 126, 0.18);
    cursor: pointer;
    font-family: IranSans, sans-serif;
    font-size: 0.77rem;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

    .tracking-search-button:hover {
        box-shadow: 0 12px 22px rgba(52, 38, 126, 0.26);
        transform: translateY(-1px);
    }

    .tracking-search-button svg {
        width: 17px;
        height: 17px;
    }

.tracking-search-helper {
    margin: 9px 0 0;
    color: #a19eaf;
    font-size: 0.66rem;
}

.tracking-error {
    display: none;
    margin: 9px 0 0;
    color: #ca4e5a;
    font-size: 0.68rem;
}

    .tracking-error.is-visible {
        display: block;
    }

.tracking-result-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
    align-items: start;
    gap: 18px;
}

.tracking-result-card,
.tracking-side-card {
    min-width: 0;
}

.tracking-result-main {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.tracking-side {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.tracking-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 21px;
    border-bottom: 1px solid #f0eff5;
}

.tracking-letter-number {
    display: block;
    margin-bottom: 7px;
    color: var(--brand);
    font-family: IranSans, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
}

.tracking-result-header h3 {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
}

.tracking-result-header p {
    margin: 6px 0 0;
    color: #9b99aa;
    font-size: 0.68rem;
}

.tracking-status {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 8px;
    color: #bb7a24;
    background: #fff5e3;
    font-size: 0.63rem;
    white-space: nowrap;
}

.tracking-result-body {
    padding: 21px;
}

.tracking-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.tracking-overview-item {
    padding: 12px;
    border: 1px solid #efedf5;
    border-radius: 11px;
    background: #fcfcfe;
}

    .tracking-overview-item span,
    .tracking-overview-item strong {
        display: block;
    }

    .tracking-overview-item span {
        color: #a09ead;
        font-size: 0.63rem;
    }

    .tracking-overview-item strong {
        margin-top: 5px;
        color: #4b4960;
        font-size: 0.7rem;
    }

.tracking-timeline-title {
    margin: 0 0 16px;
    color: #5c596e;
    font-size: 0.76rem;
}

.tracking-timeline {
    position: relative;
    display: grid;
    gap: 17px;
}

    .tracking-timeline::before {
        content: "";
        position: absolute;
        top: 10px;
        right: 8px;
        bottom: 10px;
        width: 1px;
        background: #e4e1ef;
    }

.tracking-step {
    position: relative;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.tracking-step-dot {
    position: relative;
    z-index: 1;
    width: 17px;
    height: 17px;
    margin-top: 3px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #d9d6e7;
    box-shadow: 0 0 0 1px #dedbe9;
}

.tracking-step.is-complete .tracking-step-dot {
    background: #55ae7e;
    box-shadow: 0 0 0 1px #55ae7e;
}

.tracking-step.is-current .tracking-step-dot {
    background: #5ca9ff;
    box-shadow: 0 0 0 1px #5ca9ff, 0 0 0 5px rgba(92, 169, 255, 0.13);
}

.tracking-step-copy strong,
.tracking-step-copy span {
    display: block;
}

.tracking-step-copy strong {
    color: #4b4960;
    font-size: 0.74rem;
}

.tracking-step-copy span {
    margin-top: 4px;
    color: #9e9baa;
    font-size: 0.65rem;
    line-height: 1.8;
}

.tracking-step-time {
    color: #a09ead;
    font-family: IranSans, sans-serif;
    font-size: 0.61rem;
    white-space: nowrap;
}

.tracking-side-card + .tracking-side-card {
    margin-top: 0;
}

.tracking-side-body {
    padding: 20px;
}

.tracking-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 112px;
    margin: 0;
    padding: 18px 16px;
    border: 1px dashed rgba(117, 100, 206, 0.24);
    border-radius: 14px;
    color: #918ca4;
    background: linear-gradient(145deg, rgba(117, 100, 206, 0.06), rgba(255, 255, 255, 0.76));
    font-size: 0.7rem;
    line-height: 1.9;
    text-align: center;
}

.tracking-empty-state p {
    margin: 0;
}

.tracking-empty-state::before {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 1px solid rgba(117, 100, 206, 0.18);
    border-radius: 50%;
    color: #7564ce;
    background: rgba(117, 100, 206, 0.1);
    font-size: 1rem;
    font-weight: 700;
}

.tracking-side-title {
    margin: 0 0 15px;
    color: var(--ink);
    font-size: 0.88rem;
}

.tracking-note {
    padding: 12px;
    border: 1px solid #efedf5;
    border-radius: 11px;
    background: #fcfcfe;
}

    .tracking-note + .tracking-note {
        margin-top: 9px;
    }

    .tracking-note strong,
    .tracking-note span {
        display: block;
    }

    .tracking-note strong {
        color: #5a576d;
        font-size: 0.7rem;
    }

    .tracking-note span {
        margin-top: 5px;
        color: #9896a6;
        font-size: 0.65rem;
        line-height: 1.9;
    }

.tracking-attachment {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid #efedf5;
    border-radius: 10px;
    color: #6c6881;
    background: #fcfcfe;
    font-size: 0.68rem;
}

    .tracking-attachment + .tracking-attachment {
        margin-top: 8px;
    }

    .tracking-attachment svg {
        width: 17px;
        height: 17px;
        flex: 0 0 auto;
        color: #7564ce;
    }

    .tracking-attachment small {
        display: block;
        margin-top: 3px;
        color: #a09ead;
        font-size: 0.58rem;
    }

@media (max-width: 980px) {
    .tracking-result-grid {
        grid-template-columns: 1fr;
    }

    .tracking-side-card + .tracking-side-card {
        margin-top: 0;
    }
}

@media (max-width: 560px) {
    .tracking-content {
        padding-top: 23px;
    }

    .tracking-heading h2 {
        font-size: 1.15rem;
    }

    .tracking-search-row {
        grid-template-columns: 1fr;
    }

    .tracking-search-button {
        width: 100%;
    }

    .tracking-result-header,
    .tracking-result-body,
    .tracking-side-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .tracking-result-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tracking-overview {
        grid-template-columns: 1fr;
    }

    .tracking-step {
        grid-template-columns: 25px minmax(0, 1fr);
    }

    .tracking-step-time {
        grid-column: 2;
        margin-top: -5px;
    }
}

/* =========================================================
   Letter view
   ========================================================= */

.letter-content {
    padding-top: 30px;
}

.letter-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

    .letter-heading h2 {
        margin: 0;
        color: var(--ink);
        font-size: 1.35rem;
        letter-spacing: -0.03em;
    }

    .letter-heading p {
        margin: 7px 0 0;
        color: #9694a6;
        font-size: 0.76rem;
        line-height: 1.9;
    }

.letter-heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.letter-secondary-action {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid #e3e0ee;
    border-radius: 10px;
    color: #6f6b81;
    background: #fff;
    font-size: 0.71rem;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

    .letter-secondary-action:hover {
        border-color: #cfc8ed;
        color: var(--brand);
        background: #faf9ff;
    }

    .letter-secondary-action svg,
    .letter-header-icon svg,
    .letter-panel-icon svg {
        width: 16px;
        height: 16px;
    }

.letter-header-card {
    overflow: hidden;
    margin-bottom: 18px;
}

.letter-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #fbfaff 0%, #fff 62%);
}

.letter-header-main {
    min-width: 0;
}

.letter-number {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 9px;
    border-radius: 7px;
    color: #6255b6;
    background: #f0edff;
    font-family: IranSans, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
}

.letter-header-main h3 {
    margin: 11px 0 0;
    color: var(--ink);
    font-size: 1.08rem;
}

.letter-header-main p {
    margin: 8px 0 0;
    color: #9a98a9;
    font-size: 0.68rem;
}

    .letter-header-main p b {
        padding: 0 4px;
        color: #cbc8d5;
    }

.letter-status {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.66rem;
    white-space: nowrap;
}

    .letter-status.is-visible {
        display: inline-flex;
    }

    .letter-status::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

.letter-status-draft {
    color: #9b6a27;
    background: #fff4df;
}

.letter-status-inbox {
    color: #3c83c9;
    background: #edf6ff;
}

.letter-status-forwarded {
    color: #2c9760;
    background: #eaf8ef;
}

.letter-status-readonly {
    color: #777487;
    background: #f0eff5;
}

.letter-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #efedf5;
}

.letter-meta-item {
    min-width: 0;
    padding: 15px 20px;
    border-left: 1px solid #efedf5;
}

    .letter-meta-item:last-child {
        border-left: 0;
    }

    .letter-meta-item span,
    .letter-meta-item strong {
        display: block;
    }

    .letter-meta-item span {
        color: #a09ead;
        font-size: 0.63rem;
    }

    .letter-meta-item strong {
        overflow: hidden;
        margin-top: 6px;
        color: #56536a;
        font-size: 0.71rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.letter-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: start;
    gap: 18px;
}

.letter-main-column,
.letter-side-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.letter-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #efedf5;
}

.letter-card-heading h3 {
    margin: 0;
    color: var(--ink);
    font-size: 0.88rem;
}

.letter-card-heading p {
    margin: 5px 0 0;
    color: #a09ead;
    font-size: 0.66rem;
}

.letter-header-icon,
.letter-panel-icon {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: #6f5dcc;
    background: #f0edff;
}

.letter-document-body {
    padding: 22px 23px 25px;
}

    .letter-document-body p {
        margin: 0;
        color: #666378;
        font-size: 0.79rem;
        line-height: 2.25;
        white-space: pre-wrap;
    }

        .letter-document-body p + p {
            margin-top: 12px;
        }

.letter-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 20px;
}

.letter-notes {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #eeecf4;
}

.letter-notes-title {
    margin: 0 0 10px;
    color: #5d5a70;
    font-size: 0.76rem;
}

.letter-note {
    margin: 0;
    padding: 0;
}

    .letter-note + .letter-note {
        margin-top: 14px;
    }

    .letter-note-meta {
        display: flex;
        align-items: baseline;
        gap: 6px;
    }

    .letter-note-meta strong {
        color: #5d5a70;
        font-size: 0.72rem;
    }

    .letter-note-meta span,
    .letter-note-meta time {
        color: #aaa7b5;
        font-size: 0.62rem;
    }

    .letter-note p {
        margin: 4px 0 0;
        padding-inline-start: 16px;
        color: #666378;
        font-size: 0.74rem;
        line-height: 1.9;
        white-space: pre-wrap;
    }

.letter-detail-chip {
    padding: 11px 12px;
    border: 1px solid #eeecf4;
    border-radius: 10px;
    background: #fcfcfe;
}

    .letter-detail-chip span,
    .letter-detail-chip strong {
        display: block;
    }

    .letter-detail-chip span {
        color: #9e9baa;
        font-size: 0.61rem;
    }

    .letter-detail-chip strong {
        margin-top: 5px;
        color: #5d5a70;
        font-size: 0.68rem;
    }

.letter-route-body,
.letter-side-body {
    padding: 20px;
}

.letter-route {
    position: relative;
    display: grid;
    gap: 18px;
}

    .letter-route::before {
        content: "";
        position: absolute;
        top: 10px;
        right: 8px;
        bottom: 10px;
        width: 1px;
        background: #e4e1ef;
    }

.letter-route-item {
    position: relative;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.letter-route-dot {
    position: relative;
    z-index: 1;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #d9d6e7;
    box-shadow: 0 0 0 1px #dedbe9;
}

.letter-route-item.is-complete .letter-route-dot {
    background: #55ae7e;
    box-shadow: 0 0 0 1px #55ae7e;
}

.letter-route-item.is-current .letter-route-dot {
    background: #5ca9ff;
    box-shadow: 0 0 0 1px #5ca9ff, 0 0 0 5px rgba(92, 169, 255, 0.13);
}

.letter-route-copy strong,
.letter-route-copy span {
    display: block;
}

.letter-route-copy strong {
    color: #4b4960;
    font-size: 0.73rem;
}

.letter-route-copy span {
    margin-top: 4px;
    color: #9e9baa;
    font-size: 0.64rem;
    line-height: 1.8;
}

.letter-route-time {
    color: #a09ead;
    font-family: IranSans, sans-serif;
    font-size: 0.61rem;
    white-space: nowrap;
}

.letter-state-panel {
    display: none;
    overflow: hidden;
}

    .letter-state-panel.is-visible {
        display: block;
    }

    .letter-state-panel .letter-card-header {
        border-bottom: 0;
        background: #fbfaff;
    }

    .letter-state-panel.state-draft .letter-card-header {
        background: #fffaf0;
    }

    .letter-state-panel.state-readonly .letter-card-header {
        background: #f9f9fb;
    }

.letter-state-body {
    padding: 10px 20px 20px;
}

.letter-state-message {
    margin: 0 0 16px;
    color: #777487;
    font-size: 0.72rem;
    line-height: 1.9;
}

.letter-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

    .letter-form-grid .letter-form-wide {
        grid-column: 1 / -1;
    }

.letter-form-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 15px;
}

.letter-action-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 15px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #312573 0%, #5540ad 100%);
    box-shadow: 0 8px 16px rgba(52, 38, 126, 0.16);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
}

    .letter-action-button:hover {
        filter: brightness(1.07);
    }

    .letter-action-button.secondary {
        color: #6d6880;
        border: 1px solid #e2deef;
        background: #fff;
        box-shadow: none;
    }

    .letter-action-button.danger {
        background: linear-gradient(135deg, #a94250 0%, #d86670 100%);
        box-shadow: 0 8px 16px rgba(169, 66, 80, 0.16);
    }

    .letter-action-button svg {
        width: 16px;
        height: 16px;
    }

.letter-upload-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 11px 13px;
    border: 1px dashed #cfc9e9;
    border-radius: 11px;
    color: #77728b;
    background: #fbfaff;
    font-size: 0.67rem;
}

    .letter-upload-box svg {
        width: 19px;
        height: 19px;
        color: #7666ce;
    }

    .letter-upload-box span,
    .letter-upload-box small {
        display: block;
    }

    .letter-upload-box small {
        margin-top: 4px;
        color: #aaa7b5;
        font-size: 0.59rem;
    }

.letter-history-list,
.letter-info-list,
.letter-attachment-list {
    display: grid;
    gap: 9px;
}

.letter-history-item,
.letter-info-item,
.letter-attachment-item {
    padding: 11px 12px;
    border: 1px solid #efedf5;
    border-radius: 10px;
    background: #fcfcfe;
}

    .letter-history-item strong,
    .letter-history-item span,
    .letter-info-item span,
    .letter-info-item strong,
    .letter-attachment-item strong,
    .letter-attachment-item small {
        display: block;
    }

    .letter-history-item strong,
    .letter-info-item strong,
    .letter-attachment-item strong {
        color: #5c596d;
        font-size: 0.68rem;
    }

    .letter-history-item span,
    .letter-info-item span,
    .letter-attachment-item small {
        margin-top: 4px;
        color: #9d9aa9;
        font-size: 0.62rem;
        line-height: 1.8;
    }

.letter-attachment-item {
    display: flex;
    align-items: center;
    gap: 9px;
}

.workflow-attachment-group {
    display: grid;
    gap: 7px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #efedf5;
}

.workflow-attachment-group__title {
    margin: 0;
    color: #4f4a68;
    font-size: 0.72rem;
    font-weight: 700;
}

.workflow-attachment-group > .letter-attachment-list {
    gap: 7px;
    padding-right: 10px;
    border-right: 2px solid #e9e4fb;
}

    .letter-attachment-item > svg {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
        color: #7362cb;
    }

    .letter-attachment-item small {
        margin-top: 2px;
        font-size: 0.58rem;
    }

.letter-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid #e9e6f4;
    border-radius: 11px;
    color: #716e81;
    background: #fbfaff;
    font-size: 0.68rem;
    line-height: 1.9;
}

    .letter-notice svg {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
        margin-top: 2px;
        color: #7160c9;
    }

.letter-action-feedback {
    display: none;
    margin: 11px 0 0;
    color: #2c9760;
    font-size: 0.66rem;
}

    .letter-action-feedback.is-visible {
        display: block;
    }

@media (max-width: 980px) {
    .letter-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .letter-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .letter-meta-item:nth-child(2) {
        border-left: 0;
    }

    .letter-meta-item:nth-child(-n + 2) {
        border-bottom: 1px solid #efedf5;
    }

    .letter-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 560px) {
    .letter-content {
        padding-top: 23px;
    }

    .letter-heading h2 {
        font-size: 1.15rem;
    }

    .letter-heading-actions,
    .letter-heading-actions a {
        width: 100%;
    }

        .letter-heading-actions a {
            justify-content: center;
        }

    .letter-header-top,
    .letter-card-header,
    .letter-document-body,
    .letter-route-body,
    .letter-side-body,
    .letter-state-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .letter-header-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .letter-details-grid,
    .letter-form-grid {
        grid-template-columns: 1fr;
    }

        .letter-form-grid .letter-form-wide {
            grid-column: auto;
        }

    .letter-route-item {
        grid-template-columns: 25px minmax(0, 1fr);
    }

    .letter-route-time {
        grid-column: 2;
        margin-top: -5px;
    }

    .letter-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .letter-action-button {
        width: 100%;
    }
}

/* =========================================================
   Roles, users and profile
   ========================================================= */

.admin-content,
.profile-content {
    padding-top: 30px;
}

.admin-heading,
.profile-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

    .admin-heading h2,
    .profile-heading h2 {
        margin: 0;
        color: var(--ink);
        font-size: 1.35rem;
        letter-spacing: -0.03em;
    }

    .admin-heading p,
    .profile-heading p {
        margin: 7px 0 0;
        color: #9694a6;
        font-size: 0.76rem;
        line-height: 1.9;
    }

.admin-heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 17px;
    padding: 5px;
    border: 1px solid #ebe9f2;
    border-radius: 12px;
    background: #f8f7fb;
}

.admin-tab {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 9px;
    color: #858295;
    font-size: 0.7rem;
    transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

    .admin-tab:hover,
    .admin-tab.is-active {
        color: var(--brand);
        background: #fff;
        box-shadow: 0 4px 10px rgba(31, 28, 76, 0.06);
    }

    .admin-tab svg {
        width: 16px;
        height: 16px;
    }

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 15px 17px;
    border: 1px solid #ebeaf2;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 9px 22px rgba(30, 26, 77, 0.045);
}

.admin-summary-icon {
    width: 40px;
    height: 40px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: #6352bd;
    background: #f0edff;
}

    .admin-summary-icon.blue {
        color: #3989df;
        background: #eaf4ff;
    }

    .admin-summary-icon.green {
        color: #2c9a61;
        background: #e9f8ef;
    }

    .admin-summary-icon svg {
        width: 20px;
        height: 20px;
    }

.admin-summary-copy span,
.admin-summary-copy strong {
    display: block;
}

.admin-summary-copy span {
    color: #9290a0;
    font-size: 0.66rem;
}

.admin-summary-copy strong {
    margin-top: 5px;
    color: var(--ink);
    font-family: IranSans, sans-serif;
    font-size: 1.1rem;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-toolbar-title {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.admin-toolbar-meta {
    color: #9c9aa9;
    font-size: 0.67rem;
}

.admin-toolbar-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-search-wrap {
    position: relative;
}

    .admin-search-wrap svg {
        position: absolute;
        top: 50%;
        right: 11px;
        width: 16px;
        height: 16px;
        color: #9692ad;
        pointer-events: none;
        transform: translateY(-50%);
    }

.admin-search-input {
    width: 240px;
    min-height: 39px;
    padding-right: 36px;
}

.admin-filter-select {
    min-height: 39px;
    min-width: 135px;
}

.admin-table-card {
    overflow: hidden;
}

.admin-table-scroll {
    overflow-x: auto;
}

.admin-table {
    min-width: 800px;
}

.admin-table-row {
    display: grid;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    border-top: 1px solid #f0eff5;
    color: #6b687b;
    font-size: 0.69rem;
}

    .admin-table-row.role-row {
        grid-template-columns: 1.4fr 1.8fr 0.8fr 0.85fr 0.45fr;
    }

    .admin-table-row.category-row {
        grid-template-columns: 1.25fr 2fr 0.8fr 0.45fr;
    }

    .admin-table-row.user-row {
        grid-template-columns: 1.55fr 1.2fr 1.1fr 0.8fr 0.55fr;
    }

    .admin-table-row.admin-table-head {
        padding-top: 11px;
        padding-bottom: 11px;
        color: #9b99aa;
        background: #fbfbfd;
        font-size: 0.65rem;
    }

    .admin-table-row:not(.admin-table-head):hover {
        background: #fcfbff;
    }

.admin-identity,
.admin-permission-list {
    min-width: 0;
}

.admin-identity {
    display: flex;
    align-items: center;
    gap: 9px;
}

.admin-avatar {
    width: 33px;
    height: 33px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: #5f50b6;
    background: #efecff;
    font-size: 0.68rem;
    font-weight: 700;
}

    .admin-avatar.blue {
        color: #367fbd;
        background: #eaf4ff;
    }

    .admin-avatar.green {
        color: #2d9360;
        background: #e9f8ef;
    }

.admin-identity strong,
.admin-identity span {
    display: block;
}

.admin-identity strong {
    overflow: hidden;
    color: #49465b;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-identity span {
    margin-top: 3px;
    color: #a09ead;
    font-size: 0.61rem;
}

.admin-role-name {
    color: #5a576c;
    font-weight: 700;
}

.admin-permission-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.admin-permission {
    padding: 4px 7px;
    border-radius: 6px;
    color: #6960a9;
    background: #f3f0ff;
    font-size: 0.59rem;
    white-space: nowrap;
}

.admin-description {
    padding: 4px 7px;
    border-radius: 6px;
    color: #6960a9;
    font-size: 0.59rem;
}


.admin-status {
    width: fit-content;
    padding: 5px 8px;
    border-radius: 7px;
    color: #2d9860;
    background: #eaf8ef;
    font-size: 0.6rem;
    white-space: nowrap;
}

    .admin-status.inactive {
        color: #a09baa;
        background: #f0eff4;
    }

.admin-row-action {
    width: 31px;
    height: 31px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #e4e1f1;
    border-radius: 8px;
    color: var(--brand);
    background: #faf9ff;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

    .admin-row-action:hover {
        border-color: var(--brand);
        color: #fff;
        background: var(--brand);
    }

    .admin-row-action svg {
        width: 15px;
        height: 15px;
    }

.admin-form-layout,
.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: start;
    gap: 18px;
}

.admin-form-card,
.profile-card {
    overflow: hidden;
}

.admin-form-body,
.profile-card-body {
    padding: 21px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.admin-form-wide {
    grid-column: 1 / -1;
}

.admin-form-help {
    margin: 7px 0 0;
    color: #a09ead;
    font-size: 0.63rem;
    line-height: 1.8;
}

.admin-checkbox-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #ebe9f2;
    border-radius: 9px;
    color: #6b687b;
    background: #fcfcfe;
    font-size: 0.66rem;
}

    .admin-checkbox input {
        accent-color: var(--brand);
    }

.admin-form-actions {
    display: flex;
    gap: 9px;
    margin-top: 19px;
    padding-top: 17px;
    border-top: 1px solid #efedf5;
}

.admin-delete-confirmation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #f2d2d7;
    border-radius: 10px;
    color: #9b4b58;
    background: #fff7f8;
    font-size: 0.68rem;
    flex-direction: column;
}

    .admin-delete-confirmation > div {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

.admin-side-stack,
.profile-side-stack {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.admin-info-list,
.profile-info-list {
    display: grid;
    gap: 10px;
}

.admin-info-item,
.profile-info-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0eff5;
    font-size: 0.67rem;
}

    .admin-info-item:last-child,
    .profile-info-item:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .admin-info-item span,
    .profile-info-item span {
        color: #a09ead;
    }

    .admin-info-item strong,
    .profile-info-item strong {
        color: #5c596d;
        text-align: left;
    }

.profile-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

.profile-cover {
    min-height: 118px;
    background: radial-gradient(circle at 0 0, rgba(108, 92, 212, 0.45), transparent 47%), linear-gradient(135deg, #2c226c, #5642a9);
}

.profile-main {
    position: relative;
    padding: 0 22px 22px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    margin-top: -35px;
    border: 5px solid #fff;
    border-radius: 25px;
    color: #5c4eb0;
    background: #efecff;
    box-shadow: 0 8px 20px rgba(31, 28, 76, 0.1);
    font-size: 1.18rem;
    font-weight: 700;
}

.profile-main h3 {
    margin: 14px 0 0;
    color: var(--ink);
    font-size: 1rem;
}

.profile-main > p {
    margin: 5px 0 0;
    color: #9694a6;
    font-size: 0.69rem;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin-top: 21px;
}

.profile-detail {
    padding: 12px;
    border: 1px solid #efedf5;
    border-radius: 10px;
    background: #fcfcfe;
}

    .profile-detail span,
    .profile-detail strong {
        display: block;
    }

    .profile-detail span {
        color: #a09ead;
        font-size: 0.61rem;
    }

    .profile-detail strong {
        margin-top: 5px;
        color: #5c596d;
        font-size: 0.68rem;
    }

.profile-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.profile-edit-wide {
    grid-column: 1 / -1;
}

.profile-security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #efedf5;
}

    .profile-security-item:first-child {
        padding-top: 0;
    }

    .profile-security-item:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .profile-security-item strong,
    .profile-security-item span {
        display: block;
    }

    .profile-security-item strong {
        color: #5c596d;
        font-size: 0.68rem;
    }

    .profile-security-item span {
        margin-top: 4px;
        color: #a09ead;
        font-size: 0.61rem;
    }

.profile-security-badge {
    padding: 4px 7px;
    border-radius: 6px;
    color: #2c9760;
    background: #eaf8ef;
    font-size: 0.58rem;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .admin-form-layout,
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .admin-summary-grid {
        grid-template-columns: 1fr;
    }

    .admin-heading,
    .profile-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .admin-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-toolbar-form {
        width: 100%;
    }

    .admin-search-wrap,
    .admin-search-input,
    .admin-filter-select {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .admin-content,
    .profile-content {
        padding-top: 23px;
    }

    .admin-heading h2,
    .profile-heading h2 {
        font-size: 1.15rem;
    }

    .admin-heading-actions,
    .admin-heading-actions a {
        width: 100%;
    }

        .admin-heading-actions a {
            justify-content: center;
        }

    .admin-toolbar-form {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-tabs {
        overflow-x: auto;
    }

    .admin-tab {
        flex: 0 0 auto;
    }

    .admin-form-grid,
    .admin-checkbox-list,
    .profile-edit-grid,
    .profile-details-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-wide,
    .profile-edit-wide {
        grid-column: auto;
    }

    .admin-form-body,
    .profile-card-body,
    .profile-main {
        padding-right: 16px;
        padding-left: 16px;
    }

    .admin-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

        .admin-form-actions .letter-action-button {
            width: 100%;
        }
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
    font-size: 0.7rem;
}
