/* ============================================================
   MonyBot Tenant Panel Theme — Chatfuel-inspired, soft & friendly
   Loaded via render hook in TenantPanelProvider (no build step).
   ============================================================ */

/* ---- Typography ---- */
.fi-body, .fi-body * , .fi-topbar, .fi-sidebar {
    font-family: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

/* ---- App background ---- */
.fi-body {
    background-color: #f4f6fb !important;
}
.dark .fi-body {
    background-color: #0b1220 !important;
}

/* ---- Sidebar: clean white card with soft separations ---- */
.fi-sidebar {
    background: #ffffff !important;
    border-inline-end: 1px solid #e8ecf3 !important;
}
.dark .fi-sidebar {
    background: #101827 !important;
    border-inline-end-color: #1f2937 !important;
}
.fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
}
.fi-sidebar-nav {
    padding-top: .25rem !important;
}

/* group labels: small, spaced, subtle */
.fi-sidebar-group-label {
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .04em;
    color: #8a93a6 !important;
    text-transform: none !important;
    margin-top: .35rem;
}

/* items: pill hover + colorful active state */
.fi-sidebar-item a {
    border-radius: 10px !important;
    min-height: 40px;
    transition: background .15s ease, color .15s ease;
}
.fi-sidebar-item a:hover {
    background: #eef6f1 !important;
}
.dark .fi-sidebar-item a:hover {
    background: rgba(16, 185, 129, .08) !important;
}
.fi-sidebar-item-active a,
.fi-sidebar-item a[aria-current="page"] {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, .35);
}
.fi-sidebar-item-active a .fi-sidebar-item-label,
.fi-sidebar-item-active a .fi-sidebar-item-icon,
.fi-sidebar-item a[aria-current="page"] .fi-sidebar-item-label,
.fi-sidebar-item a[aria-current="page"] .fi-sidebar-item-icon {
    color: #ffffff !important;
}
.fi-sidebar-item-icon {
    width: 1.15rem !important;
    height: 1.15rem !important;
}

/* ---- Topbar ---- */
.fi-topbar > nav, .fi-topbar {
    background: rgba(255, 255, 255, .85) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e8ecf3 !important;
    box-shadow: none !important;
}
.dark .fi-topbar > nav, .dark .fi-topbar {
    background: rgba(16, 24, 39, .85) !important;
    border-bottom-color: #1f2937 !important;
}

/* ---- Cards & sections: rounder, softer shadows ---- */
.fi-section, .fi-ta-ctn, .fi-wi-widget, .fi-fo-tabs, .fi-fo-wizard {
    border-radius: 16px !important;
    border: 1px solid #e8ecf3 !important;
    box-shadow: 0 10px 30px rgba(23, 37, 84, .05) !important;
}
.dark .fi-section, .dark .fi-ta-ctn, .dark .fi-wi-widget {
    border-color: #1f2937 !important;
}
.fi-section-header-heading {
    font-weight: 800 !important;
}

/* ---- Buttons ---- */
.fi-btn {
    border-radius: 10px !important;
    font-weight: 700 !important;
}
.fi-btn-color-primary {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    box-shadow: 0 6px 14px rgba(16, 185, 129, .30) !important;
    border: 0 !important;
}
.fi-btn-color-primary:hover {
    filter: brightness(1.05);
}

/* ---- Inputs ---- */
.fi-input-wrp, .fi-select-input, .fi-fo-textarea textarea {
    border-radius: 10px !important;
}
.fi-input-wrp:focus-within {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .18) !important;
}

/* ---- Badges: pill + soft ---- */
.fi-badge {
    border-radius: 999px !important;
    font-weight: 700 !important;
    padding-inline: .6rem !important;
}

/* ---- Tables: airy rows with hover ---- */
.fi-ta-header-cell {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #64748b !important;
}
.fi-ta-row {
    transition: background .12s ease;
}
.fi-ta-row:hover {
    background: #f6faf8 !important;
}
.dark .fi-ta-row:hover {
    background: rgba(16, 185, 129, .05) !important;
}
.fi-ta-cell {
    padding-block: .8rem !important;
}

/* ---- Page header ---- */
.fi-header-heading {
    font-weight: 900 !important;
    letter-spacing: -.01em;
}

/* ---- Empty states: friendlier ---- */
.fi-ta-empty-state-icon-ctn {
    background: #ecfdf5 !important;
    border-radius: 999px;
}
.fi-ta-empty-state-icon-ctn .fi-icon {
    color: #059669 !important;
}

/* ---- Notifications ---- */
.fi-no-notification {
    border-radius: 14px !important;
    box-shadow: 0 16px 40px rgba(23, 37, 84, .14) !important;
}

/* ============================================================
   Custom dashboard components (mb-*)
   ============================================================ */
.mbd-grid { display: grid; gap: 16px; }
@media (min-width: 1024px) { .mbd-cols-4 { grid-template-columns: repeat(4, 1fr); } .mbd-cols-3 { grid-template-columns: repeat(3, 1fr); } .mbd-cols-2 { grid-template-columns: 2fr 1fr; align-items: start; } }

.mbd-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    padding: 26px 28px; border-radius: 18px; color: #fff;
    background: linear-gradient(120deg, #047857 0%, #059669 45%, #10b981 100%);
    box-shadow: 0 18px 44px rgba(5, 150, 105, .35);
}
.mbd-hero h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; }
.mbd-hero p { margin: 0; font-size: 13.5px; opacity: .92; max-width: 62ch; line-height: 1.7; }
.mbd-hero-emoji { font-size: 44px; line-height: 1; }

.mbd-stat {
    display: flex; align-items: center; gap: 14px;
    padding: 18px; border-radius: 16px; background: #fff;
    border: 1px solid #e8ecf3; box-shadow: 0 10px 30px rgba(23, 37, 84, .05);
}
.dark .mbd-stat { background: #101827; border-color: #1f2937; }
.mbd-stat-icon {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; font-size: 21px; flex: 0 0 auto;
}
.mbd-stat-value { font-size: 22px; font-weight: 900; line-height: 1.1; }
.mbd-stat-label { font-size: 12px; color: #6b7280; font-weight: 600; }
.dark .mbd-stat-label { color: #9ca3af; }
.mbd-teal   { background: #ccfbf1; color: #0f766e; }
.mbd-blue   { background: #dbeafe; color: #1d4ed8; }
.mbd-amber  { background: #fef3c7; color: #b45309; }
.mbd-violet { background: #ede9fe; color: #6d28d9; }

.mbd-card {
    padding: 20px; border-radius: 16px; background: #fff;
    border: 1px solid #e8ecf3; box-shadow: 0 10px 30px rgba(23, 37, 84, .05);
}
.dark .mbd-card { background: #101827; border-color: #1f2937; }
.mbd-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 900; }
.mbd-card > p.mbd-sub { margin: 0 0 14px; font-size: 12.5px; color: #6b7280; }

.mbd-progress { height: 9px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin: 10px 0 16px; }
.dark .mbd-progress { background: #1f2937; }
.mbd-progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #059669, #34d399); transition: width .5s ease; }

.mbd-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: inherit; transition: background .13s ease; }
.mbd-step:hover { background: #f3f7f5; }
.dark .mbd-step:hover { background: rgba(16,185,129,.06); }
.mbd-step-check { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; font-size: 13px; font-weight: 900; flex: 0 0 auto; }
.mbd-step-check.done { background: #059669; color: #fff; }
.mbd-step-check.todo { background: #e5e7eb; color: #6b7280; }
.dark .mbd-step-check.todo { background: #374151; color: #9ca3af; }
.mbd-step-title { font-size: 13.5px; font-weight: 800; }
.mbd-step.done .mbd-step-title { color: #6b7280; text-decoration: line-through; text-decoration-thickness: 1px; }
.mbd-step-desc { font-size: 11.5px; color: #8a93a6; }
.mbd-step-go { margin-inline-start: auto; color: #059669; font-weight: 900; font-size: 15px; }

.mbd-action {
    display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 16px;
    background: #fff; border: 1px solid #e8ecf3; text-decoration: none; color: inherit;
    box-shadow: 0 10px 30px rgba(23, 37, 84, .05);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mbd-action:hover { transform: translateY(-3px); border-color: #a7f3d0; box-shadow: 0 18px 40px rgba(5,150,105,.14); }
.dark .mbd-action { background: #101827; border-color: #1f2937; }
.mbd-action-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 20px; flex: 0 0 auto; }
.mbd-action b { display: block; font-size: 14px; font-weight: 900; margin-bottom: 3px; }
.mbd-action span { font-size: 12px; color: #6b7280; line-height: 1.6; display: block; }
.dark .mbd-action span { color: #9ca3af; }

/* ============================================================
   Shared visual-builder components (au-*) — used by the
   Automation / Routing / Journey builders.
   ============================================================ */
.au-wrap { max-width: 880px; margin-inline: auto; display: grid; gap: 0; }
.au-card { border-radius: 16px; background: #fff; border: 1px solid #e8ecf3; box-shadow: 0 10px 30px rgba(23,37,84,.05); padding: 20px; }
.dark .au-card { background: #101827; border-color: #1f2937; }
.au-zone-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.au-zone-badge { display: grid; place-items: center; min-width: 76px; height: 30px; padding-inline: 12px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 900; }
.au-when .au-zone-badge { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.au-if .au-zone-badge { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.au-then .au-zone-badge { background: linear-gradient(135deg, #059669, #34d399); }
.au-zone-title { font-size: 13px; color: #6b7280; font-weight: 700; }
.au-connector { display: grid; place-items: center; height: 40px; }
.au-connector span { width: 3px; height: 100%; border-radius: 3px; background: linear-gradient(#c7d2fe, #a7f3d0); display: block; }
.au-triggers { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.au-trigger { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1.5px solid #e8ecf3; border-radius: 12px; background: #fff; cursor: pointer; text-align: start; transition: all .14s ease; font: inherit; }
.dark .au-trigger { background: #0f172a; border-color: #1f2937; }
.au-trigger:hover { border-color: #c4b5fd; transform: translateY(-2px); }
.au-trigger.selected { border-color: #7c3aed; background: #f5f3ff; box-shadow: 0 8px 22px rgba(124,58,237,.18); }
.dark .au-trigger.selected { background: rgba(124,58,237,.12); }
.au-trigger .ic { font-size: 20px; line-height: 1; }
.au-trigger b { display: block; font-size: 12.5px; font-weight: 900; margin-bottom: 2px; }
.au-trigger small { display: block; font-size: 10.5px; color: #8a93a6; line-height: 1.5; }
.au-trigger.green.selected { border-color: #059669; background: #ecfdf5; box-shadow: 0 8px 22px rgba(5,150,105,.18); }
.au-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border: 1px dashed #d9dee8; border-radius: 12px; background: #fafbfe; }
.dark .au-row { background: #0f172a; border-color: #374151; }
.au-row select, .au-row input { min-height: 38px; padding: 6px 10px; border: 1px solid #d9dee8; border-radius: 9px; background: #fff; color: #111827; font: inherit; font-size: 13px; outline: 0; }
.dark .au-row select, .dark .au-row input { background: #111827; border-color: #4b5563; color: #e5e7eb; }
.au-row select:focus, .au-row input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.au-row input { flex: 1; min-width: 140px; }
.au-x { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #9ca3af; font-size: 16px; cursor: pointer; }
.au-x:hover { background: #fee2e2; color: #dc2626; }
.au-add { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border: 1.5px dashed #c7d2fe; border-radius: 10px; background: transparent; color: #4f46e5; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.au-add:hover { background: #eef2ff; }
.au-then .au-add { border-color: #a7f3d0; color: #047857; }
.au-then .au-add:hover { background: #ecfdf5; }
.au-action-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.au-action-row { border: 1px solid #d1fae5; background: #f6fef9; border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.dark .au-action-row { background: rgba(16,185,129,.06); border-color: rgba(16,185,129,.25); }
.au-action-row .head { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 13px; }
.au-action-row .fields { display: flex; gap: 8px; flex-wrap: wrap; }
.au-action-row input, .au-action-row select { flex: 1; min-width: 130px; min-height: 36px; padding: 6px 10px; border: 1px solid #d9dee8; border-radius: 9px; font: inherit; font-size: 13px; outline: 0; background: #fff; color: #111827; }
.dark .au-action-row input, .dark .au-action-row select { background: #111827; border-color: #4b5563; color: #e5e7eb; }
.au-summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: linear-gradient(120deg, #0f172a, #1e293b); color: #e2e8f0; font-size: 13.5px; line-height: 1.8; }
.au-summary .lamp { font-size: 20px; }
.au-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.au-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.au-meta label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: #6b7280; }
.au-meta input[type="number"] { width: 84px; min-height: 38px; padding: 6px 10px; border: 1px solid #d9dee8; border-radius: 9px; font: inherit; }
.au-save { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 26px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #059669, #10b981); color: #fff; font-weight: 900; font-size: 14px; cursor: pointer; box-shadow: 0 8px 20px rgba(16,185,129,.35); }
.au-save:hover { filter: brightness(1.06); }
.au-name input, .au-name textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid #d9dee8; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; outline: 0; background:#fff; color:#111827; }
.dark .au-name input, .dark .au-name textarea { background: #111827; border-color: #4b5563; color: #e5e7eb; }
.au-name input:focus, .au-name textarea:focus { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.au-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.au-switch input { position: absolute; opacity: 0; }
.au-switch .tr { width: 42px; height: 24px; border-radius: 999px; background: #d1d5db; transition: background .15s; }
.au-switch input:checked + .tr { background: #059669; }
.au-switch .th { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: transform .15s; }
.au-switch input:checked ~ .th { transform: translateX(18px); }
[dir="rtl"] .au-switch input:checked ~ .th { transform: translateX(-18px); }

/* Journey timeline steps */
.jt-step { position: relative; display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1.5px solid #e8ecf3; background: #fff; }
.dark .jt-step { background: #101827; border-color: #1f2937; }
.jt-step.wait { border-color: #fde68a; background: #fffdf5; }
.dark .jt-step.wait { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.35); }
.jt-step-head { display: flex; align-items: center; gap: 10px; }
.jt-step-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: #eef2ff; color: #4f46e5; font-weight: 900; font-size: 13px; flex: 0 0 auto; }
.jt-step.wait .jt-step-num { background: #fef3c7; color: #b45309; }
.jt-step-title { font-weight: 900; font-size: 13.5px; }
.jt-tools { margin-inline-start: auto; display: flex; gap: 4px; }
.jt-wait-fields { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: #92400e; }
.jt-wait-fields input { width: 90px; min-height: 38px; padding: 6px 10px; border: 1px solid #fcd34d; border-radius: 9px; font: inherit; }
.jt-wait-fields select { min-height: 38px; padding: 6px 10px; border: 1px solid #fcd34d; border-radius: 9px; font: inherit; background: #fff; }
.dark .jt-wait-fields input, .dark .jt-wait-fields select { background: #111827; color: #e5e7eb; border-color: rgba(245,158,11,.4); }
