/* =====================================================================
   PANEL: login (au-*) and admin panel (ad-*)
   Same brand as the site (dark + lime, IRANSans), calmer motion.
   ===================================================================== */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #111111;
    --bg-deep: #0c0c0d;
    --surface: #171619;
    --surface-2: #1f1e22;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #ffffff;
    --text-2: #cfcfcf;
    --muted: #8a8a8a;
    --lime: #d6f345;
    --lime-soft: rgba(214, 243, 69, 0.1);
    --ink: #171619;
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.1);
    --radius: 18px;
    --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    direction: rtl;
    font-family: IRANSans, Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    /* the layouts hide the body inline until this file has loaded */
    visibility: visible;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

/* [hidden] must win over the display rules of components */
[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

/* =====================================================================
   LOGIN
   ===================================================================== */
.au-body {
    overflow-x: hidden;
}

.au-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.au-form-side {
    display: flex;
    flex-direction: column;
    padding: 34px clamp(24px, 6vw, 96px);
}

.au-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.au-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.au-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.au-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    transition: color 0.3s ease;
}

.au-back:hover {
    color: var(--lime);
}

.au-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 48px 0;
}

.au-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 34px;
}

.au-dots span {
    width: 26px;
    height: 5px;
    border-radius: 5px;
    background: var(--line-strong);
    transition: width 0.5s var(--ease), background 0.5s ease;
}

.au-dots span.is-on {
    width: 44px;
    background: var(--lime);
}

.au-step {
    display: none;
}

.au-step.is-active {
    display: block;
}

.au-title {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.5;
}

.au-hint {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.9;
}

.au-hint b {
    color: var(--text);
}

.au-field {
    display: block;
    margin-top: 34px;
}

.au-field-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
}

.au-phone-box {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 66px;
    padding: 0 22px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.au-phone-box:focus-within {
    border-color: var(--lime);
    box-shadow: 0 0 0 5px var(--lime-soft);
}

.au-phone-box > i {
    color: var(--lime);
    font-size: 20px;
}

.au-phone-box input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 2px;
    text-align: left;
}

.au-phone-box input::placeholder {
    color: #4a4a4a;
    letter-spacing: 2px;
}

.au-eye {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
}

.au-eye:hover {
    color: var(--lime);
}

.au-field.is-invalid .au-phone-box {
    border-color: var(--danger);
    box-shadow: 0 0 0 5px var(--danger-soft);
}

.au-error {
    min-height: 26px;
    margin: 12px 0 0;
    color: var(--danger);
    font-size: 14px;
    line-height: 1.8;
}

.au-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 62px;
    margin-top: 10px;
    padding: 0 28px 0 7px;
    border: none;
    border-radius: 100px;
    background: var(--lime);
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease, opacity 0.3s ease;
}

.au-btn:hover {
    box-shadow: 0 14px 34px rgba(214, 243, 69, 0.22);
}

.au-btn:active {
    transform: scale(0.98);
}

.au-btn .arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--lime);
    transition: transform 0.5s var(--ease);
}

.au-btn:hover .arrow {
    transform: translateX(-4px);
}

.au-btn .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    border: 3px solid rgba(23, 22, 25, 0.25);
    border-top-color: var(--ink);
    opacity: 0;
    animation: auSpin 0.8s linear infinite;
}

.au-btn.is-loading {
    pointer-events: none;
}

.au-btn.is-loading .label,
.au-btn.is-loading .arrow {
    opacity: 0;
}

.au-btn.is-loading .spinner {
    opacity: 1;
}

.au-btn.is-inline {
    display: inline-flex;
    width: auto;
    height: 52px;
    padding: 0 28px;
    font-size: 16px;
}

@keyframes auSpin {
    to {
        transform: rotate(360deg);
    }
}

.au-terms {
    display: flex;
    gap: 8px;
    margin: 22px 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.8;
}

.au-terms i {
    color: var(--lime);
    margin-top: 4px;
}

.au-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    color: var(--lime);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.au-link:hover {
    text-decoration: underline;
    text-underline-offset: 5px;
}

.au-edit {
    margin-right: 6px;
}

.au-alt {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-strong);
    background: transparent;
    color: var(--text);
    text-align: right;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.au-alt:hover {
    border-color: var(--lime);
    background: var(--lime-soft);
}

.au-alt > i:first-child {
    color: var(--lime);
    font-size: 20px;
}

.au-alt > i:last-child {
    margin-right: auto;
    color: var(--muted);
}

.au-alt span {
    display: flex;
    flex-direction: column;
}

.au-alt b {
    font-size: 15px;
}

.au-alt small {
    color: var(--muted);
    font-size: 12px;
}

.au-alt.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* otp boxes */
.au-otp {
    display: flex;
    gap: 12px;
    margin-top: 34px;
}

.au-otp input {
    flex: 1 1 0;
    min-width: 0;
    height: 72px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    outline: none;
    caret-color: var(--lime);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.au-otp input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 5px var(--lime-soft);
}

.au-otp input.is-filled {
    border-color: rgba(214, 243, 69, 0.55);
    background: #1b1c16;
}

.au-otp.is-invalid input {
    border-color: var(--danger);
    background: #1d1515;
}

.au-otp.is-valid input {
    border-color: var(--lime);
    background: var(--lime);
    color: var(--ink);
}

.au-resend {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 14px;
}

.au-timer {
    position: relative;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
}

.au-timer svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.au-timer circle {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 2.5;
}

.au-timer circle.bar {
    stroke: var(--lime);
    stroke-linecap: round;
    stroke-dasharray: 100.53;
    stroke-dashoffset: 0;
}

.au-timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 12px;
    direction: ltr;
}

.au-resend.is-ready .au-timer,
.au-resend.is-ready .au-resend-wait {
    display: none;
}

/* done */
.au-done {
    text-align: center;
}

.au-done-badge {
    width: 120px;
    height: 120px;
    margin: 0 auto 26px;
}

.au-done-badge svg {
    width: 100%;
    height: 100%;
}

.au-done-badge .ring {
    fill: var(--lime-soft);
    stroke: var(--lime);
    stroke-width: 3;
}

.au-done-badge .check {
    fill: none;
    stroke: var(--lime);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.au-foot {
    margin: 0;
    color: #555;
    font-size: 13px;
}

.au-foot a {
    color: var(--muted);
}

/* visual side */
.au-visual {
    position: relative;
    margin: 16px;
    border-radius: 36px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.au-orb {
    position: absolute;
    top: -20%;
    left: -15%;
    z-index: -1;
    width: 70%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(214, 243, 69, 0.35) 0%, rgba(214, 243, 69, 0) 65%);
    filter: blur(20px);
}

.au-grid-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.au-visual-inner {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 60px 30px;
}

.au-visual-title {
    margin: 0;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.55;
}

.au-visual-title span {
    color: var(--lime);
}

.au-visual-text {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.9;
}

.au-device {
    margin-top: 40px;
    padding: 22px;
    border-radius: 28px;
    background: rgba(12, 12, 13, 0.72);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
}

.au-device-head {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
}

.au-device-head .dots {
    display: flex;
    gap: 5px;
    direction: ltr;
}

.au-device-head .dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #333;
}

.au-device-head .dots i:first-child {
    background: var(--lime);
}

.au-device-head .name {
    flex: 1 1 auto;
}

.au-device-head .pct {
    color: var(--lime);
}

.au-device-bar {
    height: 6px;
    margin: 16px 0 20px;
    border-radius: 6px;
    background: var(--line-strong);
    overflow: hidden;
}

.au-device-bar span {
    display: block;
    width: 60%;
    height: 100%;
    border-radius: 6px;
    background: var(--lime);
    transform-origin: right center;
}

.au-timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.au-tl-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 16px;
}

.au-tl-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 52px;
    right: 31px;
    width: 2px;
    height: 18px;
    background: var(--line-strong);
}

.au-tl-item.is-done:not(:last-child)::after {
    background: var(--lime);
}

.au-tl-item .dot {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 16px;
}

.au-tl-item.is-done .dot {
    background: var(--lime-soft);
    color: var(--lime);
}

.au-tl-item.is-now {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.au-tl-item.is-now .dot {
    background: var(--lime);
    color: var(--ink);
}

.au-tl-item .txt {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.au-tl-item .txt b {
    font-size: 15px;
}

.au-tl-item .txt small {
    color: var(--muted);
    font-size: 12px;
}

.au-tl-item .state {
    color: var(--lime);
    font-size: 14px;
}

.au-tl-item .live {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 0 rgba(214, 243, 69, 0.6);
    animation: auLive 1.6s ease-out infinite;
}

@keyframes auLive {
    to {
        box-shadow: 0 0 0 12px rgba(214, 243, 69, 0);
    }
}

.au-toast {
    position: absolute;
    left: -10px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px 14px 22px;
    border-radius: 20px;
    background: var(--lime);
    color: var(--ink);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.au-toast .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--lime);
}

.au-toast b,
.au-toast small {
    display: block;
}

.au-toast b {
    font-size: 14px;
}

.au-toast small {
    font-size: 12px;
    opacity: 0.75;
}

/* small centered pages (access denied, temporary profile) */
.au-simple {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: radial-gradient(circle at 50% 0%, rgba(214, 243, 69, 0.08), transparent 55%), var(--bg);
}

.au-simple-card {
    width: 100%;
    max-width: 520px;
    padding: 46px 36px;
    border-radius: 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    text-align: center;
}

.au-simple-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 28px;
}

.au-simple .au-title {
    font-size: 28px;
}

.au-simple-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin-top: 30px;
}

.au-simple-btns form {
    margin: 0;
}

@media (max-width: 991px) {
    .au-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .au-visual {
        display: none;
    }
}

@media (max-width: 575px) {
    .au-form-side {
        padding: 22px 16px;
    }

    .au-back span,
    .au-back {
        font-size: 13px;
    }

    .au-card {
        padding: 36px 0;
    }

    .au-title {
        font-size: 28px;
    }

    .au-hint {
        font-size: 15px;
    }

    .au-otp {
        gap: 8px;
    }

    .au-otp input {
        height: 62px;
        font-size: 26px;
    }

    .au-simple-card {
        padding: 36px 20px;
    }
}

/* =====================================================================
   ADMIN
   ===================================================================== */
.ad-body {
    background: var(--bg-deep);
}

.ad-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: 272px;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: var(--surface);
    border-left: 1px solid var(--line);
}

.ad-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 22px;
    border-bottom: 1px solid var(--line);
}

.ad-logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.ad-logo b,
.ad-logo small {
    display: block;
}

.ad-logo b {
    font-size: 17px;
}

.ad-logo small {
    color: var(--muted);
    font-size: 12px;
}

.ad-nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.ad-nav-group {
    margin: 18px 12px 6px;
    color: #5f5f5f;
    font-size: 12px;
    font-weight: 700;
}

.ad-nav-item {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 13px;
    color: var(--text-2);
    font-size: 15px;
    transition: background 0.25s ease, color 0.25s ease;
}

.ad-nav-item i {
    width: 20px;
    color: var(--muted);
    text-align: center;
    transition: color 0.25s ease;
}

.ad-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.ad-nav-item.is-active {
    background: var(--lime);
    color: var(--ink);
    font-weight: 700;
}

.ad-nav-item.is-active i {
    color: var(--ink);
}

.ad-nav-item.is-soon {
    color: #5c5c5c;
    cursor: default;
}

.ad-nav-item.is-soon:hover {
    background: none;
}

.ad-nav-item.is-soon i {
    color: #444;
}

.ad-nav-item em {
    margin-right: auto;
    padding: 1px 8px;
    border-radius: 100px;
    border: 1px solid var(--line);
    color: #666;
    font-size: 11px;
    font-style: normal;
}

.ad-me {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    background: var(--surface-2);
}

.ad-me form {
    margin: 0 auto 0 0;
}

.ad-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    color: var(--ink);
    font-weight: 700;
}

.ad-me-text {
    min-width: 0;
}

.ad-me-text b,
.ad-me-text small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ad-me-text b {
    font-size: 14px;
}

.ad-me-text small {
    color: var(--muted);
    font-size: 12px;
}

.ad-icon-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.ad-icon-btn:hover {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink);
}

.ad-main {
    margin-right: 272px;
    min-height: 100vh;
}

.ad-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 34px;
    background: rgba(12, 12, 13, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.ad-menu-btn {
    display: none;
}

.ad-topbar-title {
    flex: 1 1 auto;
    min-width: 0;
}

.ad-topbar-title h1 {
    margin: 0;
    font-size: 22px;
}

.ad-topbar-title p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ad-ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 14px;
    transition: border-color 0.25s ease, color 0.25s ease;
}

.ad-ghost-btn:hover {
    border-color: var(--lime);
    color: var(--lime);
}

.ad-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 30px 34px 60px;
}

.ad-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.ad-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.ad-stat-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 18px;
}

.ad-stat-label {
    color: var(--muted);
    font-size: 14px;
}

.ad-stat-num {
    font-size: 34px;
    line-height: 1.3;
}

.ad-stat.is-accent {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink);
}

.ad-stat.is-accent .ad-stat-icon {
    background: var(--ink);
}

.ad-stat.is-accent .ad-stat-label {
    color: rgba(23, 22, 25, 0.7);
}

.ad-card {
    padding: 24px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.ad-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.ad-card-head h2 {
    margin: 0;
    font-size: 18px;
}

.ad-card-head h2 i {
    margin-left: 6px;
    color: var(--lime);
}

.ad-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 12px;
    font-weight: 500;
}

.ad-badge.is-soon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
}

.ad-table-wrap {
    overflow-x: auto;
}

.ad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ad-table th {
    padding: 12px 14px;
    color: var(--muted);
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.ad-table td {
    padding: 14px;
    color: var(--text-2);
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.ad-table tbody tr {
    transition: background 0.2s ease;
}

.ad-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.ad-table tbody tr:last-child td {
    border-bottom: none;
}

.ad-ltr {
    text-align: right;
    unicode-bidi: plaintext;
}

.ad-code {
    color: var(--lime);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
}

.ad-empty {
    padding: 40px 20px;
    color: var(--muted);
    text-align: center;
}

.ad-empty i {
    font-size: 34px;
    color: #444;
}

.ad-welcome {
    text-align: center;
    padding: 40px 24px;
}

.ad-welcome .ad-stat-icon {
    margin: 0 auto 14px;
}

.ad-welcome h2 {
    margin: 0;
}

.ad-welcome p {
    color: var(--muted);
}

.ad-overlay {
    display: none;
}

@media (max-width: 1199px) {
    .ad-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .ad-sidebar {
        transform: translateX(100%);
        transition: transform 0.45s var(--ease);
    }

    .ad-body.is-menu-open .ad-sidebar {
        transform: none;
    }

    .ad-overlay {
        position: fixed;
        inset: 0;
        z-index: 15;
        display: block;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    .ad-body.is-menu-open .ad-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .ad-main {
        margin-right: 0;
    }

    .ad-menu-btn {
        display: inline-flex;
    }
}

@media (max-width: 767px) {
    .ad-topbar {
        padding: 14px 16px;
    }

    .ad-topbar-title h1 {
        font-size: 18px;
    }

    .ad-ghost-btn span {
        display: none;
    }

    .ad-content {
        padding: 20px 16px 40px;
        gap: 16px;
    }

    .ad-stats {
        gap: 12px;
    }

    .ad-stat {
        padding: 16px;
    }

    .ad-stat-num {
        font-size: 26px;
    }

    .ad-card {
        padding: 18px;
        border-radius: 20px;
    }
}

/* ---------- shared admin controls ---------- */
.ad-nav-count {
    margin-right: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    color: var(--ink);
    font-size: 12px;
}

.ad-nav-item.is-active .ad-nav-count {
    background: var(--ink);
    color: var(--lime);
}

.ad-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--lime-soft);
    border: 1px solid rgba(214, 243, 69, 0.3);
    color: var(--lime);
    font-size: 14px;
}

.ad-flash.is-error {
    background: var(--danger-soft);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--danger);
}

.ad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid var(--lime);
    background: var(--lime);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ad-btn:hover {
    filter: brightness(1.08);
}

.ad-btn.is-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text-2);
}

.ad-btn.is-ghost:hover {
    border-color: var(--lime);
    color: var(--lime);
    filter: none;
}

.ad-btn.is-full {
    width: 100%;
}

.ad-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.ad-back:hover {
    color: var(--lime);
}

.ad-card.is-flush {
    padding: 6px;
}

.ad-card textarea,
.ad-filters input,
.ad-select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 14px;
    line-height: 1.8;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ad-card textarea:focus,
.ad-select:focus,
.ad-search:focus-within {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px var(--lime-soft);
}

/* status pill */
.ad-status {
    --c: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 100px;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    color: var(--c);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.is-new {
    --c: #d6f345;
}

.is-contacted {
    --c: #5ab0ff;
}

.is-negotiating {
    --c: #ffb547;
}

.is-won {
    --c: #3ddc97;
}

.is-lost {
    --c: #ff6b6b;
}

.is-spam {
    --c: #8a8a8a;
}

/* ---------- orders list ---------- */
.ad-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ad-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.ad-tabs::-webkit-scrollbar {
    display: none;
}

.ad-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 100px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ad-tab b {
    min-width: 22px;
    padding: 0 6px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.ad-tab:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.ad-tab.is-active {
    border-color: var(--c, var(--lime));
    background: color-mix(in srgb, var(--c, var(--lime)) 12%, var(--surface));
    color: var(--text);
}

.ad-tab.is-active b {
    background: var(--c, var(--lime));
    color: var(--ink);
}

.ad-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ad-search {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ad-search i {
    color: var(--muted);
}

.ad-filters .ad-search input {
    border: none;
    background: transparent;
    padding: 0;
    height: 44px;
    box-shadow: none;
}

.ad-select {
    flex: 0 1 220px;
    width: auto;
    height: 46px;
    padding: 0 14px;
    background: var(--surface);
    cursor: pointer;
}

.ad-table.is-clickable tbody tr {
    cursor: pointer;
}

.ad-table tr.is-new td:first-child {
    box-shadow: inset -3px 0 0 var(--lime);
}

.ad-person b,
.ad-person small {
    display: block;
}

.ad-person b {
    color: var(--text);
    font-weight: 500;
}

.ad-person small {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.ad-row-go {
    color: #555;
    transition: color 0.2s ease, transform 0.3s var(--ease);
}

.ad-table tbody tr:hover .ad-row-go {
    color: var(--lime);
    transform: translateX(-4px);
}

.ad-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--muted);
    font-size: 14px;
}

/* ---------- order details ---------- */
.ad-order-head {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ad-order-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    color: var(--ink);
    font-size: 22px;
}

.ad-order-title {
    flex: 1 1 auto;
    min-width: 0;
}

.ad-order-title h2 {
    margin: 2px 0 0;
    font-size: 22px;
}

.ad-code.is-big {
    font-size: 15px;
}

.ad-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.ad-split-main,
.ad-split-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.ad-answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.ad-answers div {
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--surface-2);
}

.ad-answers dt {
    color: var(--muted);
    font-size: 13px;
}

.ad-answers dd {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
}

.ad-quote {
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px dashed var(--line-strong);
}

.ad-quote span {
    color: var(--lime);
    font-size: 13px;
}

.ad-quote p {
    margin: 6px 0 0;
    color: var(--text-2);
    line-height: 1.9;
    white-space: pre-line;
}

.ad-note-form {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.ad-timeline {
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.ad-timeline li {
    position: relative;
    display: flex;
    gap: 14px;
    padding-bottom: 22px;
}

.ad-timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 40px;
    bottom: 2px;
    right: 17px;
    width: 2px;
    background: var(--line);
}

.ad-timeline .dot {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 14px;
}

.ad-timeline li.is-status .dot {
    background: var(--lime-soft);
    color: var(--lime);
}

.ad-timeline .body {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 6px;
}

.ad-timeline .meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    color: var(--muted);
    font-size: 14px;
}

.ad-timeline .meta b {
    color: var(--text);
    font-weight: 500;
}

.ad-timeline .meta em {
    color: var(--text-2);
    font-style: normal;
    font-weight: 700;
}

.ad-timeline .meta em[class*="is-"] {
    color: var(--c);
}

.ad-timeline time {
    margin-right: auto;
    font-size: 12px;
}

.ad-timeline p {
    margin: 8px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-line;
}

.ad-customer {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ad-customer b,
.ad-customer small {
    display: block;
}

.ad-customer small {
    color: var(--muted);
    text-align: right;
}

.ad-avatar.is-big {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 20px;
}

.ad-contact-btns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.ad-contact-btns .ad-btn {
    padding: 0 10px;
}

.ad-muted-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ad-muted-line .fa-circle-check {
    color: var(--lime);
}

.ad-status-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ad-status-pick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ad-status-pick input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ad-status-pick span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ad-status-pick span i {
    color: var(--c);
}

.ad-status-pick span:hover {
    border-color: var(--line-strong);
}

.ad-status-pick input:checked + span {
    border-color: var(--c);
    background: color-mix(in srgb, var(--c) 12%, transparent);
    color: var(--text);
    font-weight: 700;
}

.ad-status-pick input:focus-visible + span {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

.ad-next {
    display: flex;
    gap: 14px;
    border-style: dashed;
}

.ad-next .ad-stat-icon {
    flex: 0 0 auto;
    margin: 0;
}

.ad-next b {
    font-size: 15px;
}

.ad-next p {
    margin: 6px 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.ad-mini-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ad-mini-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-2);
    transition: background 0.2s ease;
}

.ad-mini-list a:hover {
    background: #26252a;
}

.ad-mini-list b,
.ad-mini-list small {
    display: block;
}

.ad-mini-list small {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1199px) {
    .ad-split {
        grid-template-columns: minmax(0, 1fr);
    }

    /* customer and status first: they are what you act on */
    .ad-split-side {
        order: -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

/* projects: the stages are the page, the side column follows them */
@media (max-width: 1199px) {
    .ad-split.is-main-first .ad-split-side {
        order: 0;
    }
}

@media (max-width: 767px) {
    .ad-split-side {
        display: flex;
        align-items: stretch;
    }

    .ad-answers {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-order-head {
        flex-wrap: wrap;
        gap: 12px;
    }

    .ad-order-icon {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .ad-order-title h2 {
        font-size: 18px;
    }

    .ad-select {
        flex: 1 1 100%;
    }

    /* the list becomes cards on phones */
    .ad-table.is-clickable thead {
        display: none;
    }

    .ad-table.is-clickable,
    .ad-table.is-clickable tbody {
        display: block;
    }

    .ad-table.is-clickable tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 6px 12px;
        padding: 14px;
        border-bottom: 1px solid var(--line);
    }

    .ad-table.is-clickable td {
        padding: 0;
        border: none;
    }

    .ad-table.is-clickable td:nth-child(5),
    .ad-table.is-clickable td:nth-child(6),
    .ad-table.is-clickable .ad-row-go {
        display: none;
    }

    .ad-table.is-clickable tr.is-new td:first-child {
        box-shadow: none;
    }

    .ad-table.is-clickable tr.is-new {
        box-shadow: inset -3px 0 0 var(--lime);
    }
}

/* ---------- forms ---------- */
.is-running {
    --c: #5ab0ff;
}

.is-paused {
    --c: #ffb547;
}

.ad-toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ad-toolbar-row .ad-tabs {
    flex: 1 1 auto;
    min-width: 0;
}

.ad-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ad-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ad-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ad-field.is-wide {
    grid-column: 1 / -1;
}

.ad-field > span {
    color: var(--text-2);
    font-size: 14px;
}

.ad-field > span small {
    color: var(--muted);
}

.ad-field input:not([type="radio"]):not([type="checkbox"]),
.ad-stage-edit input,
.ad-version-form input[type="url"],
.ad-pop-form input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ad-field input:focus,
.ad-stage-edit input:focus,
.ad-version-form input:focus,
.ad-pop-form input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px var(--lime-soft);
}

.ad-field input[dir="ltr"],
.ad-stage-edit input[dir="ltr"] {
    text-align: left;
}

.ad-field .ad-select {
    width: 100%;
    flex: none;
    background: var(--bg-deep);
}

.ad-money-words {
    min-height: 18px;
    color: var(--lime);
    font-size: 12px;
}

.ad-choice-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.ad-choice,
.ad-type-pick label,
.ad-status-pick label {
    position: relative;
}

.ad-choice input,
.ad-type-pick input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ad-choice span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-deep);
    color: var(--text-2);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ad-choice span i {
    color: var(--muted);
    font-size: 20px;
}

.ad-choice input:checked + span {
    border-color: var(--lime);
    background: var(--lime-soft);
    color: var(--text);
    font-weight: 700;
}

.ad-choice input:checked + span i {
    color: var(--lime);
}

.ad-choice input:focus-visible + span,
.ad-type-pick input:focus-visible + span {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

.ad-help {
    display: flex;
    gap: 8px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.ad-help i {
    margin-top: 4px;
    color: var(--lime);
}

.ad-warn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 181, 71, 0.1);
    color: #ffb547;
    font-size: 13px;
}

.ad-check-card {
    display: flex;
    gap: 14px;
    cursor: pointer;
}

.ad-check-card input {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    accent-color: var(--lime);
}

.ad-check-card b,
.ad-check-card small {
    display: block;
}

.ad-check-card small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.8;
}

.ad-form-actions {
    display: flex;
    justify-content: flex-start;
}

.ad-select.is-small {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
}

.ad-inline-select {
    margin: 0;
}

.ad-inline-select label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.ad-muted {
    color: var(--muted);
    font-size: 13px;
}

.ad-icon-btn.is-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.ad-icon-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ---------- project cards ---------- */
.ad-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.ad-project-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color 0.25s ease, transform 0.35s var(--ease);
}

.ad-project-card:hover {
    border-color: rgba(214, 243, 69, 0.4);
    transform: translateY(-3px);
}

.ad-project-card .top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-project-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
}

.ad-project-card .code {
    flex: 1 1 auto;
    color: var(--muted);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
    text-align: right;
}

.ad-project-card h3 {
    margin: 4px 0 0;
    font-size: 17px;
    line-height: 1.6;
}

.ad-project-card .who {
    color: var(--muted);
    font-size: 13px;
}

.ad-project-card .now {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 13px;
}

.ad-project-card .now > i {
    color: var(--lime);
}

.ad-project-card .now span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ad-project-card .now em {
    font-style: normal;
    font-size: 11px;
    padding: 3px 8px;
}

.ad-project-card .foot {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.ad-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-progress .bar {
    flex: 1 1 auto;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.ad-progress .bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--lime);
    transition: width 1s var(--ease);
}

.ad-progress b {
    color: var(--lime);
    font-size: 13px;
}

.ad-progress.is-big {
    margin-top: 20px;
}

.ad-progress.is-big .bar {
    height: 10px;
}

/* ---------- project page ---------- */
.ad-proj-head-top {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ad-proj-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-proj-actions .ad-select {
    border-color: var(--c, var(--line-strong));
    color: var(--c, var(--text));
}

.ad-facts {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0 0;
}

.ad-facts div {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-2);
    min-width: 0;
}

.ad-facts dt {
    color: var(--muted);
    font-size: 12px;
}

.ad-facts dd {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-facts dd small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.ad-template-cta {
    display: flex;
    gap: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 18px;
    border: 1px dashed rgba(214, 243, 69, 0.4);
    background: var(--lime-soft);
}

.ad-template-cta .ad-stat-icon {
    flex: 0 0 auto;
    margin: 0;
    background: var(--lime);
    color: var(--ink);
}

.ad-template-cta ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 16px;
    padding: 0;
    list-style: none;
}

.ad-template-cta li {
    padding: 5px 12px;
    border-radius: 100px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
}

.ad-template-cta li i {
    color: var(--lime);
    margin-left: 4px;
}

/* stage list */
.ad-stages {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ad-stage > details {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    transition: border-color 0.2s ease;
}

.ad-stage.is-current > details {
    border-color: var(--c);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 10%, transparent);
}

.ad-stage.is-skipped > details {
    opacity: 0.55;
}

.ad-stage.is-skipped .title b {
    text-decoration: line-through;
}

.ad-stage summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.ad-stage summary::-webkit-details-marker {
    display: none;
}

.ad-stage .num {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.ad-stage.is-won .num {
    background: var(--c);
    color: var(--ink);
}

.ad-stage .type-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--lime);
}

.ad-stage .title {
    flex: 1 1 auto;
    min-width: 0;
}

.ad-stage .title b,
.ad-stage .title small {
    display: block;
}

.ad-stage .title b {
    font-size: 15px;
}

.ad-stage .title small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.ad-stage .chev {
    color: var(--muted);
    font-size: 12px;
    transition: transform 0.3s var(--ease);
}

.ad-stage details[open] > summary .chev {
    transform: rotate(180deg);
}

.ad-stage-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 16px 16px;
}

.ad-stage-desc {
    margin: 0;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-line;
}

.ad-version {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.ad-version.is-latest {
    border-color: var(--line-strong);
}

.ad-version:not(.is-latest) {
    opacity: 0.75;
}

.ad-version-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13px;
}

.ad-version-head > span:not(.ad-status) {
    flex: 1 1 auto;
    color: var(--muted);
}

.ad-version-note {
    margin: 10px 0 0;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-line;
}

.ad-version-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-deep);
    color: var(--lime);
    font-size: 13px;
    overflow: hidden;
}

.ad-version-link span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ad-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.ad-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    min-width: 0;
    transition: border-color 0.2s ease;
}

.ad-file:hover {
    border-color: var(--lime);
}

.ad-file > i {
    font-size: 22px;
    color: var(--lime);
}

.ad-file img {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 8px;
    object-fit: cover;
}

.ad-file span {
    min-width: 0;
}

.ad-file b,
.ad-file small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ad-file b {
    font-size: 13px;
    font-weight: 500;
}

.ad-file small {
    color: var(--muted);
    font-size: 11px;
}

.ad-quote.is-customer {
    border-style: solid;
    border-color: rgba(255, 107, 107, 0.3);
    background: var(--danger-soft);
}

.ad-quote.is-customer span {
    color: var(--danger);
}

.ad-subform > summary {
    list-style: none;
    cursor: pointer;
}

.ad-subform > summary::-webkit-details-marker {
    display: none;
}

.ad-subform[open] > summary.ad-btn {
    border-color: var(--lime);
    color: var(--lime);
}

.ad-version-form,
.ad-stage-edit,
.ad-stage-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.ad-version-form .ad-btn,
.ad-stage-edit .ad-btn,
.ad-stage-form > .ad-btn {
    align-self: flex-start;
}

.ad-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 16px;
    border-radius: 14px;
    border: 1.5px dashed var(--line-strong);
    background: var(--bg-deep);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ad-drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ad-drop > i {
    color: var(--lime);
    font-size: 26px;
}

.ad-drop b {
    font-size: 14px;
    font-weight: 500;
}

.ad-drop small {
    color: var(--muted);
    font-size: 12px;
}

.ad-drop.is-over,
.ad-drop:hover,
.ad-drop.has-files {
    border-color: var(--lime);
    background: #16170f;
}

.ad-drop-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.ad-drop-list span {
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 12px;
}

.ad-stage-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.ad-stage-tools form {
    margin: 0;
}

.ad-stage-tools > .ad-inline-select {
    margin-left: auto;
}

.ad-subform.is-inline[open] {
    flex: 1 1 100%;
    order: 10;
}

.ad-subform.is-inline[open] > summary {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink);
}

.ad-add-stage {
    margin-top: 16px;
}

.ad-add-stage > summary {
    list-style: none;
    border-style: dashed;
}

.ad-add-stage > summary::-webkit-details-marker {
    display: none;
}

.ad-add-stage[open] > summary {
    display: none;
}

.ad-stage-form {
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed rgba(214, 243, 69, 0.4);
}

.ad-type-pick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ad-type-pick span {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-deep);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ad-type-pick span i {
    color: var(--muted);
    font-size: 18px;
}

.ad-type-pick span b {
    font-size: 14px;
}

.ad-type-pick span small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.ad-type-pick input:checked + span {
    border-color: var(--lime);
    background: var(--lime-soft);
}

.ad-type-pick input:checked + span i {
    color: var(--lime);
}

.ad-timeline.is-compact li {
    gap: 10px;
    padding-bottom: 16px;
}

.ad-timeline.is-compact .dot {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 12px;
}

.ad-timeline.is-compact li:not(:last-child)::before {
    top: 34px;
    right: 14px;
}

.ad-timeline.is-compact .meta {
    font-size: 13px;
}

.ad-timeline p.is-internal {
    border-right: 3px solid #ffb547;
}

/* ---------- users ---------- */
.ad-roles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ad-roles div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.ad-roles i {
    color: var(--lime);
    font-size: 18px;
    margin-bottom: 6px;
}

.ad-roles small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.ad-person-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-person-inline .ad-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
}

.ad-row-actions {
    position: relative;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.ad-row-actions form {
    margin: 0;
}

.ad-pop-form {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 5;
    display: flex;
    gap: 8px;
    width: 340px;
    padding: 10px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Jalali date picker ---------- */
.jd-pop {
    position: absolute;
    z-index: 50;
    width: 280px;
    padding: 12px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
    font-family: IRANSans, Tahoma, sans-serif;
    direction: rtl;
}

.jd-pop button {
    border: none;
    background: none;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
}

.jd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.jd-head b {
    font-size: 14px;
}

.jd-head button {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--muted);
}

.jd-head button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--lime);
}

.jd-days,
.jd-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.jd-days span {
    padding: 4px 0;
    color: var(--muted);
    font-size: 12px;
}

.jd-grid button {
    height: 34px;
    border-radius: 10px;
    font-size: 13px;
}

.jd-grid button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.jd-grid button.is-friday {
    color: #ff8f8f;
}

.jd-grid button.is-today {
    box-shadow: inset 0 0 0 1px var(--lime);
}

.jd-grid button.is-selected {
    background: var(--lime);
    color: var(--ink);
    font-weight: 700;
}

.jd-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.jd-foot button {
    padding: 4px 10px;
    border-radius: 8px;
    color: var(--lime);
    font-size: 13px;
}

.jd-foot button:hover {
    background: var(--lime-soft);
}

@media (max-width: 1199px) {
    .ad-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ad-choice-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ad-type-pick {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ad-fields,
    .ad-roles {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ad-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ad-proj-head-top {
        flex-wrap: wrap;
    }

    .ad-proj-actions {
        width: 100%;
    }

    .ad-proj-actions form {
        flex: 1 1 auto;
    }

    .ad-proj-actions .ad-select {
        width: 100%;
    }

    .ad-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ad-project-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-stage summary {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ad-stage .title {
        flex-basis: calc(100% - 130px);
    }

    .ad-stage summary .ad-status {
        margin-right: 40px;
    }

    .ad-stage .chev {
        margin-right: auto;
    }

    .ad-type-pick {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-template-cta {
        flex-direction: column;
    }

    .ad-pop-form {
        width: 260px;
        flex-direction: column;
    }
}

/* ---------- stage conversation (admin) ---------- */
.ad-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
}

.ad-check-inline input {
    width: 18px;
    height: 18px;
    accent-color: var(--lime);
}

.ad-check-inline i {
    color: var(--lime);
}

.ad-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ad-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
}

.ad-msg .who {
    color: var(--muted);
    font-size: 11px;
}

.ad-msg p {
    margin: 4px 0 0;
    line-height: 1.9;
    white-space: pre-line;
}

.ad-msg.is-customer {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-top-right-radius: 4px;
}

.ad-msg.is-team {
    align-self: flex-end;
    background: var(--lime-soft);
    border: 1px solid rgba(214, 243, 69, 0.25);
    border-top-left-radius: 4px;
}

.ad-thread-form {
    display: flex;
    gap: 8px;
}

.ad-thread-form input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.ad-thread-form input:focus {
    border-color: var(--lime);
}

/* =====================================================================
   CUSTOMER PROFILE (cp-*)
   ===================================================================== */
.cp-body {
    position: relative;
    min-height: 100vh;
    background: var(--bg);
    overflow-x: hidden;
}

.cp-glow {
    position: fixed;
    top: -260px;
    left: 50%;
    z-index: 0;
    width: 900px;
    height: 520px;
    margin-left: -450px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(214, 243, 69, 0.13), transparent 65%);
    pointer-events: none;
}

.cp-wrap {
    position: relative;
    z-index: 1;
    width: min(1180px, 100% - 32px);
    margin: 0 auto;
}

/* top bar */
.cp-top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(17, 17, 17, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.cp-top-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 76px;
}

.cp-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.cp-logo b,
.cp-logo small {
    display: block;
}

.cp-logo b {
    font-size: 16px;
}

.cp-logo small {
    color: var(--muted);
    font-size: 12px;
}

.cp-nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.cp-nav a,
.cp-nav button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 100px;
    border: none;
    background: none;
    color: var(--text-2);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.cp-nav a:hover,
.cp-nav button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.cp-nav a.is-active {
    background: var(--lime);
    color: var(--ink);
    font-weight: 700;
}

.cp-nav-logout {
    margin: 0;
}

.cp-me {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    color: var(--ink);
    font-weight: 700;
}

.cp-avatar.is-big {
    width: 76px;
    height: 76px;
    margin: 0 auto 16px;
    border-radius: 24px;
    font-size: 30px;
}

.cp-me-text b,
.cp-me-text small {
    display: block;
}

.cp-me-text b {
    font-size: 14px;
}

.cp-me-text small {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.cp-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 34px 0 60px;
}

.cp-foot {
    padding: 24px 0 40px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.cp-foot a {
    color: var(--lime);
}

.cp-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--lime-soft);
    border: 1px solid rgba(214, 243, 69, 0.3);
    color: var(--lime);
    font-size: 14px;
}

.cp-flash.is-error {
    background: var(--danger-soft);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--danger);
}

/* shared bits */
.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    border-radius: 100px;
    border: 1px solid var(--lime);
    background: var(--lime);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease, background 0.2s ease, color 0.2s ease;
}

.cp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(214, 243, 69, 0.2);
}

.cp-btn.is-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text);
}

.cp-btn.is-ghost:hover {
    border-color: var(--lime);
    color: var(--lime);
    box-shadow: none;
}

.cp-btn.is-dark {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--lime);
}

.cp-btn.is-full {
    width: 100%;
}

.cp-btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.cp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--lime);
    font-size: 14px;
    cursor: pointer;
}

.cp-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.cp-back:hover {
    color: var(--lime);
}

.cp-muted {
    display: flex;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.cp-muted i {
    margin-top: 5px;
    color: var(--lime);
}

.cp-chip {
    --c: var(--muted);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 100px;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    color: var(--c);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.is-wait {
    --c: #d6f345;
}

.is-work {
    --c: #5ab0ff;
}

.is-done {
    --c: #3ddc97;
}

.is-soon {
    --c: #7a7a7a;
}

.cp-card {
    padding: 24px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.cp-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 16px;
}

.cp-card h3 i {
    color: var(--lime);
}

.cp-h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 20px;
}

.cp-h2 i {
    color: var(--lime);
}

/* progress ring */
.cp-ring {
    position: relative;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
}

.cp-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg) scaleY(-1);
}

.cp-ring circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 6;
}

.cp-ring circle.bar {
    stroke: var(--lime);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--p));
}

.cp-ring b {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.cp-ring b small {
    font-size: 10px;
    color: var(--muted);
}

/* ---------- home ---------- */
.cp-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 12% 120%, rgba(214, 243, 69, 0.22), transparent 45%),
        var(--surface);
    border: 1px solid var(--line);
}

.cp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.cp-eyebrow .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 12px rgba(214, 243, 69, 0.7);
}

.cp-hero h1 {
    margin: 8px 0 6px;
    font-size: 36px;
}

.cp-hero p {
    margin: 0;
    max-width: 560px;
    color: var(--text-2);
    font-size: 16px;
    line-height: 1.9;
}

.cp-hero p b {
    color: var(--lime);
}

.cp-hero-stats {
    display: flex;
    gap: 10px;
}

.cp-hero-stats div {
    min-width: 116px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    text-align: center;
}

.cp-hero-stats b {
    display: block;
    font-size: 30px;
    line-height: 1.3;
}

.cp-hero-stats span {
    color: var(--muted);
    font-size: 13px;
}

.cp-hero-stats .is-hot {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink);
}

.cp-hero-stats .is-hot span {
    color: rgba(23, 22, 25, 0.7);
}

.cp-nudge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 18px;
    border: 1px dashed rgba(214, 243, 69, 0.45);
    background: var(--lime-soft);
}

.cp-nudge > i:first-child {
    color: var(--lime);
    font-size: 20px;
}

.cp-nudge span {
    flex: 1 1 auto;
}

.cp-nudge b,
.cp-nudge small {
    display: block;
}

.cp-nudge small {
    color: var(--muted);
    font-size: 13px;
}

.cp-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
}

.cp-action {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: var(--lime);
    color: var(--ink);
    overflow: hidden;
    transition: transform 0.35s var(--ease), box-shadow 0.35s ease;
}

.cp-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(214, 243, 69, 0.2);
}

.cp-action .icon {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--lime);
    font-size: 20px;
}

.cp-action .text {
    flex: 1 1 auto;
    min-width: 0;
}

.cp-action .text small,
.cp-action .text b,
.cp-action .text em {
    display: block;
}

.cp-action .text small {
    opacity: 0.7;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cp-action .text b {
    font-size: 16px;
}

.cp-action .text em {
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.cp-action .go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 100px;
    background: var(--ink);
    color: var(--lime);
    font-size: 12px;
    font-weight: 700;
}

.cp-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.cp-project {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color 0.3s ease, transform 0.35s var(--ease);
}

.cp-project:hover {
    border-color: rgba(214, 243, 69, 0.4);
    transform: translateY(-3px);
}

.cp-project .head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cp-project .icon {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 18px;
}

.cp-project .meta {
    flex: 1 1 auto;
    min-width: 0;
}

.cp-project .meta small,
.cp-project .meta b {
    display: block;
}

.cp-project .meta small {
    color: var(--muted);
    font-size: 12px;
}

.cp-project .meta b {
    font-size: 17px;
    line-height: 1.6;
}

.cp-project .now {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-2);
    font-size: 14px;
}

.cp-project .now > i {
    color: var(--c, var(--lime));
}

.cp-project .now span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cp-project .now em {
    color: var(--c);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.cp-project .steps {
    display: flex;
    gap: 4px;
}

.cp-project .steps span {
    flex: 1 1 0;
    height: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
}

.cp-project .steps span.is-done {
    background: var(--c);
}

.cp-project .steps span.is-wait,
.cp-project .steps span.is-work {
    background: var(--c);
    opacity: 0.8;
    animation: cpPulse 1.6s ease-in-out infinite;
}

@keyframes cpPulse {
    50% {
        opacity: 0.35;
    }
}

.cp-empty {
    padding: 50px 24px;
    border-radius: 26px;
    border: 1px dashed var(--line-strong);
    text-align: center;
}

.cp-empty .icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 26px;
}

.cp-empty h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.cp-empty p {
    margin: 0 auto 22px;
    max-width: 440px;
    color: var(--muted);
    line-height: 1.9;
}

.cp-orders {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cp-order {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.cp-order .icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--lime);
}

.cp-order .text {
    flex: 1 1 auto;
    min-width: 0;
}

.cp-order .text b,
.cp-order .text small {
    display: block;
}

.cp-order .text small {
    color: var(--muted);
    font-size: 12px;
}

/* ---------- project page ---------- */
.cp-proj-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px 24px;
    padding: 28px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 0% 0%, rgba(214, 243, 69, 0.14), transparent 40%),
        var(--surface);
    border: 1px solid var(--line);
}

.cp-proj-head .cp-ring {
    width: 96px;
    height: 96px;
}

.cp-proj-head .cp-ring b {
    font-size: 22px;
}

.cp-proj-title {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.cp-proj-title .icon {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    color: var(--ink);
    font-size: 24px;
}

.cp-proj-title small {
    color: var(--muted);
    font-size: 13px;
}

.cp-proj-title h1 {
    margin: 2px 0 0;
    font-size: 28px;
    line-height: 1.5;
}

.cp-facts {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.cp-facts div {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--line);
}

.cp-facts .is-wide {
    grid-column: 1 / -1;
}

.cp-facts dt {
    color: var(--muted);
    font-size: 12px;
}

.cp-facts dd {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 500;
}

.cp-pay-bar {
    display: block;
    height: 8px;
    margin: 6px 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.cp-pay-bar span {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: #3ddc97;
}

.cp-proj-desc {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--text-2);
    line-height: 1.9;
    white-space: pre-line;
}

.cp-proj-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.cp-side {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* timeline */
.cp-timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cp-timeline::before {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 24px;
    right: 21px;
    width: 2px;
    background: var(--line);
    transform: scaleY(var(--rail, 1));
    transform-origin: top center;
}

.cp-stage {
    position: relative;
    display: flex;
    gap: 16px;
}

.cp-node {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin-top: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 2px solid var(--line-strong);
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
}

.cp-stage.is-done .cp-node {
    background: #3ddc97;
    border-color: #3ddc97;
    color: var(--ink);
}

.cp-stage.is-wait .cp-node {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink);
    box-shadow: 0 0 0 0 rgba(214, 243, 69, 0.5);
    animation: cpNode 1.8s ease-out infinite;
}

.cp-stage.is-work .cp-node {
    border-color: #5ab0ff;
    color: #5ab0ff;
}

@keyframes cpNode {
    to {
        box-shadow: 0 0 0 14px rgba(214, 243, 69, 0);
    }
}

.cp-stage-card {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color 0.25s ease;
}

.cp-stage.is-wait .cp-stage-card {
    border-color: rgba(214, 243, 69, 0.55);
    box-shadow: 0 0 0 5px rgba(214, 243, 69, 0.06);
}

.cp-stage.is-soon:not(.is-current) .cp-stage-card {
    opacity: 0.7;
}

.cp-stage-card > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    list-style: none;
    cursor: pointer;
}

.cp-stage-card > summary::-webkit-details-marker {
    display: none;
}

.cp-stage-card .type {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--lime);
}

.cp-stage-card .title {
    flex: 1 1 auto;
    min-width: 0;
}

.cp-stage-card .title b,
.cp-stage-card .title small {
    display: block;
}

.cp-stage-card .title b {
    font-size: 16px;
}

.cp-stage-card .title small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.cp-stage-card .chev {
    color: var(--muted);
    font-size: 12px;
    transition: transform 0.3s var(--ease);
}

.cp-stage-card[open] > summary .chev {
    transform: rotate(180deg);
}

.cp-stage-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 18px 18px;
}

.cp-stage-desc {
    margin: 0;
    color: var(--text-2);
    line-height: 1.9;
    white-space: pre-line;
}

.cp-version {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.cp-version-head {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.cp-version-head span {
    color: var(--muted);
    font-size: 12px;
}

.cp-version-note {
    margin: 0;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-line;
}

.cp-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--lime-soft);
    border: 1px solid rgba(214, 243, 69, 0.3);
    transition: background 0.2s ease;
}

.cp-link-card:hover {
    background: rgba(214, 243, 69, 0.18);
}

.cp-link-card > i {
    color: var(--lime);
    font-size: 22px;
}

.cp-link-card span {
    min-width: 0;
}

.cp-link-card b,
.cp-link-card small {
    display: block;
}

.cp-link-card small {
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: right;
}

.cp-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.cp-shot {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.cp-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.cp-shot span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: var(--lime);
    font-size: 22px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cp-shot:hover img {
    transform: scale(1.06);
}

.cp-shot:hover span {
    opacity: 1;
}

.cp-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    min-width: 0;
    transition: border-color 0.2s ease;
}

.cp-file:hover {
    border-color: var(--lime);
}

.cp-file > i:first-child {
    color: var(--lime);
    font-size: 24px;
}

.cp-file > i:last-child {
    margin-right: auto;
    color: var(--muted);
}

.cp-file span {
    min-width: 0;
}

.cp-file b,
.cp-file small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cp-file b {
    font-size: 13px;
    font-weight: 500;
}

.cp-file small {
    color: var(--muted);
    font-size: 11px;
}

.cp-result {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
}

.cp-result.is-ok {
    background: rgba(61, 220, 151, 0.1);
    color: #3ddc97;
}

.cp-result.is-changes {
    flex-direction: column;
    align-items: stretch;
    background: rgba(90, 176, 255, 0.08);
    color: #5ab0ff;
}

.cp-result.is-changes p {
    margin: 4px 0 0;
    color: var(--text-2);
    line-height: 1.9;
    white-space: pre-line;
}

.cp-decide {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(214, 243, 69, 0.12), rgba(214, 243, 69, 0.03));
    border: 1px solid rgba(214, 243, 69, 0.35);
}

.cp-decide-hint {
    display: flex;
    gap: 8px;
    margin: 0;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.9;
}

.cp-decide-hint i {
    margin-top: 5px;
    color: var(--lime);
}

.cp-decide-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cp-decide-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cp-decide-form textarea,
.cp-field input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.9;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cp-decide-form textarea:focus,
.cp-field input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px var(--lime-soft);
}

.cp-decide-form .cp-btn {
    align-self: flex-start;
}

.cp-history > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
}

.cp-history > summary::-webkit-details-marker {
    display: none;
}

.cp-old-version {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
}

.cp-old-version b {
    color: var(--text);
}

.cp-old-version a {
    color: var(--lime);
}

.cp-old-version p {
    flex: 1 1 100%;
    margin: 0;
    white-space: pre-line;
}

.cp-invoice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cp-invoice > div {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.cp-invoice small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.cp-invoice b {
    font-size: 18px;
}

.cp-invoice em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.cp-invoice > p {
    grid-column: 1 / -1;
}

/* conversation */
.cp-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.cp-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
}

.cp-msg .who {
    font-size: 11px;
    opacity: 0.7;
}

.cp-msg p {
    margin: 3px 0 0;
    line-height: 1.9;
    white-space: pre-line;
}

.cp-msg.is-me {
    align-self: flex-start;
    background: var(--lime);
    color: var(--ink);
    border-top-right-radius: 4px;
}

.cp-msg.is-team {
    align-self: flex-end;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-top-left-radius: 4px;
}

.cp-thread-form {
    display: flex;
    gap: 8px;
}

.cp-thread-form input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    padding: 0 16px;
    border-radius: 100px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.cp-thread-form input:focus {
    border-color: var(--lime);
}

.cp-thread-form button {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: none;
    background: var(--lime);
    color: var(--ink);
    cursor: pointer;
}

/* side */
.cp-feed {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cp-feed li {
    display: flex;
    gap: 10px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
}

.cp-feed li > i {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--lime);
    font-size: 12px;
}

.cp-feed b {
    color: var(--text);
    font-weight: 500;
}

.cp-feed em {
    color: var(--text-2);
    font-style: normal;
}

.cp-feed time {
    display: block;
    font-size: 11px;
}

.cp-help {
    text-align: center;
}

.cp-help .icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 20px;
}

.cp-help p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
}

/* contract modal */
.cp-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cp-modal[hidden] {
    display: none;
}

.cp-modal-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 32px 26px 26px;
    border-radius: 28px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    text-align: center;
}

.cp-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.cp-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    color: var(--ink);
    font-size: 26px;
}

.cp-modal-card h3 {
    margin: 0;
    font-size: 22px;
}

.cp-modal-text {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.cp-otp {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.cp-otp input {
    flex: 1 1 0;
    min-width: 0;
    height: 62px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.cp-otp input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px var(--lime-soft);
}

.cp-otp.is-invalid input {
    border-color: var(--danger);
}

.cp-modal-error {
    min-height: 24px;
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 13px;
}

.cp-agree {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 16px;
    color: var(--text-2);
    font-size: 14px;
    text-align: right;
    cursor: pointer;
}

.cp-agree input {
    width: 20px;
    height: 20px;
    accent-color: var(--lime);
}

.cp-modal-resend {
    margin-top: 14px;
}

.cp-modal-timer {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

/* profile */
.cp-profile {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.cp-profile h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.cp-profile .cp-muted {
    justify-content: center;
}

.cp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    text-align: right;
}

.cp-field span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-2);
    font-size: 14px;
}

.cp-field input {
    height: 52px;
}

.cp-field input:disabled {
    opacity: 0.6;
    text-align: left;
}

.cp-field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.cp-form .cp-btn {
    align-self: flex-start;
}

.cp-since {
    margin-top: 22px;
}

/* confetti */
.cp-confetti {
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
    overflow: hidden;
}

.cp-confetti i {
    position: absolute;
    top: -20px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
}

@media (max-width: 991px) {
    .cp-proj-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .cp-side {
        position: static;
    }

    .cp-me-text {
        display: none;
    }
}

@media (max-width: 767px) {
    /* backdrop-filter would make the header the containing block of the fixed bottom bar */
    .cp-top {
        background: #141414;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .cp-top-inner {
        height: 64px;
    }

    /* the menu becomes an app-like bar at the bottom */
    .cp-nav {
        position: fixed;
        right: 12px;
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 30;
        justify-content: space-around;
        padding: 6px;
        border-radius: 22px;
        background: rgba(31, 30, 34, 0.92);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid var(--line-strong);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    }

    .cp-nav a,
    .cp-nav button {
        flex-direction: column;
        gap: 2px;
        padding: 8px 10px;
        border-radius: 16px;
        font-size: 11px;
    }

    .cp-nav i {
        font-size: 17px;
    }

    .cp-me {
        margin-right: auto;
    }

    .cp-main {
        padding: 22px 0 40px;
        gap: 22px;
    }

    .cp-foot {
        padding-bottom: 110px;
    }

    .cp-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
        border-radius: 24px;
    }

    .cp-hero h1 {
        font-size: 28px;
    }

    .cp-hero-stats div {
        flex: 1 1 0;
        min-width: 0;
    }

    .cp-actions,
    .cp-projects {
        grid-template-columns: minmax(0, 1fr);
    }

    .cp-action {
        flex-wrap: wrap;
    }

    .cp-action .go {
        width: 100%;
        justify-content: center;
    }

    .cp-proj-head {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 20px;
        border-radius: 24px;
    }

    .cp-proj-head .cp-ring {
        width: 72px;
        height: 72px;
    }

    .cp-proj-title .icon {
        display: none;
    }

    .cp-proj-title h1 {
        font-size: 21px;
    }

    .cp-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-timeline::before {
        right: 15px;
    }

    .cp-stage {
        gap: 10px;
    }

    .cp-node {
        width: 32px;
        height: 32px;
        margin-top: 14px;
        font-size: 13px;
    }

    .cp-stage-card > summary {
        flex-wrap: wrap;
        padding: 14px;
    }

    .cp-stage-card .type {
        display: none;
    }

    .cp-stage-card .title {
        flex-basis: calc(100% - 40px);
    }

    .cp-stage-body {
        padding: 0 14px 14px;
    }

    .cp-decide-btns .cp-btn {
        flex: 1 1 100%;
    }

    .cp-invoice {
        grid-template-columns: minmax(0, 1fr);
    }

    .cp-order {
        flex-wrap: wrap;
    }

    .cp-order .cp-chip {
        white-space: normal;
    }

    .cp-otp {
        gap: 6px;
    }
}

/* =====================================================================
   PAY PAGE (py-*)
   ===================================================================== */
.py-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 40px 16px 30px;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(214, 243, 69, 0.14), transparent 55%),
        var(--bg);
}

.py-card {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 30px;
    border-radius: 32px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}

.py-invoice {
    position: relative;
    padding: 24px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(214, 243, 69, 0.2), transparent 50%),
        var(--surface-2);
    border: 1px solid var(--line);
    text-align: center;
    overflow: hidden;
}

/* ticket-style cut-outs */
.py-invoice::before,
.py-invoice::after {
    content: "";
    position: absolute;
    bottom: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
}

.py-invoice::before {
    right: -14px;
}

.py-invoice::after {
    left: -14px;
}

.py-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 100px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 13px;
    font-weight: 700;
}

.py-invoice h1 {
    margin: 14px 0 4px;
    font-size: 24px;
}

.py-sub {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.py-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.py-amount b {
    color: var(--lime);
    font-size: 44px;
    line-height: 1.2;
}

.py-amount span {
    color: var(--text-2);
    font-size: 16px;
}

.py-due {
    margin: 10px 0 0;
    color: var(--text-2);
    font-size: 14px;
}

.py-due i {
    color: var(--lime);
}

.py-alert {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 14px;
    line-height: 1.8;
}

.py-alert i {
    margin-top: 4px;
}

.py-alert.is-error {
    background: var(--danger-soft);
    color: var(--danger);
}

.py-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    grid-auto-flow: column;
    gap: 10px;
}

.py-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text-2);
    text-align: right;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.py-method > i {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 17px;
}

.py-method b,
.py-method small {
    display: block;
}

.py-method b {
    color: var(--text);
    font-size: 14px;
}

.py-method small {
    color: var(--muted);
    font-size: 11px;
}

.py-method.is-active {
    border-color: var(--lime);
    background: var(--lime-soft);
}

.py-method.is-active > i {
    background: var(--lime);
    color: var(--ink);
}

.py-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.py-hint {
    display: flex;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.py-hint i {
    margin-top: 4px;
    color: var(--lime);
}

.py-bank {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #22211f, #171619);
    border: 1px solid var(--line-strong);
}

.py-bank-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.py-bank-row small {
    grid-column: 1;
    color: var(--muted);
    font-size: 12px;
}

.py-bank-row b {
    grid-column: 1;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 16px;
    letter-spacing: 0.5px;
    text-align: right;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.py-copy {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 100px;
    border: 1px solid var(--line-strong);
    background: none;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.py-copy:hover,
.py-copy.is-done {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink);
}

.py-holder {
    margin: 2px 4px 0;
    color: var(--muted);
    font-size: 13px;
}

.py-holder b {
    color: var(--text);
}

.py-holder i {
    color: var(--lime);
    margin-left: 4px;
}

.py-receipt {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.py-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 16px;
    border-radius: 18px;
    border: 1.5px dashed var(--line-strong);
    background: var(--bg);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.py-drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.py-drop i {
    color: var(--lime);
    font-size: 24px;
}

.py-drop b {
    font-size: 14px;
    font-weight: 500;
}

.py-drop small {
    color: var(--muted);
    font-size: 12px;
}

.py-drop:hover,
.py-drop.has-file {
    border-color: var(--lime);
}

.py-drop.has-file small {
    color: var(--lime);
}

.py-input {
    height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.py-input:focus {
    border-color: var(--lime);
}

.py-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px 4px;
    text-align: center;
}

.py-state h2 {
    margin: 8px 0 0;
    font-size: 21px;
}

.py-state p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.py-state p a {
    color: var(--lime);
}

.py-state .au-btn {
    margin-top: 14px;
}

.py-state-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 26px;
}

.py-check {
    width: 96px;
    height: 96px;
}

.py-check svg {
    width: 100%;
    height: 100%;
}

.py-check circle {
    fill: rgba(61, 220, 151, 0.12);
    stroke: #3ddc97;
    stroke-width: 3;
}

.py-check path {
    fill: none;
    stroke: #3ddc97;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.py-foot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.py-foot i {
    color: var(--lime);
}

@media (max-width: 575px) {
    .py-card {
        padding: 18px;
        border-radius: 26px;
    }

    .py-amount b {
        font-size: 36px;
    }

    .py-methods {
        grid-auto-flow: row;
    }

    .py-bank-row b {
        font-size: 13px;
        letter-spacing: 0;
    }

    .py-copy span {
        display: none;
    }
}

/* ---------- admin payments ---------- */
.ad-pay-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ad-pay {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 20px;
    align-items: start;
}

.ad-pay-main {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.ad-pay-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 18px;
}

.ad-pay-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ad-pay-amount {
    font-size: 22px;
}

.ad-pay-amount small {
    color: var(--muted);
    font-size: 13px;
}

.ad-pay-info > span {
    color: var(--text-2);
    font-size: 14px;
}

.ad-pay-info > span a {
    color: var(--lime);
}

.ad-pay-info > small {
    color: var(--muted);
    font-size: 12px;
}

.ad-pay-note {
    margin: 6px 0 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 13px;
}

.ad-pay-note.is-bad {
    background: var(--danger-soft);
    color: var(--danger);
}

.ad-receipt {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 150px;
    height: 150px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    overflow: hidden;
    color: var(--lime);
}

.ad-receipt img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-receipt i {
    font-size: 28px;
}

.ad-receipt span {
    display: none;
}

.ad-pay-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.ad-pay-actions form {
    margin: 0;
}

.ad-pay-actions .ad-subform[open] {
    flex: 1 1 100%;
}

.ad-pay-actions .ad-thread-form {
    margin-top: 10px;
}

.ad-pay-stage {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.ad-pay-stage form {
    margin: 0;
}

.ad-pay-stage .ad-help {
    margin: 0;
}

.ad-pay-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 12px;
    border-radius: 12px;
    background: var(--bg-deep);
    color: var(--muted);
    font-size: 12px;
}

.ad-pay-link > i {
    color: var(--lime);
    margin-right: 6px;
}

.ad-pay-link span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: right;
}

.ad-pay-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    color: var(--text-2);
    font-size: 13px;
}

.ad-pay-row a {
    color: var(--lime);
}

@media (max-width: 767px) {
    .ad-pay {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-receipt {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        height: 200px;
    }

    .ad-pay-main {
        flex-wrap: wrap;
    }
}

.cp-invoice > .cp-pay-btn,
.cp-invoice > .cp-result {
    grid-column: 1 / -1;
}

.cp-pay-btn {
    height: 56px;
    font-size: 16px;
}

/* ---------- confirm dialog (admin) ---------- */
.ad-confirm {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ad-confirm-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 24px 22px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    text-align: center;
}

.ad-confirm-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 24px;
}

.ad-confirm-card p {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.9;
}

.ad-confirm-btns {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.ad-confirm-btns .ad-btn {
    flex: 1 1 0;
    height: 48px;
}

.ad-confirm.is-danger .ad-confirm-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.ad-confirm.is-danger [data-ok] {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

/* ---------- customer activity that needs a look ---------- */
.ad-nav-count.is-alert {
    background: #ff8a3d;
    color: #1a1208;
    box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.6);
    animation: adAlert 1.8s ease-out infinite;
}

@keyframes adAlert {
    to {
        box-shadow: 0 0 0 8px rgba(255, 138, 61, 0);
    }
}

.ad-news-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(255, 138, 61, 0.14);
    color: #ff9a55;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.ad-news-pill .pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff8a3d;
}

.ad-news-pill .pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid #ff8a3d;
    animation: blPulse 1.6s ease-out infinite;
}

@keyframes blPulse {
    from {
        transform: scale(0.4);
        opacity: 1;
    }

    to {
        transform: scale(1.6);
        opacity: 0;
    }
}

.ad-news-pill.is-small {
    padding: 3px 10px;
    font-size: 11px;
}

.ad-project-card.has-news {
    border-color: rgba(255, 138, 61, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.07);
}

.ad-new-tag {
    padding: 1px 8px;
    border-radius: 100px;
    background: #ff8a3d;
    color: #1a1208 !important;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.ad-timeline li.is-new-event .dot {
    background: rgba(255, 138, 61, 0.16);
    color: #ff9a55;
}

.ad-timeline li.is-new-event p {
    border-right: 3px solid #ff8a3d;
}

.ad-msg.is-new {
    border-color: rgba(255, 138, 61, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.1);
}

.ad-news-card {
    border-color: rgba(255, 138, 61, 0.35);
}

.ad-news-card .ad-card-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-news-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff8a3d;
    box-shadow: 0 0 12px rgba(255, 138, 61, 0.8);
}

.ad-news-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ad-news-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-2);
    transition: background 0.2s ease;
}

.ad-news-list a:hover {
    background: #26252a;
}

.ad-news-list .icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 138, 61, 0.14);
    color: #ff9a55;
}

.ad-news-list .text {
    flex: 1 1 auto;
    min-width: 0;
}

.ad-news-list .text b,
.ad-news-list .text small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ad-news-list .text b {
    font-size: 14px;
    font-weight: 700;
}

.ad-news-list .text b span {
    color: var(--text-2);
    font-weight: 400;
}

.ad-news-list .text small {
    color: var(--muted);
    font-size: 12px;
}

.ad-news-list time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
}

/* ===============================================================
   blog: article list and editor (/admin/blog)
   =============================================================== */
.is-draft {
    --c: #8a8a8a;
}

.is-review {
    --c: #ffb547;
}

.is-published {
    --c: #3ddc97;
}

.is-scheduled {
    --c: #5ab0ff;
}

.ad-article-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 280px;
}

.ad-article-thumb {
    flex: none;
    display: grid;
    place-items: center;
    width: 72px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    color: var(--muted);
}

.ad-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-article-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ad-article-text b {
    color: var(--text);
    font-weight: 700;
    line-height: 1.7;
}

.ad-article-text small {
    max-width: 360px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-article-text .ad-article-note {
    color: #ffb547;
    white-space: normal;
}

.ad-feature-star {
    margin-right: 6px;
    color: var(--lime);
    font-size: 13px;
}

.ad-fields.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.ad-choice-grid.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ad-choice-grid.is-compact span {
    flex-direction: row;
    justify-content: flex-start;
    padding: 11px 12px;
}

.ad-choice-grid.is-compact span i {
    font-size: 15px;
}

.ad-title-input.ad-title-input {
    height: 58px;
    font-size: 20px;
    font-weight: 700;
}

.ad-slug {
    display: flex;
    align-items: stretch;
    direction: ltr;
}

.ad-slug-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 14px;
}

.ad-field .ad-slug input:not([type="radio"]):not([type="checkbox"]) {
    border-radius: 0 12px 12px 0;
    font-size: 14px;
}

.ad-counter {
    color: var(--muted);
    font-size: 12px;
}

.ad-review-note {
    align-items: flex-start;
    margin: 0;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.9;
}

.ad-review-note i {
    margin-top: 6px;
}

.ad-review-note small {
    color: var(--text-2);
}

.ad-publish-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

button.ad-ghost-btn {
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.ad-ghost-btn.is-full {
    justify-content: center;
    width: 100%;
}

.ad-ghost-btn.is-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.ad-btn.is-busy {
    pointer-events: none;
    opacity: 0.7;
}

.ad-return {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.ad-return summary {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffb547;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
}

.ad-return summary::-webkit-details-marker {
    display: none;
}

.ad-return[open] summary {
    margin-bottom: 12px;
}

.ad-return textarea {
    margin-bottom: 10px;
}

/* cover picker */
.ad-cover {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    border: 1px dashed var(--line-strong);
    background: var(--bg-deep);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ad-cover:hover {
    border-color: var(--lime);
}

.ad-cover input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ad-cover img {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-cover.has-image img {
    display: block;
}

.ad-cover-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    color: var(--text-2);
    text-align: center;
}

.ad-cover-empty i {
    color: var(--lime);
    font-size: 26px;
}

.ad-cover-empty small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.ad-cover.has-image .ad-cover-empty {
    position: relative;
    z-index: 1;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(12, 12, 13, 0.75);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ad-cover.has-image .ad-cover-empty small {
    display: none;
}

.ad-cover.has-image:hover .ad-cover-empty {
    opacity: 1;
}

.ad-cover + .ad-check-inline {
    margin-top: 12px;
}

/* the editor */
.ad-editor-card {
    padding: 0;
    overflow: visible;
}

.ad-editor {
    position: relative;
    display: flex;
    flex-direction: column;
}

.ad-editor-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
}

.ad-editor-bar button {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-2);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.ad-editor-bar button b {
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.ad-editor-bar button:hover {
    background: var(--surface-2);
    color: var(--text);
}

.ad-editor-bar button.is-on {
    background: var(--lime-soft);
    color: var(--lime);
}

.ad-editor-bar button:disabled {
    opacity: 0.3;
    cursor: default;
}

.ad-editor-bar .is-end {
    margin-right: auto;
}

.ad-editor-sep {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--line-strong);
}

.ad-editor-pop {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.ad-editor-pop[hidden] {
    display: none;
}

.ad-editor-pop input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.ad-editor-pop input:focus {
    border-color: var(--lime);
}

.ad-editor-pop .ad-btn {
    padding: 9px 16px;
}

.ad-editor-body {
    min-height: 480px;
    padding: 28px 34px 40px;
    color: #cfcfcf;
    font-size: 16px;
    line-height: 2.1;
    outline: none;
    overflow-wrap: anywhere;
}

.ad-editor-body:empty::before,
.ad-editor-body > p:only-child:has(> br:only-child)::before {
    content: attr(data-placeholder);
    position: absolute;
    color: var(--muted);
    pointer-events: none;
}

.ad-editor-body > p:only-child:has(> br:only-child)::before {
    content: "متن مقاله را اینجا بنویسید… با H2 بخش‌ها را جدا کنید؛ تیترهای H2 فهرست مقاله را می‌سازند.";
}

.ad-editor-body p {
    margin: 0 0 18px;
}

.ad-editor-body strong,
.ad-editor-body b {
    color: #fff;
}

.ad-editor-body a {
    color: var(--lime);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.ad-editor-body h2 {
    position: relative;
    margin: 36px 0 14px;
    padding-right: 18px;
    color: #fff;
    font-size: 24px;
    line-height: 1.6;
}

.ad-editor-body h2::before {
    content: "";
    position: absolute;
    top: 6px;
    right: 0;
    width: 5px;
    height: calc(100% - 12px);
    border-radius: 5px;
    background: var(--lime);
}

.ad-editor-body h3 {
    margin: 28px 0 10px;
    color: #fff;
    font-size: 19px;
    line-height: 1.7;
}

.ad-editor-body ul,
.ad-editor-body ol {
    margin: 0 0 18px;
    padding-right: 26px;
}

.ad-editor-body li {
    margin-bottom: 6px;
}

.ad-editor-body li::marker {
    color: var(--lime);
}

.ad-editor-body blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    border-radius: 18px;
    border-right: 4px solid var(--lime);
    background: var(--bg-deep);
    color: #fff;
    font-size: 19px;
    font-weight: 700;
}

.ad-editor-body .ar-callout {
    position: relative;
    margin: 24px 0;
    padding: 16px 56px 16px 20px;
    border-radius: 16px;
    border: 1px dashed rgba(214, 243, 69, 0.45);
    background: rgba(214, 243, 69, 0.05);
}

.ad-editor-body .ar-callout::before {
    content: "\f0eb";
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--ink);
    font-family: "Font Awesome 7 Pro";
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
}

.ad-editor-body .ar-callout strong {
    color: var(--lime);
}

.ad-editor-body figure {
    margin: 26px 0;
}

.ad-editor-body img {
    display: block;
    max-width: 100%;
    border-radius: 16px;
}

.ad-editor-body figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.ad-editor-source {
    min-height: 480px;
    margin: 0;
    padding: 24px;
    border: 0;
    background: var(--bg-deep);
    color: #d4d4d4;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.8;
    resize: vertical;
    outline: none;
}

.ad-card .ad-editor-source {
    border-radius: 0;
    border: 0;
    box-shadow: none;
}

.ad-editor-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.ad-editor-busy {
    color: var(--lime);
}

.ad-editor-toast {
    position: absolute;
    top: 64px;
    left: 16px;
    right: 16px;
    z-index: 6;
}

@media (max-width: 767px) {
    .ad-editor-body {
        min-height: 360px;
        padding: 20px 18px 30px;
    }

    .ad-editor-bar {
        padding: 8px;
        border-radius: 18px 18px 0 0;
    }

    .ad-editor-bar button {
        min-width: 34px;
        height: 34px;
    }

    .ad-editor-sep {
        display: none;
    }

    .ad-article-cell {
        min-width: 220px;
    }
}

/* sidebar: the signed-in person links to their profile */
.ad-me-link {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 12px;
    min-width: 0;
    border-radius: 12px;
}

.ad-me-link:hover .ad-me-text b {
    color: var(--lime);
}

img.ad-avatar {
    object-fit: cover;
    background: var(--surface);
}

/* staff profile */
.ad-profile-photo {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ad-profile-photo .ad-avatar {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    font-size: 30px;
}

.ad-profile-photo label {
    position: relative;
    overflow: hidden;
}

.ad-profile-photo input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ad-link {
    color: var(--lime);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.ad-mini-list small .ad-status {
    padding: 2px 10px;
    font-size: 11px;
}

/* ===============================================================
   portfolio (/admin/portfolio)
   =============================================================== */
.ad-pf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.ad-pf-card {
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.ad-pf-card:hover {
    border-color: var(--line-strong);
}

.ad-pf-card.is-hidden-item .ad-pf-cover img {
    filter: grayscale(1);
    opacity: 0.5;
}

.ad-pf-cover {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    background: var(--bg-deep);
    color: var(--muted);
    font-size: 26px;
}

.ad-pf-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-pf-num {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(12, 12, 13, 0.8);
    color: var(--lime);
    font-size: 14px;
    font-weight: 700;
}

.ad-pf-home {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 100px;
    background: var(--lime);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.ad-pf-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 18px;
}

.ad-pf-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ad-pf-title b {
    font-size: 16px;
}

.ad-pf-title a:hover b {
    color: var(--lime);
}

.ad-pf-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.ad-pf-actions form {
    margin: 0;
}

.ad-pf-actions .ad-ghost-btn {
    margin-right: auto;
}

.ad-icon-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.ad-specs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ad-spec {
    display: grid;
    grid-template-columns: 46px 130px minmax(0, 1fr) minmax(0, 1.4fr) 40px;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.ad-spec-icon {
    display: grid;
    place-items: center;
    height: 46px;
    border-radius: 12px;
    background: var(--lime-soft);
    color: var(--lime);
}

.ad-spec input,
.ad-spec .ad-select {
    height: 46px;
    min-width: 0;
}

.ad-spec input {
    width: 100%;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.ad-spec input:focus {
    border-color: var(--lime);
}

.ad-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.ad-gallery:empty {
    display: none;
}

.ad-gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border-radius: 16px;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    cursor: grab;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.ad-gallery-item img {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    object-fit: cover;
    pointer-events: none;
}

.ad-gallery-item input {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.ad-gallery-item input:focus {
    border-color: var(--lime);
}

.ad-gallery-item small {
    color: var(--lime);
    font-size: 12px;
}

.ad-gallery-tools {
    display: flex;
    gap: 4px;
}

.ad-gallery-tools .ad-icon-btn {
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.ad-gallery-tools .is-danger {
    margin-right: auto;
}

.ad-gallery-item.is-dragging {
    opacity: 0.4;
    border-color: var(--lime);
}

.ad-gallery-item.is-new {
    cursor: default;
    border-style: dashed;
    border-color: rgba(214, 243, 69, 0.4);
}

.ad-gallery-preview {
    margin-top: 12px;
}

.ad-gallery-drop {
    margin-top: 14px;
}

.ad-pf-video {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 14px;
    background: #000;
}

@media (max-width: 1199px) {
    .ad-pf-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ad-pf-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-spec {
        grid-template-columns: 46px minmax(0, 1fr) 40px;
    }

    .ad-spec .ad-select {
        grid-column: 2 / 4;
        grid-row: 1;
    }

    .ad-spec-icon {
        grid-row: 1;
    }

    .ad-spec input:first-of-type {
        grid-column: 1 / 3;
    }

    .ad-spec input:last-of-type {
        grid-column: 1 / 3;
    }

    .ad-spec [data-spec-remove] {
        grid-column: 3;
        grid-row: 2 / 4;
    }

    .ad-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ad-pf-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* ===============================================================
   contact messages (/admin/messages)
   =============================================================== */
.ad-msg-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ad-contact {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ad-contact.is-new {
    border-color: rgba(214, 243, 69, 0.4);
    box-shadow: inset -4px 0 0 var(--lime);
}

.ad-contact-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ad-contact-who {
    flex: 1;
    min-width: 0;
}

.ad-contact-who b,
.ad-contact-who small {
    display: block;
}

.ad-contact-who small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.ad-contact-who small a:hover {
    color: var(--lime);
}

.ad-contact-text {
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--bg-deep);
    color: var(--text-2);
    font-size: 15px;
    line-height: 2;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.ad-contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ad-contact-actions form {
    margin: 0;
}

.ad-contact-actions .ad-btn {
    padding: 9px 16px;
}

.ad-contact-actions .ad-ghost-btn {
    padding: 8px 14px;
    font-size: 13px;
}

.ad-contact-actions .ad-ghost-btn i {
    color: var(--c, currentColor);
}

.ad-contact-delete {
    margin-right: auto !important;
}

.ad-contact-note summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
}

.ad-contact-note summary::-webkit-details-marker {
    display: none;
}

.ad-contact-note[open] summary {
    margin-bottom: 10px;
    color: var(--text-2);
}

/* ===============================================================
   frequently asked questions (/admin/faq)
   =============================================================== */
.ad-faq-layout {
    grid-template-columns: 280px minmax(0, 1fr);
}

.ad-faq-layout .ad-split-side {
    position: sticky;
    top: 110px;
}

.ad-faq-groups {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
}

.ad-faq-groups-label {
    margin: 10px 10px 4px;
    color: var(--muted);
    font-size: 12px;
}

.ad-faq-groups-label:first-child {
    margin-top: 0;
}

.ad-faq-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--text-2);
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.ad-faq-group i {
    width: 18px;
    color: var(--muted);
    text-align: center;
}

.ad-faq-group span {
    flex: 1;
}

.ad-faq-group b {
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.ad-faq-group:hover {
    background: var(--surface-2);
    color: var(--text);
}

.ad-faq-group.is-active {
    background: var(--lime-soft);
    color: var(--lime);
    font-weight: 700;
}

.ad-faq-group.is-active i {
    color: var(--lime);
}

.ad-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ad-faq {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--bg-deep);
    scroll-margin-top: 110px;
}

.ad-faq.is-hidden-item .ad-faq-q {
    opacity: 0.5;
}

.ad-faq details {
    flex: 1;
    min-width: 0;
}

.ad-faq summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.ad-faq summary::-webkit-details-marker {
    display: none;
}

.ad-faq-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 13px;
    font-weight: 700;
}

.ad-faq-q {
    flex: 1;
    min-width: 0;
}

.ad-faq-q b {
    display: block;
    font-size: 15px;
    line-height: 1.8;
}

.ad-faq-q small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ad-faq details[open] .ad-faq-q small {
    display: none;
}

.ad-faq-edit-icon {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.ad-faq summary:hover .ad-faq-edit-icon,
.ad-faq details[open] .ad-faq-edit-icon {
    color: var(--lime);
}

.ad-faq .ad-faq-form {
    margin-top: 14px;
}

.ad-faq-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ad-faq-form-actions {
    display: flex;
    justify-content: flex-end;
}

.ad-faq-tools {
    display: flex;
    gap: 4px;
}

.ad-faq-tools form {
    margin: 0;
}

.ad-faq-tools .ad-icon-btn {
    width: 34px;
    height: 34px;
}

/* ===============================================================
   customers (/admin/customers)
   =============================================================== */
.ad-avatar.is-small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 13px;
}

.ad-avatar.is-big {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 24px;
}

.ad-customer-head {
    flex-wrap: wrap;
}

.ad-customer-head .ad-order-title h2 {
    margin: 0 0 4px;
}

.ad-customer-head .ad-contact-btns {
    margin-right: auto;
}

.ad-stat-num.is-money {
    font-size: 24px;
}

.ad-mini-list a > span:first-child {
    min-width: 0;
}

.ad-clamp {
    display: -webkit-box !important;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 500;
}

@media (max-width: 1199px) {
    .ad-faq-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-faq-layout .ad-split-side {
        position: static;
        display: block;
    }

    .ad-faq-groups {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .ad-faq-groups-label {
        display: none;
    }

    .ad-faq-group {
        flex: none;
    }
}

@media (max-width: 767px) {
    .ad-faq {
        flex-direction: column;
    }

    .ad-faq-tools {
        align-self: flex-end;
    }

    .ad-faq-groups {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .ad-faq-groups-label {
        display: none;
    }

    .ad-faq-group {
        flex: none;
    }

    .ad-contact-actions .ad-ghost-btn span {
        display: inline;
    }
}

.ad-customer-head .ad-contact-btns {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0;
}

.ad-customer-head .ad-contact-btns .ad-btn {
    padding: 10px 16px;
}

/* destructive actions at the end of an edit page */
.ad-btn.is-danger {
    background: var(--danger);
    color: #fff;
}

.ad-btn.is-danger:hover {
    background: #ff8585;
}

.ad-danger-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-color: rgba(255, 107, 107, 0.3);
    background: var(--danger-soft);
}

.ad-danger-zone > div {
    flex: 1;
    min-width: 260px;
}

.ad-danger-zone b {
    color: var(--danger);
}

.ad-danger-zone p {
    margin: 8px 0 4px;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.9;
}

.ad-danger-zone small {
    color: var(--muted);
    font-size: 12px;
}

.ad-danger-zone form {
    margin: 0;
}

/* pay page: back to the project in the customer's profile */
.py-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: center;
    padding: 8px 14px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 14px;
    transition: color 0.2s ease, background 0.2s ease;
}

.py-back:hover {
    background: var(--surface-2);
    color: var(--lime);
}

/* an inline button with the arrow circle (pay page) */
.au-btn.is-inline:has(.arrow) {
    gap: 16px;
    padding: 0 24px 0 6px;
}

.au-btn.is-inline .arrow {
    width: 40px;
    height: 40px;
}

/* ===============================================================
   site content (/admin/content)
   =============================================================== */
.cf-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cf-section {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--bg-deep);
    transition: border-color 0.2s ease, transform 0.3s var(--ease);
}

.cf-section:hover {
    border-color: rgba(214, 243, 69, 0.4);
    transform: translateY(-2px);
}

.cf-section-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 18px;
}

.cf-section-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cf-section-text b {
    font-size: 15px;
}

.cf-section-text small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.cf-section-text em {
    color: var(--text-2);
    font-size: 11px;
    font-style: normal;
    opacity: 0.8;
}

.cf-section-go {
    color: var(--muted);
}

.cf-section:hover .cf-section-go {
    color: var(--lime);
}

.cf-obj {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.cf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cf-field.is-wide {
    grid-column: 1 / -1;
}

.cf-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cf-label > span,
.cf-label-text,
.cf-list-head > span {
    color: var(--text-2);
    font-size: 14px;
}

.cf-label input,
.cf-label textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 15px;
    line-height: 1.8;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-label input[dir="ltr"] {
    text-align: left;
}

.cf-label input:focus,
.cf-label textarea:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px var(--lime-soft);
}

.cf-label .ad-select {
    width: 100%;
    flex: none;
}

/* an icon select shows the chosen icon beside it */
.cf-icon-pick {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-icon-pick .ad-select {
    flex: 1;
    min-width: 0;
}

.cf-icon-preview {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 19px;
}

.cf-help {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

/* lists */
.cf-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cf-count {
    color: var(--muted);
    font-size: 12px;
}

.cf-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-item {
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
}

.cf-item > .cf-obj {
    padding: 4px 16px 16px;
}

.cf-item.is-folded > .cf-obj {
    display: none;
}

.cf-item-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 8px;
}

.cf-item-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--lime-soft);
    color: var(--lime);
    font-size: 12px;
    font-weight: 700;
}

.cf-item-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-item-tools {
    display: flex;
    gap: 4px;
}

.cf-item-tools .ad-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.cf-item.is-folded [data-act="fold"] i {
    transform: rotate(90deg);
}

/* nested lists sit a little quieter */
.cf-item .cf-item {
    background: var(--surface);
}

.cf-add {
    align-self: flex-start;
    border-style: dashed;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.cf-add:disabled {
    opacity: 0.4;
    cursor: default;
}

.cf-actions {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
}

.cf-actions .is-danger {
    margin-right: auto;
}

@media (max-width: 767px) {
    .cf-sections,
    .cf-obj {
        grid-template-columns: minmax(0, 1fr);
    }

    .cf-item > .cf-obj {
        padding: 4px 10px 12px;
    }
}

/* the "add" button keeps its text on phones: a lone + is unclear */
@media (max-width: 767px) {
    .cf-add span {
        display: inline;
    }
}

/* =====================================================================
   MEDIA: the library (/admin/media) and the picker window (md-*), wwwroot/js/media.js
   ===================================================================== */
.md-open,
.md-open body {
    overflow: hidden;
}

.md-browser {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 260px;
}

.md-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.md-upload-btn {
    cursor: pointer;
}

.md-filters {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--bg-deep);
    border: 1px solid var(--line);
}

.md-filters:empty {
    display: none;
}

.md-filters button {
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.md-filters button.is-active {
    background: var(--lime-soft);
    color: var(--lime);
}

.md-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 200px;
    max-width: 320px;
    height: 44px;
    margin-right: auto;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--muted);
}

.md-search:focus-within {
    border-color: var(--lime);
}

.md-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
}

.md-hint {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.md-hint i {
    color: var(--lime);
    margin-left: 4px;
}

.md-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.md-browser.is-loading .md-grid {
    opacity: 0.5;
}

.md-item {
    position: relative;
    display: block;
    aspect-ratio: 1;
    padding: 0;
    border-radius: 14px;
    border: 2px solid transparent;
    background: var(--bg-deep);
    overflow: hidden;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.md-item img,
.md-item video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.md-item:hover,
.md-item:focus-visible {
    border-color: var(--line-strong);
}

.md-item.is-selected {
    border-color: var(--lime);
}

.md-item-name {
    position: absolute;
    inset: auto 0 0;
    padding: 18px 8px 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.md-item:hover .md-item-name,
.md-item.is-selected .md-item-name {
    opacity: 1;
}

.md-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--lime);
    color: var(--ink);
    font-size: 12px;
    transform: scale(0);
    transition: transform 0.2s var(--ease);
}

.md-item.is-selected .md-check {
    transform: scale(1);
}

.md-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
}

.md-unused {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--muted);
    font-size: 10px;
}

.md-empty {
    margin: 30px 0;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

.md-more {
    align-self: center;
}

/* upload queue */
.md-queue {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.md-queue:empty {
    display: none;
}

.md-job {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-deep);
}

.md-job-icon {
    color: var(--lime);
    font-size: 22px;
}

.md-job-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.md-job-text b {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-job-text small {
    color: var(--muted);
    font-size: 12px;
}

.md-bar {
    height: 5px;
    border-radius: 5px;
    background: var(--line);
    overflow: hidden;
}

.md-bar i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--lime);
    transition: width 0.2s linear;
}

.md-job.is-error {
    border-color: rgba(255, 107, 107, 0.4);
}

.md-job.is-error .md-job-icon,
.md-job.is-error small {
    color: var(--danger);
}

.md-job.is-error .md-bar {
    display: none;
}

/* drag & drop */
.md-drop {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 2px dashed var(--lime);
    background: rgba(12, 12, 13, 0.85);
    color: var(--lime);
    font-size: 18px;
    font-weight: 700;
    pointer-events: none;
}

.md-drop i {
    margin-left: 8px;
}

.md-browser.is-over .md-drop {
    display: flex;
}

/* file names, extensions and links keep Latin digits (IRANSans draws Persian ones) */
.md-latin,
.md-job-text b,
.md-item-name,
.md-link input {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    unicode-bidi: plaintext;
}

/* the picker window */
.md-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.md-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    height: min(86vh, 900px);
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.md-head,
.md-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
}

.md-head {
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.md-head h3 {
    margin: 0;
    font-size: 16px;
}

.md-head h3 i {
    color: var(--lime);
    margin-left: 6px;
}

.md-body {
    flex: 1;
    min-height: 0;
    padding: 16px 20px;
    overflow-y: auto;
}

.md-foot {
    border-top: 1px solid var(--line);
}

.md-count {
    margin-left: auto;
    color: var(--text-2);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-foot .ad-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* the library page */
.md-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.md-detail-open .md-page {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.md-detail {
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.md-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.md-detail-preview {
    border-radius: 14px;
    background: var(--bg-deep);
    overflow: hidden;
}

.md-detail-preview img,
.md-detail-preview video {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.md-detail-name {
    margin: 0;
    font-weight: 700;
    word-break: break-word;
}

.md-name.is-saved {
    border-color: var(--lime) !important;
}

.md-meta {
    display: grid;
    gap: 6px;
    margin: 0;
    font-size: 13px;
}

.md-meta div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.md-meta dt {
    color: var(--muted);
}

.md-meta dd {
    margin: 0;
    color: var(--text-2);
}

.md-link {
    display: flex;
    gap: 6px;
}

.md-link input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text-2);
    font-size: 12px;
}

.md-uses b {
    font-size: 13px;
}

.md-uses ul {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.md-uses a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
}

.md-uses a:hover {
    color: var(--lime);
}

.md-uses small {
    color: var(--lime);
    margin-left: 6px;
}

.md-uses p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.md-detail [data-delete][disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* a form field that holds one image or video (cover, content fields) */
.md-field {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 14px;
    border: 1px dashed var(--line-strong);
    background: var(--bg-deep);
}

.md-field-preview {
    display: none;
    width: 120px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #000;
}

.md-field.has-file .md-field-preview {
    display: block;
}

.md-field-empty {
    color: var(--muted);
    font-size: 13px;
}

.md-field.has-file .md-field-empty {
    display: none;
}

.md-field-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}

.md-field:not(.has-file) [data-media-clear] {
    display: none;
}

.md-field.is-video .md-field-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.md-field.is-video {
    flex-direction: column;
    align-items: stretch;
}

.md-field.is-video .md-field-tools {
    margin-right: 0;
}

.ad-cover .ad-cover-clear {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: rgba(12, 12, 13, 0.8);
    color: #fff;
}

.ad-cover .ad-cover-clear:hover {
    background: var(--danger);
}

.ad-cover:not(.has-image) .ad-cover-clear {
    display: none;
}

@media (max-width: 991px) {
    .md-detail-open .md-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .md-detail {
        position: fixed;
        inset: auto 0 0;
        z-index: 60;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
    }
}

@media (max-width: 575px) {
    .md-modal {
        padding: 0;
    }

    .md-card {
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .md-body,
    .md-head,
    .md-foot {
        padding-inline: 14px;
    }

    .md-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .md-search {
        max-width: none;
        flex-basis: 100%;
    }

    .md-field {
        flex-wrap: wrap;
    }
}

/* the gallery's "add from the media library" button, drawn like a drop zone */
.ad-gallery-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 22px 16px;
    border-radius: 14px;
    border: 1.5px dashed var(--line-strong);
    background: var(--bg-deep);
    color: var(--text-2);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ad-gallery-add:hover {
    border-color: var(--lime);
}

.ad-gallery-add i {
    color: var(--lime);
    margin-left: 6px;
}

.ad-gallery-add small {
    color: var(--muted);
}
