@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cairo:wght@400;500;600;700&display=swap');

:root {
    --yomi-purple: #4A2B6B;
    --yomi-purple-deep: #3A1F55;
    --yomi-purple-hover: #5A3680;
    --yomi-purple-active: #2E1944;
    --yomi-purple-soft: #6D4A95;
    --yomi-purple-accent: #7C4DBC;
    --yomi-page: #F4F4F5;
    --yomi-panel: #FFFFFF;
    --yomi-border: #E5E7EB;
    --yomi-border-soft: #F0F0F2;
    --yomi-text: #1F2937;
    --yomi-text-2: #6B7280;
    --yomi-text-3: #9CA3AF;
    --yomi-red: #E11D48;
    --yomi-topbar-h: 48px;
    --yomi-rail-w: 0px;
}

html, body, .fi-body, .fi-layout {
    font-family: 'Inter','Cairo',system-ui,sans-serif !important;
    background: var(--yomi-page) !important;
    color: var(--yomi-text);
}

/* ============================================================
   TOPBAR — full-width purple bar pinned to top
   ============================================================ */
.fi-topbar,
.fi-topbar > * {
    background: var(--yomi-purple) !important;
}
.fi-topbar {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    z-index: 60 !important;
    border: 0 !important;
    height: var(--yomi-topbar-h) !important;
    min-height: var(--yomi-topbar-h) !important;
    padding: 0 16px !important;
    box-shadow: none !important;
}
.fi-topbar > nav {
    display: flex !important;
    align-items: center !important;
    height: var(--yomi-topbar-h) !important;
    gap: 0 !important;
    grid-template-columns: none !important;
    width: 100%;
    max-width: none !important;
    padding: 0 !important;
    background: transparent !important;
}
.fi-topbar > nav > * { background: transparent; }
.yomi-tb-left   { order: 1; flex: 1; }
.yomi-tb-search { order: 2; flex: 0 0 440px; margin: 0; }
.yomi-tb-right  { order: 3; flex: 1; justify-content: flex-end; }
.fi-user-menu   {
    order: 99 !important;
    position: absolute !important;
    right: 12px !important; top: 9px !important;
    margin: 0 !important;
}
/* hide Filament's default topbar pieces */
.fi-topbar-search-ctn,
.fi-topbar .fi-search-input,
.fi-topbar .fi-search-field,
.fi-topbar .fi-global-search,
.fi-topbar .fi-global-search-field,
.fi-topbar form[role="search"],
.fi-topbar > nav > input[type="search"],
.fi-topbar > nav > .fi-input-wrp,
.fi-topbar > nav > .fi-input-wrp-input,
.fi-topbar .fi-logo,
.fi-topbar-item-button.fi-topbar-database-notifications-btn,
.fi-topbar nav > div[x-persist] { display: none !important; }

/* LEFT cluster */
.yomi-tb-left {
    display: flex; align-items: center; gap: 6px;
    flex: 1;
    height: var(--yomi-topbar-h);
}
.yomi-tb-collapse {
    width: 30px; height: 30px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: #fff; border: 0; cursor: pointer;
}
.yomi-tb-collapse:hover { background: rgba(255,255,255,0.12); }
.yomi-tb-logo {
    display: inline-flex; align-items: center; gap: 6px;
    color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -0.4px;
    text-decoration: none; padding: 0 8px 0 0;
}
.yomi-tb-logo {
    display: inline-flex; align-items: baseline; gap: 0;
    text-decoration: none;
}
.yomi-logo-brand {
    font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -0.5px;
}
.yomi-logo-admin {
    font-size: 18px; font-weight: 300; color: rgba(255,255,255,0.55);
    letter-spacing: -0.5px;
}
.yomi-tb-add {
    display: inline-flex; align-items: center; gap: 5px;
    height: 30px; padding: 0 14px 0 12px;
    background: var(--yomi-purple-accent); color: #fff;
    border: 0; border-radius: 16px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    margin-left: 6px;
}
.yomi-tb-add:hover { background: #8E5DCC; }

/* CENTER search */
.yomi-tb-search {
    flex: 1; max-width: 480px;
    margin: 0 auto;
    height: 34px; padding: 0 12px;
    display: flex; align-items: center; gap: 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    color: rgba(255,255,255,0.55);
}
.yomi-tb-search svg { color: rgba(255,255,255,0.55); flex-shrink: 0; }
.yomi-tb-search input {
    flex: 1; border: 0; background: transparent; outline: none !important;
    box-shadow: none !important;
    font-size: 13px; color: #fff;
}
.yomi-tb-search:focus-within {
    border-color: rgba(255,255,255,0.4);
    outline: none !important;
    box-shadow: none !important;
}
.yomi-tb-search input::placeholder { color: rgba(255,255,255,0.55); }
.yomi-tb-search .yomi-tb-kbd {
    display: flex; align-items: center; gap: 3px;
    font-size: 10.5px; color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 4px; padding: 1px 6px;
    white-space: nowrap; flex-shrink: 0;
}
.yomi-tb-search-open {
    border-color: rgba(255,255,255,0.5) !important;
}

/* Search dropdown */
.yomi-search-drop {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: #fff; border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--yomi-border);
    z-index: 300; overflow: hidden;
    padding: 4px 0;
}
.yomi-tb-search { position: relative; }
.yomi-search-section-label {
    padding: 5px 12px 3px;
    font-size: 10px; font-weight: 600; color: var(--yomi-text-3);
    letter-spacing: 0.6px; text-transform: uppercase;
}
.yomi-search-empty {
    padding: 16px 12px;
    font-size: 12px; color: var(--yomi-text-2); text-align: center;
}
.yomi-search-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px; cursor: pointer;
    transition: background 0.1s;
}
.yomi-search-item:hover,
.yomi-search-item-active { background: #F5F0FF; }
.yomi-search-item-icon {
    width: 24px; height: 24px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.yomi-search-item-label {
    flex: 1; font-size: 12px; font-weight: 500; color: var(--yomi-text);
}
.yomi-search-item-group {
    font-size: 10px; color: var(--yomi-text-3);
    background: var(--yomi-border-soft); border-radius: 4px;
    padding: 1px 6px;
}
.yomi-search-item-enter {
    font-size: 11px; color: var(--yomi-text-3);
    opacity: 0; transition: opacity 0.1s;
}
.yomi-search-item-active .yomi-search-item-enter { opacity: 1; }
.yomi-kbd {
    font-size: 10px; color: var(--yomi-text-3); background: var(--yomi-page);
    border: 1px solid var(--yomi-border); padding: 1px 6px; border-radius: 4px;
    font-family: 'Inter', monospace; font-weight: 500;
}

/* RIGHT cluster */
.yomi-tb-right {
    display: flex; align-items: center; gap: 12px;
    height: var(--yomi-topbar-h);
}
.yomi-tb-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px;
    background: #fff; color: var(--yomi-text);
    border: 0; border-radius: 6px;
    font-size: 12px; font-weight: 600; cursor: pointer;
}
.yomi-tb-pill:hover { background: #F4F4F5; }
.yomi-tb-pill .yomi-sparkle { color: var(--yomi-purple-accent); }
.yomi-tb-sep {
    width: 1px; height: 20px; background: rgba(255,255,255,0.18);
    margin: 0 4px;
}
.yomi-tb-ico {
    width: 30px; height: 30px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: rgba(255,255,255,0.85);
    border: 0; cursor: pointer;
}
.yomi-tb-ico:hover { background: rgba(255,255,255,0.12); color: #fff; }
.yomi-tb-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: #F5B97A; color: #5A3010;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer; flex-shrink: 0; outline: none;
}

/* Dropdowns */
.yomi-drop-wrap { position: relative; }
.yomi-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: #fff; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--yomi-border);
    z-index: 200; min-width: 240px;
    overflow: hidden;
}
.yomi-notif-panel { min-width: 300px; }
.yomi-dp-header {
    padding: 12px 16px 10px;
    font-size: 13px; font-weight: 700; color: var(--yomi-text);
    border-bottom: 1px solid var(--yomi-border-soft);
}
.yomi-dp-empty {
    padding: 28px 16px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--yomi-text-3); font-size: 12.5px;
}
.yomi-dp-user {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
}
.yomi-dp-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: #F5B97A; color: #5A3010;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.yomi-dp-user-name { font-size: 13px; font-weight: 600; color: var(--yomi-text); }
.yomi-dp-user-email { font-size: 11.5px; color: var(--yomi-text-2); margin-top: 1px; }
.yomi-dp-divider { height: 1px; background: var(--yomi-border-soft); margin: 2px 0; }
.yomi-dp-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px; width: 100%;
    font-size: 13px; color: var(--yomi-text);
    text-decoration: none; background: none; border: none;
    cursor: pointer; text-align: left;
}
.yomi-dp-item:hover { background: var(--yomi-border-soft); }
.yomi-dp-item-danger { color: var(--yomi-red) !important; }
.yomi-dp-item-danger:hover { background: #FFF0F3 !important; }
.yomi-dp-item-active { background: var(--yomi-border-soft); font-weight: 600; }

/* Language switcher pill */
.yomi-tb-lang {
    width: auto; padding: 0 8px; gap: 4px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.yomi-tb-lang-code { line-height: 1; }
.yomi-lang-panel { min-width: 200px; }
.yomi-lang-flag { font-size: 16px; line-height: 1; }

/* Theme toggle */
.yomi-tb-theme svg { display: block; }


/* ============================================================
   LAYOUT — push content below fixed topbar
   ============================================================ */
.fi-layout { padding-top: var(--yomi-topbar-h) !important; }
.fi-main-ctn { background: var(--yomi-page) !important; }

/* ============================================================
   RAIL — hidden (removed from layout)
   ============================================================ */
.yomi-rail { display: none !important; }

/* ============================================================
   SIDEBAR — floating card, flush left under topbar
   ============================================================ */
.fi-sidebar {
    width: 240px !important; min-width: 240px !important;
    background: var(--yomi-panel) !important;
    border: 0 !important;
    border-right: 1px solid var(--yomi-border) !important;
    border-radius: 12px 0 0 0 !important;
    box-shadow: none !important;
    position: fixed !important;
    top: var(--yomi-topbar-h) !important;
    left: 0 !important;
    padding-top: 0 !important;
    margin: 0 !important;
    height: calc(100vh - var(--yomi-topbar-h)) !important;
    z-index: 40 !important;
    overflow: hidden !important;
}
.fi-main-ctn { padding-left: 248px !important; }
.fi-sidebar-header { display: none !important; }
.fi-sidebar-nav {
    padding: 0 !important;
    gap: 0 !important;
    display: flex !important;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.fi-sidebar-nav::-webkit-scrollbar { display: none; }

.fi-sidebar-nav-groups { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; gap: 0 !important; padding-top: 8px !important; }
.fi-sidebar-group { padding: 0 !important; margin: 0 !important; border-top: 0 !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; overflow: hidden !important; }
.fi-sidebar-group + .fi-sidebar-group {
    margin-top: 0 !important; padding-top: 0 !important;
    border-top: 1px solid var(--yomi-border-soft) !important;
}

/* Tab switching — show/hide groups by active tab */
.fi-sidebar[data-active-tab="settings"] .fi-sidebar-group[data-yomi-tab="general"] { display: none !important; }
.fi-sidebar[data-active-tab="general"] .fi-sidebar-group[data-yomi-tab="settings"] { display: none !important; }

/* Group header row */
.fi-sidebar-group-button {
    padding: 8px 14px 4px 14px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}
.fi-sidebar-group-label {
    display: block !important;
    font-size: 10px !important; font-weight: 700 !important;
    color: var(--yomi-text-3) !important;
    text-transform: uppercase; letter-spacing: .5px;
    flex: 1;
}

/* Chevron icon button — visible, animated */
.fi-sidebar-group-collapse-button {
    background: transparent !important;
    border: 0 !important; box-shadow: none !important;
    padding: 2px !important;
    width: 20px !important; height: 20px !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, background 0.1s !important;
    flex-shrink: 0;
}
.fi-sidebar-group-collapse-button:hover { background: var(--yomi-page) !important; }
.fi-sidebar-group-collapse-button > svg,
.fi-sidebar-group-collapse-button [data-icon],
.fi-sidebar-group-collapse-button .fi-icon {
    width: 13px !important; height: 13px !important;
    color: var(--yomi-text-2) !important;
    flex-shrink: 0;
}

.fi-sidebar-group-items { gap: 2px !important; padding: 2px 10px 6px 10px !important; }

.fi-sidebar-item { padding: 0 !important; }
.fi-sidebar-item-button {
    height: 34px !important; padding: 0 8px !important;
    border-radius: 6px !important; font-size: 12px !important;
    color: var(--yomi-text) !important; gap: 8px !important;
    font-weight: 500 !important; background: transparent !important;
    box-shadow: none !important; width: 100% !important;
}
.fi-sidebar-item-button .fi-icon,
.fi-sidebar-item-icon {
    width: 14px !important; height: 14px !important;
    color: var(--yomi-text-2) !important; flex-shrink: 0 !important;
}
.fi-sidebar-item-button:hover {
    background: var(--yomi-page) !important;
    color: var(--yomi-text) !important;
}
.fi-sidebar-item-button:hover .fi-icon,
.fi-sidebar-item-button:hover .fi-sidebar-item-icon { color: var(--yomi-purple) !important; }

.fi-sidebar-item.fi-active .fi-sidebar-item-button,
.fi-sidebar-item-button.fi-active {
    background: #F3EEFA !important;
    color: var(--yomi-purple) !important; font-weight: 600 !important;
    box-shadow: none !important;
}
.fi-sidebar-item.fi-active .fi-icon,
.fi-sidebar-item-button.fi-active .fi-icon,
.fi-sidebar-item-button.fi-active .fi-sidebar-item-icon { color: var(--yomi-purple) !important; }

.fi-sidebar-item-label,
.fi-sidebar-item-button > span,
.fi-sidebar-item-button .fi-sidebar-item-label {
    font-size: 12px !important;
    color: inherit !important;
    overflow: hidden !important; text-overflow: ellipsis !important;
    white-space: nowrap; max-width: none !important;
    min-width: 0;
}
.fi-sidebar-item-button {
    padding-left: 10px !important; padding-right: 12px !important;
    overflow: hidden !important;
}
.fi-sidebar-item, .fi-sidebar-group-items { overflow: visible !important; }

/* Sidebar tab switcher */
.yomi-sidebar-tabs { padding: 10px 10px 6px; }
.yomi-st-inner {
    display: flex; gap: 3px;
    background: var(--yomi-page);
    border-radius: 10px; padding: 3px;
}
.yomi-st-btn {
    flex: 1; height: 32px;
    border-radius: 8px; border: 0;
    background: transparent;
    color: var(--yomi-text-3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.yomi-st-btn:hover { color: var(--yomi-text-2); }
.yomi-st-active {
    background: #fff !important;
    color: var(--yomi-purple) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

/* Sidebar bottom card — "Return to Old Dashboard" */
.yomi-sidebar-bottom { margin-top: auto; padding: 14px 14px 18px; }
.yomi-sidebar-card {
    background: #F3EEFA;
    border-radius: 10px; padding: 14px;
}
.yomi-sidebar-card-title { font-size: 12.5px; font-weight: 700; color: var(--yomi-text); margin: 0 0 4px; line-height: 1.3; }
.yomi-sidebar-card-body { font-size: 11px; color: var(--yomi-text-2); line-height: 1.45; margin: 0 0 10px; }
.yomi-sidebar-card-cta {
    display: block; text-align: center; height: 30px; line-height: 30px;
    background: var(--yomi-purple); color: #fff; border: 0;
    border-radius: 6px; font-size: 11.5px; font-weight: 600;
    text-decoration: none;
}
.yomi-sidebar-card-cta:hover { background: var(--yomi-purple-hover); }

/* ============================================================
   MAIN content area
   ============================================================ */
.fi-main { padding: 20px 24px !important; max-width: none !important; }
.fi-page { padding-top: 0 !important; }

/* ============================================================
   CARDS / SECTIONS — Zid-style rounded white panels
   ============================================================ */
.fi-section, .fi-fo-section-content-ctn, .fi-section-content-ctn {
    background: var(--yomi-panel) !important;
    border: 1px solid var(--yomi-border) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
.fi-section-header { padding: 20px 20px 16px !important; }
.fi-section-header-heading { font-size: 14.5px !important; font-weight: 700 !important; color: var(--yomi-text) !important; }
.fi-section-content { padding: 14px 20px 18px !important; }

/* ============================================================
   PAGE HEADER — back-arrow style title
   ============================================================ */
.fi-header-heading { font-size: 18px !important; font-weight: 700 !important; color: var(--yomi-text) !important; }
.fi-header-subheading { font-size: 12px !important; color: var(--yomi-text-2) !important; }
.fi-breadcrumbs-item a, .fi-breadcrumbs-item span {
    font-size: 11px !important; color: var(--yomi-text-3) !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.fi-btn-color-primary {
    background: var(--yomi-purple) !important; color: #fff !important;
    border-radius: 6px !important; height: 34px !important;
    font-size: 12px !important; font-weight: 600 !important;
    border: 0 !important;
}
.fi-btn-color-primary:hover { background: var(--yomi-purple-hover) !important; }
.fi-btn-color-gray {
    background: #fff !important; color: var(--yomi-text) !important;
    border: 1px solid var(--yomi-border) !important;
    border-radius: 6px !important; height: 34px !important;
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.fi-input, .fi-input-wrp, .fi-select-input, textarea.fi-input {
    border-radius: 6px !important;
    border: 1px solid var(--yomi-border) !important;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 12.5px !important;
}
.fi-input-wrp:focus-within {
    border-color: var(--yomi-purple-accent) !important;
    box-shadow: 0 0 0 3px rgba(124,77,188,0.12) !important;
}
.fi-fo-field-wrp-label, .fi-fo-field-label {
    font-size: 12px !important; font-weight: 600 !important; color: var(--yomi-text) !important;
    margin-bottom: 6px !important;
}

/* ============================================================
   TABLES
   ============================================================ */
.fi-ta {
    border: 1px solid var(--yomi-border) !important; border-radius: 10px !important;
    background: #fff !important; box-shadow: none !important;
}
.fi-ta-header { padding: 0 !important; border-bottom: 1px solid var(--yomi-border) !important; }
.fi-ta-table thead,
.fi-ta-table thead tr,
.fi-ta-table thead th {
    background: var(--yomi-page) !important;
}
.fi-ta-header-cell,
.fi-ta-header-cell[aria-sort],
.fi-ta-header-cell.fi-ta-header-cell-sorted {
    height: 30px !important; font-size: 11px !important; font-weight: 600 !important;
    color: var(--yomi-text-3) !important; text-transform: uppercase; letter-spacing: .5px;
    background: var(--yomi-page) !important;
    padding: 0 12px !important;
}
.fi-ta-header-cell button,
.fi-ta-header-cell span,
.fi-ta-header-cell-label,
.fi-ta-header-cell > * {
    font-size: 11px !important; font-weight: 600 !important;
    color: var(--yomi-text-3) !important; text-transform: uppercase; letter-spacing: .5px;
}
.fi-ta-cell { font-size: 12px !important; padding: 5px 12px !important; color: var(--yomi-text) !important; }
.fi-ta-row { border-bottom: 1px solid var(--yomi-border-soft) !important; }
.fi-ta-row:hover { background: var(--yomi-page) !important; }
.fi-ta-row:last-child { border-bottom: 0 !important; }
/* compact checkbox/action columns */
.fi-ta-col-action { width: 36px !important; padding: 4px 8px !important; background: var(--yomi-page) !important; }
.fi-ta-header-cell:first-child,
.fi-ta-cell:first-child { padding-left: 12px !important; }
.fi-badge {
    height: 18px !important; padding: 0 6px !important;
    font-size: 9.5px !important; font-weight: 700 !important;
    border-radius: 4px !important; text-transform: uppercase; letter-spacing: .3px;
}
.fi-pagination { padding: 8px 12px !important; border-top: 1px solid var(--yomi-border) !important; font-size: 12px !important; }

/* ============================================================
   DASHBOARD — Analytics
   ============================================================ */
.yd-wrap { display: flex; flex-direction: column; gap: 16px; }

/* stat cards */
.yd-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.yd-stat {
    background: #fff; border: 1px solid var(--yomi-border);
    border-radius: 10px; padding: 16px;
    display: flex; align-items: center; gap: 12px;
}
.yd-stat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.yd-stat-val { font-size: 22px; font-weight: 800; color: var(--yomi-text); line-height: 1; margin-bottom: 3px; }
.yd-stat-lbl { font-size: 11px; color: var(--yomi-text-2); font-weight: 500; }

/* dashboard layout toolbar */
.yd-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.yd-toolbar-hint {
    font-size: 11.5px; color: var(--yomi-text-3); font-weight: 500;
}
.yd-reset-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 12px;
    background: #fff; color: var(--yomi-text);
    border: 1px solid var(--yomi-border);
    border-radius: 6px;
    font-size: 11.5px; font-weight: 600; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.yd-reset-btn:hover {
    background: var(--yomi-purple); color: #fff;
    border-color: var(--yomi-purple);
}
.yd-reset-btn svg { flex-shrink: 0; }

/* draggable 12-col widget grid */
.yd-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    align-items: start;
}
.yd-w-3  { grid-column: span 3; }
.yd-w-4  { grid-column: span 4; }
.yd-w-6  { grid-column: span 6; }
.yd-w-8  { grid-column: span 8; }
.yd-w-9  { grid-column: span 9; }
.yd-w-12 { grid-column: span 12; }

/* daily-orders spans 2 rows so right side fits payment + customers + insights */
[data-widget-id="daily-orders"] { grid-row: span 2; }
[data-widget-id="daily-orders"] .yd-spark-svg { height: 180px; }

/* Sales Insights mini-stat grid */
.yd-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.yd-insight {
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    background: var(--yomi-page);
    border-radius: 8px;
    min-width: 0;
}
.yd-insight-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.yd-insight-body { min-width: 0; flex: 1; }
.yd-insight-val {
    font-size: 16px; font-weight: 800; color: var(--yomi-text); line-height: 1;
    margin-bottom: 4px; white-space: nowrap;
}
.yd-insight-unit {
    font-size: 10px; font-weight: 600; color: var(--yomi-text-2);
    margin-left: 4px;
}
.yd-insight-lbl {
    font-size: 10.5px; color: var(--yomi-text-2); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 900px) {
    .yd-insights-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
    .yd-w-3, .yd-w-4 { grid-column: span 6; }
    .yd-w-6, .yd-w-8, .yd-w-9 { grid-column: span 12; }
}
@media (max-width: 640px) {
    .yd-w-3, .yd-w-4, .yd-w-6, .yd-w-8, .yd-w-9 { grid-column: span 12; }
}

/* drag affordances */
.yd-drag-handle { cursor: grab; user-select: none; }
.yd-drag-handle:active { cursor: grabbing; }
.yd-grip {
    color: var(--yomi-text-3);
    font-size: 14px;
    letter-spacing: -2px;
    opacity: .55;
    transition: opacity .15s;
}
.yd-card:hover .yd-grip { opacity: 1; }
.yd-ghost {
    opacity: .35;
    background: var(--yomi-page) !important;
    border-style: dashed !important;
}
.yd-chosen { box-shadow: 0 8px 24px rgba(76, 29, 149, .18); }
.yd-dragging { transform: rotate(.5deg); }

/* reviews full-width: layout as multi-col grid */
.yd-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.yd-reviews-grid .yd-review-row { border-bottom: 0; padding-bottom: 0; }

/* chart row (legacy) */
.yd-charts { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.yd-card {
    background: #fff; border: 1px solid var(--yomi-border);
    border-radius: 10px; padding: 18px;
}
.yd-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.yd-card-title { font-size: 13px; font-weight: 700; color: var(--yomi-text); }
.yd-view-all { font-size: 11px; color: var(--yomi-purple); font-weight: 600; text-decoration: none; }
.yd-view-all:hover { text-decoration: underline; }
.yd-empty { font-size: 12px; color: var(--yomi-text-3); padding: 20px 0; text-align: center; }

/* bar chart */
.yd-chart-card { min-height: 220px; }
.yd-bar-chart {
    display: flex; align-items: flex-end; gap: 10px;
    height: 160px; padding: 0 4px;
}
.yd-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; height: 100%; }
.yd-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.yd-bar {
    width: 100%; border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, var(--yomi-purple-accent) 0%, var(--yomi-purple) 100%);
    min-height: 4px; transition: height 0.3s;
}
.yd-bar-val { font-size: 9px; color: var(--yomi-text-2); font-weight: 600; text-align: center; }
.yd-bar-lbl { font-size: 10px; color: var(--yomi-text-3); font-weight: 500; }

/* donut */
.yd-donut-wrap {
    width: 130px; height: 130px;
    position: relative; margin: 0 auto 16px;
}
.yd-donut-svg {
    width: 130px; height: 130px;
    transform: rotate(-90deg);
}
.yd-donut-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.yd-donut-total { font-size: 22px; font-weight: 800; color: var(--yomi-text); line-height: 1; }
.yd-donut-sub { font-size: 10px; color: var(--yomi-text-3); font-weight: 500; margin-top: 2px; }
.yd-legend { display: flex; flex-direction: column; gap: 7px; }
.yd-legend-row { display: flex; align-items: center; gap: 8px; }
.yd-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.yd-legend-lbl { font-size: 11.5px; color: var(--yomi-text); flex: 1; }
.yd-legend-val { font-size: 11.5px; font-weight: 700; color: var(--yomi-text); }

/* bottom row */
.yd-bottom { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.yd-table-card { overflow: auto; }
.yd-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.yd-table th {
    text-align: left; font-size: 10.5px; font-weight: 600;
    color: var(--yomi-text-3); text-transform: uppercase; letter-spacing: .4px;
    padding: 6px 10px; border-bottom: 1px solid var(--yomi-border);
}
.yd-table td { padding: 9px 10px; border-bottom: 1px solid var(--yomi-border-soft); color: var(--yomi-text); }
.yd-table tr:last-child td { border-bottom: 0; }
.yd-mono { font-family: monospace; font-size: 11px; }
.yd-badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 10.5px; font-weight: 600;
}
.yd-badge-pending    { background: #FFF3E0; color: #E65100; }
.yd-badge-paid       { background: #E8F5E9; color: #1B5E20; }
.yd-badge-processing { background: #E3F2FD; color: #0D47A1; }
.yd-badge-shipped    { background: #F3E5F5; color: #6A1B9A; }
.yd-badge-delivered  { background: #E8F5E9; color: #1B5E20; }
.yd-badge-cancelled  { background: #FFEBEE; color: #B71C1C; }
.yd-badge-returned   { background: #EFEBE9; color: #4E342E; }

/* top products */
.yd-top-list { display: flex; flex-direction: column; gap: 10px; }
.yd-top-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--yomi-page);
    border-radius: 8px;
}
.yd-top-rank {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--yomi-purple); color: #fff;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.yd-top-name { flex: 1; font-size: 12px; color: var(--yomi-text); font-weight: 500; }
.yd-top-count { font-size: 11px; color: var(--yomi-text-2); font-weight: 600; white-space: nowrap; }

/* secondary stat row */
.yd-stats-2 { grid-template-columns: repeat(6, 1fr); }

/* mid row: sparkline + payment + customers */
.yd-mid { display: grid; grid-template-columns: 1fr 240px 280px; gap: 16px; }

/* sparkline */
.yd-spark-wrap { position: relative; margin-bottom: 12px; }
.yd-spark-svg { width: 100%; height: 80px; display: block; }
.yd-spark-labels {
    display: flex; justify-content: space-between;
    margin-top: 4px; padding: 0 2px;
}
.yd-spark-labels span { font-size: 9px; color: var(--yomi-text-3); }
.yd-spark-summary { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--yomi-border); padding-top: 10px; }
.yd-spark-item { display: flex; align-items: center; gap: 10px; font-size: 11.5px; }
.yd-spark-date { color: var(--yomi-text-2); width: 48px; flex-shrink: 0; }
.yd-spark-cnt  { flex: 1; color: var(--yomi-text); font-weight: 600; }
.yd-spark-rev  { color: var(--yomi-purple); font-weight: 600; }

/* payment bar */
.yd-pay-list { display: flex; flex-direction: column; gap: 12px; }
.yd-pay-row {}
.yd-pay-top { display: flex; justify-content: space-between; margin-bottom: 5px; }
.yd-pay-lbl { font-size: 12px; color: var(--yomi-text); font-weight: 500; }
.yd-pay-val { font-size: 12px; font-weight: 700; color: var(--yomi-text); }
.yd-pay-bar-bg { height: 6px; background: var(--yomi-border); border-radius: 3px; overflow: hidden; }
.yd-pay-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* customers */
.yd-cust-list { display: flex; flex-direction: column; gap: 10px; }
.yd-cust-row { display: flex; align-items: center; gap: 10px; }
.yd-cust-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--yomi-purple); color: #fff;
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.yd-cust-info { flex: 1; min-width: 0; }
.yd-cust-name  { font-size: 12px; font-weight: 600; color: var(--yomi-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yd-cust-email { font-size: 10.5px; color: var(--yomi-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yd-cust-date  { font-size: 10.5px; color: var(--yomi-text-3); flex-shrink: 0; }

/* bottom row */
.yd-bottom { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.yd-side-stack { display: flex; flex-direction: column; gap: 16px; }

/* reviews */
.yd-reviews-list { display: flex; flex-direction: column; gap: 10px; }
.yd-review-row { display: flex; align-items: flex-start; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--yomi-border-soft); }
.yd-review-row:last-child { border-bottom: 0; padding-bottom: 0; }
.yd-review-stars { font-size: 11px; line-height: 1; flex-shrink: 0; }
.yd-review-body { flex: 1; min-width: 0; }
.yd-review-product { display: block; font-size: 11px; font-weight: 600; color: var(--yomi-text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yd-review-comment { font-size: 10.5px; color: var(--yomi-text-2); line-height: 1.4; }
.yd-review-date { font-size: 10px; color: var(--yomi-text-3); flex-shrink: 0; white-space: nowrap; }

/* Hide page heading on dashboard */
.fi-page-dashboard > .fi-header,
.fi-dashboard-page > .fi-header,
.fi-page.fi-dashboard > .fi-header { display: none !important; }

/* Login page — remove black bg, crop, enlarge */
.fi-simple-header .fi-logo,
.fi-simple-header [class*="logo"],
.fi-simple-header > * > .fi-logo {
    background: #ffffff !important;
    isolation: isolate;
}
.fi-simple-header img,
.fi-simple-layout img[src*="logo"],
.fi-logo img {
    filter: invert(1) !important;
    mix-blend-mode: multiply !important;
    width: 200px !important;
    height: 90px !important;
    object-fit: cover !important;
    object-position: center 50% !important;
    border-radius: 0 !important;
    display: block !important;
    background: #ffffff !important;
}
.fi-simple-main .fi-simple-header h1,
.fi-simple-layout .fi-simple-header h1,
.fi-simple-header h1 {
    display: none !important;
}

/* ============================================================
   RTL OVERRIDES — flip sidebar, main padding, dropdowns
   ============================================================ */
html[dir="rtl"] .fi-sidebar {
    left: auto !important;
    right: 0 !important;
    border-right: 0 !important;
    border-left: 1px solid var(--yomi-border) !important;
    border-radius: 0 12px 0 0 !important;
}
html[dir="rtl"] .fi-main-ctn {
    padding-left: 0 !important;
    padding-right: 248px !important;
}
html[dir="rtl"] .fi-topbar { direction: rtl; }
html[dir="rtl"] .yomi-tb-search {
    right: auto !important;
    left: 12px !important;
}
html[dir="rtl"] .yomi-tb-right { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .yomi-dropdown,
html[dir="rtl"] .yomi-lang-panel,
html[dir="rtl"] .yomi-notif-panel,
html[dir="rtl"] .yomi-profile-panel,
html[dir="rtl"] .yomi-search-drop {
    left: 0 !important;
    right: auto !important;
}
html[dir="rtl"] .yomi-tb-kbd { margin-left: 0; margin-right: 6px; }
html[dir="rtl"] .fi-sidebar-nav-groups,
html[dir="rtl"] .fi-sidebar-group,
html[dir="rtl"] .fi-sidebar-item,
html[dir="rtl"] .fi-sidebar-group-button { text-align: right; }
html[dir="rtl"] .fi-sidebar-item-icon,
html[dir="rtl"] .fi-sidebar-group-button-icon { margin-right: 0; margin-left: 10px; }
html[dir="rtl"] .yd-stat,
html[dir="rtl"] .yd-card-head,
html[dir="rtl"] .yd-insight,
html[dir="rtl"] .yd-cust-row,
html[dir="rtl"] .yd-top-row,
html[dir="rtl"] .yd-review-row,
html[dir="rtl"] .yd-pay-row,
html[dir="rtl"] .yd-spark-item { direction: rtl; text-align: right; }
html[dir="rtl"] .yd-stat-icon,
html[dir="rtl"] .yd-insight-icon { margin-left: 10px; margin-right: 0; }
html[dir="rtl"] .yd-toolbar { direction: rtl; }
html[dir="rtl"] .yd-table { direction: rtl; }
html[dir="rtl"] .yd-table th,
html[dir="rtl"] .yd-table td { text-align: right; }
html[dir="rtl"] .fi-ta-cell:first-child,
html[dir="rtl"] .fi-ta-header-cell:first-child {
    padding-left: 0 !important;
    padding-right: 12px !important;
}
html[dir="rtl"] .fi-ta-row,
html[dir="rtl"] .fi-ta-header-row { direction: rtl; }
html[dir="rtl"] .fi-page,
html[dir="rtl"] .fi-resource-page,
html[dir="rtl"] .fi-section { direction: rtl; text-align: right; }
html[dir="rtl"] .yomi-tb-search { direction: rtl; }
html[dir="rtl"] .yomi-tb-search input { text-align: right; }
html[dir="rtl"] .fi-input-wrp input,
html[dir="rtl"] .fi-input-wrp textarea,
html[dir="rtl"] .fi-input { text-align: right; }

/* ============================================================
   MOBILE RESPONSIVE — admin panel
   ============================================================ */

/* Tablet & below */
@media (max-width: 1024px) {
    .fi-main { padding: 16px !important; }
    .yomi-topbar-search { width: 280px; max-width: 30vw; }
    .yomi-chip-wallet,
    .yomi-chip-ai .yomi-chip-lbl { display: none; }
    .yd-charts { grid-template-columns: 1fr; }
    .yd-insights-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Mobile */
@media (max-width: 768px) {
    /* Sidebar becomes off-canvas drawer (Filament handles toggle) */
    .fi-sidebar {
        position: fixed !important;
        top: 0; bottom: 0; left: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
        width: 240px !important;
        box-shadow: 0 0 20px rgba(0,0,0,.15);
    }
    .fi-sidebar.fi-sidebar-open,
    .fi-sidebar-open .fi-sidebar { transform: translateX(0) !important; }
    html[dir="rtl"] .fi-sidebar {
        left: auto; right: 0;
        transform: translateX(100%);
    }
    html[dir="rtl"] .fi-sidebar.fi-sidebar-open,
    html[dir="rtl"] .fi-sidebar-open .fi-sidebar { transform: translateX(0) !important; }

    .fi-main-ctn,
    html[dir="rtl"] .fi-main-ctn {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .fi-main { padding: 12px !important; max-width: 100% !important; }

    /* Dashboard stat strip stacks */
    .yd-stats { grid-template-columns: repeat(2, 1fr) !important; }
    .yd-stats-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .yd-mid,
    .yd-bottom { grid-template-columns: 1fr !important; }
    .yd-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
    [data-widget-id="daily-orders"] { grid-row: auto !important; }
    .yd-wrap { gap: 12px; }
    .yd-card { padding: 12px !important; }

    /* Prevent any horizontal overflow */
    body, .fi-body, .fi-main-ctn, .fi-main { overflow-x: hidden; max-width: 100vw; }

    /* Topbar: compact, show burger */
    .fi-topbar { padding: 0 8px !important; }
    .fi-topbar > nav { gap: 8px !important; padding: 0 !important; }
    .fi-topbar-open-sidebar-btn,
    .fi-topbar-close-sidebar-btn { display: inline-flex !important; }

    .yomi-topbar-left { min-width: 0; padding-right: 8px; gap: 8px; }
    .yomi-brand-add,
    .yomi-add-pill { display: none; }
    .yomi-brand { font-size: 16px; }

    .yomi-topbar-search,
    .yomi-search,
    .yomi-tb-search { display: none !important; }
    .yomi-topbar-right { gap: 4px; }
    .yomi-topbar-right > *:not(.fi-user-menu):not(.fi-dropdown) { display: none !important; }
    .yomi-chip,
    .yomi-pill,
    .yomi-icon-btn,
    .yomi-pill-row { display: none !important; }
    .fi-topbar-close-sidebar-btn { display: none !important; }
    .fi-user-menu, .fi-dropdown { display: inline-flex !important; }

    /* Page header */
    .fi-header-heading { font-size: 18px !important; }
    .fi-header-subheading { font-size: 13px !important; }
    .fi-page-header-actions { flex-wrap: wrap; gap: 6px; }

    /* Sections stacked */
    .fi-section-header,
    .fi-section-content { padding: 12px !important; }

    /* Tables: horizontal scroll wrapper */
    .fi-ta-ctn,
    .fi-ta { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    .fi-ta-table { min-width: 640px; }
    .fi-ta-cell,
    .fi-ta-header-cell { padding: 8px 10px !important; font-size: 12px !important; }
    .fi-ta-header { padding: 8px 10px !important; flex-wrap: wrap; gap: 8px; }
    .fi-ta-header-toolbar { width: 100%; flex-wrap: wrap; gap: 6px; }

    /* Filters drawer: full width */
    .fi-ta-filters-form { grid-template-columns: 1fr !important; }

    /* Forms: single column */
    .fi-fo-component-ctn .grid,
    .fi-fo-grid { grid-template-columns: 1fr !important; }
    .fi-fo-field-wrp { width: 100% !important; }

    /* Stat widgets stack */
    .fi-wi-stats-overview .grid { grid-template-columns: 1fr !important; }
    .fi-wi-stats-overview-stat-value { font-size: 22px !important; }

    /* Dashboard custom widgets */
    .yd-insights-grid { grid-template-columns: 1fr !important; }
    .yd-w-3, .yd-w-4, .yd-w-6, .yd-w-8, .yd-w-9 { grid-column: span 12 !important; }
    .yd-toolbar { flex-wrap: wrap; gap: 8px; }
    .yd-reviews-grid { grid-template-columns: 1fr; }

    /* Modals fill screen */
    .fi-modal-window { max-width: 100% !important; margin: 8px !important; }

    /* Pagination wrap */
    .fi-pagination { flex-wrap: wrap; gap: 8px; padding: 8px 10px !important; }

    /* Tabs scroll horizontally */
    .fi-tabs { overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; }
    .fi-tabs-item { flex-shrink: 0; }

    /* User menu */
    .fi-dropdown-panel { max-width: calc(100vw - 16px); }
}

/* Small phones */
@media (max-width: 480px) {
    .fi-main { padding: 8px !important; }
    .fi-header-heading { font-size: 16px !important; }
    .fi-btn { height: 32px !important; font-size: 13px !important; padding: 0 10px !important; }
    .yomi-brand { font-size: 14px; }
    .fi-ta-table { min-width: 540px; }
    .yd-stats,
    .yd-stats-2 { grid-template-columns: 1fr !important; }
}

/* Show Filament's burger only on mobile (hidden on desktop by default) */
@media (min-width: 769px) {
    .fi-topbar-open-sidebar-btn,
    .fi-topbar-close-sidebar-btn { display: none !important; }
}
