/*
 * برج‌یار — پوسته پنل مدیریت
 * چیدمان و حس کلی از کیت فیگما «Property Management Dashboard» (پس‌زمینه بژ، کارت‌های سفید با گوشه ۲۷px،
 * منوی کناری کپسولی، آیکون‌های دایره‌ای) + رنگ‌های لوگو (نارنجی #F39C12، سرمه‌ای #1F2937).
 * این فایل بعد از استایل خود Filament بارگذاری می‌شود (AdminPanelProvider ← renderHook STYLES_AFTER).
 */

:root {
    --by-orange: #F39C12;
    --by-orange-soft: #FDF0DC;
    --by-navy: #1F2937;
    --by-bg: #EAE9E3;
    --by-card: #FFFFFF;
    --by-ink: #201F23;
    --by-muted: #596269;
    --by-line: #E6E6E6;
    --by-soft: #F4F3EF;
    --by-green: #4C6C5A;
    --by-green-soft: #E6EFEA;
    --by-red: #98140B;
    --by-red-soft: #FCE8E7;

    --radius-xl: 1.6875rem; /* 27px — کارت‌های کیت */
    --radius-lg: 0.875rem;
}

.dark {
    --by-bg: #111827;
    --by-card: #1F2937;
    --by-ink: #F9FAFB;
    --by-muted: #9CA3AF;
    --by-line: #ffffff1a;
    --by-soft: #ffffff0d;
    --by-green-soft: #4C6C5A33;
    --by-red: #FCA5A5;
    --by-red-soft: #98140B55;
}

.dark .by-pill.is-primary {
    background: var(--by-orange);
    color: #111827;
}

.dark .by-pill.is-primary:hover {
    background: #fff;
}

/* ── پس‌زمینه و نوار بالا ─────────────────────────────── */
.fi-body,
.fi-simple-layout {
    background-color: var(--by-bg);
}

.fi-topbar {
    background-color: var(--by-bg) !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-topbar .fi-input-wrp,
.fi-global-search-field .fi-input-wrp {
    border-radius: 999px;
    background: var(--by-card);
    box-shadow: none;
}

/* ── منوی کناری: کارت سفید گرد با آیتم‌های کپسولی ─────────── */
.fi-sidebar {
    background-color: var(--by-bg) !important;
}

@media (min-width: 1024px) {
    .fi-sidebar {
        box-shadow: none !important;
    }

    .fi-sidebar .fi-sidebar-nav {
        background: var(--by-card);
        border-radius: 2rem;
        margin: 0 0.75rem 0.75rem;
        padding-inline: 1rem;
        padding-block: 1.5rem;
    }
}

.fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
}

.fi-sidebar-group-label {
    font-size: 0.75rem;
    color: var(--by-muted);
}

.fi-sidebar-item-btn {
    border-radius: 999px;
    padding-block: 0.55rem;
}

.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover {
    background-color: var(--by-soft);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn:hover {
    background-color: var(--by-navy) !important;
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn:hover {
    background-color: var(--by-orange) !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
    color: #fff !important;
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
    color: #111827 !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-grouped-border-part {
    background-color: var(--by-orange) !important;
}

/* ── کارت‌ها: سفید، گوشه ۲۷px، بدون خط دور ───────────────── */
.fi-section:not(.fi-section-not-contained):not(.fi-aside),
.fi-section:not(.fi-section-not-contained).fi-aside > .fi-section-content-ctn,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-in-entry-wrp-card,
.fi-fo-repeater-item {
    background-color: var(--by-card);
    box-shadow: none !important;
}

.fi-section:not(.fi-section-not-contained):not(.fi-aside).fi-section-has-header:not(.fi-collapsed) > .fi-section-content-ctn,
.fi-ta-ctn .fi-ta-header {
    border-color: var(--by-line);
}

.fi-section .fi-section-header-heading,
.fi-ta-header-heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--by-ink);
}

/* ── سرصفحه ───────────────────────────────────────────── */
.fi-header-heading {
    font-weight: 700;
    color: var(--by-ink);
    letter-spacing: -0.01em;
}

.fi-header-subheading {
    color: var(--by-muted);
}

/* ── کارت‌های آماری (Total Property / Number of Sales …) ──── */
.fi-wi-stats-overview-stat {
    padding: 1.6rem 1.75rem;
}

.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label-ctn {
    column-gap: 0.85rem;
}

.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label-ctn > .fi-icon {
    width: 3rem;
    height: 3rem;
    padding: 0.75rem;
    border-radius: 999px;
    background: var(--by-soft);
    color: var(--by-navy);
}

.dark .fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label-ctn > .fi-icon {
    color: var(--by-orange);
}

.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--by-ink);
}

.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--by-ink);
    letter-spacing: -0.02em;
    line-height: 1.5;
}

.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-description {
    color: var(--by-muted);
}

/* ── جدول‌ها ─────────────────────────────────────────── */
.fi-ta-header-cell {
    background: transparent !important;
    color: var(--by-muted);
    font-weight: 500;
}

.fi-ta-row:hover > .fi-ta-cell {
    background-color: var(--by-soft);
}

/* ── دکمه‌ها و ورودی‌ها ───────────────────────────────── */
.fi-btn {
    border-radius: 999px;
}

.fi-input-wrp {
    border-radius: 0.875rem;
}

.fi-badge {
    border-radius: 0.5rem;
}

/* ── صفحه ورود ───────────────────────────────────────── */
.fi-simple-main {
    border-radius: var(--radius-xl);
    box-shadow: none !important;
    background: var(--by-card);
}

/* ── ویجت «سلام» داشبورد ─────────────────────────────── */
.by-welcome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: 0.25rem 0.25rem 0.5rem;
}

.by-welcome h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--by-ink);
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.by-welcome p {
    margin: 0.35rem 0 0;
    font-size: 1.05rem;
    color: var(--by-muted);
}

.by-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.by-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    background: var(--by-card);
    color: var(--by-ink);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.by-pill:hover {
    background: var(--by-navy);
    color: #fff;
}

.by-pill.is-primary {
    background: var(--by-navy);
    color: #fff;
}

.by-pill.is-primary:hover {
    background: var(--by-orange);
    color: var(--by-navy);
}

.by-pill svg {
    width: 1.15rem;
    height: 1.15rem;
}

.by-pill .by-count {
    min-width: 1.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--by-orange);
    color: var(--by-navy);
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.4rem;
}

/* ── ویجت «درخواست‌های تعمیرات» (Maintenance Requests) ──── */
.by-card {
    background: var(--by-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
}

.by-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.by-card-head h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--by-ink);
}

.by-card-head a {
    font-size: 0.9rem;
    color: var(--by-muted);
    text-decoration: none;
}

.by-card-head a:hover {
    color: var(--by-orange);
}

.by-req {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--by-line);
    text-decoration: none;
    color: inherit;
}

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

.by-req:hover .by-req-title {
    color: var(--by-orange);
}

.by-req-main {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.by-ic {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: var(--by-soft);
    color: var(--by-navy);
}

.dark .by-ic {
    color: var(--by-orange);
}

.by-ic svg {
    width: 1.3rem;
    height: 1.3rem;
}

.by-ic.is-urgent {
    background: var(--by-red-soft);
    color: var(--by-red);
}

.by-ic.is-high {
    background: var(--by-orange-soft);
    color: #B45309;
}

.by-req-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--by-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.by-req-sub {
    font-size: 0.78rem;
    color: #8F8E96;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.by-req-name {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.by-req-who {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--by-ink);
    min-width: 0;
}

.by-avatar {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--by-navy);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.by-avatar.is-empty {
    background: var(--by-soft);
    color: var(--by-muted);
}

.by-tag {
    display: inline-block;
    border-radius: 0.5rem;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--by-soft);
    color: var(--by-muted);
}

.by-tag.is-urgent { background: var(--by-red-soft); color: var(--by-red); }
.by-tag.is-high { background: var(--by-orange-soft); color: #B45309; }
.by-tag.is-ok { background: var(--by-green-soft); color: var(--by-green); }

.by-empty {
    padding: 2rem 0;
    text-align: center;
    color: var(--by-muted);
}

@media (max-width: 768px) {
    .by-req-name {
        display: none;
    }

    .by-welcome h2 {
        font-size: 1.5rem;
    }
}

/* ── سئوسنج مطالب مجله ───────────────────────────── */
.by-seo { display: grid; gap: 1rem; }
.by-seo-top { display: flex; align-items: center; gap: 1rem; }
.by-seo-score { position: relative; width: 5.5rem; height: 5.5rem; flex-shrink: 0; color: var(--by-ink); }
.by-seo-score svg { width: 100%; height: 100%; }
.by-seo-score svg circle:last-child { transition: stroke-dasharray .5s ease; }
.by-seo-score > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.by-seo-score b { font-size: 1.6rem; font-weight: 800; color: var(--c); }
.by-seo-score small { font-size: .7rem; color: var(--by-muted); }
.by-seo-grade { font-weight: 700; font-size: 1.05rem; }
.by-seo-stats { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.by-seo-stats span { font-size: .75rem; background: var(--by-soft); color: var(--by-muted); border-radius: 999px; padding: .15rem .6rem; }
.by-serp { border: 1px solid var(--by-line); border-radius: 1rem; padding: .9rem 1.1rem; background: var(--by-card); font-family: Arial, Vazirmatn, sans-serif; }
.by-serp-label { font-size: .7rem; color: var(--by-muted); margin-bottom: .35rem; font-family: Vazirmatn, sans-serif; }
.by-serp-url { font-size: .8rem; color: #4D5156; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.by-serp-title { font-size: 1.15rem; color: #1A0DAB; margin: .15rem 0; line-height: 1.5; }
.by-serp-desc { font-size: .85rem; color: #4D5156; line-height: 1.7; }
.dark .by-serp-title { color: #8AB4F8; }
.dark .by-serp-url, .dark .by-serp-desc { color: #BDC1C6; }
.by-seo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.by-seo-list li { display: flex; align-items: flex-start; gap: .6rem; font-size: .875rem; color: var(--by-ink); }
.by-seo-list small { display: block; color: var(--by-muted); font-size: .78rem; margin-top: .1rem; }
.by-seo-i { flex-shrink: 0; width: 1.4rem; height: 1.4rem; border-radius: 999px; display: grid; place-items: center; font-size: .75rem; font-weight: 800; margin-top: .1rem; }
