/* Omfinity ERP — sistema de diseño de la app (documento autónomo, no hereda el theme de WP) */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/dmsans-400.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/dmsans-500.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/dmsans-700.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/playfair-600.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/playfair-700.woff2') format('woff2'); }

:root {
	--bg: #f4f6f4;
	--surface: #ffffff;
	--ink: #121e18;
	--accent: #00361a;
	--accent-hover: #1b4d2e;
	--accent-soft: #e8f7ec;
	--muted: #717971;
	--border: #e0e5e0;
	--warning: #b45309;
	--warning-soft: #fef3e2;
	--danger: #b3261e;
	--danger-soft: #fdecea;
	--success: #1b4d2e;
	--ml-yellow: #fff100;
	--radius-sm: 6px;
	--radius-md: 8px;
	--radius-lg: 12px;
	--font-heading: 'Playfair Display', Georgia, serif;
	--font-body: 'DM Sans', Arial, Helvetica, sans-serif;
	--sidebar-w: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.1; margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ── LAYOUT ── */
.omf-shell { display: flex; min-height: 100vh; }
.omf-sidebar {
	width: var(--sidebar-w); flex-shrink: 0; background: var(--accent); color: #fff;
	display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.omf-sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.omf-sidebar__brand img { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; background: #fff; }
.omf-sidebar__brand-text { font-family: var(--font-heading); font-weight: 700; font-size: 15px; line-height: 1.15; }
.omf-sidebar__brand-sub { font-size: 10px; color: rgba(255,255,255,.65); margin-top: 2px; letter-spacing: .02em; }
.omf-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.omf-nav__item {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
	color: rgba(255,255,255,.82); font-size: 13.5px; font-weight: 500; margin-bottom: 2px; border-left: 3px solid transparent;
}
.omf-nav__item:hover { background: rgba(255,255,255,.08); color: #fff; }
.omf-nav__item.is-active { background: var(--accent-hover); color: #fff; border-left-color: #fff; }
.omf-nav__icon { width: 18px; text-align: center; flex-shrink: 0; }
.omf-nav__section { padding: 14px 12px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); }
.omf-sidebar__footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; color: rgba(255,255,255,.7); }
.omf-sidebar__footer a { display: block; margin-top: 4px; color: #fff; font-weight: 500; }

.omf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.omf-topbar {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
	position: sticky; top: 0; z-index: 10;
}
.omf-topbar__title { font-family: var(--font-heading); font-size: 20px; font-weight: 700; }
.omf-topbar__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.omf-topbar__user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.omf-topbar__avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.omf-menu-toggle { display: none; background: none; border: none; color: var(--accent); font-size: 20px; cursor: pointer; padding: 4px; }

.omf-content { padding: 22px 24px 90px; flex: 1; }
.omf-content__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* ── KPI GRID ── */
.omf-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.omf-kpi {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
	padding: 16px 18px; box-shadow: 0 4px 14px rgba(0,54,26,.06);
}
.omf-kpi__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.omf-kpi__value { font-family: var(--font-heading); font-size: 24px; font-weight: 700; margin-top: 6px; color: var(--accent); }
.omf-kpi__sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.omf-kpi.is-warning .omf-kpi__value { color: var(--warning); }
.omf-kpi.is-danger .omf-kpi__value { color: var(--danger); }

/* ── TABS ── */
.omf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.omf-tab { background: none; border: none; padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.omf-tab:hover { color: var(--accent); }
.omf-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.omf-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 18px; overflow: hidden; }
.omf-section__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 10px; flex-wrap: wrap; }
.omf-section__title { font-family: var(--font-heading); font-size: 15px; font-weight: 700; }
.omf-section__body { padding: 18px; }

/* ── LOCKED (sin acceso financiero) ── */
.omf-locked { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--muted); font-size: 13px; background: #fafbfa; border-radius: var(--radius-md); }

/* ── BUTTONS ── */
.omf-btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-sm);
	border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; font-size: 13px;
	cursor: pointer; transition: background .15s ease;
}
.omf-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.omf-btn--secondary { background: transparent; color: var(--accent); }
.omf-btn--secondary:hover { background: var(--accent-soft); }
.omf-btn--danger { background: var(--danger); border-color: var(--danger); }
.omf-btn--sm { padding: 6px 11px; font-size: 12px; }
.omf-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORMS ── */
.omf-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.omf-field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.omf-field input, .omf-field select, .omf-field textarea {
	border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; background: #fff; color: var(--ink);
}
.omf-field input:focus, .omf-field select:focus, .omf-field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.omf-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px; }
.omf-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.omf-filters input, .omf-filters select { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: #fff; font-size: 13px; }

/* ── TABLE ── */
.omf-table-wrap { overflow-x: auto; }
table.omf-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.omf-table thead tr { background: var(--accent); color: #fff; }
table.omf-table th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; white-space: nowrap; }
table.omf-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.omf-table tbody tr:nth-child(even) { background: #f7fdf9; }
table.omf-table tbody tr:hover { background: var(--accent-soft); }
.omf-table__empty { padding: 30px; text-align: center; color: var(--muted); }
.omf-cell-muted { color: var(--muted); font-size: 12px; }

/* ── BADGES ── */
.omf-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.omf-badge--success { background: var(--accent-soft); color: var(--success); }
.omf-badge--warning { background: var(--warning-soft); color: var(--warning); }
.omf-badge--danger { background: var(--danger-soft); color: var(--danger); }
.omf-badge--muted { background: #eef0ee; color: var(--muted); }
.omf-badge--ml { background: var(--ml-yellow); color: #333; }

.omf-search-row:hover { background: var(--accent-soft); }

/* ── MODAL ── */
.omf-modal-overlay { position: fixed; inset: 0; background: rgba(18,30,24,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.omf-modal-overlay.is-open { display: flex; }
.omf-modal { background: #fff; border-radius: var(--radius-lg); max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.omf-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.omf-modal__title { font-family: var(--font-heading); font-size: 17px; font-weight: 700; }
.omf-modal__close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.omf-modal__body { padding: 18px 20px; }
.omf-modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ── TOAST ── */
.omf-toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--radius-md); font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transform: translateY(8px); transition: all .2s ease; }
.omf-toast.is-visible { opacity: 1; transform: translateY(0); }
.omf-toast.is-error { background: var(--danger); }

/* ── LOGIN ── */
.omf-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent) 0%, #04220f 100%); padding: 20px; }
.omf-login__card { background: #fff; border-radius: var(--radius-lg); padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.omf-login__logo { display: flex; justify-content: center; margin-bottom: 14px; }
.omf-login__logo img { width: 56px; height: 56px; border-radius: 10px; }
.omf-login__title { font-family: var(--font-heading); text-align: center; font-size: 22px; color: var(--accent); margin-bottom: 4px; }
.omf-login__sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.omf-login__error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }
.omf-login .omf-btn { width: 100%; justify-content: center; margin-top: 6px; }

/* ── PRÉSTAMOS · consejos de proyección ── */
.omf-pv-advice { background: var(--accent-soft); color: #123; border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; line-height: 1.5; margin-top: 8px; }
.omf-pv-advice--ok { background: var(--accent-soft); }
.omf-pv-advice--warn { background: var(--warning-soft); color: var(--warning); }
.omf-pv-advice--danger { background: var(--danger-soft); color: var(--danger); }

/* ── MOBILE ── */
.omf-bottom-nav { display: none; }
@media (max-width: 880px) {
	.omf-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
	.omf-sidebar.is-open { transform: translateX(0); }
	.omf-menu-toggle { display: inline-flex; }
	.omf-main { width: 100%; }
	.omf-content { padding: 16px 14px 90px; }
	.omf-topbar { padding: 12px 14px; }
	.omf-topbar__title { font-size: 17px; }
	.omf-kpi-grid { grid-template-columns: repeat(2, 1fr); }
	.omf-sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; display: none; }
	.omf-sidebar-scrim.is-open { display: block; }
}
@media (max-width: 480px) {
	.omf-kpi-grid { grid-template-columns: 1fr 1fr; }
	.omf-kpi__value { font-size: 20px; }
}
