/* =========================================================================
   SEO Workflow Tool — App styles
   Theme palette: WooHelpDesk navy (#1a2a4a) + orange (#f7941d)
   ========================================================================= */

:root {
	--wf-navy:      #1a2a4a;
	--wf-navy-2:    #213460;
	--wf-navy-3:    #0d1e38;
	--wf-orange:    #f7941d;
	--wf-orange-2:  #e07f0a;
	--wf-off:       #f6f7f9;
	--wf-border:    #dde0e8;
	--wf-text:      #2c3345;
	--wf-muted:     #6b7488;
	--wf-green:     #2d9e5f;
	--wf-red:       #c0392b;
	--wf-card-bg:   #ffffff;
	--wf-radius-sm: 4px;
	--wf-radius:    8px;
	--wf-shadow:    0 1px 2px rgba(13,30,56,0.06), 0 2px 6px rgba(13,30,56,0.05);
}

/* Base */
* { box-sizing: border-box; }
body.wf {
	margin: 0;
	font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--wf-text);
	background: var(--wf-off);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
body.wf a { color: var(--wf-navy); text-decoration: none; }
body.wf a:hover { color: var(--wf-orange); }
code { font-family: 'SF Mono', Consolas, monospace; background: var(--wf-off); padding: 1px 6px; border-radius: 3px; font-size: 13px; }

/* Topbar */
.wf-topbar {
	background: var(--wf-navy);
	color: #fff;
	position: sticky; top: 0; z-index: 50;
	box-shadow: 0 2px 0 rgba(0,0,0,0.06);
}
.wf-topbar-inner {
	max-width: 1200px; margin: 0 auto;
	padding: 0 24px;
	display: flex; align-items: center; gap: 24px;
	min-height: 60px;
}
.wf-topbar-brand {
	display: flex; align-items: center; gap: 10px;
	color: #fff !important;
	font-weight: 700; font-size: 15px;
}
.wf-brand-mark {
	width: 32px; height: 32px; background: var(--wf-orange);
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 800; font-size: 11px; border-radius: var(--wf-radius-sm);
	letter-spacing: 0.05em;
}
.wf-topbar-nav {
	display: flex; gap: 2px; margin-left: 16px; flex: 1; flex-wrap: wrap;
}
.wf-topbar-nav a {
	color: rgba(255,255,255,0.78) !important;
	padding: 8px 14px; border-radius: var(--wf-radius-sm);
	font-size: 14px; font-weight: 600;
	transition: background 0.15s, color 0.15s;
}
.wf-topbar-nav a:hover,
.wf-topbar-nav a.is-active {
	background: rgba(255,255,255,0.1);
	color: #fff !important;
}
.wf-topbar-cta { background: var(--wf-orange); color: #fff !important; }
.wf-topbar-cta:hover { background: var(--wf-orange-2) !important; color: #fff !important; }
.wf-topbar-user { display: flex; align-items: center; gap: 14px; }
.wf-user-meta { text-align: right; line-height: 1.15; }
.wf-user-name { font-weight: 700; font-size: 13px; color: #fff; }
.wf-user-role { font-size: 11px; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.05em; }
.wf-topbar-logout {
	color: rgba(255,255,255,0.78) !important; font-size: 13px;
	padding: 6px 12px; border: 1px solid rgba(255,255,255,0.2);
	border-radius: var(--wf-radius-sm);
}
.wf-topbar-logout:hover { background: rgba(255,255,255,0.08); color: #fff !important; }
@media (max-width: 720px) {
	.wf-topbar-inner { flex-wrap: wrap; gap: 12px; padding: 10px 16px; }
	.wf-topbar-nav { order: 3; width: 100%; margin-left: 0; }
	.wf-user-meta { display: none; }
}

/* Flash wrap */
.wf-flash-wrap { background: transparent; padding: 16px 0 0; }

/* Layout */
.wf-main { padding: 28px 0 64px; min-height: calc(100vh - 60px - 50px); }
.wf-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.wf-footer {
	background: var(--wf-navy-3); color: rgba(255,255,255,0.55);
	padding: 14px 0; font-size: 12px;
}
.wf-footer .wf-container { text-align: center; }

/* Page head */
.wf-page-head { margin-bottom: 20px; }
.wf-page-title {
	font-size: 26px; font-weight: 700; color: var(--wf-navy);
	margin: 4px 0 4px;
	display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.wf-page-sub { color: var(--wf-muted); margin: 0; font-size: 14px; }
.wf-back {
	display: inline-block; font-size: 13px;
	color: var(--wf-muted) !important; margin-bottom: 4px;
	font-weight: 600;
}
.wf-back:hover { color: var(--wf-navy) !important; }

/* Card */
.wf-card {
	background: var(--wf-card-bg);
	border: 1px solid var(--wf-border);
	border-radius: var(--wf-radius);
	padding: 22px 24px;
	margin-bottom: 18px;
	box-shadow: var(--wf-shadow);
}
.wf-card-title {
	font-size: 16px; font-weight: 700; color: var(--wf-navy);
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--wf-border);
}
.wf-action-card { border-left: 4px solid var(--wf-orange); }

/* Stats row */
.wf-stats-row {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px; margin-bottom: 18px;
}
.wf-stat {
	background: #fff; border: 1px solid var(--wf-border);
	border-left: 4px solid var(--wf-navy);
	border-radius: var(--wf-radius-sm);
	padding: 14px 18px;
	display: flex; flex-direction: column; gap: 4px;
	box-shadow: var(--wf-shadow);
}
.wf-stat-done { border-left-color: var(--wf-green); }
.wf-stat-label { font-size: 12px; color: var(--wf-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.wf-stat-value { font-size: 26px; font-weight: 700; color: var(--wf-navy); line-height: 1.2; }
.wf-stat-value small { font-size: 13px; color: var(--wf-muted); font-weight: 400; }

/* Status chips */
.wf-status-chip {
	display: inline-block; padding: 3px 10px; border-radius: 999px;
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
	vertical-align: middle;
}
.wf-status-with_clerk     { background: #fff4e0; color: #8a4b00; }
.wf-status-with_seo_qa    { background: #e7f1fd; color: #0a4b8f; }
.wf-status-with_manual_qa { background: #efe5ff; color: #4a1d99; }
.wf-status-completed      { background: #dcf5e7; color: #155c2c; }

/* Tabs */
.wf-tabs {
	background: #fff; border: 1px solid var(--wf-border);
	border-radius: var(--wf-radius); box-shadow: var(--wf-shadow); overflow: hidden;
}
.wf-tablist {
	display: flex; background: var(--wf-off);
	border-bottom: 1px solid var(--wf-border);
	padding: 4px 4px 0; gap: 2px; overflow-x: auto;
}
.wf-tab {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 18px; color: var(--wf-muted) !important;
	font-weight: 600; font-size: 14px;
	border-bottom: 3px solid transparent;
	margin-bottom: -1px; white-space: nowrap;
	transition: color 0.15s, background 0.15s;
}
.wf-tab:hover { color: var(--wf-navy) !important; }
.wf-tab.is-active {
	color: var(--wf-navy) !important;
	border-bottom-color: var(--wf-orange);
	background: #fff;
	border-radius: var(--wf-radius-sm) var(--wf-radius-sm) 0 0;
}
.wf-tab-count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 22px; height: 22px; padding: 0 7px;
	background: var(--wf-border); color: var(--wf-navy);
	border-radius: 999px; font-size: 11px; font-weight: 700;
}
.wf-tab.is-active .wf-tab-count { background: var(--wf-navy); color: #fff; }
.wf-tab.is-highlight .wf-tab-count { background: var(--wf-orange); color: #fff; }
.wf-tabpanel { padding: 6px 0 0; }

/* Item list */
.wf-item-list { list-style: none; margin: 0; padding: 0; }
.wf-item-list li { border-bottom: 1px solid var(--wf-border); }
.wf-item-list li:last-child { border-bottom: none; }
.wf-item-link {
	display: flex; align-items: center; gap: 16px;
	padding: 16px 24px; color: inherit !important;
	transition: background 0.12s;
}
.wf-item-link:hover { background: var(--wf-off); }
.wf-item-main { flex: 1; min-width: 0; }
.wf-item-subject {
	font-weight: 700; font-size: 15px; color: var(--wf-navy);
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	margin-bottom: 4px;
}
.wf-item-url { font-size: 13px; color: var(--wf-muted); word-break: break-all; margin-bottom: 4px; }
.wf-item-meta { font-size: 12px; color: var(--wf-muted); }
.wf-item-arrow { color: var(--wf-muted); font-size: 20px; font-weight: 700; }
.wf-dot { opacity: 0.5; margin: 0 2px; }
.wf-returned-hint { color: var(--wf-orange-2); font-weight: 700; }

/* Empty */
.wf-empty { padding: 48px 24px; text-align: center; color: var(--wf-muted); }
.wf-empty-icon {
	width: 48px; height: 48px; border-radius: 50%;
	background: var(--wf-green); color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 22px; margin-bottom: 10px;
}

/* Forms */
.wf-form { display: flex; flex-direction: column; gap: 14px; }
.wf-label {
	display: flex; flex-direction: column; gap: 6px;
	font-size: 13px; font-weight: 600; color: var(--wf-text);
}
.wf-label em { color: var(--wf-red); font-style: normal; }
.wf-label input[type="text"],
.wf-label input[type="url"],
.wf-label input[type="email"],
.wf-label input[type="password"],
.wf-label input[type="date"],
.wf-label input[type="file"],
.wf-label textarea,
.wf-label select {
	width: 100%; padding: 10px 12px;
	border: 1px solid var(--wf-border);
	border-radius: var(--wf-radius-sm);
	font-size: 14px; font-family: inherit; color: var(--wf-text);
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.wf-label input:disabled { background: var(--wf-off); color: var(--wf-muted); }
.wf-label textarea { resize: vertical; min-height: 110px; line-height: 1.55; font-family: inherit; }
.wf-label input:focus, .wf-label textarea:focus, .wf-label select:focus {
	outline: none;
	border-color: var(--wf-navy);
	box-shadow: 0 0 0 3px rgba(26, 42, 74, 0.12);
}
.wf-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--wf-text); font-weight: 500; }
.wf-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.wf-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* Buttons */
.wf-btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 9px 18px; font-size: 14px; font-weight: 700; font-family: inherit;
	border-radius: var(--wf-radius-sm);
	border: 1px solid transparent; cursor: pointer;
	text-decoration: none; line-height: 1.2;
	transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.04s;
}
.wf-btn:active { transform: translateY(1px); }
.wf-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.wf-btn-lg { padding: 12px 22px; font-size: 15px; }
.wf-btn-sm { padding: 6px 12px; font-size: 13px; }
.wf-btn-block { width: 100%; }
.wf-btn-primary { background: var(--wf-orange); color: #fff !important; }
.wf-btn-primary:hover:not([disabled]) { background: var(--wf-orange-2); color: #fff !important; }
.wf-btn-ghost { background: #fff; color: var(--wf-navy) !important; border-color: var(--wf-border); }
.wf-btn-ghost:hover:not([disabled]) { border-color: var(--wf-navy); background: var(--wf-off); }

.wf-btn-mini {
	display: inline-block; padding: 4px 10px; font-size: 12px; font-weight: 600;
	background: var(--wf-off); color: var(--wf-navy) !important;
	border: 1px solid var(--wf-border); border-radius: 3px;
	cursor: pointer; text-decoration: none; margin-right: 4px;
}
.wf-btn-mini:hover { border-color: var(--wf-navy); }
.wf-btn-danger { color: var(--wf-red) !important; border-color: #f5c2bd; }
.wf-btn-danger:hover { background: #fdecea; }

/* Alerts */
.wf-alert {
	padding: 12px 16px; border-radius: var(--wf-radius-sm);
	margin-bottom: 12px; font-size: 14px; border: 1px solid;
}
.wf-alert-success { background: #dcf5e7; border-color: #9bdeb7; color: #155c2c; }
.wf-alert-error   { background: #fdecea; border-color: #f5c2bd; color: #9c2a20; }
.wf-alert-warning { background: #fff4e0; border-color: #f7d79b; color: #8a4b00; }
.wf-req { color: var(--wf-red); }

/* Detail */
.wf-detail-grid {
	display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
	gap: 22px; align-items: start;
}
@media (max-width: 900px) { .wf-detail-grid { grid-template-columns: 1fr; } }

.wf-definition { margin: 0; }
.wf-definition dt {
	font-size: 11px; color: var(--wf-muted);
	text-transform: uppercase; letter-spacing: 0.05em;
	font-weight: 700; margin-top: 12px;
}
.wf-definition dt:first-child { margin-top: 0; }
.wf-definition dd { margin: 4px 0 0; font-size: 14px; word-break: break-word; }

.wf-meta { list-style: none; margin: 0; padding: 0; }
.wf-meta li {
	display: flex; justify-content: space-between;
	padding: 8px 0; border-bottom: 1px dashed var(--wf-border);
	font-size: 13px; gap: 12px;
}
.wf-meta li:last-child { border-bottom: none; }
.wf-meta strong { color: var(--wf-muted); font-weight: 600; }
.wf-meta span { color: var(--wf-text); text-align: right; }

.wf-timeline { list-style: none; margin: 0; padding: 0; counter-reset: wf-tl; }
.wf-timeline li {
	position: relative; padding: 10px 0 10px 28px;
	border-bottom: 1px dashed var(--wf-border); font-size: 13px;
}
.wf-timeline li:last-child { border-bottom: none; }
.wf-timeline li::before {
	counter-increment: wf-tl; content: counter(wf-tl);
	position: absolute; left: 0; top: 12px;
	width: 20px; height: 20px; background: var(--wf-navy); color: #fff;
	border-radius: 50%; font-size: 11px; font-weight: 700;
	text-align: center; line-height: 20px;
}
.wf-timeline-action { font-weight: 700; color: var(--wf-navy); }
.wf-timeline-meta { font-size: 12px; color: var(--wf-muted); margin-top: 2px; }
.wf-timeline-comment {
	margin-top: 6px; padding: 8px 10px;
	background: var(--wf-off); border-left: 3px solid var(--wf-orange);
	font-size: 12px; line-height: 1.5;
	border-radius: 0 var(--wf-radius-sm) var(--wf-radius-sm) 0;
}

.wf-featured-image img {
	max-width: 100%; height: auto;
	border: 1px solid var(--wf-border); border-radius: var(--wf-radius-sm);
	display: block; margin-bottom: 12px;
}
.wf-muted { color: var(--wf-muted); margin: 0 0 8px; font-size: 13px; }

.wf-sep { text-align: center; margin: 16px 0; position: relative; }
.wf-sep::before {
	content: ""; position: absolute; top: 50%; left: 0; right: 0;
	height: 1px; background: var(--wf-border);
}
.wf-sep span {
	position: relative; background: #fff; padding: 0 12px;
	color: var(--wf-muted); font-size: 12px;
	text-transform: uppercase; letter-spacing: 0.05em;
}

/* Tables */
.wf-table-wrap { overflow-x: auto; }
.wf-table {
	width: 100%; border-collapse: collapse; font-size: 14px;
}
.wf-table th {
	text-align: left; padding: 10px 12px;
	background: var(--wf-off);
	border-bottom: 1px solid var(--wf-border);
	font-size: 12px; color: var(--wf-muted);
	text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
}
.wf-table td {
	padding: 12px 12px; border-bottom: 1px solid var(--wf-border);
	vertical-align: middle;
}
.wf-table tr:last-child td { border-bottom: none; }
.wf-table tr.is-inactive { opacity: 0.5; }

/* Filter bar */
.wf-filter-bar {
	padding: 10px 14px; background: #fff;
	border: 1px solid var(--wf-border); border-radius: var(--wf-radius-sm);
	display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
	margin-bottom: 18px;
}
.wf-filter-bar select, .wf-filter-bar input[type="date"] {
	padding: 7px 10px; border: 1px solid var(--wf-border);
	border-radius: var(--wf-radius-sm); font-size: 13px; font-family: inherit;
}
.wf-range-note { margin-left: auto; font-size: 12px; color: var(--wf-muted); }

/* Login page */
body.wf-login-body {
	background: linear-gradient(135deg, var(--wf-navy) 0%, var(--wf-navy-3) 100%);
	min-height: 100vh;
}
.wf-login-page {
	min-height: 100vh; display: flex; align-items: center;
	justify-content: center; padding: 24px;
}
.wf-login-card {
	background: #fff; border-radius: var(--wf-radius);
	padding: 36px 32px; width: 100%; max-width: 400px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.wf-login-brand { text-align: center; margin-bottom: 24px; }
.wf-login-mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 56px; height: 56px; background: var(--wf-orange);
	color: #fff; border-radius: var(--wf-radius);
	font-weight: 800; font-size: 16px; letter-spacing: 0.05em;
	margin-bottom: 12px;
}
.wf-login-title { font-size: 20px; font-weight: 700; color: var(--wf-navy); }
.wf-login-sub { font-size: 12px; color: var(--wf-muted); margin-top: 4px; }
.wf-login-foot { text-align: center; margin: 12px 0 0; font-size: 13px; color: var(--wf-muted); }

/* Install page reuses login style */
body.wf-install .wf-install-page {
	min-height: 100vh; display: flex; align-items: center;
	justify-content: center; padding: 24px;
	background: linear-gradient(135deg, var(--wf-navy) 0%, var(--wf-navy-3) 100%);
}
.wf-install-card {
	background: #fff; border-radius: var(--wf-radius);
	padding: 36px 32px; width: 100%; max-width: 560px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.wf-install-brand { text-align: center; margin-bottom: 24px; }
.wf-install-mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 56px; height: 56px; background: var(--wf-orange); color: #fff;
	border-radius: var(--wf-radius); font-weight: 800; font-size: 16px;
	margin-bottom: 12px;
}
.wf-install-title { font-size: 20px; font-weight: 700; color: var(--wf-navy); }
.wf-install-sub { font-size: 12px; color: var(--wf-muted); }
.wf-cred-table {
	width: 100%; border-collapse: collapse; margin: 8px 0;
	border: 1px solid var(--wf-border); border-radius: var(--wf-radius-sm);
	overflow: hidden;
}
.wf-cred-table th, .wf-cred-table td {
	padding: 10px 12px; border-bottom: 1px solid var(--wf-border); text-align: left;
}
.wf-cred-table th { background: var(--wf-off); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wf-muted); }
.wf-cred-table tr:last-child td { border-bottom: none; }
