/* ══════════════════════════════════════════════════════════════
   Policy Flow – Frontend Dashboard Styles
   Uses the shared LanTech pmf- design system (left nav + cards).
   Matches PM / SRM / DocSig / StockFlow layout.
   ══════════════════════════════════════════════════════════════ */

/* ── Theme isolation ──────────────────────────────────────── */
body.policyflow-dashboard-page .entry-content,
body.policyflow-dashboard-page .post-content,
body.policyflow-dashboard-page .content,
body.policyflow-dashboard-page .site-content,
body.policyflow-dashboard-page main:not(.pmf-main),
body.policyflow-dashboard-page #content,
body.policyflow-dashboard-page .page-content {
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* ── Layout: pmf-app (sidebar + main) ─────────────────────── */
.pmf-app {
	box-sizing: border-box;
	--sidebar-w: 260px;
	--bg: #f4f6f9;
	--card-bg: #ffffff;
	--border: #e2e8f0;
	--text: #1e293b;
	--text-muted: #64748b;
	--primary: #3b82f6;
	--primary-hover: #2563eb;
	--success: #10b981;
	--warning: #f59e0b;
	--danger: #ef4444;
	--radius: 8px;
	--shadow: 0 1px 3px rgba(0,0,0,.08);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	display: flex;
	min-height: 100vh;
	width: 100%;
	background: var(--bg);
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
}
.pmf-app * { box-sizing: border-box; }
.pmf-app a { color: var(--primary); text-decoration: none; }
.pmf-app a:hover { color: var(--primary-hover); }

/* ── Sidebar ──────────────────────────────────────────────── */
.pmf-app .pmf-sidebar {
	width: var(--sidebar-w);
	background: #1e293b !important;
	color: #cbd5e1 !important;
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 100;
	overflow-y: auto;
	transition: transform 0.25s ease;
}
.pmf-app .pmf-sidebar a { text-decoration: none !important; }
.pmf-app .pmf-sidebar-header { padding: 20px 20px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.pmf-app .pmf-logo { font-size: 16px; font-weight: 700; color: #f1f5f9 !important; display: flex; align-items: center; gap: 8px; }
.pmf-app .pmf-logo .dashicons { color: var(--primary) !important; font-size: 22px; width: 22px; height: 22px; }

.pmf-app .pmf-sidebar-user { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.pmf-app .pmf-avatar img { border-radius: 50%; display: block; }
.pmf-app .pmf-user-name { font-size: 13px; font-weight: 600; color: #f1f5f9 !important; }
.pmf-app .pmf-user-role { font-size: 11px; color: #94a3b8 !important; }

.pmf-app .pmf-nav { list-style: none; padding: 10px 0; margin: 0; flex: 1; }
.pmf-app .pmf-nav-item a {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 20px; color: #94a3b8 !important; font-size: 13px; font-weight: 500;
	transition: all 0.15s; border-left: 3px solid transparent;
}
.pmf-app .pmf-nav-item a:hover { background: rgba(255,255,255,.05) !important; color: #e2e8f0 !important; }
.pmf-app .pmf-nav-item.active a { background: rgba(59,130,246,.2) !important; color: #93c5fd !important; border-left-color: var(--primary); }
.pmf-app .pmf-nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.pmf-app .pmf-nav-icon.dashicons { font-size: 18px; width: 18px; height: 18px; }

/* ── Nav group accordion (multi-plugin) ── */
.pmf-app .pmf-nav-group-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 20px; background: none !important; border: none; color: #94a3b8 !important; font-size: 13px; font-weight: 600; cursor: pointer; text-transform: uppercase; letter-spacing: .5px; }
.pmf-app .pmf-nav-group-toggle:hover { color: #e2e8f0 !important; }
.pmf-app .pmf-nav-chevron { font-size: 11px; transition: transform .2s; }
.pmf-app .pmf-nav-group.expanded .pmf-nav-chevron { transform: rotate(90deg); }
.pmf-app .pmf-nav-subitems { list-style: none; padding: 0; margin: 0; display: none; }
.pmf-app .pmf-nav-group.expanded .pmf-nav-subitems { display: block; }
.pmf-app .pmf-nav-subitem a { padding-left: 36px !important; }

/* ── Sidebar footer ───────────────────────────────────────── */
.pmf-app .pmf-sidebar-footer { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 4px; }
.pmf-app .pmf-footer-link { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: #94a3b8 !important; font-size: 12px; text-decoration: none !important; }
.pmf-app .pmf-footer-link:hover { color: #e2e8f0 !important; }
.pmf-app .pmf-footer-link .dashicons { font-size: 16px; width: 16px; height: 16px; }

/* ── Mobile sidebar toggle ────────────────────────────────── */
.pmf-sidebar-toggle {
	display: none; position: fixed; top: 12px; left: 12px; z-index: 200;
	background: #1e293b; color: #fff; border: none; border-radius: 6px;
	padding: 8px 12px; font-size: 18px; cursor: pointer; line-height: 1;
}

/* ── Main content ─────────────────────────────────────────── */
.pmf-app .pmf-main {
	flex: 1;
	margin-left: var(--sidebar-w) !important;
	padding: 30px;
	max-width: 1200px;
	min-width: 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media screen and (max-width: 782px) {
	.pmf-app .pmf-sidebar { transform: translateX(-100%); }
	.pmf-app .pmf-sidebar.open { transform: translateX(0); }
	.pmf-sidebar-toggle { display: block; }
	.pmf-app .pmf-main { margin-left: 0 !important; padding-top: 50px; padding-left: 15px; padding-right: 15px; }
}

/* ── Page header, stats row ───────────────────────────────── */
.pmf-page-header { margin-bottom: 24px; }
.pmf-back-link { display: inline-block; font-size: 13px; margin-bottom: 8px; color: var(--primary); }
.pmf-back-link:hover { color: var(--primary-hover); }
.pmf-page-header h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.pmf-subtitle { font-size: 14px; color: var(--text-muted); margin: 0; }

.pmf-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.pmf-stat-card {
	background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 20px; box-shadow: var(--shadow);
	border-left: 4px solid var(--accent, var(--primary));
}
.pmf-stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }
.pmf-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Cards ────────────────────────────────────────────────── */
.pmf-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.pmf-card {
	background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: var(--shadow); overflow: hidden;
}
.pmf-card-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pmf-card-header h3 { font-size: 15px; font-weight: 600; margin: 0; color: var(--text); }
.pmf-link { font-size: 13px; font-weight: 500; color: var(--primary); }
.pmf-link:hover { color: var(--primary-hover); }

/* ── Lists ────────────────────────────────────────────────── */
.pmf-list { list-style: none; padding: 12px 0; margin: 0; }
.pmf-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit; transition: background 0.15s; flex-wrap: wrap; gap: 8px; }
.pmf-list-item:hover { background: #f8fafc; }
.pmf-list-item:last-child { border-bottom: none; }
.pmf-list-item a { color: var(--primary); text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────── */
.pmf-actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.pmf-action-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 10px 18px;
	background: var(--card-bg, #fff); border: 1px solid var(--border, #e2e8f0);
	border-radius: var(--radius, 8px);
	color: var(--text, #1e293b); font-size: 13px; font-weight: 600;
	cursor: pointer; transition: all .15s; text-decoration: none;
}
.pmf-action-btn:hover { background: #f8fafc; border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pmf-action-btn.pmf-action-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.pmf-action-btn.pmf-action-primary:hover { background: var(--primary-hover); color: #fff; }
.pmf-action-btn.pmf-action-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.pmf-action-btn.pmf-action-danger:hover { opacity: 0.9; }
.pmf-action-btn.pmf-action-sm { padding: 6px 12px; font-size: 12px; }

/* ── Tables ───────────────────────────────────────────────── */
.pmf-table-wrap { overflow-x: auto; }
.pmf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pmf-table th, .pmf-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.pmf-table th { background: #f8fafc; font-weight: 600; font-size: 12px; }
.pmf-table tbody tr:hover { background: #f8fafc; }

/* ── Utilities ────────────────────────────────────────────── */
.pmf-muted { color: var(--text-muted); font-size: 13px; }
.pmf-empty { padding: 24px 20px; text-align: center; color: var(--text-muted); font-size: 14px; margin: 0; }
.pmf-section { margin-bottom: 24px; }
.pmf-section-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; color: var(--text); }
.pmf-policy-content { margin-bottom: 20px; }
.policyflow-ack-btn { margin-left: auto; }
