/* ============================================================
   WebPulse Admin — Modern WP Style
   ============================================================ */

:root
{
	--font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--bg: #f0f2f5;
	--surface: #ffffff;
	--border: #d0d5dd;
	--border-light: #e4e7ec;
	--border-lighter: #eaecf0;
	--text: #101828;
	--text2: #344054;
	--text3: #667085;
	--text4: #98a2b3;
	--accent: #1570ef;
	--accent-hover: #1260cc;
	--accent-dark: #0b4a9a;
	--accent-light: #eff8ff;
	--green: #12b76a;
	--green-light: #ecfdf3;
	--red: #f04438;
	--red-light: #fef3f2;
	--orange: #f79009;
	--orange-light: #fffaeb;
	--purple: #7a5af8;
	--purple-light: #f4f3ff;
	--sidebar-bg: #0c111d;
	--sidebar-hover: #1d2939;
	--sidebar-active: #1570ef;
	--sidebar-text: #98a2b3;
	--sidebar-w: 256px;
	--topbar-h: 52px;
	--radius: 8px;
	--radius-sm: 6px;
	--radius-lg: 10px;
	--radius-xl: 12px;
	--shadow: 0 1px 2px rgba(16,24,40,.05);
	--shadow-md: 0 4px 8px -2px rgba(16,24,40,.1), 0 2px 4px -2px rgba(16,24,40,.06);
	--shadow-lg: 0 12px 16px -4px rgba(16,24,40,.08), 0 4px 6px -2px rgba(16,24,40,.03);
	--ease: cubic-bezier(.4,0,.2,1);
}

body
{
	font-family: var(--font) !important;
	background: var(--bg) !important;
	color: var(--text) !important;
	font-size: 14px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	margin: 0;
}

::selection { background: rgba(21,112,239,.15); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text4); }

a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent-hover); }

h1,h2,h3,h4,h5,h6 { color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.text-muted { color: var(--text4) !important; }
.text-primary { color: var(--accent) !important; }
.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }

code
{
	background: #f2f4f7;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 12px;
	color: var(--red);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.wrapper { display: flex; min-height: 100vh; background: var(--bg); }

/* ============================================================
   SIDEBAR — Dark modern
   ============================================================ */

.sidebar,
.wp-sidebar
{
	position: fixed;
	top: 0; left: 0; bottom: 0;
	width: var(--sidebar-w) !important;
	background: var(--sidebar-bg) !important;
	border-right: none !important;
	box-shadow: none !important;
	z-index: 1000;
	overflow: hidden;
}

.sidebar-content,
.wp-sidebar-inner
{
	display: flex !important;
	flex-direction: column !important;
	height: 100% !important;
	padding: 0 !important;
}

.wp-logo
{
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 18px 16px;
	text-decoration: none !important;
	flex-shrink: 0;
}

.wp-logo:hover { text-decoration: none !important; }

.wp-logo-mark
{
	width: 32px;
	height: 32px;
	border-radius: var(--radius);
	background: var(--accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 800;
	flex-shrink: 0;
}

.wp-logo-text
{
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	letter-spacing: -.03em;
}

.wp-logo-text span
{
	color: var(--sidebar-text);
	font-weight: 400;
	margin-left: 3px;
	font-size: 13px;
}

.wp-menu
{
	flex: 1;
	overflow-y: auto;
	padding: 6px 10px;
	border-top: 1px solid rgba(255,255,255,.06);
}

.wp-menu-section { margin-bottom: 2px; }

.wp-menu-heading
{
	font-size: 10px;
	font-weight: 600;
	color: #475467;
	padding: 16px 10px 5px;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.wp-menu-section:first-child .wp-menu-heading { padding-top: 6px; }

.wp-menu-link
{
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 10px;
	margin-bottom: 1px;
	border-radius: var(--radius-sm);
	text-decoration: none !important;
	color: var(--sidebar-text) !important;
	font-size: 13px;
	font-weight: 450;
	transition: all .15s var(--ease);
	cursor: pointer;
}

.wp-menu-link i,
.wp-menu-link svg
{
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	stroke-width: 1.6;
	color: #475467;
	transition: color .15s var(--ease);
}

.wp-menu-link:hover
{
	background: var(--sidebar-hover);
	color: #f2f4f7 !important;
}

.wp-menu-link:hover i,
.wp-menu-link:hover svg { color: #d0d5dd; }

.wp-menu-link.active
{
	background: var(--sidebar-active);
	color: #fff !important;
	font-weight: 550;
}

.wp-menu-link.active i,
.wp-menu-link.active svg { color: rgba(255,255,255,.85); }

.wp-sidebar-bottom
{
	padding: 8px 10px 14px;
	border-top: 1px solid rgba(255,255,255,.06);
	flex-shrink: 0;
}

.wp-logout { color: #475467 !important; }
.wp-logout:hover { color: var(--red) !important; background: rgba(240,68,56,.12) !important; }
.wp-logout:hover i, .wp-logout:hover svg { color: var(--red); }

/* ============================================================
   TOPBAR
   ============================================================ */

.main
{
	margin-left: var(--sidebar-w);
	flex: 1;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.navbar,
.wp-topbar
{
	background: var(--surface) !important;
	border-bottom: 1px solid var(--border-light) !important;
	box-shadow: none !important;
	padding: 0 24px !important;
	height: var(--topbar-h) !important;
	min-height: var(--topbar-h) !important;
	display: flex !important;
	align-items: center !important;
	position: sticky;
	top: 0;
	z-index: 100;
}

.wp-topbar-title,
.navbar .h4
{
	font-size: 15px !important;
	font-weight: 600 !important;
	color: var(--text) !important;
	letter-spacing: -.02em;
	margin: 0 !important;
}

.wp-topbar-actions
{
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none;
	padding: 0;
	margin-bottom: 0;
}

.wp-topbar-actions .nav-item { list-style: none; }
.wp-topbar-toggle { margin-right: 14px; }
.hamburger { color: var(--text3) !important; }

/* ============================================================
   CONTENT
   ============================================================ */

.content { flex: 1; padding: 24px !important; }

/* ============================================================
   CARDS
   ============================================================ */

.card
{
	background: var(--surface) !important;
	border: 1px solid var(--border-light) !important;
	border-radius: var(--radius-lg) !important;
	box-shadow: var(--shadow) !important;
	transition: box-shadow .2s var(--ease);
}

.card:hover { box-shadow: var(--shadow) !important; }

.card-header
{
	background: transparent !important;
	border-bottom: 1px solid var(--border-lighter) !important;
	padding: 14px 18px !important;
}

.card-header h5,
.card-header .card-title
{
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--text) !important;
	margin: 0 !important;
	letter-spacing: -.01em;
}

.card-body { padding: 18px !important; }

/* ============================================================
   TABLES
   ============================================================ */

.table { font-size: 13px !important; color: var(--text) !important; margin-bottom: 0 !important; }

.table thead th
{
	font-size: 12px !important;
	font-weight: 550 !important;
	color: var(--text3) !important;
	border-bottom: 1px solid var(--border-light) !important;
	padding: 10px 14px !important;
	background: transparent !important;
	white-space: nowrap;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

.table > :not(caption) > * > * { border-bottom-color: var(--border-lighter) !important; }

.table td
{
	padding: 10px 14px !important;
	vertical-align: middle !important;
	color: var(--text2) !important;
}

.table td strong { color: var(--text) !important; }
.table td a { color: var(--accent) !important; font-weight: 500; }
.table td a:hover { color: var(--accent-hover) !important; }

.table-hover > tbody > tr:hover > * { background-color: #f9fafb !important; }
.table > tbody > tr:last-child > td { border-bottom: none !important; }

/* ============================================================
   BADGES — Soft tinted, modern
   ============================================================ */

.badge
{
	font-weight: 550 !important;
	font-size: 11px !important;
	padding: 3px 8px !important;
	border-radius: 99px !important;
	border: none !important;
}

.badge.bg-success { background: var(--green-light) !important; color: #067647 !important; }
.badge.bg-danger { background: var(--red-light) !important; color: #b42318 !important; }
.badge.bg-warning { background: var(--orange-light) !important; color: #b54708 !important; }
.badge.bg-primary { background: var(--accent-light) !important; color: var(--accent) !important; }
.badge.bg-info { background: var(--purple-light) !important; color: #5925dc !important; }
.badge.bg-secondary { background: #f2f4f7 !important; color: var(--text2) !important; }
.badge.bg-light { background: #f2f4f7 !important; color: var(--text3) !important; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn
{
	border-radius: var(--radius) !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	padding: 8px 14px !important;
	transition: all .15s var(--ease) !important;
	border: 1px solid transparent !important;
	line-height: 1.4;
}

.btn-sm { padding: 4px 10px !important; font-size: 12px !important; border-radius: var(--radius-sm) !important; }

.table .btn-sm { padding: 3px 7px !important; font-size: 11px !important; line-height: 1.3; }
.table .btn-sm svg, .table .btn-sm i { width: 14px; height: 14px; }

.btn-primary
{
	background: var(--accent) !important;
	border-color: var(--accent) !important;
	color: #fff !important;
	box-shadow: 0 1px 2px rgba(16,24,40,.05) !important;
}

.btn-primary:hover { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }

.btn-outline-primary
{
	color: var(--accent) !important;
	border-color: var(--border) !important;
	background: var(--surface) !important;
	box-shadow: 0 1px 2px rgba(16,24,40,.05) !important;
}

.btn-outline-primary:hover { background: var(--accent-light) !important; border-color: var(--accent) !important; }

.btn-outline-secondary
{
	color: var(--text2) !important;
	border-color: var(--border) !important;
	background: var(--surface) !important;
	box-shadow: 0 1px 2px rgba(16,24,40,.05) !important;
}

.btn-outline-secondary:hover { background: #f9fafb !important; border-color: #98a2b3 !important; }

.btn-light
{
	background: #f2f4f7 !important;
	border-color: var(--border-light) !important;
	color: var(--text2) !important;
}

.btn-light:hover { background: var(--border-lighter) !important; }

/* ============================================================
   FORMS
   ============================================================ */

.form-control, .form-select
{
	border-radius: var(--radius) !important;
	border: 1px solid var(--border) !important;
	font-size: 14px !important;
	padding: 8px 12px !important;
	color: var(--text) !important;
	background: var(--surface) !important;
	box-shadow: 0 1px 2px rgba(16,24,40,.05) !important;
	transition: border-color .15s var(--ease), box-shadow .15s var(--ease) !important;
}

.form-control:focus, .form-select:focus
{
	border-color: var(--accent) !important;
	box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 0 0 4px rgba(21,112,239,.12) !important;
	outline: none !important;
}

.form-control::placeholder { color: var(--text4); }

.form-control-sm, .form-select-sm { padding: 6px 10px !important; font-size: 13px !important; }
.form-label { font-size: 13px !important; font-weight: 500 !important; color: var(--text2) !important; margin-bottom: 5px !important; }

.form-check-input { border-radius: 4px !important; border: 1px solid var(--border) !important; width: 18px; height: 18px; }
.form-check-input:checked { background-color: var(--accent) !important; border-color: var(--accent) !important; }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(21,112,239,.12) !important; }

/* ============================================================
   ALERTS
   ============================================================ */

.alert
{
	border: 1px solid var(--border-light) !important;
	border-radius: var(--radius-lg) !important;
	font-size: 13px !important;
	background: var(--surface) !important;
	color: var(--text2) !important;
	padding: 12px 16px !important;
}

/* ============================================================
   DROPDOWNS
   ============================================================ */

.dropdown-menu
{
	border: 1px solid var(--border-light) !important;
	border-radius: var(--radius) !important;
	box-shadow: var(--shadow-lg) !important;
	padding: 4px !important;
	background: var(--surface) !important;
}

.dropdown-item
{
	border-radius: var(--radius-sm) !important;
	font-size: 13px !important;
	padding: 7px 12px !important;
	color: var(--text2) !important;
}

.dropdown-item:hover { background: #f9fafb !important; color: var(--text) !important; }

/* ============================================================
   FOOTER
   ============================================================ */

.footer
{
	border-top: 1px solid var(--border-lighter) !important;
	background: transparent !important;
	padding: 14px 24px !important;
}

.footer span, .footer a { font-size: 12px !important; color: var(--text4) !important; }

/* ============================================================
   SORTABLE
   ============================================================ */

.wp-sortable
{
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
	text-decoration: none !important;
	color: var(--text3) !important;
	font-size: 12px !important;
	font-weight: 550 !important;
	transition: color .15s var(--ease);
}

.wp-sortable:hover { color: var(--accent) !important; }
.wp-sortable.active { color: var(--text) !important; }
.wp-sort-icon { display: inline-block; margin-left: 2px; font-size: 8px; opacity: .3; }
.wp-sortable.active .wp-sort-icon { opacity: .7; }

.pagination .btn { min-width: 32px; }

/* ============================================================
   DASHBOARD — KPI Cards
   ============================================================ */

.db-kpi { border-radius: var(--radius-xl) !important; transition: all .2s var(--ease); }
.db-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md) !important; }
.db-kpi .card-body { padding: 20px 22px !important; }

.db-kpi-icon
{
	width: 38px;
	height: 38px;
	border-radius: var(--radius);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.db-kpi-icon svg { width: 18px; height: 18px; }

.db-kpi-value
{
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -.03em;
	line-height: 1;
	margin-top: 12px;
	color: var(--text);
}

.db-kpi-label { font-size: 11px; color: var(--text3); font-weight: 550; text-transform: uppercase; letter-spacing: .04em; }
.db-kpi-footer { font-size: 12px; color: var(--text3); margin-top: 6px; }
.db-kpi-footer strong { color: var(--text2); }

.db-kpi-trend { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.db-kpi-trend.up { background: var(--green-light); color: #067647; }
.db-kpi-trend.down { background: var(--red-light); color: #b42318; }
.db-kpi-trend.neutral { background: #f2f4f7; color: var(--text4); }

/* ============================================================
   DASHBOARD — Panels
   ============================================================ */

.db-card { border-radius: var(--radius-xl) !important; }
.db-card .card-header { padding: 14px 20px !important; }
.db-card .card-body { padding: 18px 20px !important; }

/* ============================================================
   DASHBOARD — Live Feed
   ============================================================ */

.db-live-feed { max-height: 400px; overflow-y: auto; }

.db-feed-item
{
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	border-bottom: 1px solid var(--border-lighter);
	transition: background .12s var(--ease);
}

.db-feed-item:hover { background: #f9fafb; }
.db-feed-item:last-child { border-bottom: none; }

.db-feed-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.db-feed-keyword { font-size: 13px; font-weight: 600; color: var(--text); }
.db-feed-meta { font-size: 11px; color: var(--text4); }
.db-feed-count { font-size: 11px; font-weight: 600; color: var(--accent); margin-left: auto; flex-shrink: 0; background: var(--accent-light); padding: 2px 8px; border-radius: 99px; }

/* ============================================================
   DASHBOARD — Keyword Bars
   ============================================================ */

.db-keyword-bar { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.db-keyword-name { font-size: 13px; font-weight: 500; color: var(--text); flex: 0 0 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-keyword-track { flex: 1; height: 6px; background: var(--border-lighter); border-radius: 99px; overflow: hidden; }
.db-keyword-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.db-keyword-count { font-size: 12px; font-weight: 600; color: var(--text2); flex: 0 0 50px; text-align: right; }

/* ============================================================
   DASHBOARD — Alerts
   ============================================================ */

.db-alert { border: none !important; border-radius: var(--radius-lg) !important; font-size: 13px; padding: 12px 16px !important; display: flex; align-items: center; gap: 10px; }
.db-alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; animation: db-pulse 2s infinite; }
@keyframes db-pulse { 0%,100% { opacity:1; } 50% { opacity:.2; } }
.db-alert-reindex .db-alert-dot { background: var(--orange); }
.db-alert-queue .db-alert-dot { background: var(--accent); }
.db-alert-reindex { background: var(--orange-light) !important; }
.db-alert-queue { background: var(--accent-light) !important; }
.db-mini-chart { height: 48px; }

.chart-period { padding: 3px 10px !important; font-size: 11px !important; font-weight: 550 !important; border-radius: var(--radius-sm) !important; }
.chart-period.active { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991px)
{
	.sidebar, .wp-sidebar { transform: translateX(-100%); transition: transform .2s var(--ease); }
	.sidebar.toggled, .wp-sidebar.toggled { transform: translateX(0); }
	.main { margin-left: 0; }
	.content { padding: 16px !important; }
}

@media (max-width: 679px)
{
	table.is-responsive td, table.is-responsive th { background: var(--surface); padding: 0.4rem; font-size: 13px; border-color: var(--border-lighter); }
	table.is-responsive tr:last-child td { padding-bottom: 20px; border-color: var(--border) !important; border-bottom-width: 3px !important; }
	table.is-responsive tr:first-child td { padding-top: 20px; }
}

.input-has-error { border-color: var(--red) !important; }
label.required { position: relative; }
label.required:after { content: "*"; color: var(--red); margin-left: 2px; }
.settings-toggle { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
