/* FMO responsive shell - keeps the app usable inside narrow WordPress themes */
.fmo-app, .fmo-app * { box-sizing: border-box; }
.fmo-app {
    font-family: Tahoma, Arial, sans-serif;
    color: #172033;
    background: #f6f7fb;
    border: 1px solid #e8eaf1;
    border-radius: 18px;
    overflow: hidden;
    margin: 20px auto;
    width: min(1180px, calc(100vw - 28px));
    max-width: min(1180px, calc(100vw - 28px));
    position: relative;
}
/* Break out of default post/page content width without affecting the rest of the site */
.entry-content > .fmo-app,
.wp-block-post-content > .fmo-app,
.page-content > .fmo-app {
    left: 50%;
    transform: translateX(-50%);
}
body:has(#fmo-app) .entry-title {
    margin-bottom: 18px;
}
.fmo-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 22px;
    background: linear-gradient(135deg, #1f2937, #334155);
    color: #fff;
}
.fmo-topbar h2 { margin: 0 0 6px; color: #fff; font-size: clamp(22px, 3vw, 32px); line-height: 1.35; }
.fmo-topbar p { margin: 0; opacity: .85; line-height: 1.8; word-break: break-word; }
.fmo-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 700px; }
.fmo-sidebar {
    background: #ffffff;
    border-left: 1px solid #e8eaf1;
    padding: 14px;
}
.fmo-sidebar button {
    display: block;
    width: 100%;
    text-align: right;
    background: transparent;
    border: 0;
    border-radius: 12px;
    padding: 13px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    font-weight: 700;
    color: #344054;
}
.fmo-sidebar button.active,
.fmo-sidebar button:hover { background: #eef4ff; color: #175cd3; }
.fmo-content { padding: 18px; min-width: 0; overflow: hidden; }
.fmo-tab { display: none; }
.fmo-tab.active { display: block; }
.fmo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.fmo-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fmo-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fmo-card {
    background: #fff;
    border: 1px solid #e8eaf1;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}
.fmo-card h3, .fmo-card h4 { margin-top: 0; color: #111827; }
.fmo-card span { display: block; color: #667085; font-size: 13px; margin-bottom: 6px; }
.fmo-card strong { font-size: 22px; color: #111827; }
.fmo-form { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fmo-form-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fmo-form.fmo-inline { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.fmo-form label { display: grid; gap: 6px; font-weight: 700; color: #344054; font-size: 13px; }
.fmo-form input,
.fmo-form select,
.fmo-form textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 10px 11px;
    background: #fff;
    min-height: 42px;
    box-sizing: border-box;
}
.fmo-form textarea { min-height: 84px; resize: vertical; }
.fmo-btn {
    background: #175cd3;
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 800;
    min-height: 42px;
}
.fmo-btn:hover { background: #0b4db7; }
.fmo-btn:disabled { opacity: .65; cursor: not-allowed; }
.fmo-muted { color: #667085; font-size: 13px; }
.fmo-table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.fmo-table-wrap table { width: 100%; border-collapse: collapse; min-width: 720px; }
.fmo-table-wrap th,
.fmo-table-wrap td { border-bottom: 1px solid #eef0f5; padding: 11px; text-align: right; vertical-align: top; }
.fmo-table-wrap th { background: #f8fafc; color: #475467; font-size: 13px; }
.fmo-alert {
    margin: 14px 18px 0;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 700;
}
.fmo-alert.success { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.fmo-alert.error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.fmo-result { margin-top: 14px; }
.fmo-login-box {
    padding: 18px;
    background: #fff4e5;
    border: 1px solid #ffd9a8;
    border-radius: 12px;
    color: #8a4b00;
    font-weight: 700;
}
@media (max-width: 1250px) {
    .fmo-layout { grid-template-columns: 1fr; }
    .fmo-sidebar { display: flex; overflow-x: auto; gap: 8px; border-left: 0; border-bottom: 1px solid #e8eaf1; }
    .fmo-sidebar button { min-width: 160px; text-align: center; }
    .fmo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fmo-grid,
    .fmo-grid.two,
    .fmo-form-wide,
    .fmo-form.fmo-inline { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .fmo-topbar { flex-direction: column; align-items: stretch; }
    .fmo-content { padding: 12px; }
    .fmo-kpis { grid-template-columns: 1fr; }
}


.fmo-counter-box {
    border: 1px dashed #b8c4d8;
    background: #f8fbff;
    border-radius: 14px;
    padding: 14px;
    display: grid;
    gap: 10px;
}
.fmo-counter-number {
    font-size: 42px;
    line-height: 1;
    font-weight: 900;
    text-align: center;
    color: #1d4ed8;
    background: #eef4ff;
    border-radius: 12px;
    padding: 18px;
}
.fmo-counter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.fmo-pan-groups {
    display: grid;
    gap: 10px;
}
.fmo-pan-group {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}
.fmo-live-total {
    padding: 12px 14px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #14532d;
    font-weight: 800;
}
.fmo-btn.secondary {
    background: #e5e7eb;
    color: #111827;
}
.fmo-btn.danger {
    background: #dc2626;
    color: #fff;
}
@media (max-width: 900px) {
    .fmo-pan-group { grid-template-columns: 1fr; }
}

.fmo-vehicles {
    display: grid;
    gap: 14px;
    margin: 14px 0;
}
.fmo-vehicle-card {
    border: 1px solid #dbe4f0;
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}
.fmo-vehicle-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.fmo-vehicle-head h4 { margin: 0; }
.fmo-circle-counter {
    display: grid;
    place-items: center;
    gap: 5px;
    min-height: 120px;
    border: 1px dashed #93c5fd;
    border-radius: 16px;
    background: #eff6ff;
}
.fmo-circle-counter button {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 0;
    background: #175cd3;
    color: #fff;
    font-size: 38px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(23, 92, 211, .25);
}
.fmo-circle-counter span {
    display: inline-block;
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: #1e3a8a;
}
.fmo-circle-counter small {
    color: #475467;
    font-weight: 700;
}
.fmo-mini-total {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-weight: 800;
}
.fmo-mini-total strong { color: #175cd3; }
.fmo-reception-total {
    margin: 14px 0;
    font-size: 16px;
}
@media (max-width: 760px) {
    .fmo-vehicle-head { align-items: stretch; flex-direction: column; }
    .fmo-circle-counter { min-height: 105px; }
    .fmo-circle-counter button { width: 64px; height: 64px; font-size: 34px; }
}

.fmo-login-shell, .fmo-login-shell * { box-sizing: border-box; }
.fmo-login-shell {
    direction: rtl;
    display: grid;
    place-items: center;
    min-height: 70vh;
    background: linear-gradient(135deg, #eef4ff, #f8fafc);
    padding: 24px;
    font-family: Tahoma, Arial, sans-serif;
    width: min(760px, calc(100vw - 28px));
    max-width: min(760px, calc(100vw - 28px));
    margin: 20px auto;
    position: relative;
}
.entry-content > .fmo-login-shell,
.wp-block-post-content > .fmo-login-shell,
.page-content > .fmo-login-shell {
    left: 50%;
    transform: translateX(-50%);
}
.fmo-login-card {
    width: min(100%, 440px);
    background: #fff;
    border: 1px solid #e8eaf1;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .10);
    padding: 26px;
    text-align: right;
}
.fmo-login-card h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 26px;
}
.fmo-login-card p {
    margin: 0 0 18px;
    color: #667085;
    line-height: 1.8;
}
.fmo-login-card label {
    display: block;
    color: #344054;
    font-weight: 800;
    margin-bottom: 8px;
}
.fmo-login-card input[type="text"],
.fmo-login-card input[type="password"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 10px 12px;
    box-sizing: border-box;
    margin-bottom: 14px;
}
.fmo-login-card input[type="submit"] {
    width: 100%;
    background: #175cd3;
    color: #fff;
    border: 0;
    border-radius: 12px;
    min-height: 46px;
    font-weight: 900;
    cursor: pointer;
}
.fmo-login-card input[type="submit"]:hover { background: #0b4db7; }
.fmo-login-note {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475467;
    font-size: 13px;
    line-height: 1.7;
}
.fmo-my-activity-card strong {
    font-size: 14px;
    color: #027a48;
}
.fmo-good{color:#16803b}.fmo-bad{color:#b42318}.fmo-calcs .fmo-card{align-self:start}.fmo-result table strong.fmo-bad{background:#fff1f0;padding:3px 7px;border-radius:999px}.fmo-result table strong.fmo-good{background:#ecfdf3;padding:3px 7px;border-radius:999px}

.fmo-btn.small{padding:7px 12px;font-size:12px;border-radius:10px;}
.fmo-edit-note{font-size:11px;color:#64748b;margin-top:4px;white-space:nowrap;}
.fmo-modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:99999;display:flex;align-items:flex-start;justify-content:center;padding:35px 14px;overflow:auto;direction:rtl;}
.fmo-modal{width:min(980px,96vw);background:#fff;border-radius:22px;box-shadow:0 25px 80px rgba(15,23,42,.35);padding:18px;max-height:92vh;overflow:auto;}
.fmo-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;border-bottom:1px solid #e5e7eb;padding-bottom:10px;}
.fmo-modal-head h3{margin:0;font-size:24px;}
.fmo-edit-form{margin-top:10px;}
@media(max-width:700px){.fmo-modal-backdrop{padding:10px}.fmo-modal{width:100%;border-radius:16px;padding:12px}.fmo-modal-head h3{font-size:19px}}

/* v1.8 responsive/full-width improvements */
body.fmo-has-app .site,
body.fmo-has-app .site-main,
body.fmo-has-app .content-area,
body.fmo-has-app .entry-content,
body.fmo-has-app .wp-block-post-content,
body.fmo-has-app .page-content,
body.fmo-has-app .post-content,
body.fmo-has-app .ast-container,
body.fmo-has-app .container,
body.fmo-has-app .content-wrapper {
    max-width: 100% !important;
}
body.fmo-has-app .sidebar,
body.fmo-has-app #secondary,
body.fmo-has-app .widget-area,
body.fmo-has-app .site-sidebar {
    display: none !important;
}
body.fmo-has-app .content-area,
body.fmo-has-app .site-main,
body.fmo-has-app .primary,
body.fmo-has-app .site-content {
    width: 100% !important;
    flex: 0 0 100% !important;
}
.fmo-app {
    width: min(1380px, calc(100vw - 24px));
    max-width: min(1380px, calc(100vw - 24px));
}
.entry-content > .fmo-app,
.wp-block-post-content > .fmo-app,
.page-content > .fmo-app,
.post-content > .fmo-app {
    position: relative;
    right: 50%;
    transform: translateX(50%);
    width: min(1380px, calc(100vw - 24px));
    max-width: min(1380px, calc(100vw - 24px));
}
.fmo-layout {
    grid-template-columns: 260px minmax(0, 1fr);
}
.fmo-sidebar {
    position: sticky;
    top: 16px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow: auto;
}
.fmo-content {
    overflow: visible;
}
.fmo-card,
.fmo-topbar,
.fmo-sidebar,
.fmo-table-wrap,
.fmo-form {
    max-width: 100%;
}
@media (max-width: 1280px) {
    .fmo-app,
    .entry-content > .fmo-app,
    .wp-block-post-content > .fmo-app,
    .page-content > .fmo-app,
    .post-content > .fmo-app {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        right: 50%;
        transform: translateX(50%);
    }
}
@media (max-width: 1250px) {
    .fmo-sidebar {
        position: static;
        max-height: none;
    }
}
@media (max-width: 768px) {
    .fmo-app,
    .entry-content > .fmo-app,
    .wp-block-post-content > .fmo-app,
    .page-content > .fmo-app,
    .post-content > .fmo-app {
        width: calc(100vw - 10px);
        max-width: calc(100vw - 10px);
        border-radius: 12px;
    }
    .fmo-topbar {
        padding: 16px;
    }
    .fmo-topbar h2 {
        font-size: 28px;
    }
    .fmo-sidebar {
        padding: 10px;
    }
    .fmo-sidebar button {
        min-width: 145px;
        white-space: nowrap;
    }
    .fmo-grid,
    .fmo-grid.two,
    .fmo-kpis,
    .fmo-form-wide,
    .fmo-form.fmo-inline {
        grid-template-columns: 1fr !important;
    }
    .fmo-table-wrap table {
        min-width: 620px;
    }
}


/* v1.9 chair/pan counter */
.fmo-circle-counter small::after {
    content: " — الحساب الافتراضي: 80 كتكوت/برنيكة، و4 إلى 20 برنيكة/كرسي";
    display: block;
    font-size: 11px;
    color: #667085;
    margin-top: 4px;
    max-width: 220px;
}


/* v2.0 Login portal and role gateway */
.fmo-login-shell.fmo-login-portal {
    width: min(1220px, calc(100vw - 24px));
    max-width: min(1220px, calc(100vw - 24px));
    margin: 28px auto;
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 18px;
    align-items: stretch;
}
.fmo-login-hero,
.fmo-login-card,
.fmo-login-roles,
.fmo-entry-card {
    background: #fff;
    border: 1px solid #e8eaf1;
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}
.fmo-login-hero {
    background: linear-gradient(135deg, #111827, #334155);
    color: #fff;
    padding: 34px;
    display: grid;
    align-content: center;
}
.fmo-login-brand {
    display: inline-flex;
    width: fit-content;
    padding: 9px 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    font-weight: 900;
    margin-bottom: 18px;
}
.fmo-login-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1.25;
    color: #fff;
}
.fmo-login-hero p {
    margin: 0;
    font-size: 18px;
    line-height: 1.9;
    color: rgba(255,255,255,.88);
}
.fmo-login-card {
    padding: 28px;
}
.fmo-login-card h2,
.fmo-login-roles h3 {
    margin-top: 0;
    color: #111827;
}
.fmo-login-card form p {
    margin: 0 0 12px;
}
.fmo-login-card input[type="text"],
.fmo-login-card input[type="password"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 10px 12px;
}
.fmo-login-card input[type="submit"] {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    background: #175cd3;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}
.fmo-login-note {
    margin-top: 12px;
    color: #667085;
    font-size: 13px;
    line-height: 1.7;
}
.fmo-login-roles {
    grid-column: 1 / -1;
    padding: 22px;
}
.fmo-role-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.fmo-role-card {
    border: 1px solid #e8eaf1;
    border-radius: 18px;
    padding: 14px;
    background: #f8fafc;
    display: grid;
    gap: 7px;
    min-height: 142px;
}
.fmo-role-card.active {
    background: #eef4ff;
    border-color: #175cd3;
    box-shadow: inset 0 0 0 2px rgba(23,92,211,.12);
}
.fmo-role-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: #fff;
    font-size: 25px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}
.fmo-role-card strong {
    font-size: 15px;
    color: #111827;
}
.fmo-role-card span {
    display: block;
    color: #667085;
    font-size: 12px;
    line-height: 1.7;
}
.fmo-dashboard-locked .fmo-dashboard-shell {
    display: none;
}
.fmo-entry-gate {
    padding: 24px;
    background: #f6f7fb;
}
.fmo-entry-card {
    padding: 26px;
}
.fmo-entry-badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #027a48;
    font-weight: 900;
    margin-bottom: 10px;
}
.fmo-entry-card h2 {
    margin: 0 0 8px;
    color: #111827;
}
.fmo-entry-card p {
    color: #475467;
}
.fmo-entry-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.fmo-entry-actions .fmo-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 1000px) {
    .fmo-login-shell.fmo-login-portal {
        grid-template-columns: 1fr;
    }
    .fmo-role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .fmo-login-shell.fmo-login-portal {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        margin: 10px auto;
    }
    .fmo-login-hero,
    .fmo-login-card,
    .fmo-login-roles,
    .fmo-entry-card {
        border-radius: 16px;
        padding: 18px;
    }
    .fmo-role-grid {
        grid-template-columns: 1fr;
    }
    .fmo-entry-actions {
        display: grid;
    }
}


/* v2.1 default user role selectors */
.fmo-role-card-login[data-login-user] {
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.fmo-role-card-login[data-login-user]:hover,
.fmo-role-card-login.selected {
    transform: translateY(-2px);
    border-color: #175cd3;
    box-shadow: 0 14px 28px rgba(23, 92, 211, .14);
    background: #eef4ff;
}
.fmo-role-card-login em {
    color: #175cd3;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}


/* v2.2 administrative delete/edit zone */
.fmo-btn.small {
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 12px;
    margin: 2px;
}
.fmo-danger-zone {
    border-color: #fecaca;
    background: #fffafa;
}
.fmo-danger-zone h3 {
    color: #991b1b;
}


/* v2.4 separated chick / pan / chair count lines */
.fmo-vehicle-meta { margin-bottom: 12px; }
.fmo-count-lines { display: grid; gap: 12px; margin: 12px 0; }
.fmo-count-line {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    background: #fff;
}
.fmo-line-title { display: grid; gap: 4px; align-content: center; }
.fmo-line-title span { font-size: 26px; margin: 0; }
.fmo-line-title strong { font-size: 16px; color: #111827; }
.fmo-line-title small { color: #667085; line-height: 1.6; }
.fmo-line-total { min-height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #f8fafc; border: 1px dashed #d0d5dd; font-weight: 900; }
.fmo-line-chick { background: #fff7ed; }
.fmo-line-pan { background: #f0fdf4; }
.fmo-line-chair { background: #eff6ff; }
.fmo-line-adjust { background: #fafafa; grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(150px, 1fr)); }
@media (max-width: 980px) {
    .fmo-count-line, .fmo-line-adjust { grid-template-columns: 1fr; }
}


/* v2.5 reception counters refinements */
.fmo-mini-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    border: 1px dashed #93c5fd;
    border-radius: 14px;
    background: #eff6ff;
    padding: 8px 10px;
}
.fmo-mini-plus {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 0;
    background: #175cd3;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(23, 92, 211, .18);
}
.fmo-mini-counter span {
    min-width: 34px;
    text-align: center;
    font-size: 22px;
    font-weight: 900;
    color: #1e3a8a;
}
.fmo-mini-counter small {
    color: #475467;
    font-weight: 700;
}
.fmo-preset-buttons {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.fmo-preset-buttons button {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #175cd3;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 800;
    cursor: pointer;
}
.fmo-preset-buttons button:hover {
    background: #dbeafe;
}
.fmo-line-chair .fmo-circle-counter { display: none; }


/* v2.6 Smart management modules */
.fmo-alert-list { display: grid; gap: 12px; }
.fmo-smart-alert {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
}
.fmo-smart-alert strong { display:block; font-size: 16px; margin-bottom: 5px; }
.fmo-smart-alert span { display:block; color:#667085; font-size: 13px; margin-bottom: 6px; }
.fmo-smart-alert p { margin:0; }
.fmo-smart-alert.danger { background:#fef2f2; border-color:#fecaca; color:#7f1d1d; }
.fmo-smart-alert.warning { background:#fffbeb; border-color:#fde68a; color:#78350f; }
.fmo-quick-tasks { display:flex; gap:8px; flex-wrap:wrap; }
.fmo-done-row { opacity:.72; background:#f0fdf4; }
.fmo-danger-text { color:#b42318; }
.fmo-report-paper {
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:20px;
    margin-top:14px;
}
.fmo-report-paper h2, .fmo-report-paper h3 { color:#111827; }
.fmo-report-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.fmo-report-actions a { text-decoration:none; }
@media print {
    body * { visibility: hidden !important; }
    #fmo-printable-report, #fmo-printable-report * { visibility: visible !important; }
    #fmo-printable-report {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        border: 0 !important;
        box-shadow: none !important;
    }
}


/* v2.7 inventory supplier/transfer controls */
.fmo-highlight-card {
    border-color: #bfdbfe;
    background: #eff6ff;
}
.fmo-admin-stock-card {
    border-color: #fde68a;
    background: #fffbeb;
}
.fmo-transfer-row {
    background: #f8fafc;
}
.fmo-admin-stock-card textarea,
.fmo-highlight-card textarea {
    min-height: 74px;
}


/* v2.8 advanced reporting */
.fmo-advanced-report-card {
    border-color: #c7d2fe;
    background: #f8faff;
}
.fmo-checklist {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: #fff;
    display: grid;
    gap: 9px;
}
.fmo-checklist h4 {
    margin: 0 0 4px;
    color: #111827;
}
.fmo-checklist label {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.fmo-checklist input[type="checkbox"] {
    width: auto;
    min-height: auto;
}
.fmo-default-checks {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.fmo-secondary-checks {
    border-color: #fed7aa;
    background: #fff7ed;
}
.fmo-report-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0;
}
.fmo-advanced-report-paper {
    overflow: visible;
}
.fmo-adv-table th,
.fmo-adv-table td {
    white-space: nowrap;
}
@media print {
    .fmo-report-toolbar,
    .fmo-sidebar,
    .fmo-topbar,
    #wpadminbar {
        display: none !important;
    }
    .fmo-advanced-report-paper {
        width: 100% !important;
        border: 0 !important;
        box-shadow: none !important;
    }
}


/* v2.9 reception reports */
.fmo-reception-report-card {
    border-color: #bfdbfe;
    background: #eff6ff;
}
.fmo-reception-report-paper h2 {
    margin-top: 0;
}
.fmo-report-notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.fmo-report-notes-grid p {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin: 0;
    line-height: 1.8;
}
@media (max-width: 800px) {
    .fmo-report-notes-grid {
        grid-template-columns: 1fr;
    }
}


/* v3.0 comparable software inspired modules */
.fmo-biosecurity-card {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.fmo-harvest-card {
    border-color: #fed7aa;
    background: #fff7ed;
}
.fmo-sensor-card {
    border-color: #bae6fd;
    background: #f0f9ff;
}
.fmo-bio-checks {
    grid-column: 1 / -1;
}
.fmo-bio-checks label {
    font-size: 14px;
}


/* v3.1 simpler interactive UI */
.fmo-layout {
    grid-template-columns: 285px minmax(0, 1fr);
}
.fmo-sidebar {
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    background: #f8fafc;
}
.fmo-menu-tools {
    background: #ffffff;
    border: 1px solid #e8eaf1;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
}
.fmo-menu-tools strong {
    display: block;
    margin-bottom: 8px;
    color: #101828;
}
.fmo-menu-search {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 10px 11px;
    box-sizing: border-box;
    background: #fff;
}
.fmo-menu-group {
    background: #fff;
    border: 1px solid #e8eaf1;
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 12px;
}
.fmo-menu-title {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: #667085;
    margin: 0 4px 8px;
}
.fmo-sidebar button {
    margin-bottom: 4px;
    padding: 11px 10px;
    font-size: 13px;
    line-height: 1.35;
}
.fmo-sidebar button.active {
    background: #175cd3;
    color: #fff;
    box-shadow: 0 8px 16px rgba(23, 92, 211, .18);
}
.fmo-screen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 15px 16px;
    margin-bottom: 16px;
}
.fmo-current-screen-title {
    display: block;
    font-size: 20px;
    font-weight: 900;
    color: #111827;
}
.fmo-current-screen-desc {
    margin: 5px 0 0;
    color: #475467;
    line-height: 1.7;
}
.fmo-welcome-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    background: #101828;
    color: #fff;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
}
.fmo-welcome-card h2 {
    margin: 0 0 6px;
    color: #fff;
}
.fmo-welcome-card p {
    margin: 0;
    color: #d0d5dd;
}
.fmo-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.fmo-quick-actions button {
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 900;
    background: #fff;
    color: #175cd3;
}
.fmo-help-box {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 18px;
    padding: 16px;
    margin-top: 18px;
}
.fmo-help-box strong {
    display: block;
    color: #92400e;
    font-size: 17px;
    margin-bottom: 6px;
}
.fmo-help-box p {
    margin: 0;
    color: #78350f;
    line-height: 1.8;
}
.fmo-help-box ol {
    margin: 0;
    padding-right: 20px;
    color: #78350f;
    line-height: 1.9;
    font-weight: 700;
}
.fmo-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.fmo-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .07);
}
@media (max-width: 1100px) {
    .fmo-layout {
        grid-template-columns: 1fr;
    }
    .fmo-sidebar {
        position: relative;
        top: auto;
        max-height: none;
        display: grid;
        gap: 10px;
    }
    .fmo-help-box {
        grid-template-columns: 1fr;
    }
    .fmo-screen-head,
    .fmo-welcome-card {
        flex-direction: column;
        align-items: stretch;
    }
}


/* v3.2 review workflow and cycle closing */
.fmo-review-card {
    border-color: #bfdbfe;
    background: #eff6ff;
}
.fmo-close-cycle-card {
    border-color: #fecaca;
    background: #fff1f2;
}
.fmo-review-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 12px 14px;
    margin-top: 10px;
}
.fmo-review-summary strong {
    font-size: 28px;
    color: #175cd3;
}
.fmo-pending-pending {
    background: #fffbeb;
}
.fmo-pending-approved {
    background: #f0fdf4;
}
.fmo-pending-rejected {
    background: #fef2f2;
}


/* v3.3 dashboard current counts */
.fmo-structure-counts-card {
    border-color: #bae6fd;
    background: #f0f9ff;
}
.fmo-structure-counts-card h4 {
    margin-top: 18px;
}
.fmo-structure-counts-card table td strong {
    font-size: 18px;
    color: #0f172a;
}

/* v3.4 notifications, validation and cycle close checklist */
.fmo-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fmo-notify-wrap {
    position: relative;
    z-index: 30;
}
.fmo-notify-btn {
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    border-radius: 14px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 900;
    min-height: 42px;
}
.fmo-notify-btn strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    margin-inline-start: 5px;
    font-size: 12px;
}
.fmo-notify-panel {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    width: min(360px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 38px rgba(15,23,42,.16);
    padding: 10px;
    max-height: 430px;
    overflow-y: auto;
}
.fmo-notify-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #eef2f7;
    padding: 8px 8px 10px;
    margin-bottom: 6px;
}
.fmo-notify-head span {
    color: #b42318;
    font-weight: 900;
    font-size: 12px;
}
.fmo-notify-item {
    display: block;
    width: 100%;
    text-align: right;
    border: 0;
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    background: #f8fafc;
}
.fmo-notify-item strong { display:block; color:#111827; margin-bottom:4px; }
.fmo-notify-item small { display:block; color:#475467; line-height:1.5; }
.fmo-notify-item.danger { background:#fef2f2; }
.fmo-notify-item.warning { background:#fffbeb; }
.fmo-notify-item.info { background:#eff6ff; }
.fmo-close-checklist {
    border-color: #fecaca;
    background: #fff7f7;
}
.fmo-close-checklist h4 { margin-top: 0; }
@media (max-width: 800px) {
    .fmo-notify-panel { right: 0; left: auto; }
    .fmo-top-actions { width: 100%; justify-content: space-between; }
}


/* v3.5 main dashboard timeline */
.fmo-timeline-card {
    border-color: #ddd6fe;
    background: #fbfaff;
}
.fmo-card-head-inline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.fmo-card-head-inline h3 { margin-bottom: 4px; }
.fmo-card-head-inline strong {
    background: #ede9fe;
    color: #5b21b6;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
}
.fmo-timeline-filter {
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 16px;
    padding: 12px;
}
.fmo-timeline-wrap {
    display: grid;
    gap: 14px;
}
.fmo-timeline-day h4 {
    margin: 0 0 8px;
    color: #4c1d95;
}
.fmo-timeline-list {
    position: relative;
    display: grid;
    gap: 10px;
}
.fmo-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}
.fmo-timeline-dot {
    width: 12px;
    height: 12px;
    background: #7c3aed;
    border: 3px solid #ede9fe;
    border-radius: 50%;
    margin-top: 12px;
}
.fmo-timeline-body {
    background: #fff;
    border: 1px solid #e9d5ff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 6px 16px rgba(76, 29, 149, .05);
}
.fmo-timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.fmo-timeline-meta strong { font-size: 15px; color: #111827; }
.fmo-timeline-meta span {
    background: #f3f4f6;
    border-radius: 999px;
    padding: 3px 8px;
    color: #374151;
    font-size: 12px;
    font-weight: 800;
}
.fmo-timeline-meta small { color: #667085; font-weight: 800; }
.fmo-timeline-body p { margin: 0 0 8px; color: #111827; }
.fmo-timeline-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.fmo-timeline-sub span {
    background: #f8fafc;
    border: 1px solid #eef2ff;
    border-radius: 999px;
    padding: 4px 8px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
}
.fmo-empty-timeline {
    background: #fff;
    border: 1px dashed #c4b5fd;
    border-radius: 16px;
    padding: 18px;
    color: #6d28d9;
    font-weight: 800;
}
@media (max-width: 900px) {
    .fmo-card-head-inline { flex-direction: column; }
}

/* v3.6 offline mode */
.fmo-offline-center {
    min-width: 230px;
}
.fmo-offline-widget {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}
.fmo-offline-widget.offline {
    border-color: #fecaca;
    background: #fef2f2;
}
.fmo-offline-widget.online {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.fmo-offline-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #16a34a;
    display: inline-block;
}
.fmo-offline-widget.offline .fmo-offline-dot {
    background: #dc2626;
}
.fmo-offline-widget strong {
    font-size: 13px;
    color: #111827;
}
.fmo-offline-widget span {
    font-size: 12px;
    color: #475467;
}
.fmo-offline-list {
    flex-basis: 100%;
    display: grid;
    gap: 5px;
    margin-top: 6px;
    max-height: 110px;
    overflow: auto;
}
.fmo-offline-list div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255,255,255,.72);
    border-radius: 10px;
    padding: 6px 8px;
}
.fmo-offline-list b,
.fmo-offline-list small {
    font-size: 11px;
}
@media (max-width: 900px) {
    .fmo-offline-center {
        min-width: 100%;
    }
}


/* v3.7 Dawagen.Masr / Egypoultry.com style + export/settings */
.fmo-app {
    --fmo-primary: #0f766e;
    --fmo-primary-dark: #115e59;
    --fmo-accent: #f59e0b;
    --fmo-soft: #ecfdf5;
    --fmo-cream: #fffbeb;
    border-color: #99f6e4;
    background:
        radial-gradient(circle at top right, rgba(15,118,110,.10), transparent 34%),
        linear-gradient(180deg, #f0fdfa, #f8fafc 42%, #ffffff);
}
.fmo-topbar {
    background:
        linear-gradient(135deg, rgba(17,94,89,.97), rgba(15,118,110,.94)),
        radial-gradient(circle at left, rgba(245,158,11,.28), transparent 38%);
    border-bottom: 4px solid var(--fmo-accent);
}
.fmo-topbar h2::before {
    content: '🐔 ';
}
.fmo-sidebar button.active {
    background: linear-gradient(135deg, var(--fmo-primary), var(--fmo-primary-dark));
    color: #fff;
}
.fmo-sidebar button:hover {
    background: #ccfbf1;
    color: var(--fmo-primary-dark);
}
.fmo-btn {
    background: var(--fmo-primary);
}
.fmo-btn:hover {
    background: var(--fmo-primary-dark);
}
.fmo-btn.secondary {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}
.fmo-screen-head,
.fmo-welcome-card {
    background:
        linear-gradient(135deg, #ecfdf5, #ffffff),
        radial-gradient(circle at left, rgba(245,158,11,.18), transparent 40%);
    border-color: #99f6e4;
}
.fmo-welcome-card h2,
.fmo-current-screen-title {
    color: #064e3b;
}
.fmo-brand-hero {
    background:
        linear-gradient(135deg, #064e3b, #0f766e),
        radial-gradient(circle at left, rgba(245,158,11,.45), transparent 42%);
    color: #fff;
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: 0 16px 40px rgba(15, 118, 110, .18);
}
.fmo-brand-hero span {
    display: inline-block;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 900;
    margin-bottom: 10px;
}
.fmo-brand-hero h2 {
    margin: 0 0 8px;
    color: #fff;
}
.fmo-brand-hero p {
    margin: 0;
    color: #d1fae5;
}
.fmo-export-card {
    background: linear-gradient(180deg, #ecfdf5, #fff);
    border-color: #99f6e4;
}
.fmo-backup-card {
    background: linear-gradient(180deg, #fffbeb, #fff);
    border-color: #fde68a;
}
.fmo-settings-card {
    background: linear-gradient(180deg, #f0f9ff, #fff);
    border-color: #bae6fd;
}
.fmo-success-note {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 800;
}

/* v3.8 security hardening UI */
.fmo-security-card {
    background: linear-gradient(180deg, #fef2f2, #fff);
    border-color: #fecaca;
}
.fmo-sec-pass td { background: #f0fdf4; }
.fmo-sec-warning td { background: #fffbeb; }
.fmo-sec-danger td { background: #fef2f2; }
.fmo-security-card code {
    direction: ltr;
    display: inline-block;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    padding: 6px 8px;
    font-family: Consolas, Monaco, monospace;
}


/* v3.9 server backup + recovery */
.fmo-server-backup-card {
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border-color: #cbd5e1;
}
.fmo-server-backup-card code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px 6px;
    direction: ltr;
    display: inline-block;
}
.fmo-warning-note {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 12px 14px;
    margin: 10px 0;
    font-weight: 800;
}
.fmo-danger-note {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 12px 14px;
    margin: 10px 0;
    font-weight: 800;
}


/* v4.0 danger zone */
.fmo-danger-zone-card {
    background: linear-gradient(180deg, #fff1f2, #ffffff);
    border-color: #fecdd3;
}
.fmo-danger-zone-card h3 {
    color: #991b1b;
}
.fmo-check-line {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #fecdd3;
    border-radius: 14px;
    padding: 12px 14px;
    margin: 12px 0;
    font-weight: 800;
}
.fmo-check-line input {
    width: auto !important;
}


/* v4.3 manager report fix */
.fmo-manager-paper {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 18px;
}
.fmo-report-brand {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #064e3b, #0f766e);
    color: #fff;
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.fmo-report-brand span {
    color: #d1fae5;
}
.fmo-whatsapp-preview {
    white-space: pre-wrap;
    direction: rtl;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    line-height: 1.8;
}
@media print {
    body * { visibility: hidden; }
    #fmo-manager-printable-report, #fmo-manager-printable-report * { visibility: visible; }
    #fmo-manager-printable-report {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: 0;
    }
}


/* v4.4 full review */
.fmo-expense-card {
    background: linear-gradient(180deg, #fff7ed, #ffffff);
    border-color: #fed7aa;
}


/* v4.5 detailed user access */
.fmo-chip {
    display: inline-block;
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 900;
    margin-inline-start: 6px;
}
.fmo-access-modal {
    width: min(1120px, 96vw);
}
.fmo-access-box {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #f0fdfa, #ffffff);
}
.fmo-access-box .fmo-checklist {
    max-height: 360px;
    overflow: auto;
}
.fmo-modal-close {
    float: left;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 0;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 900;
    cursor: pointer;
}


/* v4.6 sign out + cash calculator */
.fmo-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.fmo-signout-btn {
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fmo-cash-card {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #f0fdf4, #ffffff);
}
.fmo-cash-quick {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}
.fmo-cash-rows {
    display: grid;
    gap: 10px;
}
.fmo-cash-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr) minmax(120px, auto) auto;
    gap: 8px;
    align-items: end;
    background: #fff;
    border: 1px solid #dcfce7;
    border-radius: 14px;
    padding: 10px;
}
.fmo-cash-row > span {
    font-weight: 900;
    padding-bottom: 12px;
}
.fmo-cash-row [data-cash-line-total] {
    background: #ecfdf5;
    color: #065f46;
    border-radius: 12px;
    padding: 11px 12px;
    text-align: center;
}
.fmo-cash-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #065f46, #0f766e);
    color: #fff;
    border-radius: 18px;
    padding: 15px 18px;
    margin-top: 14px;
}
.fmo-cash-total strong {
    font-size: 28px;
    color: #fff;
}
@media(max-width:720px) {
    .fmo-cash-quick,
    .fmo-cash-row {
        grid-template-columns: 1fr;
    }
    .fmo-cash-row > span {
        padding-bottom: 0;
    }
}


/* v4.7 cash calculator redesign + advanced users */
.fmo-calc-first {
    grid-column: 1 / -1;
}
.fmo-cash-card {
    border: 1px solid #86efac !important;
    background:
        radial-gradient(circle at top left, rgba(16,185,129,.12), transparent 38%),
        linear-gradient(180deg, #f0fdf4, #ffffff) !important;
}
.fmo-cash-head {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(220px, 320px);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}
.fmo-cash-total {
    margin: 0 !important;
    box-shadow: 0 14px 30px rgba(6,95,70,.18);
}
.fmo-cash-quick {
    grid-template-columns: minmax(0,1fr) auto !important;
    background: #fff;
    border: 1px solid #dcfce7;
    border-radius: 16px;
    padding: 12px;
}
.fmo-cash-table-head,
.fmo-cash-row {
    display: grid !important;
    grid-template-columns: minmax(100px,1fr) 34px minmax(100px,1fr) minmax(130px,160px) 80px !important;
    gap: 8px;
    align-items: center !important;
}
.fmo-cash-table-head {
    color: #065f46;
    font-weight: 900;
    padding: 0 10px 6px;
}
.fmo-cash-row {
    background: #ffffff !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 16px !important;
    padding: 10px !important;
}
.fmo-cash-row input {
    min-height: 42px !important;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
}
.fmo-cash-x {
    text-align: center;
    color: #64748b;
    font-size: 20px;
    font-weight: 900;
}
.fmo-cash-row [data-cash-line-total] {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #bbf7d0;
    font-size: 18px;
}
.fmo-email-settings-card {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #eff6ff, #ffffff);
}
.fmo-access-modal .fmo-form > .fmo-grid.two {
    margin-bottom: 12px;
}
.fmo-farm-checks {
    border-color: #c7d2fe;
    background: #f8faff;
}
@media(max-width:720px) {
    .fmo-cash-head,
    .fmo-cash-quick,
    .fmo-cash-table-head,
    .fmo-cash-row {
        grid-template-columns: 1fr !important;
    }
    .fmo-cash-table-head {
        display: none !important;
    }
}


/* v4.8 calculator categories */
.fmo-calc-hero {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
    border-color: #99f6e4;
}
.fmo-calc-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.fmo-calc-category {
    background: #ffffff;
    border-color: #d1fae5;
}
.fmo-calc-category h3 {
    margin-top: 0;
    color: #064e3b;
}
.fmo-calc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.fmo-calc-nav-btn {
    border: 1px solid #a7f3d0;
    background: #f0fdf4;
    color: #065f46;
    border-radius: 999px;
    padding: 9px 12px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.fmo-calc-nav-btn.active,
.fmo-calc-nav-btn:hover {
    background: #0f766e;
    color: #fff;
    border-color: #0f766e;
}
.fmo-calc-card {
    display: none;
}
.fmo-calc-card.active {
    display: block;
}
.fmo-calc-cards .fmo-card.active {
    grid-column: 1 / -1;
}
.fmo-calc-card .fmo-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.fmo-calc-card .fmo-result {
    margin-top: 12px;
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px;
}
@media(max-width:1000px){
    .fmo-calc-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fmo-calc-card .fmo-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media(max-width:720px){
    .fmo-calc-category-grid,
    .fmo-calc-card .fmo-form { grid-template-columns: 1fr; }
}


/* v4.9 calculator polish: icons, cash direct rows, eggs/trays */
.fmo-calc-nav-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    min-height: 44px;
    text-align: right;
}
.fmo-calc-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    font-size: 18px;
    line-height: 1;
}
.fmo-calc-nav-btn.active .fmo-calc-icon {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.45);
}
.fmo-calc-label {
    flex: 1;
    line-height: 1.35;
    font-weight: 900;
}
.fmo-cash-card .fmo-cash-head {
    align-items: stretch;
}
.fmo-cash-table-head {
    grid-template-columns: minmax(100px,1fr) 34px minmax(100px,1fr) minmax(130px,160px) 80px !important;
}
.fmo-cash-row {
    grid-template-columns: minmax(100px,1fr) 34px minmax(100px,1fr) minmax(130px,160px) 80px !important;
}
.fmo-cash-direct-box {
    margin-top: 16px;
    background: #fff;
    border: 1px dashed #86efac;
    border-radius: 16px;
    padding: 12px;
}
.fmo-cash-direct-box h4 {
    margin: 0 0 4px;
    color: #065f46;
}
.fmo-cash-direct-head,
.fmo-cash-direct-row {
    display: grid;
    grid-template-columns: minmax(140px,1fr) minmax(120px,180px) minmax(130px,160px) 80px;
    gap: 8px;
    align-items: center;
}
.fmo-cash-direct-head {
    color: #065f46;
    font-weight: 900;
    padding: 8px 0 6px;
}
.fmo-cash-direct-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
    margin-top: 8px;
}
.fmo-cash-direct-row input {
    min-height: 42px !important;
    text-align: center;
    font-weight: 800;
}
.fmo-cash-direct-row [data-cash-direct-total] {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    font-size: 18px;
}
@media(max-width:720px) {
    .fmo-cash-table-head,
    .fmo-cash-row,
    .fmo-cash-direct-head,
    .fmo-cash-direct-row {
        grid-template-columns: 1fr !important;
    }
    .fmo-cash-table-head,
    .fmo-cash-direct-head {
        display: none !important;
    }
}


/* v5.0 daily date/time auto controls */
.fmo-daily-time-tools {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 10px 12px;
}
.fmo-daily-time-tools .fmo-btn {
    white-space: nowrap;
}


/* v5.1 navigation + task notifications */
.fmo-nav-controls {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.fmo-nav-controls .fmo-btn[disabled],
.fmo-floating-nav button[disabled] {
    opacity: .45;
    cursor: not-allowed;
}
.fmo-floating-nav {
    position: sticky;
    bottom: 8px;
    z-index: 30;
    display: none;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e2e8f0;
}
.fmo-floating-nav button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 900;
    color: #fff;
    background: #0f766e;
    cursor: pointer;
}
.fmo-floating-nav button:first-child,
.fmo-floating-nav button:last-child {
    background: #f8fafc;
    color: #0f766e;
    border: 1px solid #99f6e4;
}
.fmo-task-focus {
    animation: fmoTaskPulse 1.1s ease-in-out 0s 5;
    outline: 3px solid #f59e0b;
    outline-offset: -3px;
}
@keyframes fmoTaskPulse {
    0%,100% { background: #fff7ed; }
    50% { background: #ffedd5; }
}
.fmo-notify-item small::after {
    content: ' ← اضغط للفتح';
    color: #0f766e;
    font-weight: 900;
}
@media(max-width: 820px) {
    .fmo-floating-nav { display: flex; }
    .fmo-nav-controls { width: 100%; }
    .fmo-nav-controls .fmo-btn { flex: 1; }
}


/* v5.2 reception batch/date-time improvements */
.fmo-batch-empty-note {
    grid-column: 1 / -1;
    margin: 0 0 4px;
}
.fmo-form select[name="batch_id"] {
    background-color: #fff !important;
    cursor: pointer;
}
.fmo-form select[name="batch_id"]:disabled {
    opacity: .65;
    cursor: not-allowed;
}


/* v5.3 subscription and farm licensing */
.fmo-subscription-card {
    border-color: #bbf7d0;
    background:
        radial-gradient(circle at top left, rgba(16,185,129,.12), transparent 36%),
        linear-gradient(180deg, #f0fdf4, #ffffff);
}
.fmo-payment-box {
    display: grid;
    gap: 4px;
    background: #052e16;
    color: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    margin: 12px 0;
    border: 2px solid #22c55e;
}
.fmo-payment-box span {
    font-size: 26px;
    font-weight: 900;
    direction: ltr;
}
.fmo-payment-box small {
    color: #bbf7d0;
}
.fmo-sub-amount {
    grid-column: 1 / -1;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 900;
}
.fmo-sub-amount strong {
    font-size: 24px;
}
.fmo-license-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 900;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
}
.fmo-license-badge.pending {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.fmo-license-badge.approved,
.fmo-license-badge.active {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.fmo-license-badge.rejected,
.fmo-license-badge.expired,
.fmo-license-badge.paused {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.fmo-small-input {
    max-width: 150px;
    min-height: 34px !important;
    margin: 3px;
}


/* v5.4 gateway, renewal and quick batch */
.fmo-license-gate {
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}
.fmo-license-gate h3 {
    margin: 0 0 8px;
}
.fmo-license-gate p {
    margin: 0 0 12px;
    font-weight: 700;
}
.fmo-license-gate.new-user,
.fmo-license-gate.pending {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
    border-color: #86efac;
    color: #064e3b;
}
.fmo-license-gate.rejected {
    background: linear-gradient(135deg, #fef2f2, #ffffff);
    border-color: #fecaca;
    color: #991b1b;
}
.fmo-license-gate.active-soon {
    background: linear-gradient(135deg, #fffbeb, #ffffff);
    border-color: #fde68a;
    color: #92400e;
}
.fmo-quick-batch-card {
    border-color: #bfdbfe;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,.10), transparent 34%),
        linear-gradient(180deg, #eff6ff, #ffffff);
}
.fmo-quick-batch-card h3::before {
    content: '⚡ ';
}

/* v5.5 owner notifications and broadcast */
.fmo-broadcast-card {
    border-color: #c4b5fd;
    background:
        radial-gradient(circle at top left, rgba(139,92,246,.12), transparent 36%),
        linear-gradient(180deg, #f5f3ff, #ffffff);
}
.fmo-notify-item em {
    display: inline-flex;
    width: fit-content;
    margin-top: 5px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}
.fmo-whatsapp-outbox {
    margin-top: 14px;
    background: #ffffff;
    border: 1px dashed #c4b5fd;
    border-radius: 16px;
    padding: 12px;
}
.fmo-whatsapp-outbox h4 {
    margin: 0 0 4px;
    color: #5b21b6;
}


/* v5.7 WhatsApp API settings */
.fmo-whatsapp-api-note {
    grid-column: 1 / -1;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: 14px;
    padding: 10px 12px;
    font-weight: 700;
}
.fmo-chip.success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.fmo-chip.danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}


/* =========================
   v6.0 SaaS UI / Design System
   ========================= */
#fmo-app {
    --fmo-primary: #0f766e;
    --fmo-primary-2: #14b8a6;
    --fmo-dark: #0f172a;
    --fmo-muted: #64748b;
    --fmo-line: #e2e8f0;
    --fmo-soft: #f8fafc;
    --fmo-success: #16a34a;
    --fmo-warning: #d97706;
    --fmo-danger: #dc2626;
    --fmo-radius: 20px;
    --fmo-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}
#fmo-app .fmo-card {
    border: 1px solid var(--fmo-line);
    border-radius: var(--fmo-radius);
    box-shadow: var(--fmo-shadow);
    background: #fff;
}
#fmo-app .fmo-card h3 {
    letter-spacing: -.2px;
}
#fmo-app .fmo-btn,
#fmo-app button.fmo-btn,
#fmo-app .fmo-quick-actions button,
#fmo-app .fmo-role-action,
#fmo-app .fmo-wizard-steps button {
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
#fmo-app .fmo-btn:hover,
#fmo-app .fmo-quick-actions button:hover,
#fmo-app .fmo-role-action:hover,
#fmo-app .fmo-wizard-steps button:hover {
    transform: translateY(-1px);
}
#fmo-app.fmo-loading {
    opacity: .72;
    pointer-events: none;
}
#fmo-app.fmo-loading::after {
    content: 'جاري تحميل البيانات...';
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    background: #0f172a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: 0 14px 35px rgba(15,23,42,.2);
    font-weight: 800;
}
.fmo-v6-pill {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #115e59;
    font-weight: 900;
    margin-bottom: 8px;
}
.fmo-welcome-card.v6 {
    background:
        radial-gradient(circle at 20% 0%, rgba(20,184,166,.22), transparent 36%),
        linear-gradient(135deg, #0f172a, #134e4a);
    color: #fff;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 22px 60px rgba(15,23,42,.18);
}
.fmo-welcome-card.v6 p,
.fmo-welcome-card.v6 h2 {
    color: #fff;
}
.fmo-welcome-card.v6 .fmo-quick-actions button {
    background: rgba(255,255,255,.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 16px;
}

/* Role dashboard */
.fmo-role-dashboard {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    margin: 16px 0;
}
.fmo-role-head {
    border-radius: 24px;
    padding: 18px;
    background: linear-gradient(180deg, #ecfeff, #ffffff);
    border: 1px solid #bae6fd;
    box-shadow: var(--fmo-shadow);
}
.fmo-role-head span,
.fmo-role-head small {
    display: block;
    color: var(--fmo-muted);
    font-weight: 700;
}
.fmo-role-head strong {
    display: block;
    font-size: 24px;
    color: var(--fmo-dark);
    margin: 6px 0;
}
.fmo-role-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
}
.fmo-role-action {
    text-align: right;
    border: 1px solid var(--fmo-line);
    background: #fff;
    border-radius: 22px;
    padding: 16px;
    min-height: 128px;
    cursor: pointer;
    box-shadow: var(--fmo-shadow);
}
.fmo-role-action span {
    display: inline-flex;
    font-size: 28px;
    margin-bottom: 10px;
}
.fmo-role-action strong,
.fmo-role-action small {
    display: block;
}
.fmo-role-action small {
    color: var(--fmo-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* License summary */
.fmo-license-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 22px;
    margin-bottom: 14px;
    border: 1px solid var(--fmo-line);
    background: #fff;
    box-shadow: var(--fmo-shadow);
}
.fmo-license-summary div {
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
}
.fmo-license-summary span {
    display: block;
    color: var(--fmo-muted);
    font-size: 12px;
    font-weight: 800;
}
.fmo-license-summary strong {
    display: block;
    font-size: 20px;
    color: var(--fmo-dark);
}
.fmo-license-summary.active {
    border-color: #86efac;
}
.fmo-license-summary.warning {
    border-color: #fcd34d;
    background: #fffbeb;
}
.fmo-license-summary.danger {
    border-color: #fecaca;
    background: #fef2f2;
}

/* Wizard */
.fmo-wizard-card {
    background: #fff;
    border: 1px solid var(--fmo-line);
    border-radius: 24px;
    padding: 18px;
    margin: 16px 0;
    box-shadow: var(--fmo-shadow);
}
.fmo-wizard-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.fmo-wizard-title strong {
    font-size: 20px;
}
.fmo-wizard-title span {
    color: var(--fmo-muted);
    font-weight: 900;
}
.fmo-progress {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}
.fmo-progress i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--fmo-primary), var(--fmo-primary-2));
    border-radius: 999px;
}
.fmo-wizard-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.fmo-wizard-steps button {
    border: 1px solid var(--fmo-line);
    border-radius: 18px;
    background: #f8fafc;
    padding: 12px;
    text-align: right;
    cursor: pointer;
}
.fmo-wizard-steps button.done {
    border-color: #86efac;
    background: #ecfdf5;
}
.fmo-wizard-steps button.todo {
    border-style: dashed;
}
.fmo-wizard-steps b {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--fmo-dark);
    color: #fff;
    margin-bottom: 8px;
}
.fmo-wizard-steps strong,
.fmo-wizard-steps small {
    display: block;
}
.fmo-wizard-steps small {
    color: var(--fmo-muted);
}

/* Notifications hub */
.fmo-card-headline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.fmo-card-headline h3,
.fmo-card-headline p {
    margin: 0;
}
.fmo-notification-list {
    display: grid;
    gap: 8px;
}
.fmo-notification-row {
    border: 1px solid var(--fmo-line);
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 5px 8px;
    text-align: right;
    cursor: pointer;
}
.fmo-notification-row span {
    grid-row: span 3;
    color: var(--fmo-primary);
    font-size: 24px;
    line-height: 1;
}
.fmo-notification-row strong,
.fmo-notification-row small,
.fmo-notification-row em {
    display: block;
}
.fmo-notification-row small {
    color: var(--fmo-muted);
}
.fmo-notification-row.read {
    opacity: .62;
}
.fmo-notification-row.danger {
    border-color: #fecaca;
    background: #fff7f7;
}
.fmo-notification-row.warning {
    border-color: #fde68a;
    background: #fffbeb;
}
.fmo-notify-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--fmo-line);
}

/* Batch cards and empty states */
.fmo-batch-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}
.fmo-batch-card {
    border: 1px solid var(--fmo-line);
    border-radius: 18px;
    padding: 12px;
    background: #f8fafc;
}
.fmo-batch-card div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.fmo-batch-card strong {
    color: var(--fmo-dark);
}
.fmo-batch-card span,
.fmo-batch-card p {
    color: var(--fmo-muted);
}
.fmo-batch-card b {
    font-size: 22px;
    color: var(--fmo-primary);
}
.fmo-empty-state {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
    padding: 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 20px;
    background: #f8fafc;
}
.fmo-empty-state span {
    font-size: 42px;
}
.fmo-empty-state strong {
    color: var(--fmo-dark);
}
.fmo-empty-state small {
    color: var(--fmo-muted);
}

/* Broadcast / WhatsApp command center */
.fmo-broadcast-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 12px 0;
}
.fmo-broadcast-stats div {
    background: #f8fafc;
    border: 1px solid var(--fmo-line);
    border-radius: 16px;
    padding: 12px;
}
.fmo-broadcast-stats span {
    display: block;
    color: var(--fmo-muted);
    font-weight: 800;
}
.fmo-broadcast-stats strong {
    display: block;
    font-size: 24px;
    color: var(--fmo-dark);
}
.fmo-error-text {
    color: var(--fmo-danger);
    font-weight: 800;
}

/* Mobile polish */
@media (max-width: 980px) {
    .fmo-role-dashboard {
        grid-template-columns: 1fr;
    }
    .fmo-role-actions,
    .fmo-wizard-steps,
    .fmo-grid.fmo-kpis.v6,
    .fmo-license-summary,
    .fmo-broadcast-stats {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 640px) {
    #fmo-app {
        font-size: 15px;
    }
    .fmo-welcome-card.v6 {
        padding: 18px;
        border-radius: 22px;
    }
    .fmo-role-actions,
    .fmo-wizard-steps,
    .fmo-grid.fmo-kpis.v6,
    .fmo-license-summary,
    .fmo-broadcast-stats,
    .fmo-batch-card-grid {
        grid-template-columns: 1fr;
    }
    .fmo-card,
    .fmo-role-action,
    .fmo-wizard-card {
        border-radius: 18px !important;
    }
    .fmo-form button[type="submit"] {
        position: sticky;
        bottom: 72px;
        z-index: 50;
        width: 100%;
        box-shadow: 0 12px 32px rgba(15,23,42,.18);
    }
    .fmo-table-wrap table,
    .fmo-table-wrap thead,
    .fmo-table-wrap tbody,
    .fmo-table-wrap th,
    .fmo-table-wrap td,
    .fmo-table-wrap tr {
        font-size: 13px;
    }
    .fmo-notify-panel {
        position: fixed !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-height: 75vh;
        overflow: auto;
    }
}


/* v6.2 stability polish: hide system admin from public UI + stop mobile horizontal drift */
html:has(#fmo-app),
body:has(#fmo-app),
html:has(.fmo-login-shell),
body:has(.fmo-login-shell) {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}
body:has(#fmo-app) .entry-content,
body:has(#fmo-app) .wp-block-post-content,
body:has(#fmo-app) .page-content,
body:has(#fmo-app) .post-content,
body:has(.fmo-login-shell) .entry-content,
body:has(.fmo-login-shell) .wp-block-post-content,
body:has(.fmo-login-shell) .page-content,
body:has(.fmo-login-shell) .post-content {
    overflow-x: clip !important;
}
.fmo-app,
.fmo-login-shell.fmo-login-portal,
.entry-content > .fmo-app,
.wp-block-post-content > .fmo-app,
.page-content > .fmo-app,
.post-content > .fmo-app {
    right: auto !important;
    left: auto !important;
    transform: none !important;
    max-width: min(1380px, calc(100vw - 16px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
#fmo-app,
.fmo-dashboard-shell,
.fmo-layout,
.fmo-content,
.fmo-tab,
.fmo-card,
.fmo-screen-head,
.fmo-topbar,
.fmo-role-dashboard,
.fmo-wizard-card,
.fmo-license-summary,
.fmo-table-wrap {
    min-width: 0 !important;
    max-width: 100% !important;
}
.fmo-topbar,
.fmo-screen-head,
.fmo-card-headline,
.fmo-entry-actions,
.fmo-top-actions,
.fmo-nav-controls {
    flex-wrap: wrap !important;
}
.fmo-sidebar button,
.fmo-role-card,
.fmo-role-action,
.fmo-wizard-steps button,
.fmo-btn {
    font-family: Tahoma, Arial, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif !important;
}
.fmo-sidebar button {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    white-space: normal !important;
    word-break: break-word;
}
.fmo-role-icon,
.fmo-calc-icon,
.fmo-role-action span,
.fmo-empty-state span {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', Tahoma, sans-serif !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 768px) {
    .fmo-app,
    .fmo-login-shell.fmo-login-portal,
    .entry-content > .fmo-app,
    .wp-block-post-content > .fmo-app,
    .page-content > .fmo-app,
    .post-content > .fmo-app {
        width: calc(100vw - 10px) !important;
        max-width: calc(100vw - 10px) !important;
        margin: 6px auto !important;
        border-radius: 12px !important;
    }
    .fmo-layout { display: block !important; }
    .fmo-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .fmo-menu-group {
        min-width: 0 !important;
    }
    .fmo-sidebar button {
        min-width: 128px !important;
        max-width: 210px !important;
        flex: 0 0 auto;
        text-align: center !important;
        justify-content: center;
    }
    .fmo-content,
    .fmo-entry-gate,
    .fmo-topbar,
    .fmo-screen-head {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .fmo-form input,
    .fmo-form select,
    .fmo-form textarea {
        font-size: 16px !important;
    }
    .fmo-table-wrap {
        width: 100% !important;
        overflow-x: auto !important;
    }
    .fmo-table-wrap table {
        min-width: 560px !important;
    }
}
@media (max-width: 420px) {
    .fmo-table-wrap table { min-width: 500px !important; }
    .fmo-sidebar button { min-width: 116px !important; max-width: 180px !important; }
    .fmo-role-action, .fmo-card { padding: 12px !important; }
}


/* v6.5 Barn performance vs standards + transaction export */
.fmo-barn-performance-card {
    margin: 16px 0;
}
.fmo-performance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.fmo-performance-card {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}
.fmo-performance-card.warning {
    border-color: #fcd34d;
    background: linear-gradient(180deg, #fffdf2, #fffbeb);
}
.fmo-performance-card.danger {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff7f7, #fef2f2);
}
.fmo-performance-card.ahead {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #f0f9ff, #eff6ff);
}
.fmo-performance-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.fmo-performance-top strong {
    display: block;
    font-size: 20px;
    color: #0f172a;
}
.fmo-performance-top span {
    display: block;
    color: #64748b;
    margin-top: 4px;
}
.fmo-performance-top em {
    font-style: normal;
    border-radius: 999px;
    padding: 6px 10px;
    background: #ecfdf5;
    color: #166534;
    font-weight: 900;
    white-space: nowrap;
}
.fmo-performance-card.warning .fmo-performance-top em {
    background: #fef3c7;
    color: #92400e;
}
.fmo-performance-card.danger .fmo-performance-top em {
    background: #fee2e2;
    color: #991b1b;
}
.fmo-performance-card.ahead .fmo-performance-top em {
    background: #dbeafe;
    color: #1d4ed8;
}
.fmo-performance-meta,
.fmo-performance-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0;
}
.fmo-performance-meta span,
.fmo-performance-details span {
    background: rgba(255,255,255,.7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    color: #475569;
}
.fmo-weight-compare {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.fmo-weight-compare div {
    background: #0f172a;
    color: #fff;
    border-radius: 16px;
    padding: 10px;
}
.fmo-weight-compare span {
    display: block;
    color: #cbd5e1;
    font-size: 12px;
}
.fmo-weight-compare strong {
    display: block;
    font-size: 18px;
    margin-top: 4px;
}
.fmo-progress.performance {
    margin: 12px 0;
    height: 12px;
}
.fmo-progress.performance i {
    background: linear-gradient(90deg, #14b8a6, #22c55e);
}
.fmo-performance-card.warning .fmo-progress.performance i {
    background: linear-gradient(90deg, #f59e0b, #facc15);
}
.fmo-performance-card.danger .fmo-progress.performance i {
    background: linear-gradient(90deg, #ef4444, #f97316);
}
.fmo-tx-report-modal {
    max-width: 920px;
}
.fmo-report-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}
.fmo-report-meta span {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 8px;
}
.fmo-printable-report h3 {
    font-size: 24px;
    margin-bottom: 4px;
}
[data-export-tx] {
    margin-inline-end: 6px;
    margin-bottom: 4px;
}
@media (max-width: 860px) {
    .fmo-performance-grid,
    .fmo-performance-meta,
    .fmo-performance-details,
    .fmo-weight-compare,
    .fmo-report-meta {
        grid-template-columns: 1fr;
    }
}

/* v6.6 Current cycle, end-cycle report, and demo reset */
.fmo-cycle-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #0f172a, #0f766e);
    color: #fff;
    margin-bottom: 14px;
}
.fmo-cycle-hero h2,
.fmo-cycle-hero p { color: #fff; margin: 4px 0; }
.fmo-cycle-hero span { color: #ccfbf1; font-weight: 900; }
.fmo-cycle-hero.good { background: linear-gradient(135deg, #064e3b, #0f766e); }
.fmo-cycle-hero.excellent { background: linear-gradient(135deg, #14532d, #16a34a); }
.fmo-cycle-hero.medium { background: linear-gradient(135deg, #78350f, #d97706); }
.fmo-cycle-hero.danger { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.fmo-cycle-score {
    min-width: 128px;
    min-height: 128px;
    border-radius: 28px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 10px;
}
.fmo-cycle-score strong { font-size: 42px; line-height: 1; }
.fmo-cycle-score small, .fmo-cycle-score em { display: block; color: #fff; font-style: normal; font-weight: 800; }
.fmo-cycle-kpis .fmo-card strong { font-size: 21px; }
.fmo-current-cycle-item {
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 14px;
    margin: 14px 0;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15,23,42,.06);
}
.fmo-recommend-list { margin: 0; padding-inline-start: 22px; }
.fmo-recommend-list li { margin: 8px 0; line-height: 1.6; }
.fmo-demo-admin-card {
    border-color: #93c5fd !important;
    background: linear-gradient(180deg, #eff6ff, #ffffff) !important;
}
.fmo-success-note {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
    border-radius: 14px;
    padding: 10px 12px;
    font-weight: 900;
}
@media (max-width: 720px) {
    .fmo-cycle-hero { flex-direction: column; align-items: stretch; }
    .fmo-cycle-score { min-width: 0; min-height: 96px; }
}


/* v6.7 current cost + live price profit forecast */
.fmo-profit-forecast {
    margin: 16px 0;
    border: 1px solid #c7d2fe;
    background:
        radial-gradient(circle at 95% 0%, rgba(20,184,166,.16), transparent 34%),
        linear-gradient(180deg, #ffffff, #f8fafc);
}
.fmo-profit-forecast.compact {
    margin: 0;
}
.fmo-profit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 900;
    white-space: nowrap;
}
.fmo-profit-current,
.fmo-profit-results,
.fmo-profit-inputs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.fmo-profit-inputs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fmo-profit-current div,
.fmo-profit-results div {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    background: #fff;
}
.fmo-profit-current span,
.fmo-profit-results span {
    display: block;
    color: #64748b;
    font-weight: 800;
    font-size: 12px;
}
.fmo-profit-current strong,
.fmo-profit-results strong {
    display: block;
    margin-top: 4px;
    font-size: 21px;
    color: #0f172a;
}
.fmo-profit-results [data-projected-profit] {
    font-size: 26px;
}
.fmo-profit-results strong.positive {
    color: #15803d;
}
.fmo-profit-results strong.negative {
    color: #b91c1c;
}
.fmo-profit-inputs label {
    display: grid;
    gap: 6px;
    font-weight: 900;
    color: #0f172a;
}
.fmo-profit-inputs input {
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 11px 12px;
    font-weight: 900;
    font-size: 17px;
    background: #fff;
}
.fmo-profit-scenarios {
    margin-top: 12px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 12px;
}
.fmo-profit-scenarios h4 {
    margin: 0 0 8px;
}
.fmo-profit-scenarios [data-price-scenarios] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.fmo-price-scenario {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
}
.fmo-price-scenario span,
.fmo-price-scenario em {
    display: block;
    font-style: normal;
    color: #64748b;
}
.fmo-price-scenario strong {
    display: block;
    color: #0f172a;
    font-size: 18px;
}
.fmo-price-scenario.positive em {
    color: #15803d;
    font-weight: 900;
}
.fmo-price-scenario.negative em {
    color: #b91c1c;
    font-weight: 900;
}
.fmo-overview-profit-panel {
    margin: 16px 0;
}
.fmo-overview-profit-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
}
.fmo-profit-forecast.compact .fmo-profit-current,
.fmo-profit-forecast.compact .fmo-profit-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fmo-profit-forecast.compact .fmo-profit-current div:nth-child(4) {
    display: none;
}
@media (max-width: 980px) {
    .fmo-profit-current,
    .fmo-profit-results,
    .fmo-profit-inputs,
    .fmo-profit-scenarios [data-price-scenarios],
    .fmo-profit-forecast.compact .fmo-profit-current,
    .fmo-profit-forecast.compact .fmo-profit-results {
        grid-template-columns: 1fr;
    }
    .fmo-profit-badge {
        width: 100%;
    }
}

/* v6.8 hierarchy note */
.fmo-hierarchy-note {
    border-color: #bae6fd !important;
    background: linear-gradient(180deg, #f0f9ff, #ffffff) !important;
    color: #0f172a;
}
.fmo-hierarchy-note strong {
    color: #0369a1;
}


/* v6.9 Full-page app mode + scope selection */
body.fmo-has-app {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background: #f8fafc !important;
}

/* Hide theme header/footer only on the page that contains [fmo_app] */
body.fmo-has-app header,
body.fmo-has-app footer,
body.fmo-has-app .site-header,
body.fmo-has-app .site-footer,
body.fmo-has-app #masthead,
body.fmo-has-app #colophon,
body.fmo-has-app .wp-block-template-part,
body.fmo-has-app .wp-site-blocks > header,
body.fmo-has-app .wp-site-blocks > footer,
body.fmo-has-app .entry-header,
body.fmo-has-app .page-header,
body.fmo-has-app .wp-block-post-title,
body.fmo-has-app h1.entry-title {
    display: none !important;
}

body.fmo-has-app .wp-site-blocks,
body.fmo-has-app .site,
body.fmo-has-app #page,
body.fmo-has-app #content,
body.fmo-has-app .site-content,
body.fmo-has-app .content-area,
body.fmo-has-app main,
body.fmo-has-app article,
body.fmo-has-app .entry-content,
body.fmo-has-app .wp-block-post-content,
body.fmo-has-app .is-layout-constrained,
body.fmo-has-app .wp-block-group,
body.fmo-has-app .alignwide,
body.fmo-has-app .alignfull {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.fmo-has-app #fmo-app {
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh !important;
    margin-inline: calc(50% - 50vw) !important;
    border-radius: 0 !important;
}

body.fmo-has-app .fmo-dashboard-shell,
body.fmo-has-app .fmo-login-shell {
    min-height: 100vh;
    border-radius: 0 !important;
}

.fmo-scope-bar {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
}

.fmo-scope-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.fmo-scope-summary span {
    color: #0f172a;
    font-weight: 900;
}

.fmo-scope-pickers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.fmo-scope-pickers em {
    display: block;
    font-style: normal;
    color: #64748b;
    font-weight: 800;
    margin-bottom: 6px;
}

.fmo-scope-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fmo-scope-buttons button {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
}

.fmo-scope-buttons button.active,
.fmo-scope-buttons button:hover {
    border-color: #14b8a6;
    background: #ecfdf5;
    color: #065f46;
}

.fmo-selected-row {
    outline: 2px solid #14b8a6;
    outline-offset: -2px;
    background: #ecfdf5 !important;
}

@media (max-width: 900px) {
    body.fmo-has-app #wpadminbar {
        position: fixed;
    }
    .fmo-scope-pickers {
        grid-template-columns: 1fr;
    }
    .fmo-scope-summary {
        align-items: stretch;
    }
}

/* v7.0 uses isolated database tables with prefix fmo_v70_ and auto-selects new barns after creation. */


/* v8.0 Sanad visibility fixes */
.fmo-weight-compare div,
.fmo-weight-compare strong,
.fmo-weight-compare span {
    color: #ffffff !important;
}
.fmo-weight-compare span {
    opacity: .88;
}
.fmo-weight-compare strong {
    text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
.fmo-performance-card .fmo-weight-compare div {
    background: #0b1736 !important;
}


/* v8.1 Sanad UX & workflow improvements */
.fmo-scope-bar {
    position: sticky;
    top: 10px;
    z-index: 30;
    backdrop-filter: blur(12px);
}
.fmo-sanad-first-run {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 18px;
    align-items: center;
    border: 1px solid #99f6e4;
    background: linear-gradient(135deg, #f0fdfa, #ffffff 58%, #eff6ff);
    margin: 0 0 16px;
}
.fmo-first-run-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 34px;
    background: #0f172a;
    color: #fff;
}
.fmo-first-run-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}
.fmo-first-run-steps span {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #dbeafe;
    background: #fff;
    border-radius: 12px;
    padding: 9px;
    font-weight: 900;
}
.fmo-first-run-steps b {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #14b8a6;
    color: #fff;
}
#fmo-app button:focus-visible,
#fmo-app a:focus-visible,
#fmo-app input:focus-visible,
#fmo-app select:focus-visible,
#fmo-app textarea:focus-visible {
    outline: 3px solid #38bdf8 !important;
    outline-offset: 2px;
}
.fmo-weight-compare div,
.fmo-weight-compare span,
.fmo-weight-compare strong {
    color: #ffffff !important;
}
.fmo-table-wrap {
    scrollbar-width: thin;
}
@media (max-width: 900px) {
    .fmo-scope-bar { position: relative; top: auto; }
    .fmo-sanad-first-run { grid-template-columns: 1fr; text-align: center; }
    .fmo-first-run-icon { margin: 0 auto; }
    .fmo-first-run-steps { grid-template-columns: 1fr 1fr; }
    .fmo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    #fmo-app .fmo-btn, #fmo-app button { min-height: 42px; }
}
@media (max-width: 520px) {
    .fmo-first-run-steps { grid-template-columns: 1fr; }
}

/* v8.2 Sanad private login: never show WordPress UI on app page */
body.fmo-has-app #wpadminbar {
    display: none !important;
}
html:has(body.fmo-has-app) {
    margin-top: 0 !important;
}
body.fmo-has-app {
    padding-top: 0 !important;
}
.fmo-custom-login-form {
    display: grid;
    gap: 14px;
}
.fmo-custom-login-form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}
.fmo-custom-login-form input[type="text"],
.fmo-custom-login-form input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #fff;
    color: #0f172a;
    font-size: 16px;
}
.fmo-password-wrap {
    position: relative;
}
.fmo-password-wrap input {
    padding-left: 48px !important;
}
.fmo-password-toggle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #eef2ff;
    cursor: pointer;
}
.fmo-remember {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}
.fmo-login-submit {
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    background: #0f4c81;
    color: #fff;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
}
.fmo-login-submit:disabled {
    opacity: .7;
    cursor: wait;
}
.fmo-login-error {
    display: none;
    padding: 11px 12px;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 800;
}
.fmo-login-error:not(:empty) {
    display: block;
}
.fmo-login-error.success {
    background: #ecfdf5;
    color: #166534;
}


/* v8.4 restored full navigation sidebar */
.fmo-layout {
    grid-template-columns: 285px minmax(0, 1fr) !important;
    align-items: start;
}
.fmo-sidebar {
    display: block !important;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 12px;
    z-index: 30;
}
.fmo-sidebar .fmo-menu-group { display: block; margin-bottom: 14px; }
.fmo-sidebar .fmo-menu-title { display:block; padding:7px 8px; color:#64748b; font-size:12px; font-weight:900; }
.fmo-sidebar button { width:100%; min-width:0 !important; max-width:none !important; margin:3px 0; text-align:right !important; justify-content:flex-start !important; }
.fmo-sidebar-toggle { display:none; }
@media (max-width: 1250px) {
    .fmo-layout { grid-template-columns: 260px minmax(0,1fr) !important; }
    .fmo-sidebar { display:block !important; overflow-y:auto !important; overflow-x:hidden !important; border-bottom:0 !important; }
}
@media (max-width: 900px) {
    .fmo-layout { display:block !important; }
    .fmo-sidebar-toggle { display:inline-flex; }
    .fmo-sidebar {
        position:fixed !important; top:0 !important; right:0 !important; bottom:0 !important;
        width:min(86vw,330px) !important; max-width:330px !important; max-height:100vh !important;
        border-radius:0 !important; transform:translateX(110%); transition:transform .22s ease;
        box-shadow:-18px 0 48px rgba(15,23,42,.22); z-index:99999 !important; padding-top:18px;
    }
    .fmo-sidebar.is-open { transform:translateX(0); }
    body.fmo-sidebar-open::after { content:""; position:fixed; inset:0; background:rgba(15,23,42,.48); z-index:99998; }
    .fmo-sidebar .fmo-menu-group { min-width:0 !important; }
    .fmo-sidebar button { min-width:0 !important; max-width:none !important; flex:none !important; text-align:right !important; justify-content:flex-start !important; }
}


/* v8.5 farm warehouse and invoice lots */
.fmo-warehouse-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px}
.fmo-warehouse-summary-card{display:flex;gap:12px;align-items:center;background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:14px;box-shadow:0 8px 22px rgba(15,23,42,.05)}
.fmo-warehouse-summary-card>span{font-size:30px}.fmo-warehouse-summary-card strong,.fmo-warehouse-summary-card em,.fmo-warehouse-summary-card small{display:block}.fmo-warehouse-summary-card em{font-style:normal;font-weight:900;color:#0f172a;margin:3px 0}.fmo-warehouse-summary-card small{color:#64748b}.fmo-lot-empty{opacity:.55;background:#f8fafc}.fmo-form small{font-weight:400;color:#64748b}
@media(max-width:1000px){.fmo-warehouse-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.fmo-warehouse-summary{grid-template-columns:1fr}}


/* v8.6 production mode */
.fmo-mode-broiler .fmo-layer-only,
.fmo-mode-broiler [name="eggs_count"],
.fmo-mode-broiler [name="tray_count"],
.fmo-mode-broiler [name="egg_weight_g"] { display:none !important; }
.fmo-form-subgrid { display: contents; }

/* v8.8 subscription plans, activation codes, and internal billing controls */
.fmo-subscription-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.fmo-subscription-plan {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 180px;
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.fmo-subscription-plan.trial {
    border-color: #86efac;
    background: linear-gradient(180deg, #ecfdf5, #fff);
}
.fmo-subscription-plan.annual {
    border-color: #fcd34d;
    background: linear-gradient(180deg, #fffbeb, #fff);
}
.fmo-subscription-plan h4 {
    margin: 0;
    font-size: 22px;
}
.fmo-subscription-plan strong {
    color: #065f46;
    font-size: 22px;
}
.fmo-subscription-plan small {
    color: #475569;
    line-height: 1.8;
}
.fmo-subscription-request-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fmo-generated-code-box {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.fmo-generated-code-box code {
    display: block;
    direction: ltr;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    background: #052e16;
    color: #fff;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 900;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
}
.fmo-generated-code-box small {
    color: #92400e;
    font-weight: 700;
}
@media (max-width: 900px) {
    .fmo-subscription-plan-grid,
    .fmo-subscription-request-grid {
        grid-template-columns: 1fr;
    }
}

/* Sanad v8.9 governance and audit controls */
.fmo-row-reversed {
    opacity: .72;
    background: repeating-linear-gradient(135deg, rgba(120, 35, 35, .05), rgba(120, 35, 35, .05) 8px, transparent 8px, transparent 16px);
}
.fmo-row-reversed td {
    text-decoration-color: rgba(150, 30, 30, .45);
}
.fmo-subscription-card code,
#fmo-tab-subscription code {
    direction: ltr;
    unicode-bidi: isolate;
    font-weight: 700;
}
.fmo-close-cycle-card hr {
    border: 0;
    border-top: 1px solid rgba(128, 128, 128, .25);
    margin: 24px 0;
}


/* Sanad v9.0 identity */
.fmo-brand-logo {
    display: block;
    object-fit: contain;
    background: #fff;
    border-radius: 18px;
}
.fmo-brand-logo-login {
    width: min(280px, 76vw);
    height: auto;
    max-height: 280px;
    margin: 0 auto 14px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
}
.fmo-topbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 560px;
}
.fmo-brand-logo-topbar {
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    padding: 4px;
    box-shadow: 0 9px 24px rgba(0,0,0,.2);
}
.fmo-brand-logo-first-run {
    width: 70px;
    height: 70px;
    border-radius: 20px;
}
.fmo-first-run-logo {
    padding: 0;
    overflow: hidden;
    background: #fff;
}
.fmo-report-brand-with-logo,
.fmo-brand-hero-with-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}
.fmo-brand-logo-report {
    width: 72px;
    height: 72px;
    border: 1px solid #e2e8f0;
}
.fmo-brand-logo-section {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    box-shadow: 0 10px 26px rgba(15,23,42,.12);
}
@media (max-width: 700px) {
    .fmo-topbar-brand,
    .fmo-brand-hero-with-logo {
        align-items: flex-start;
    }
    .fmo-brand-logo-topbar {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }
    .fmo-brand-logo-section {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
    }
}
@media print {
    .fmo-brand-logo-report { width: 62px; height: 62px; }
}


/* Sanad logo palette overrides */
.fmo-app {
    --fmo-primary: #b78318;
    --fmo-primary-dark: #7a5510;
    --fmo-primary-2: #e31b23;
    --fmo-accent: #e31b23;
}
.fmo-topbar {
    background: linear-gradient(135deg, #111111, #2a2a2a) !important;
    border-bottom-color: #d4a12b !important;
}
.fmo-topbar h2::before { content: '' !important; }
.fmo-sidebar button.active {
    background: linear-gradient(135deg, #171717, #343434) !important;
    color: #fff !important;
    box-shadow: inset -4px 0 0 #d4a12b;
}
.fmo-sidebar button:hover {
    background: #fff8e8 !important;
    color: #7a5510 !important;
}
.fmo-btn:not(.danger):not(.secondary),
.fmo-login-submit {
    background: linear-gradient(135deg, #b78318, #8a6113) !important;
}
.fmo-btn:not(.danger):not(.secondary):hover,
.fmo-login-submit:hover {
    background: linear-gradient(135deg, #8a6113, #6b480c) !important;
}
.fmo-btn.secondary {
    background: #fff8e8 !important;
    color: #6b480c !important;
    border-color: #e5c46f !important;
}
.fmo-screen-head,
.fmo-welcome-card,
.fmo-sanad-first-run {
    background: linear-gradient(135deg, #fffaf0, #ffffff) !important;
    border-color: #e7c872 !important;
}
.fmo-welcome-card h2,
.fmo-current-screen-title {
    color: #171717 !important;
}
.fmo-brand-hero {
    background: linear-gradient(135deg, #171717, #3b2b0d) !important;
    box-shadow: 0 16px 40px rgba(23, 23, 23, .2) !important;
}
.fmo-login-hero {
    background: linear-gradient(135deg, #111111, #312407) !important;
    border-color: #d4a12b !important;
}
.fmo-login-brand {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 22px !important;
}
.fmo-login-card input[type="text"],
.fmo-login-card input[type="password"] {
    border-color: #d9bd70 !important;
    background: #fffdf8 !important;
}


.fmo-reference-link {
    color: #9a6a00;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.fmo-reference-link:hover { color: #c41230; }

/* v9.2 — Internal poultry market */
.fmo-market-summary { align-items: stretch; }
.fmo-market-summary .fmo-card { height: 100%; }
.fmo-market-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.fmo-market-meta > div { border: 1px solid var(--fmo-border, #e6e6e6); border-radius: 12px; padding: 12px; background: #fafafa; }
.fmo-market-meta span { display: block; color: #666; font-size: 12px; margin-bottom: 5px; }
.fmo-market-meta strong { display: block; overflow-wrap: anywhere; }
.fmo-market-warning, .fmo-market-advisory { border-radius: 12px; padding: 11px 13px; margin: 12px 0; line-height: 1.7; }
.fmo-market-warning { background: #fff0ed; border: 1px solid #efb0a5; color: #8a2315; }
.fmo-market-advisory { background: #fff8df; border: 1px solid #e7cd72; color: #64510e; }
.fmo-market-trend { display: inline-flex; min-width: 68px; justify-content: center; border-radius: 999px; padding: 5px 9px; font-weight: 700; font-size: 12px; }
.fmo-market-trend.up { background: #e8f7ee; color: #16753c; }
.fmo-market-trend.down { background: #fff0ed; color: #a12c1d; }
.fmo-market-trend.stable { background: #eef1f4; color: #45515c; }
.fmo-market-table td:nth-child(2), .fmo-market-table td:nth-child(3) { white-space: nowrap; font-weight: 700; }
@media (max-width: 780px) {
    .fmo-market-meta { grid-template-columns: 1fr; }
}


/* v9.6 farm showcase */
.fmo-farm-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.fmo-farm-showcase-card {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,248,248,.98));
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.fmo-farm-showcase-card.is-selected {
    border-color: rgba(184, 134, 11, .45);
    box-shadow: 0 10px 24px rgba(184, 134, 11, .12);
}
.fmo-farm-showcase-head {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.fmo-farm-showcase-title {
    font-size: 1.18rem;
    font-weight: 800;
    color: #1f1f1f;
    margin-bottom: 6px;
}
.fmo-farm-showcase-subtitle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: #666;
    font-size: .92rem;
}
.fmo-farm-showcase-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.fmo-farm-showcase-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.fmo-farm-metric {
    background: #111;
    color: #fff;
    border-radius: 14px;
    padding: 12px;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.fmo-farm-metric.production {
    background: linear-gradient(135deg, #7a1616, #b8860b);
}
.fmo-farm-metric span {
    color: rgba(255,255,255,.82);
    font-size: .86rem;
}
.fmo-farm-metric strong {
    color: #fff;
    font-size: 1rem;
    line-height: 1.45;
}
.fmo-farm-showcase-barns {
    border-top: 1px solid rgba(0,0,0,.08);
    padding-top: 12px;
}
.fmo-farm-showcase-barns h4 {
    margin: 0 0 10px;
    font-size: 1rem;
}
.fmo-farm-barn-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fmo-farm-barn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f7f7f7;
    border: 1px solid rgba(0,0,0,.05);
}
.fmo-farm-barn-row strong {
    display: block;
    color: #1f1f1f;
}
.fmo-farm-barn-row small {
    color: #777;
    display: block;
    margin-top: 2px;
}
.fmo-farm-barn-meta {
    white-space: nowrap;
    color: #444;
}
.fmo-farm-notes {
    margin-top: 12px;
    background: #fff8e8;
    color: #594200;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px dashed rgba(184,134,11,.35);
}
@media (max-width: 900px) {
    .fmo-farm-showcase-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .fmo-farm-showcase-card {
        padding: 14px;
    }
    .fmo-farm-showcase-metrics {
        grid-template-columns: 1fr;
    }
    .fmo-farm-barn-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .fmo-farm-barn-meta {
        white-space: normal;
    }
}


/* v9.7 simplified mode and saved media */
.fmo-simple-mode .fmo-simple-hidden,
.fmo-simple-mode .fmo-simple-empty-group { display:none !important; }
.fmo-simple-mode .fmo-topbar-brand p { display:none; }
.fmo-media-thumb { border:0; background:#f4f4f4; border-radius:12px; padding:5px; cursor:pointer; display:inline-flex; flex-direction:column; gap:4px; align-items:center; color:#333; }
.fmo-media-thumb img { width:72px; height:58px; object-fit:cover; border-radius:9px; display:block; }
.fmo-media-thumb span { font-size:12px; font-weight:700; }
.fmo-media-gallery { display:flex; flex-wrap:wrap; gap:12px; }
.fmo-media-lightbox { position:fixed; inset:0; z-index:1000000; background:rgba(0,0,0,.82); display:flex; align-items:center; justify-content:center; padding:18px; }
.fmo-media-lightbox-card { background:#fff; border-radius:18px; padding:12px; width:min(920px,96vw); max-height:94vh; display:flex; flex-direction:column; gap:10px; align-items:center; position:relative; }
.fmo-media-lightbox-card > button { position:absolute; top:8px; left:8px; border:0; border-radius:50%; width:36px; height:36px; font-size:24px; cursor:pointer; }
.fmo-media-lightbox-card img { max-width:100%; max-height:76vh; object-fit:contain; border-radius:12px; }
.fmo-media-lightbox-card a { font-weight:700; color:#7a1616; }
.fmo-selected-barn-analysis { border:1px solid rgba(184,134,11,.25); background:linear-gradient(180deg,#fff,#fffbf1); }
@media(max-width:700px){
  .fmo-media-thumb img{width:62px;height:50px}
  .fmo-media-lightbox{padding:8px}
  .fmo-media-lightbox-card{width:100%;border-radius:14px}
}

/* v9.8 calendar and simple daily entry */
.fmo-calendar-shell { overflow: hidden; }
.fmo-calendar-month-nav { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.fmo-calendar-filter { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; align-items:end; margin:16px 0; }
.fmo-calendar-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin:14px 0; }
.fmo-calendar-summary > div { background:#111; color:#fff; border-radius:14px; padding:12px; display:flex; flex-direction:column; gap:5px; }
.fmo-calendar-summary span { color:rgba(255,255,255,.75); font-size:.84rem; }
.fmo-calendar-summary strong { font-size:1.05rem; }
.fmo-calendar-weekdays { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; margin-bottom:8px; text-align:center; font-weight:700; color:#555; }
.fmo-calendar-weekdays span { padding:8px 4px; }
.fmo-calendar-grid { display:grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap:8px; }
.fmo-calendar-day { min-height:150px; text-align:right; border:1px solid rgba(0,0,0,.08); border-radius:14px; padding:10px; background:#fff; color:#222; display:flex; flex-direction:column; gap:8px; cursor:pointer; transition:.18s ease; }
.fmo-calendar-day:hover { transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.08); }
.fmo-calendar-day.blank { background:transparent; border:0; pointer-events:none; }
.fmo-calendar-day.has-data { border-color:rgba(184,134,11,.4); }
.fmo-calendar-day.warning { border-color:#d49b20; background:#fffaf0; }
.fmo-calendar-day.danger { border-color:#b42318; background:#fff5f4; }
.fmo-calendar-day-number { display:flex; align-items:center; justify-content:space-between; }
.fmo-calendar-day-number strong { font-size:1.1rem; }
.fmo-calendar-day-number em { font-style:normal; font-size:.78rem; color:#6d5a00; }
.fmo-calendar-day-stats { display:grid; gap:3px; font-size:.78rem; }
.fmo-calendar-day-stats span { display:flex; justify-content:space-between; gap:6px; }
.fmo-calendar-day-empty { color:#aaa; font-size:.78rem; padding-top:8px; }
.fmo-calendar-event-badges { display:flex; flex-wrap:wrap; gap:4px; margin-top:auto; }
.fmo-calendar-event-badges span { background:#f1f1f1; border-radius:999px; padding:3px 7px; font-size:.7rem; }
.fmo-calendar-day-modal { width:min(960px,94vw); max-height:90vh; overflow:auto; }
.fmo-calendar-modal-head { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:14px; }
.fmo-calendar-modal-head span { color:#777; }
.fmo-calendar-modal-head h3 { margin:3px 0 0; }
.fmo-calendar-day-kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.fmo-calendar-day-kpis > div { background:#111; color:#fff; border-radius:12px; padding:10px; display:flex; flex-direction:column; gap:5px; }
.fmo-calendar-day-kpis span { color:rgba(255,255,255,.72); font-size:.78rem; }
.fmo-calendar-standard-card { background:#fff8e8; border:1px solid rgba(184,134,11,.28); border-radius:14px; padding:14px; margin-bottom:14px; }
.fmo-calendar-standard-card h4 { margin:0 0 8px; }
.fmo-calendar-standard-card > div { display:flex; flex-wrap:wrap; gap:12px; }
.fmo-calendar-events-list { display:flex; flex-direction:column; gap:10px; }
.fmo-calendar-event-card { border:1px solid rgba(0,0,0,.08); border-radius:14px; padding:14px; background:#fff; }
.fmo-calendar-event-card.necropsy { border-inline-start:5px solid #7a1616; }
.fmo-calendar-event-card.treatment { border-inline-start:5px solid #b8860b; }
.fmo-calendar-event-card.daily { border-inline-start:5px solid #1f5d4d; }
.fmo-calendar-event-title { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.fmo-calendar-event-title em { margin-inline-start:auto; font-style:normal; color:#777; font-size:.8rem; }
.fmo-calendar-event-context { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.fmo-calendar-event-context span { background:#f3f3f3; border-radius:999px; padding:3px 8px; font-size:.78rem; }
.fmo-calendar-event-notes { background:#fafafa; border-radius:10px; padding:9px; }
.fmo-calendar-event-media { margin-top:10px; }

.fmo-daily-mode-switch { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.fmo-daily-mode-switch > div:last-child { display:flex; gap:8px; }
.fmo-daily-entry-panel { display:none; }
.fmo-daily-entry-panel.active { display:block; }
.fmo-simple-daily-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.fmo-simple-daily-grid label { display:flex; flex-direction:column; gap:6px; }
.fmo-simple-notes { grid-column:span 2; }
.fmo-simple-medications { grid-column:1/-1; border-top:1px solid rgba(0,0,0,.08); padding-top:14px; }
.fmo-simple-medication-row { display:grid; grid-template-columns:repeat(6,minmax(120px,1fr)) auto; gap:8px; align-items:end; padding:10px; background:#f8f8f8; border-radius:12px; margin-top:8px; }
.fmo-simple-save { grid-column:1/-1; }
.fmo-simple-comparison { margin-top:14px; border-radius:16px; padding:16px; background:#f2fff8; border:1px solid #9ad5b8; }
.fmo-simple-comparison.warning { background:#fff9e8; border-color:#e1b85d; }
.fmo-simple-comparison.danger { background:#fff1ef; border-color:#d88178; }
.fmo-simple-comparison-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.fmo-simple-comparison-head h4 { margin:3px 0 0; }
.fmo-simple-comparison-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:12px; }
.fmo-simple-comparison-grid > div { background:rgba(255,255,255,.8); border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:4px; }
.fmo-simple-comparison-grid span,.fmo-simple-comparison-grid small { color:#666; }

@media (max-width: 1100px) {
    .fmo-calendar-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .fmo-calendar-day-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .fmo-simple-daily-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .fmo-simple-medication-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .fmo-simple-comparison-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .fmo-calendar-weekdays { display:none; }
    .fmo-calendar-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .fmo-calendar-day.blank { display:none; }
    .fmo-calendar-day { min-height:135px; }
    .fmo-calendar-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .fmo-calendar-day-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 520px) {
    .fmo-simple-daily-grid,.fmo-simple-comparison-grid { grid-template-columns:1fr; }
    .fmo-calendar-summary { grid-template-columns:1fr 1fr; }
    .fmo-simple-notes { grid-column:auto; }
    .fmo-simple-medication-row { grid-template-columns:1fr; }
}


/* v9.9 global simple/advanced mode, fixed scope, quick calendar entry, media archive */
.fmo-mode-status{display:inline-flex;align-items:center;min-height:38px;padding:7px 12px;border-radius:999px;background:#ecfdf5;color:#065f46;border:1px solid #99f6e4;font-weight:900;white-space:nowrap}.fmo-mode-status.advanced{background:#fff7ed;color:#9a3412;border-color:#fed7aa}.fmo-simple-mode .fmo-advanced-only,.fmo-simple-mode .fmo-help-box{display:none!important}.fmo-scope-pickers{grid-template-columns:repeat(3,minmax(0,1fr))}.fmo-scope-context-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 12px}.fmo-scope-context-kpis>div{display:flex;flex-direction:column;gap:4px;padding:9px 11px;border-radius:12px;background:#0f172a;color:#fff}.fmo-scope-context-kpis span{color:#cbd5e1;font-size:.78rem}.fmo-scope-context-kpis strong{color:#fff;font-size:.92rem;overflow-wrap:anywhere}.fmo-calendar-day-number>div{display:flex;align-items:center;gap:5px}.fmo-calendar-day-add{border:0;border-radius:999px;padding:4px 7px;background:#111827;color:#fff;font-size:.68rem;font-weight:900;cursor:pointer;min-height:0!important}.fmo-calendar-day-add:hover{background:#b8860b}.fmo-calendar-quick-menu{width:min(700px,94vw)}.fmo-calendar-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}.fmo-calendar-quick-grid button{border:1px solid #e5e7eb;background:#fff;border-radius:14px;padding:16px 10px;font-weight:900;cursor:pointer}.fmo-calendar-quick-grid button:hover{border-color:#b8860b;background:#fffaf0}.fmo-calendar-quick-context{display:flex;flex-wrap:wrap;gap:8px;color:#475569;font-weight:800}.fmo-calendar-quick-context span{background:#f8fafc;border-radius:999px;padding:6px 10px}.fmo-media-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px;margin-top:16px}.fmo-media-archive-card{border:1px solid #e5e7eb;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 6px 18px rgba(15,23,42,.05)}.fmo-media-archive-card .fmo-media-thumb{width:100%;height:190px;border:0;border-radius:0;padding:0;display:block;position:relative;overflow:hidden}.fmo-media-archive-card .fmo-media-thumb img{width:100%;height:100%;object-fit:cover;display:block}.fmo-media-archive-card .fmo-media-thumb span{position:absolute;inset-inline-end:8px;bottom:8px;background:rgba(0,0,0,.75);color:#fff;border-radius:999px;padding:5px 9px}.fmo-media-archive-meta{padding:12px;display:flex;flex-direction:column;gap:6px}.fmo-media-archive-meta p,.fmo-media-archive-meta small,.fmo-media-archive-meta em{margin:0;color:#64748b;font-style:normal;overflow-wrap:anywhere}.fmo-media-archive-meta em{background:#fff8e8;border-radius:9px;padding:7px;color:#6b4f00}@media(max-width:900px){.fmo-scope-pickers{grid-template-columns:1fr}.fmo-scope-context-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.fmo-calendar-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.fmo-mode-status{width:100%;justify-content:center}.fmo-scope-context-kpis{grid-template-columns:1fr 1fr}.fmo-calendar-quick-grid{grid-template-columns:1fr}.fmo-media-gallery{grid-template-columns:1fr}}

/* v10.0 fresh-login start screen and unified first setup wizard */
.fmo-start-screen,.fmo-first-setup-wizard{position:fixed;inset:0;z-index:100000;background:rgba(12,12,12,.76);backdrop-filter:blur(4px);display:flex;align-items:flex-start;justify-content:center;padding:24px;overflow:auto}.fmo-start-panel,.fmo-setup-panel{width:min(1100px,100%);background:#fff;border-radius:22px;box-shadow:0 24px 80px rgba(0,0,0,.25);padding:22px;margin:auto}.fmo-start-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;border-bottom:1px solid #eee;padding-bottom:16px;margin-bottom:18px}.fmo-start-head h2{margin:4px 0 4px}.fmo-start-head p{margin:0;color:#666}.fmo-start-logo{height:48px;width:auto}.fmo-start-close{border:0;background:#f3f3f3;border-radius:50%;width:40px;height:40px;font-size:25px;cursor:pointer}.fmo-start-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}.fmo-start-farm-card{border:1px solid #e7e7e7;border-radius:16px;padding:16px;background:#fafafa;display:flex;flex-direction:column;gap:12px}.fmo-start-farm-card.preferred{border-color:#c99b22;box-shadow:0 0 0 2px rgba(201,155,34,.09)}.fmo-start-farm-card h3{margin:6px 0 2px}.fmo-start-farm-card p{margin:0;color:#777}.fmo-start-batch{background:#fff;border:1px solid #ececec;border-radius:12px;padding:10px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.fmo-start-batch strong{width:100%}.fmo-start-batch.empty{color:#777}.fmo-start-actions,.fmo-start-footer{display:flex;gap:8px;flex-wrap:wrap}.fmo-start-footer{justify-content:space-between;border-top:1px solid #eee;margin-top:18px;padding-top:16px}.fmo-setup-section{border:1px solid #ececec;border-radius:16px;padding:16px;margin-bottom:14px;background:#fcfcfc}.fmo-setup-step{display:flex;gap:12px;align-items:center;margin-bottom:12px}.fmo-setup-step>b{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#111;color:#fff}.fmo-setup-step h3,.fmo-setup-step p{margin:0}.fmo-setup-step p{color:#777;font-size:.9rem}.fmo-setup-row{background:#fff;border:1px solid #e8e8e8;border-radius:13px;padding:12px;margin-bottom:10px}.fmo-setup-row-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.fmo-setup-row-title button{border:0;background:#fff0f0;color:#a40000;border-radius:8px;padding:5px 9px;cursor:pointer}.fmo-setup-submit{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;position:sticky;bottom:0;background:#fff;padding:14px 0 0;border-top:1px solid #eee}.fmo-setup-success{text-align:center;padding:30px 10px}.fmo-setup-success>span{display:inline-grid;place-items:center;width:72px;height:72px;border-radius:50%;background:#e9f9ed;color:#127a2d;font-size:42px;font-weight:700}.fmo-setup-success code{font-size:1.05rem}.fmo-info-note{background:#fff7dc;border:1px solid #ead18a;color:#5f4a00;border-radius:12px;padding:10px 12px;margin-bottom:14px}
@media(max-width:700px){.fmo-start-screen,.fmo-first-setup-wizard{padding:8px}.fmo-start-panel,.fmo-setup-panel{border-radius:16px;padding:14px}.fmo-start-head{align-items:center}.fmo-start-grid{grid-template-columns:1fr}.fmo-start-actions .fmo-btn,.fmo-start-footer .fmo-btn,.fmo-setup-submit .fmo-btn{width:100%}.fmo-setup-section .fmo-grid.three{grid-template-columns:1fr}}

/* v10.0.2 login membership / WhatsApp CTA */
.fmo-login-membership {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(22, 163, 74, .22);
    border-radius: 16px;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}
.fmo-membership-heading {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
}
.fmo-membership-heading strong {
    color: #14532d;
    font-size: 16px;
    font-weight: 900;
}
.fmo-membership-heading span {
    color: #475569;
    font-size: 13px;
    line-height: 1.7;
}
.fmo-membership-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.fmo-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    padding: 9px 12px;
    border-radius: 13px;
    background: #16a34a;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 7px 18px rgba(22, 163, 74, .18);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.fmo-whatsapp-btn:hover,
.fmo-whatsapp-btn:focus-visible {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(22, 163, 74, .24);
}
.fmo-whatsapp-btn > span:last-child {
    display: grid;
    gap: 1px;
    text-align: right;
    line-height: 1.2;
}
.fmo-whatsapp-btn b {
    font-size: 14px;
    font-weight: 900;
}
.fmo-whatsapp-btn small {
    color: rgba(255,255,255,.92);
    font-size: 12px;
    direction: ltr;
}
.fmo-whatsapp-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    font-size: 16px;
}
@media (max-width: 520px) {
    .fmo-membership-actions { grid-template-columns: 1fr; }
    .fmo-whatsapp-btn { justify-content: flex-start; padding-inline: 16px; }
}

/* v10.1 — Sanad UI 2.0: cheerful per-user themes + interactive navigation */
#fmo-app {
    --ui-bg: #f5fbf8;
    --ui-surface: #ffffff;
    --ui-surface-2: #ecf8f2;
    --ui-sidebar: #f0faf6;
    --ui-topbar-a: #157a6e;
    --ui-topbar-b: #2a9d8f;
    --ui-primary: #188977;
    --ui-primary-2: #36b59f;
    --ui-accent: #f2b84b;
    --ui-text: #17352f;
    --ui-muted: #668078;
    --ui-border: #d8ebe4;
    --ui-shadow: 0 12px 30px rgba(34, 93, 79, .09);
    --ui-radius: 18px;
    background: var(--ui-bg) !important;
    color: var(--ui-text) !important;
    transition: background .28s ease, color .28s ease;
}
#fmo-app[data-fmo-theme="fresh-farm"] {
    --ui-bg:#f4fbf7; --ui-surface:#ffffff; --ui-surface-2:#eaf8f1; --ui-sidebar:#eefaf4;
    --ui-topbar-a:#176b60; --ui-topbar-b:#2fa28e; --ui-primary:#188977; --ui-primary-2:#46bda6;
    --ui-accent:#f1b84b; --ui-text:#183b33; --ui-muted:#67827a; --ui-border:#d4eae2;
    --ui-shadow:0 12px 32px rgba(23,107,96,.10);
}
#fmo-app[data-fmo-theme="pastel-joy"] {
    --ui-bg:#fffaf7; --ui-surface:#fffefe; --ui-surface-2:#fff1eb; --ui-sidebar:#fff7f3;
    --ui-topbar-a:#7868b5; --ui-topbar-b:#d887a3; --ui-primary:#7b6ab6; --ui-primary-2:#aa8dd8;
    --ui-accent:#f2ad76; --ui-text:#493f59; --ui-muted:#81778b; --ui-border:#eee1ea;
    --ui-shadow:0 12px 32px rgba(127,104,181,.11);
}
#fmo-app[data-fmo-theme="sky-clean"] {
    --ui-bg:#f3f9fe; --ui-surface:#ffffff; --ui-surface-2:#eaf6fd; --ui-sidebar:#eff8fd;
    --ui-topbar-a:#176e9b; --ui-topbar-b:#32a7c7; --ui-primary:#197fa9; --ui-primary-2:#4bb7d0;
    --ui-accent:#74c9b8; --ui-text:#173f53; --ui-muted:#688393; --ui-border:#d8eaf3;
    --ui-shadow:0 12px 32px rgba(23,110,155,.10);
}
#fmo-app[data-fmo-theme="royal-sanad"] {
    --ui-bg:#fbf9f4; --ui-surface:#ffffff; --ui-surface-2:#fff7e7; --ui-sidebar:#fcfaf4;
    --ui-topbar-a:#29251d; --ui-topbar-b:#6f5721; --ui-primary:#9b7118; --ui-primary-2:#d2a536;
    --ui-accent:#c81d25; --ui-text:#2c2923; --ui-muted:#776f62; --ui-border:#eadfca;
    --ui-shadow:0 12px 32px rgba(92,72,28,.10);
}

#fmo-app .fmo-dashboard-shell,
#fmo-app .fmo-layout,
#fmo-app .fmo-content { background: var(--ui-bg) !important; }
#fmo-app .fmo-topbar {
    background: linear-gradient(135deg,var(--ui-topbar-a),var(--ui-topbar-b)) !important;
    border-bottom: 0 !important;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--ui-topbar-a) 20%, transparent) !important;
}
#fmo-app .fmo-sidebar {
    background: var(--ui-sidebar) !important;
    border-color: var(--ui-border) !important;
    box-shadow: 8px 0 26px rgba(30,60,50,.04);
}
#fmo-app .fmo-menu-tools {
    background: color-mix(in srgb,var(--ui-surface) 86%,var(--ui-primary) 14%) !important;
    border:1px solid var(--ui-border); border-radius:16px; padding:12px !important; margin-bottom:12px;
}
#fmo-app .fmo-menu-search { background:var(--ui-surface)!important; border-color:var(--ui-border)!important; color:var(--ui-text)!important; }
#fmo-app .fmo-menu-group { border:1px solid transparent; border-radius:16px; padding:5px; margin-bottom:10px!important; transition:background .22s ease,border-color .22s ease,transform .22s ease; }
#fmo-app .fmo-menu-group:hover { background:color-mix(in srgb,var(--ui-surface) 70%,transparent); border-color:var(--ui-border); }
#fmo-app .fmo-menu-title {
    width:100%; display:flex!important; align-items:center!important; justify-content:space-between!important;
    background:transparent!important; color:var(--ui-muted)!important; border:0!important; box-shadow:none!important;
    font-size:12px!important; font-weight:900!important; padding:8px 9px!important; min-width:0!important; cursor:pointer!important;
}
#fmo-app .fmo-menu-title b { font-size:16px; transition:transform .2s ease; }
#fmo-app .fmo-menu-group.is-collapsed .fmo-menu-title b { transform:rotate(90deg); }
#fmo-app .fmo-menu-group.is-collapsed > button[data-tab] { display:none!important; }
#fmo-app .fmo-sidebar button[data-tab] {
    border:1px solid transparent!important; border-radius:13px!important; color:var(--ui-text)!important; background:transparent!important;
    transition:transform .18s ease,background .18s ease,color .18s ease,box-shadow .18s ease!important;
}
#fmo-app .fmo-sidebar button[data-tab]:hover { transform:translateX(-3px); background:var(--ui-surface)!important; color:var(--ui-primary)!important; box-shadow:0 6px 16px rgba(0,0,0,.055)!important; }
#fmo-app .fmo-sidebar button[data-tab].active { background:linear-gradient(135deg,var(--ui-primary),var(--ui-primary-2))!important; color:#fff!important; box-shadow:0 8px 20px color-mix(in srgb,var(--ui-primary) 24%,transparent)!important; }

#fmo-app .fmo-card,
#fmo-app .fmo-screen-head,
#fmo-app .fmo-scope-bar,
#fmo-app .fmo-calendar-day,
#fmo-app table,
#fmo-app .fmo-form-card,
#fmo-app .fmo-selected-barn-analysis {
    background:var(--ui-surface)!important; border-color:var(--ui-border)!important; color:var(--ui-text)!important;
    box-shadow:var(--ui-shadow)!important; border-radius:var(--ui-radius)!important;
    transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease,background .25s ease!important;
}
#fmo-app .fmo-card:hover { transform:translateY(-2px); box-shadow:0 16px 34px rgba(0,0,0,.09)!important; }
#fmo-app .fmo-card h3,#fmo-app .fmo-card h4,#fmo-app .fmo-current-screen-title { color:var(--ui-text)!important; }
#fmo-app .fmo-card span,#fmo-app .fmo-current-screen-desc { color:var(--ui-muted)!important; }
#fmo-app .fmo-btn:not(.danger):not(.secondary) { background:linear-gradient(135deg,var(--ui-primary),var(--ui-primary-2))!important; color:#fff!important; border:0!important; }
#fmo-app .fmo-btn.secondary { background:var(--ui-surface)!important; color:var(--ui-primary)!important; border-color:var(--ui-border)!important; }
#fmo-app input,#fmo-app select,#fmo-app textarea { background:var(--ui-surface)!important; border-color:var(--ui-border)!important; color:var(--ui-text)!important; }
#fmo-app input:focus,#fmo-app select:focus,#fmo-app textarea:focus { border-color:var(--ui-primary)!important; box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 14%,transparent)!important; }
#fmo-app thead th { background:color-mix(in srgb,var(--ui-surface-2) 85%,var(--ui-primary) 15%)!important; color:var(--ui-text)!important; }
#fmo-app tbody tr:hover td { background:color-mix(in srgb,var(--ui-surface-2) 70%,transparent)!important; }
#fmo-app .fmo-calendar-day:hover { border-color:var(--ui-primary)!important; transform:translateY(-3px); }
#fmo-app .fmo-calendar-day.has-data { border-color:color-mix(in srgb,var(--ui-primary) 46%,var(--ui-border))!important; }
#fmo-app .fmo-floating-nav { background:color-mix(in srgb,var(--ui-surface) 93%,transparent)!important; border-color:var(--ui-border)!important; box-shadow:0 -8px 28px rgba(0,0,0,.07)!important; }
#fmo-app .fmo-floating-nav button { color:var(--ui-primary)!important; }

/* Pastel Joy intentionally gives alternating menu groups cheerful, quiet surfaces. */
#fmo-app[data-fmo-theme="pastel-joy"] .fmo-menu-group:nth-of-type(1){background:#eef9f2}
#fmo-app[data-fmo-theme="pastel-joy"] .fmo-menu-group:nth-of-type(2){background:#eef7fd}
#fmo-app[data-fmo-theme="pastel-joy"] .fmo-menu-group:nth-of-type(3){background:#f4effc}
#fmo-app[data-fmo-theme="pastel-joy"] .fmo-menu-group:nth-of-type(4){background:#fff3e9}
#fmo-app[data-fmo-theme="pastel-joy"] .fmo-menu-group:nth-of-type(5){background:#fff9dd}

.fmo-theme-control { position:relative; }
.fmo-theme-panel[hidden] { display:none!important; }
.fmo-theme-panel {
    position:absolute; top:calc(100% + 10px); left:0; z-index:100010; width:min(360px,92vw); padding:12px;
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; background:#fff; color:#24302c;
    border:1px solid #e3e9e6; border-radius:18px; box-shadow:0 18px 45px rgba(0,0,0,.18);
}
.fmo-theme-panel-head { grid-column:1/-1; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:5px 5px 8px; }
.fmo-theme-panel-head small { color:#718078; }
.fmo-theme-choice { border:1px solid #e7ece9!important; background:#fff!important; border-radius:14px!important; padding:10px!important; color:#25342f!important; text-align:right!important; cursor:pointer; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.fmo-theme-choice:hover { transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.08); }
.fmo-theme-choice.active { border-color:#239b87!important; box-shadow:0 0 0 3px rgba(35,155,135,.12); }
.fmo-theme-choice b,.fmo-theme-choice small { display:block; }
.fmo-theme-choice small { margin-top:3px; color:#7b8581; }
.fmo-theme-swatches { display:flex; gap:4px; margin-bottom:8px; }
.fmo-theme-swatches i { width:22px; height:12px; border-radius:999px; display:block; }
.fmo-theme-swatches.fresh i:nth-child(1){background:#188977}.fmo-theme-swatches.fresh i:nth-child(2){background:#eaf8f1}.fmo-theme-swatches.fresh i:nth-child(3){background:#f1b84b}
.fmo-theme-swatches.pastel i:nth-child(1){background:#b8e8cf}.fmo-theme-swatches.pastel i:nth-child(2){background:#d9c9f3}.fmo-theme-swatches.pastel i:nth-child(3){background:#ffcdb2}
.fmo-theme-swatches.sky i:nth-child(1){background:#32a7c7}.fmo-theme-swatches.sky i:nth-child(2){background:#d9f1fb}.fmo-theme-swatches.sky i:nth-child(3){background:#74c9b8}
.fmo-theme-swatches.royal i:nth-child(1){background:#29251d}.fmo-theme-swatches.royal i:nth-child(2){background:#d2a536}.fmo-theme-swatches.royal i:nth-child(3){background:#c81d25}

/* Semantic status colors remain stable in every theme. */
#fmo-app .fmo-good,#fmo-app .status-good,#fmo-app .is-success { color:#16803b!important; }
#fmo-app .fmo-bad,#fmo-app .status-danger,#fmo-app .is-danger { color:#b42318!important; }
#fmo-app .status-warning,#fmo-app .is-warning { color:#a15c00!important; }

@media(max-width:900px){
    .fmo-theme-control { position:static; }
    .fmo-theme-panel { position:fixed; left:12px; right:12px; top:auto; bottom:78px; width:auto; grid-template-columns:1fr 1fr; z-index:100001; }
    #fmo-app .fmo-sidebar button[data-tab]:hover { transform:none; }
}
@media(max-width:520px){
    .fmo-theme-panel { grid-template-columns:1fr; max-height:70vh; overflow:auto; }
    .fmo-theme-panel-head { position:sticky; top:0; background:#fff; z-index:1; }
}


/* Sanad v10.2 — focused simple mode */
.fmo-simple-mode .fmo-topbar-brand p { display:none; }
.fmo-simple-mode .fmo-sidebar .fmo-menu-title { display:none; }
.fmo-simple-mode .fmo-sidebar .fmo-menu-group { margin:0; padding:4px 0; border:0; background:transparent; box-shadow:none; }
.fmo-simple-mode .fmo-sidebar .fmo-menu-group:not(.fmo-simple-empty-group) + .fmo-menu-group:not(.fmo-simple-empty-group) { border-top:1px solid var(--fmo-border, rgba(15,23,42,.08)); }
.fmo-simple-mode .fmo-sidebar button[data-tab] { min-height:52px; border-radius:16px; margin:4px 8px; font-weight:700; justify-content:flex-start; }
.fmo-simple-mode .fmo-menu-tools strong { font-size:1.05rem; }
.fmo-simple-mode .fmo-screen-head .fmo-current-screen-desc { display:none; }
.fmo-simple-mode .fmo-help-box { display:none !important; }
.fmo-simple-today { display:grid; gap:16px; }
.fmo-simple-today-hero { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:22px; border-radius:24px; background:linear-gradient(135deg,var(--fmo-card,#fff),var(--fmo-soft,#f4faf7)); border:1px solid var(--fmo-border,rgba(15,23,42,.08)); box-shadow:0 14px 34px rgba(15,23,42,.07); }
.fmo-simple-eyebrow { display:inline-flex; padding:6px 10px; border-radius:999px; background:var(--fmo-accent-soft,#e8f7f1); color:var(--fmo-accent,#177f69); font-weight:800; font-size:.78rem; }
.fmo-simple-today-hero h2 { margin:8px 0 4px; font-size:clamp(1.35rem,3vw,2rem); }
.fmo-simple-today-hero p { margin:0; color:var(--fmo-muted,#64748b); }
.fmo-simple-health { min-width:160px; padding:14px 16px; border-radius:18px; text-align:center; background:#f1f5f9; }
.fmo-simple-health span,.fmo-simple-health small { display:block; font-size:.76rem; opacity:.75; }
.fmo-simple-health strong { display:block; margin:3px 0; }
.fmo-simple-health.good { background:#dcfce7; color:#166534; }
.fmo-simple-health.watch { background:#fef3c7; color:#92400e; }
.fmo-simple-health.danger { background:#fee2e2; color:#991b1b; }
.fmo-simple-today-kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; }
.fmo-simple-today-kpis > div { min-width:0; padding:15px 13px; border-radius:18px; background:var(--fmo-card,#fff); border:1px solid var(--fmo-border,rgba(15,23,42,.08)); box-shadow:0 7px 18px rgba(15,23,42,.045); }
.fmo-simple-today-kpis span { display:block; color:var(--fmo-muted,#64748b); font-size:.76rem; margin-bottom:5px; }
.fmo-simple-today-kpis strong { font-size:1.08rem; }
.fmo-simple-today-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.fmo-simple-today-action { min-height:96px; display:flex; align-items:center; gap:13px; padding:16px; border:0; border-radius:22px; text-align:right; cursor:pointer; box-shadow:0 10px 24px rgba(15,23,42,.07); transition:transform .18s ease,box-shadow .18s ease; color:#17202a; }
.fmo-simple-today-action:hover { transform:translateY(-2px); box-shadow:0 14px 30px rgba(15,23,42,.11); }
.fmo-simple-today-action i { width:46px; height:46px; display:grid; place-items:center; border-radius:15px; background:rgba(255,255,255,.72); font-style:normal; font-size:1.45rem; flex:0 0 46px; }
.fmo-simple-today-action span { display:grid; gap:3px; }
.fmo-simple-today-action b { font-size:1rem; }
.fmo-simple-today-action small { color:rgba(23,32,42,.66); }
.fmo-simple-today-action.daily { background:#dff7eb; }
.fmo-simple-today-action.medicine { background:#eee7ff; }
.fmo-simple-today-action.health { background:#ffe8e1; }
.fmo-simple-today-action.calendar { background:#e2f1ff; }
.fmo-simple-today-action.stock { background:#fff1c9; }
.fmo-simple-today-action.report { background:#e6ecff; }
.fmo-simple-today-lower { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.fmo-simple-alert-list { display:grid; gap:8px; }
.fmo-simple-alert { display:grid; gap:3px; width:100%; text-align:right; padding:11px 12px; border:0; border-radius:14px; background:var(--fmo-soft,#f8fafc); cursor:pointer; }
.fmo-simple-alert.warning { background:#fff7d6; }
.fmo-simple-alert.danger { background:#ffe6e6; }
.fmo-simple-alert span { color:var(--fmo-muted,#64748b); font-size:.82rem; }
.fmo-simple-all-good { padding:16px; border-radius:14px; background:#e8f8ef; color:#17623b; font-weight:800; }
.fmo-simple-cycle-summary { display:grid; grid-template-columns:1.5fr repeat(3,1fr); align-items:center; gap:10px; }
.fmo-simple-cycle-summary > strong,.fmo-simple-cycle-summary > span { grid-column:1; }
.fmo-simple-cycle-summary > div { grid-row:1 / span 2; text-align:center; padding:10px; border-radius:14px; background:var(--fmo-soft,#f8fafc); }
.fmo-simple-cycle-summary > div:nth-of-type(1) { grid-column:2; }
.fmo-simple-cycle-summary > div:nth-of-type(2) { grid-column:3; }
.fmo-simple-cycle-summary > div:nth-of-type(3) { grid-column:4; }
.fmo-simple-cycle-summary em { display:block; font-style:normal; color:var(--fmo-muted,#64748b); font-size:.75rem; }

@media (max-width: 900px) {
  .fmo-simple-today-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .fmo-simple-today-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fmo-simple-today-lower { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
  .fmo-simple-mode .fmo-topbar { padding:10px 12px; }
  .fmo-simple-today-hero { align-items:flex-start; flex-direction:column; padding:17px; }
  .fmo-simple-health { width:100%; min-width:0; text-align:right; }
  .fmo-simple-today-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fmo-simple-today-actions { grid-template-columns:1fr 1fr; gap:9px; }
  .fmo-simple-today-action { min-height:88px; padding:12px; border-radius:18px; }
  .fmo-simple-today-action i { width:40px; height:40px; flex-basis:40px; font-size:1.2rem; }
  .fmo-simple-today-action small { display:none; }
  .fmo-simple-cycle-summary { grid-template-columns:repeat(3,1fr); }
  .fmo-simple-cycle-summary > strong,.fmo-simple-cycle-summary > span { grid-column:1 / -1; }
  .fmo-simple-cycle-summary > div { grid-row:auto; }
  .fmo-simple-cycle-summary > div:nth-of-type(1) { grid-column:1; }
  .fmo-simple-cycle-summary > div:nth-of-type(2) { grid-column:2; }
  .fmo-simple-cycle-summary > div:nth-of-type(3) { grid-column:3; }
}


/* Sanad v10.3 Simple Mode 2.0 — direct, calm daily operation */
.fmo-simple-scope-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:10px;align-items:end;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:18px;padding:12px;box-shadow:var(--ui-shadow);margin-bottom:14px}
.fmo-simple-scope-field{display:flex;flex-direction:column;gap:6px;min-width:0}.fmo-simple-scope-field span{font-size:.78rem;font-weight:900;color:var(--ui-muted)}
.fmo-simple-scope-field select{min-height:46px;border-radius:13px!important;padding:8px 11px!important;font-weight:800}
.fmo-simple-smart-add{min-height:46px;border:0;border-radius:13px;padding:8px 16px;background:linear-gradient(135deg,var(--ui-primary),var(--ui-primary-2));color:#fff;font-weight:900;cursor:pointer;box-shadow:0 8px 18px color-mix(in srgb,var(--ui-primary) 20%,transparent)}
.fmo-simple-primary-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 14px;padding:6px;background:color-mix(in srgb,var(--ui-surface-2) 70%,var(--ui-surface) 30%);border:1px solid var(--ui-border);border-radius:17px}
.fmo-simple-primary-tabs button{min-height:48px;border:0;border-radius:12px;background:transparent;color:var(--ui-text);font-weight:900;cursor:pointer}.fmo-simple-primary-tabs button:hover,.fmo-simple-primary-tabs button.active{background:var(--ui-surface);color:var(--ui-primary);box-shadow:0 6px 16px rgba(0,0,0,.06)}
.fmo-simple-setup-path-card{background:linear-gradient(135deg,color-mix(in srgb,var(--ui-surface) 90%,var(--ui-primary) 10%),var(--ui-surface));border:1px solid var(--ui-border);border-radius:20px;padding:18px;margin-bottom:14px;box-shadow:var(--ui-shadow)}
.fmo-simple-setup-path-card h3{margin:5px 0}.fmo-simple-setup-path-card p{margin:0 0 14px;color:var(--ui-muted)}
.fmo-simple-setup-path{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.fmo-simple-setup-path>button,.fmo-simple-setup-path>div{border:1px solid var(--ui-border);background:var(--ui-surface);border-radius:15px;padding:13px;text-align:right;display:grid;grid-template-columns:34px 1fr;column-gap:9px;align-items:center;color:var(--ui-text)}
.fmo-simple-setup-path b{grid-row:1/3;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--ui-primary);color:#fff}.fmo-simple-setup-path strong,.fmo-simple-setup-path small{display:block}.fmo-simple-setup-path small{color:var(--ui-muted);margin-top:3px}.fmo-simple-setup-path .done{opacity:.78}.fmo-simple-setup-path .done b{background:#16803b}.fmo-simple-setup-path .disabled{opacity:.45;cursor:not-allowed}.fmo-simple-setup-path .active{cursor:pointer;box-shadow:0 7px 18px rgba(0,0,0,.05)}
.fmo-simple-mode [data-delete-record][data-entity-type="farm"],.fmo-simple-mode [data-delete-record][data-entity-type="barn"]{display:none!important}
.fmo-simple-bottom-nav{display:none}
@media(max-width:900px){
  .fmo-simple-mode .fmo-content{padding-bottom:88px!important}.fmo-simple-mode .fmo-floating-nav{display:none!important}
  .fmo-simple-mode .fmo-simple-bottom-nav{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);left:8px;right:8px;bottom:8px;z-index:100020;background:color-mix(in srgb,var(--ui-surface) 94%,transparent);backdrop-filter:blur(16px);border:1px solid var(--ui-border);border-radius:18px;padding:6px;box-shadow:0 12px 36px rgba(0,0,0,.14)}
  .fmo-simple-bottom-nav button{border:0;background:transparent;color:var(--ui-muted);min-height:54px;border-radius:13px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;font-weight:900;font-size:.72rem}.fmo-simple-bottom-nav button b{font-size:1.15rem;color:var(--ui-primary)}
  .fmo-simple-mode .fmo-sidebar:not(.is-open){display:none!important}.fmo-simple-mode .fmo-layout{grid-template-columns:1fr!important}
  .fmo-simple-scope-strip{grid-template-columns:1fr 1fr}.fmo-simple-smart-add{grid-column:1/-1}.fmo-simple-primary-tabs{grid-template-columns:repeat(4,1fr);overflow:auto}.fmo-simple-primary-tabs button{font-size:.78rem;padding:5px}
  .fmo-simple-setup-path{grid-template-columns:1fr}
}
@media(max-width:520px){.fmo-simple-scope-strip{grid-template-columns:1fr}.fmo-simple-smart-add{grid-column:auto}.fmo-simple-primary-tabs button span{display:block;font-size:.72rem}}

/* v11 financial ledger + data quality */
.fmo-kpi-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:14px}.fmo-kpi-strip>div{padding:12px 14px;border:1px solid var(--fmo-border,#e5e7eb);border-radius:14px;background:var(--fmo-surface-soft,#f8fafc)}.fmo-kpi-strip span{display:block;font-size:12px;color:var(--fmo-muted,#64748b);margin-bottom:4px}.fmo-kpi-strip strong{font-size:18px}.fmo-inline-form{display:flex;align-items:center;gap:6px;min-width:260px}.fmo-inline-form input{min-width:130px}.fmo-alert.warning{border-color:#f59e0b;background:#fffbeb}.fmo-alert.danger{border-color:#ef4444;background:#fef2f2}@media(max-width:680px){.fmo-inline-form{min-width:220px;flex-wrap:wrap}.fmo-inline-form input{min-width:0;flex:1 1 120px}}


/* v11 global search — searches only entities already authorized in the current payload. */
.fmo-global-search-wrap{position:relative;min-width:min(360px,34vw);flex:1 1 280px}
.fmo-global-search-wrap input{width:100%;min-height:42px;border:1px solid var(--fmo-border,#d9e3df);border-radius:12px;background:var(--fmo-surface,#fff);padding:9px 13px;color:var(--fmo-text,#1f2937);box-shadow:0 2px 10px rgba(15,23,42,.04)}
.fmo-global-search-wrap input:focus{outline:2px solid color-mix(in srgb,var(--fmo-primary,#0f766e) 25%,transparent);border-color:var(--fmo-primary,#0f766e)}
.fmo-global-search-results{position:absolute;top:calc(100% + 7px);right:0;left:0;z-index:1200;max-height:420px;overflow:auto;background:var(--fmo-surface,#fff);border:1px solid var(--fmo-border,#d9e3df);border-radius:14px;box-shadow:0 18px 45px rgba(15,23,42,.16);padding:7px}
.fmo-global-search-results[hidden]{display:none!important}
.fmo-global-search-results button{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;width:100%;text-align:right;border:0;border-radius:10px;background:transparent;padding:9px 10px;color:var(--fmo-text,#1f2937);cursor:pointer}
.fmo-global-search-results button:hover,.fmo-global-search-results button:focus{background:var(--fmo-soft,#eef8f5);outline:none}
.fmo-global-search-results button span{grid-row:1/3;align-self:center;font-size:11px;font-weight:800;border-radius:999px;padding:4px 7px;background:var(--fmo-soft,#eef8f5);color:var(--fmo-primary,#0f766e)}
.fmo-global-search-results button strong{font-size:13px}
.fmo-global-search-results button small{opacity:.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fmo-global-search-empty{padding:16px;text-align:center;opacity:.7;font-size:13px}
@media(max-width:900px){.fmo-global-search-wrap{order:10;flex-basis:100%;min-width:100%}.fmo-global-search-results{position:fixed;top:86px;right:12px;left:12px;max-height:55vh}}

/* Sanad v11.1 operational health dashboard */
.fmo-health-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-top:14px}.fmo-health-card{background:var(--fmo-card,#fff);border:1px solid rgba(15,23,42,.09);border-radius:18px;padding:16px;box-shadow:0 8px 28px rgba(15,23,42,.06)}.fmo-health-card-head{display:flex;align-items:center;gap:10px}.fmo-health-card-head>div{display:flex;flex-direction:column;gap:2px}.fmo-health-card-head small{opacity:.68}.fmo-health-dot{width:12px;height:12px;border-radius:50%;flex:0 0 12px}.fmo-health-card.is-ok .fmo-health-dot{background:#22c55e}.fmo-health-card.is-warning .fmo-health-dot{background:#f59e0b}.fmo-health-card.is-critical .fmo-health-dot{background:#ef4444}.fmo-health-card.is-info .fmo-health-dot{background:#3b82f6}.fmo-health-card p{margin:10px 0;color:var(--fmo-muted,#64748b);line-height:1.7}.fmo-health-card ul{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}.fmo-health-card li{display:flex;justify-content:space-between;gap:10px;font-size:12px;padding-top:6px;border-top:1px dashed rgba(100,116,139,.22)}.fmo-health-card li span{opacity:.7}.fmo-health-card li b{font-weight:700;max-width:64%;overflow-wrap:anywhere;text-align:left;direction:ltr}
.fmo-lazy-controls{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;margin:12px 0 4px;padding:10px;border-top:1px dashed rgba(100,116,139,.25)}

/* v11.2 role home, notification center, unified icons and smart tables */
.fmo-ui-icon{display:inline-block;flex:0 0 auto;vertical-align:middle;color:currentColor}
#fmo-app .fmo-sidebar button[data-tab]{display:flex;align-items:center;gap:10px}
#fmo-app .fmo-sidebar button[data-tab]>.fmo-ui-icon{width:19px;height:19px;opacity:.88}
#fmo-app .fmo-sidebar button[data-tab].active>.fmo-ui-icon{opacity:1}
.fmo-simple-bottom-nav [data-icon]{display:grid;place-items:center;min-height:22px}
.fmo-simple-bottom-nav .fmo-ui-icon{width:21px;height:21px}

.fmo-role-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
.fmo-role-kpi{appearance:none;border:1px solid color-mix(in srgb,var(--ui-primary) 12%,var(--fmo-border,#e5e7eb));background:linear-gradient(145deg,var(--ui-surface,#fff),var(--ui-surface-2,#f8fafc));border-radius:18px;padding:16px;text-align:right;min-height:112px;display:grid;grid-template-columns:auto 1fr;grid-template-areas:"icon label" "value value";gap:7px 10px;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;color:var(--fmo-text,#172033)}
.fmo-role-kpi:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(15,23,42,.08);border-color:color-mix(in srgb,var(--ui-primary) 35%,transparent)}
.fmo-role-kpi>span{grid-area:icon;width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:color-mix(in srgb,var(--ui-primary) 12%,transparent);color:var(--ui-primary)}
.fmo-role-kpi>small{grid-area:label;align-self:center;font-weight:800;color:var(--fmo-muted,#64748b);font-size:13px}
.fmo-role-kpi>strong{grid-area:value;font-size:24px;line-height:1.2;color:var(--fmo-text,#111827)}
.fmo-role-action>span{display:grid!important;place-items:center!important;width:42px!important;height:42px!important;border-radius:13px!important;background:color-mix(in srgb,var(--ui-primary) 10%,transparent)!important;color:var(--ui-primary)!important;font-size:0!important}

.fmo-notifications-page{display:grid;gap:16px}
.fmo-notifications-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:22px;border-radius:22px;background:linear-gradient(135deg,color-mix(in srgb,var(--ui-primary) 10%,var(--ui-surface,#fff)),var(--ui-surface,#fff));border:1px solid color-mix(in srgb,var(--ui-primary) 14%,transparent)}
.fmo-notifications-head h2{margin:4px 0 8px;font-size:25px}.fmo-notifications-head p{margin:0;color:var(--fmo-muted,#64748b);max-width:700px}
.fmo-section-kicker{display:inline-flex;color:var(--ui-primary);font-size:12px;font-weight:900;letter-spacing:.03em}
.fmo-notification-summary{display:flex;gap:10px;flex-wrap:wrap}.fmo-notification-summary span{min-width:105px;padding:10px 13px;border-radius:14px;background:var(--ui-surface,#fff);border:1px solid var(--fmo-border,#e5e7eb);display:grid;gap:2px;text-align:center;color:var(--fmo-muted,#64748b)}.fmo-notification-summary span b{font-size:20px;color:var(--fmo-text,#111827)}.fmo-notification-summary span.danger{background:#fff2f2;border-color:#fecaca;color:#b91c1c}.fmo-notification-summary span.danger b{color:#b91c1c}
.fmo-notification-filters{display:flex;gap:8px;flex-wrap:wrap;padding:4px 0}
.fmo-notification-filter{border:1px solid var(--fmo-border,#dbe2ea);background:var(--ui-surface,#fff);color:var(--fmo-text,#334155);border-radius:999px;padding:9px 13px;display:inline-flex;align-items:center;gap:8px;font-weight:800;cursor:pointer}.fmo-notification-filter b{min-width:24px;height:24px;border-radius:999px;display:grid;place-items:center;background:var(--ui-surface-2,#f1f5f9);font-size:11px}.fmo-notification-filter.active{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}.fmo-notification-filter.active b{background:rgba(255,255,255,.18);color:#fff}
.fmo-notifications-actions{display:flex;justify-content:flex-end}
.fmo-notifications-list{display:grid;gap:10px}
.fmo-notification-card{width:100%;border:1px solid var(--fmo-border,#e5e7eb);background:var(--ui-surface,#fff);border-radius:17px;padding:14px 16px;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:center;text-align:right;cursor:pointer;color:var(--fmo-text,#111827);transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}
.fmo-notification-card:hover{transform:translateY(-1px);box-shadow:0 9px 24px rgba(15,23,42,.07);border-color:color-mix(in srgb,var(--ui-primary) 30%,var(--fmo-border,#e5e7eb))}.fmo-notification-card.read{opacity:.72}.fmo-notification-card.unread{border-inline-start:4px solid var(--ui-primary)}.fmo-notification-card.danger{border-inline-start-color:#dc2626;background:linear-gradient(90deg,#fff8f8,var(--ui-surface,#fff))}.fmo-notification-card.warning{border-inline-start-color:#d97706}
.fmo-notification-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--ui-surface-2,#f1f5f9);color:var(--ui-primary)}.fmo-notification-card.danger .fmo-notification-icon{background:#fee2e2;color:#b91c1c}.fmo-notification-card.warning .fmo-notification-icon{background:#fef3c7;color:#b45309}
.fmo-notification-copy{display:grid;gap:3px}.fmo-notification-copy strong{font-size:14px}.fmo-notification-copy small{color:var(--fmo-muted,#64748b);line-height:1.55}.fmo-notification-copy time{font-size:11px;color:#94a3b8}.fmo-notification-open{font-size:12px;font-weight:900;color:var(--ui-primary)}

.fmo-table-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:10px 0 8px;padding:10px;border:1px solid var(--fmo-border,#e5e7eb);border-radius:14px;background:color-mix(in srgb,var(--ui-surface-2,#f8fafc) 74%,var(--ui-surface,#fff))}
.fmo-table-search{display:flex;align-items:center;gap:8px;min-width:min(320px,100%);flex:1;color:var(--fmo-muted,#64748b)}.fmo-table-search input{width:100%;min-height:38px;border:1px solid var(--fmo-border,#dbe2ea);border-radius:10px;background:var(--ui-surface,#fff);padding:7px 10px;color:var(--fmo-text,#111827)}
.fmo-table-size{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:800;color:var(--fmo-muted,#64748b)}.fmo-table-size select{min-height:36px;border:1px solid var(--fmo-border,#dbe2ea);border-radius:9px;background:var(--ui-surface,#fff);padding:4px 8px}
.fmo-table-pagination{display:flex;align-items:center;gap:8px;margin-inline-start:auto}.fmo-table-pagination button{border:1px solid var(--fmo-border,#dbe2ea);background:var(--ui-surface,#fff);border-radius:9px;padding:7px 10px;font-weight:800;color:var(--fmo-text,#334155);cursor:pointer}.fmo-table-pagination button:disabled{opacity:.45;cursor:not-allowed}.fmo-table-pagination span{font-size:12px;color:var(--fmo-muted,#64748b);min-width:120px;text-align:center}
.fmo-table-wrap th.fmo-sortable{cursor:pointer;user-select:none;position:relative;padding-inline-end:24px!important}.fmo-table-wrap th.fmo-sortable::after{content:'↕';position:absolute;inset-inline-end:7px;opacity:.35;font-size:12px}.fmo-table-wrap th.fmo-sortable.sort-asc::after{content:'↑';opacity:1;color:var(--ui-primary)}.fmo-table-wrap th.fmo-sortable.sort-desc::after{content:'↓';opacity:1;color:var(--ui-primary)}
.fmo-table-enhanced table tbody tr{transition:background .12s ease}.fmo-table-enhanced table tbody tr:hover{background:color-mix(in srgb,var(--ui-primary) 5%,var(--ui-surface,#fff))}

@media(max-width:900px){.fmo-role-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.fmo-notifications-head{flex-direction:column}.fmo-notification-summary{width:100%}.fmo-notification-summary span{flex:1}.fmo-table-pagination{width:100%;margin-inline-start:0;justify-content:space-between}.fmo-table-search{min-width:100%}}
@media(max-width:560px){.fmo-role-kpi-grid{grid-template-columns:1fr 1fr;gap:8px}.fmo-role-kpi{min-height:98px;padding:12px}.fmo-role-kpi>strong{font-size:19px}.fmo-notification-card{grid-template-columns:38px minmax(0,1fr)}.fmo-notification-open{display:none}.fmo-notification-icon{width:36px;height:36px}.fmo-notification-filters{overflow-x:auto;flex-wrap:nowrap;padding-bottom:6px}.fmo-notification-filter{white-space:nowrap}.fmo-table-tools{align-items:stretch}.fmo-table-size{flex:1}.fmo-table-pagination span{min-width:0}}

/* v11.3 Team & Account */
.fmo-team-quick-add{border:1px solid rgba(15,118,110,.14);background:linear-gradient(135deg,rgba(236,253,245,.9),rgba(239,246,255,.78))}
.fmo-team-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-top:14px}
.fmo-team-member{border:1px solid var(--fmo-border,#e5e7eb);border-radius:18px;padding:16px;background:var(--fmo-card,#fff);box-shadow:0 8px 24px rgba(15,23,42,.05);display:flex;flex-direction:column;gap:14px;min-width:0}
.fmo-team-member-head{display:flex;align-items:center;gap:12px;min-width:0}.fmo-team-member-head>div:last-child{min-width:0}.fmo-team-member-head strong,.fmo-team-member-head small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fmo-team-member-head small{color:var(--fmo-muted,#64748b);margin-top:3px}
.fmo-team-avatar,.fmo-account-avatar{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;flex:0 0 auto;background:linear-gradient(135deg,rgba(20,184,166,.14),rgba(59,130,246,.14));color:var(--fmo-accent,#0f766e)}
.fmo-team-meta{display:grid;gap:8px;color:var(--fmo-muted,#64748b);font-size:13px}.fmo-team-meta span{display:flex;align-items:center;gap:7px;min-width:0}
.fmo-team-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}
.fmo-account-card{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(320px,1.2fr);gap:24px;align-items:start}.fmo-account-profile{display:flex;gap:14px;align-items:center;padding:8px}.fmo-account-profile h3{margin:3px 0 5px}.fmo-account-profile p{margin:0;color:var(--fmo-muted,#64748b);word-break:break-word}.fmo-account-password{border-inline-start:1px solid var(--fmo-border,#e5e7eb);padding-inline-start:24px}
.fmo-simple-today-action.team{background:linear-gradient(135deg,rgba(167,243,208,.55),rgba(191,219,254,.48))}
.fmo-simple-bottom-nav button.active{font-weight:800;transform:translateY(-1px)}
@media(max-width:760px){.fmo-account-card{grid-template-columns:1fr}.fmo-account-password{border-inline-start:0;border-top:1px solid var(--fmo-border,#e5e7eb);padding-inline-start:0;padding-top:18px}.fmo-team-grid{grid-template-columns:1fr}.fmo-team-actions .fmo-btn{flex:1}}

/* v11.4 Parent Stock / Breeder module */
.fmo-breeder-only { display:none; }
form[data-farm-production-type="breeder"] .fmo-breeder-only,
.fmo-first-setup-wizard[data-farm-production-type="breeder"] .fmo-breeder-only { display:block; }
.fmo-breeder-hero { display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap; }
.fmo-breeder-hero h2 { margin:.35rem 0; }
.fmo-breeder-scope { display:flex; gap:12px; flex-wrap:wrap; align-items:end; }
.fmo-breeder-scope label { min-width:220px; }
.fmo-breeder-kpis .fmo-card strong { display:block; margin-top:6px; font-size:1.35rem; }
.fmo-breeder-compare > div { min-width:0; }
.fmo-breeder-compare h4 { margin:0 0 8px; }
.fmo-breeder-metric { min-height:112px; }
.fmo-breeder-metric > span { display:block; font-size:1.35rem; font-weight:800; margin-bottom:6px; }
.fmo-breeder-metric small { display:block; margin-bottom:8px; }
.fmo-breeder-target-editor summary { cursor:pointer; padding:4px 0 10px; }
.fmo-catalog-card { border:1px solid var(--fmo-border, #dfe7e2); border-radius:14px; padding:14px; background:var(--fmo-card, #fff); }
.fmo-catalog-card strong,.fmo-catalog-card small { display:block; }
.fmo-catalog-card p { margin:.55rem 0; }
.fmo-span-all { grid-column:1 / -1; }
@media (max-width: 760px) { .fmo-breeder-hero { align-items:stretch; } .fmo-breeder-scope { width:100%; } .fmo-breeder-scope label { min-width:100%; } }
