/* OFast Pipeline — Client Portal Styles (V2 Redesign) */

/* ── Theme Variables ──────────────────────────────────────────────────────── */
:root {
    /* Dark Theme (Default to match user request) */
    --bg-body: #131722;
    --bg-sidebar: #1c2233;
    --bg-card: #1e2638;
    --bg-card-hover: #252e42;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #cbd5e1;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.12);
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --btn-primary: #3b82f6;
    --btn-primary-hover: #2563eb;
    --dropdown-bg: #1c2233;
    --dropdown-border: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    color-scheme: dark;
}

[data-theme="light"],
html.light,
html:not(.dark):not([data-theme="dark"]) {
    color-scheme: light;
    --bg-body: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dark: #334155;
    --border-color: #e2e8f0;
    --border-highlight: #cbd5e1;
    --accent-blue: #2563eb;
    --accent-green: #059669;
    --accent-orange: #d97706;
    --accent-red: #dc2626;
    --accent-purple: #7c3aed;
    --btn-primary: #2563eb;
    --btn-primary-hover: #1d4ed8;
    --dropdown-bg: #ffffff;
    --dropdown-border: #e2e8f0;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ── Theme Toggle Sun/Moon Icon Display ─────────────────────────────────── */
html.dark .theme-toggle-moon,
html[data-theme="dark"] .theme-toggle-moon {
    display: none !important;
}
html.dark .theme-toggle-sun,
html[data-theme="dark"] .theme-toggle-sun {
    display: block !important;
}

html.light .theme-toggle-moon,
html[data-theme="light"] .theme-toggle-moon,
html:not(.dark):not([data-theme="dark"]) .theme-toggle-moon {
    display: block !important;
}
html.light .theme-toggle-sun,
html[data-theme="light"] .theme-toggle-sun,
html:not(.dark):not([data-theme="dark"]) .theme-toggle-sun {
    display: none !important;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

body.ofp-portal-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Shell & Layout ───────────────────────────────────────────────────────── */
.ofp-shell {
    display: flex;
    min-height: 100vh;
}

.ofp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ofp-content-area {
    padding: 32px;
    flex: 1 0 auto;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.ofp-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 250;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.ofp-sidebar-header {
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.ofp-nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.ofp-nav-brand span {
    color: var(--accent-orange);
}

/* Match BulkSMS orange touch */

.ofp-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
}

.ofp-nav-group {
    margin-bottom: 24px;
}

.ofp-nav-group-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding: 0 12px;
}

.ofp-sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ofp-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ofp-nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.ofp-nav-item.active {
    background: var(--bg-card-hover);
    color: var(--text-main);
    font-weight: 600;
}

.ofp-nav-item.active .ofp-nav-icon {
    /* Kept intentionally empty to override any previous glow/shadow if needed */
}

.ofp-nav-item.locked {
    color: var(--text-muted);
    opacity: 0.6;
    cursor: default;
}

.ofp-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ofp-nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.ofp-nav-label {
    flex: 1;
}

.ofp-nav-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 100px;
    background: var(--accent-blue);
    color: #fff;
}

/* ── Topbar (Inside Main) ─────────────────────────────────────────────────── */
.ofp-topbar {
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-body);
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.ofp-sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 1024px) {
    .ofp-sidebar-toggle {
        display: block;
    }
}

.ofp-topbar-search {
    flex: 1;
    display: flex;
    align-items: center;
}

.ofp-topbar-search .search-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    width: 320px;
}

.ofp-topbar-search input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    width: 100%;
    outline: none;
    margin-left: 8px;
}

.ofp-topbar-search svg {
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.ofp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ofp-btn-balance {
    background: var(--btn-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.15s;
}

.ofp-btn-balance:hover {
    background: var(--btn-primary-hover);
}

.ofp-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ofp-icon-btn:hover {
    background: var(--bg-sidebar);
    color: var(--text-main);
}

.ofp-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

/* ── User Dropdown ────────────────────────────────────────────────────────── */
.ofp-user-menu {
    position: relative;
}

.ofp-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-sidebar);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-orange);
    font-weight: 700;
    transition: border-color 0.2s;
    overflow: hidden;
}

.ofp-user-avatar:hover {
    border-color: var(--accent-blue);
}

.ofp-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ofp-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    width: 240px;
    background: var(--dropdown-bg);
    border: 1px solid var(--dropdown-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 400;
}

/* Invisible bridge to keep hover active across the 12px gap */
.ofp-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.ofp-user-menu:hover .ofp-dropdown,
.ofp-user-menu.active .ofp-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ofp-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--dropdown-border);
}

.ofp-dropdown-header strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 2px;
}

.ofp-dropdown-header span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.ofp-dropdown-body {
    padding: 8px;
}

.ofp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: background 0.15s;
}

.ofp-dropdown-item:hover {
    background: var(--bg-card-hover);
}

.ofp-dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.ofp-dropdown-item.danger {
    color: var(--accent-red);
}

.ofp-dropdown-item.danger svg {
    color: var(--accent-red);
}

/* ── Dashboard Content ────────────────────────────────────────────────────── */
.ofp-greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
}

.ofp-greeting h1 {
    font-size: 24px;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 6px;
}

.ofp-greeting p {
    color: var(--text-muted);
    font-size: 14px;
}

.ofp-greeting-right {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.ofp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.ofp-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.ofp-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ofp-stat-title {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.ofp-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ofp-stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.ofp-stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.ofp-stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
}

.ofp-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.ofp-stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ofp-stat-sub.positive {
    color: var(--accent-green);
}

/* Charts & Grids */
.ofp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.ofp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    min-width: 0;
}

.ofp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ofp-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.ofp-card-link {
    font-size: 13px;
    color: var(--accent-green);
    text-decoration: none;
}

/* Empty States & Placeholders */
.ofp-chart-placeholder {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding-top: 20px;
}

.ofp-bar {
    flex: 1;
    background: var(--border-highlight);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 4px;
}

.ofp-bar.orange {
    background: var(--accent-orange);
}

.ofp-bar.blue {
    background: var(--accent-blue);
}

.ofp-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.ofp-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 24px;
}

.ofp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ofp-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.05);
}

.ofp-table td {
    padding: 16px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(128, 128, 128, 0.05);
}

.ofp-table tr:last-child td {
    border-bottom: none;
}

/* ── System Status ────────────────────────────────────────────────────────── */
.ofp-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.ofp-status-pill {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ofp-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.ofp-status-info strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 2px;
}

.ofp-status-info span {
    color: var(--accent-green);
    font-size: 12px;
}

/* ── Banner ───────────────────────────────────────────────────────────────── */
.ofp-referral-banner {
    background: linear-gradient(90deg, var(--bg-card), var(--bg-body));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.ofp-referral-banner .icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.ofp-banner-content {
    display: flex;
    align-items: center;
}

.ofp-banner-text h3 {
    color: var(--text-main);
    font-size: 16px;
    margin-bottom: 4px;
}

.ofp-banner-text p {
    color: var(--text-muted);
    font-size: 14px;
}

.ofp-btn-accent {
    background: var(--accent-orange);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.ofp-btn-accent:hover {
    background: #d97706;
}

/* ── Standard Components (Forms, Alerts, Badges) ──────────────────────────── */
.ofp-alert {
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.ofp-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.ofp-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.ofp-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.ofp-badge-new {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.ofp-badge-converted {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.ofp-field {
    margin-bottom: 16px;
}

.ofp-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ── Toggle Switch ────────────────────────────────────────────────────────── */
.ofp-toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    gap: 10px;
}

.ofp-toggle-switch input {
    display: none;
}

.ofp-toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background-color: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    transition: 0.3s;
    flex-shrink: 0;
}

.ofp-toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--text-muted);
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.ofp-toggle-switch input:checked + .ofp-toggle-slider {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
}

.ofp-toggle-switch input:checked + .ofp-toggle-slider::before {
    transform: translateX(18px);
    background-color: var(--accent-blue);
}

.ofp-field input,
.ofp-field select,
.ofp-field textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.ofp-field textarea {
    resize: vertical;
}

.ofp-field input:focus {
    border-color: var(--accent-blue);
}

.ofp-btn {
    background: var(--accent-blue);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ofp-btn:hover {
    opacity: 0.9;
}


/* ── Container & Layouts ─────────────────────────────────────────────────── */
.ofp-container {
    max-width: 1200px;
    margin: 0 auto;
}

.ofp-page-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ofp-page-header h1 {
    font-size: 24px;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 6px;
}

.ofp-page-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.ofp-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ofp-badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.ofp-badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.ofp-badge-yellow,
.ofp-badge-orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.ofp-badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.ofp-badge-grey {
    background: var(--bg-body);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.ofp-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.ofp-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.ofp-table th {
    padding: 16px 20px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(128, 128, 128, 0.05);
    background: var(--bg-card);
}

.ofp-table td {
    padding: 16px 20px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(128, 128, 128, 0.05);
    vertical-align: middle;
}

.ofp-table tbody tr:hover td {
    background: var(--bg-card-hover);
}

.ofp-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.ofp-alert {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 24px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ofp-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.ofp-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.ofp-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.ofp-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.ofp-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ofp-form-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.ofp-form-row>.ofp-field {
    flex: 1;
    min-width: 280px;
}

.ofp-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.ofp-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.ofp-field input[type="text"],
.ofp-field input[type="email"],
.ofp-field input[type="number"],
.ofp-field input[type="tel"],
.ofp-field input[type="password"],
.ofp-field input[type="date"],
.ofp-field select,
.ofp-field textarea,
.ofp-input,
.ofp-select,
.ofp-textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ofp-field input::placeholder,
.ofp-field textarea::placeholder,
.ofp-input::placeholder,
.ofp-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.ofp-field input:focus,
.ofp-field select:focus,
.ofp-field textarea:focus,
.ofp-input:focus,
.ofp-select:focus,
.ofp-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--bg-body);
}

.ofp-field input:hover,
.ofp-field select:hover,
.ofp-field textarea:hover,
.ofp-input:hover,
.ofp-select:hover,
.ofp-textarea:hover {
    border-color: var(--border-highlight);
}

.ofp-field textarea,
.ofp-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.ofp-select,
.ofp-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    padding-right: 40px;
    cursor: pointer;
}

.ofp-select option,
.ofp-field select option {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 8px 12px;
}

input[type="date"].ofp-input,
.ofp-field input[type="date"] {
    color-scheme: dark;
}
[data-theme="light"] input[type="date"].ofp-input,
[data-theme="light"] .ofp-field input[type="date"] {
    color-scheme: light;
}

.ofp-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.ofp-form-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
}

/* ── Button Variants ─────────────────────────────────────────────────────── */
.ofp-btn-primary {
    background: var(--accent-blue);
    color: #fff;
}

.ofp-btn-primary:hover {
    background: #2563eb;
    opacity: 1;
}

.ofp-btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.ofp-btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.ofp-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.ofp-btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

/* Empty State */
.ofp-empty {
    text-align: center;
    padding: 48px 24px;
}

.ofp-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ofp-empty h3 {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.ofp-empty p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Tables */
.ofp-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: 8px;
}
.ofp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.ofp-table th {
    text-align: left;
    padding: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(128, 128, 128, 0.05);
    background: rgba(128, 128, 128, 0.02);
}
.ofp-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.05);
    color: var(--text-main);
    vertical-align: middle;
}
.ofp-table tbody tr:last-child td {
    border-bottom: none;
}
.ofp-table tbody tr {
    transition: background-color 0.2s ease;
}
.ofp-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Credit Bars */
.ofp-credit-bar-wrap {
    display: flex;
    flex-direction: column;
}
.ofp-credit-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ofp-credit-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.ofp-credit-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}
.ofp-credit-bar-fill.high {
    background: linear-gradient(90deg, #059669, #10b981);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.ofp-credit-bar-fill.medium {
    background: linear-gradient(90deg, #d97706, #f59e0b);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.ofp-credit-bar-fill.low {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .ofp-sidebar {
        position: fixed;
        height: 100%;
        transform: translateX(-100%);
    }

    body.ofp-sidebar-open .ofp-sidebar {
        transform: translateX(0);
    }

    .ofp-topbar-search {
        display: none;
    }

    /* Hide search on mobile */
    .ofp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ofp-grid-2 {
        grid-template-columns: 1fr;
    }

    .ofp-referral-banner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .ofp-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .ofp-referral-banner .icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
}

@media (max-width: 640px) {
    .ofp-stats-grid {
        grid-template-columns: 1fr;
    }

    .ofp-content-area {
        padding: 16px;
    }
}

/* ── Pipeline Timeline Redesign ──────────────────────────────────────────── */
.ofp-pipeline-timeline {
    position: relative;
    margin-top: 24px;
    padding-left: 0;
    max-width: 750px;
}

.ofp-pipeline-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 19px;
    width: 2px;
    background: var(--border-color);
}

.ofp-timeline-progress {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 19px;
    width: 2px;
    background: var(--accent-blue);
    transform-origin: top;
    transform: scaleY(0);
    z-index: 1;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    transition: transform 0.1s ease-out;
}

.ofp-timeline-step {
    position: relative;
    padding-left: 56px;
    margin-bottom: 32px;
}

.ofp-timeline-badge {
    position: absolute;
    left: 0;
    top: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
    box-shadow: 0 0 0 8px var(--bg-body);
    transition: all 0.3s ease;
}

.ofp-timeline-badge svg {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.ofp-timeline-step:hover .ofp-timeline-badge,
.ofp-timeline-step.active .ofp-timeline-badge {
    border-color: var(--accent-orange);
    background: rgba(245, 158, 11, 0.1);
}

.ofp-timeline-step:hover .ofp-timeline-badge svg,
.ofp-timeline-step.active .ofp-timeline-badge svg {
    color: var(--accent-orange);
}

/* ── Toggle Switch & Card Header ───────────────────────────────────────────── */
.ofp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ofp-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.ofp-toggle input[type="checkbox"] {
    display: none;
}

.ofp-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 24px;
    transition: background-color 0.3s ease;
    border: 1px solid var(--border-highlight);
}

.ofp-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ofp-toggle input[type="checkbox"]:checked + .ofp-toggle-slider {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
}

.ofp-toggle input[type="checkbox"]:checked + .ofp-toggle-slider::after {
    transform: translateX(20px);
}

.ofp-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

/* Typography & spacing tweaks for pipeline form */
.ofp-pipeline-form .ofp-card {
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
}

.ofp-pipeline-form .ofp-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ofp-pipeline-form .ofp-card-header {
    margin-bottom: 16px;
}

.ofp-pipeline-form .ofp-card-header h3 {
    margin-bottom: 0;
}

.ofp-pipeline-form .ofp-field label {
    font-size: 12px;
}

.ofp-pipeline-form .ofp-field input[type="text"],
.ofp-pipeline-form .ofp-field input[type="email"],
.ofp-pipeline-form .ofp-field input[type="number"],
.ofp-pipeline-form .ofp-field input[type="tel"],
.ofp-pipeline-form .ofp-field select,
.ofp-pipeline-form .ofp-field textarea {
    padding: 10px 14px;
    font-size: 13px;
}

.ofp-pipeline-form .ofp-hint {
    font-size: 11px;
    line-height: 1.5;
}

/* ── Live Preview Layout & Phone Mockup ────────────────────────────────────── */
.ofp-pipeline-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.ofp-pipeline-main {
    flex: 1;
    min-width: 0;
}

.ofp-pipeline-sidebar {
    width: 360px;
    position: sticky;
    top: 96px;
    flex-shrink: 0;
}

.ofp-phone-mockup {
    background: #0f172a;
    border-radius: 32px;
    border: 12px solid #1e293b;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    height: 780px;
    max-height: calc(100vh - 120px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ofp-phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 24px;
    background: #1e293b;
    border-radius: 0 0 16px 16px;
    z-index: 20;
}

.ofp-phone-screen {
    background: #f8fafc;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.ofp-phone-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 36px 16px 12px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    z-index: 10;
}

.ofp-phone-contact {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.ofp-phone-body {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.ofp-phone-body::-webkit-scrollbar {
    width: 4px;
}

.ofp-phone-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.ofp-chat-bubble {
    background: #e2e8f0;
    color: #0f172a;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 90%;
    align-self: flex-start;
    transition: all 0.4s ease;
    transform-origin: left bottom;
}

.ofp-chat-bubble.active {
    background: var(--accent-blue);
    color: #ffffff;
    border: 1px solid var(--accent-blue);
    transform: scale(1.04);
    box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.5);
}

.ofp-chat-bubble.call-bubble {
    background: #fce7f3;
    border: 1px solid #fbcfe8;
}

.ofp-chat-bubble.call-bubble.active {
    background: #fbcfe8;
    box-shadow: 0 8px 16px -4px rgba(219, 39, 119, 0.2);
}

.ofp-chat-bubble strong {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: #be185d;
}

@media (max-width: 1024px) {
    .ofp-pipeline-layout {
        flex-direction: column;
    }

    .ofp-pipeline-sidebar {
        width: 100%;
        position: static;
        max-width: 360px;
        margin: 0 auto;
    }
}

/* Micro-Stats Grid */
.ofp-micro-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .ofp-micro-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .ofp-micro-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ── Custom Select Dropdown ────────────────────────────────────────────────── */
.ofp-custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.ofp-custom-select-wrapper select {
    display: none !important;
}

.ofp-custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-main, #374151);
    background: var(--bg-body, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ofp-custom-select-trigger:hover {
    border-color: var(--accent-blue, #1a73e8);
}

.ofp-custom-select-wrapper.open .ofp-custom-select-trigger {
    border-color: var(--accent-blue, #1a73e8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ofp-custom-select-trigger::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted, #9ca3af);
    border-bottom: 2px solid var(--text-muted, #9ca3af);
    transform: rotate(45deg) translateY(-2px);
    transition: all 0.2s ease;
}

.ofp-custom-select-wrapper.open .ofp-custom-select-trigger::after {
    transform: rotate(-135deg) translateY(-2px);
}

.ofp-custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    z-index: 99;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.ofp-custom-select-wrapper.open .ofp-custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ofp-custom-select-option {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-main, #374151);
    cursor: pointer;
    transition: background 0.15s ease;
}

.ofp-custom-select-option:hover,
.ofp-custom-select-option.selected {
    background: var(--bg-card-hover, #f8fafc);
    color: var(--accent-blue, #1a73e8);
}

/* ── Plan Grid ────────────────────────────────────────────────────────── */
.ofp-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.ofp-plan-option {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--bg-card);
}
.ofp-plan-option:has(input:checked) {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}
.ofp-plan-option input {
    display: none;
}
.ofp-plan-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}
.ofp-plan-price {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.ofp-plan-leads {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ── Preloaders & Skeletons ──────────────────────────────────────────────── */
.ofp-form-loading-wrapper {
    position: relative;
}

.ofp-action-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    opacity: 0.85;
    z-index: 49;
    border-radius: inherit;
    animation: fadeInOverlay 0.2s ease;
}

.ofp-action-overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease;
}

.ofp-action-overlay-text {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ofp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

.ofp-skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card-hover) 25%,
        var(--border-color) 50%,
        var(--bg-card-hover) 75%
    );
    background-size: 400% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: 6px;
    color: transparent !important;
    border-color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.ofp-skeleton > * {
    opacity: 0 !important;
}

@keyframes skeletonPulse {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.ofp-skeleton-card {
    height: 160px;
    width: 100%;
    border-radius: 20px;
    margin-bottom: 20px;
}/* -- Notification Layout ---------------------------------------------------- */
.ofp-notif-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.ofp-notif-main {
    flex: 1;
    min-width: 0;
}
.ofp-notif-sidebar {
    width: 400px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
}
.ofp-notif-tabs {
    display: none;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}
.ofp-notif-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.ofp-notif-tab.active {
    color: var(--text-main);
    border-bottom-color: var(--accent-blue);
}

.ofp-notif-item {
    padding: 16px 24px;
}
.ofp-notif-item.unread {
    background: rgba(59, 130, 246, 0.04);
}

@media (max-width: 900px) {
    .ofp-notif-layout {
        display: block;
    }
    .ofp-notif-tabs {
        display: flex;
    }
    .ofp-notif-panel {
        display: none;
    }
    .ofp-notif-panel.active {
        display: block;
    }
    .ofp-notif-sidebar {
        width: 100%;
        position: static;
        margin-top: 24px;
    }
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.ofp-modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ofp-modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    animation: ofpModalIn 0.2s ease;
}

@keyframes ofpModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ofp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.ofp-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.ofp-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.ofp-modal-close:hover {
    color: var(--accent-red);
}

.ofp-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.ofp-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ── Cards Grid ──────────────────────────────────────────────────────────── */
.ofp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.ofp-card.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ofp-card.template-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.ofp-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ofp-tab {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ofp-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.ofp-tab.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.ofp-empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

.ofp-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
}

.ofp-empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* ── Small / Ghost Buttons ───────────────────────────────────────────────── */
.ofp-btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.ofp-btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.ofp-btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.ofp-btn-ghost.ofp-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ── Badge Purple ────────────────────────────────────────────────────────── */
.ofp-badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

@media (max-width: 640px) {
    .ofp-cards-grid {
        grid-template-columns: 1fr;
    }
    .ofp-modal {
        max-width: 100% !important;
    }
}
