/* AI Marketing Agent Pro - Admin UI styles */

.ama-wrap { margin-right: 20px; }
.ama-wrap #ama-app { max-width: 1200px; }

/* Phase 14.1 ("Paid Ads Command Center") - the redesigned Performance/
   Organic screens are meant to use the full width of a wide monitor (a
   macro-to-micro dashboard with many side-by-side panels), so only these
   two get a much wider cap instead of raising it for every screen (forms
   elsewhere already constrain their own field widths, but there's no
   reason to force Settings/Logs/etc into an oversized column just because
   Performance wants one).

   Fix (real client report - "huge white space at right side in tab"):
   the Presentation tab's title-slide preview is meant to fill the screen
   like an actual widescreen slide, exactly like Performance/Organic want
   full width for their own dashboards - it was left off this selector by
   oversight, so it was still capped at the 1200px default above while
   every other client-facing tab's content comfortably fits under that
   cap. Added here rather than raising the global 1200px default, which
   would force Settings/Logs/etc into an oversized column for no reason.

   Fix (same bug class, real client report - Social Media tab narrower
   than Paid Ads/Organic with a large empty gap on the right): the Social
   Media tab's snapshot cards (Facebook Page/Instagram/LinkedIn Company
   Page/YouTube) are meant to use the same full-width layout as the other
   dashboard-style tabs, but ama-social was left off this selector by the
   same oversight as the Presentation fix above, so it was still capped
   at 1200px. Added here for the same reason - no other tab's width is
   affected.

   Fix (same bug class, real client report - "every tab UI Should be full
   width"): Publish Content, Topic Research, PSU HR & Marketing
   Notifications, Content Pipeline and Budget and ROI had the same narrow-
   with-empty-gap problem as Social Media/Presentation above, for the same
   reason (left off this selector by oversight). Added here so every
   client-facing tab now matches Paid Ads' width; Settings/Logs/Connectors/
   AI Providers/Notifications/Scheduler/Team Access/System Health etc.
   deliberately stay at the narrower 1200px default above, since they're
   plain forms/tables with no reason to stretch that wide. */
.ama-wrap #ama-app[data-page="ama-performance"],
.ama-wrap #ama-app[data-page="ama-organic"],
.ama-wrap #ama-app[data-page="ama-presentation"],
.ama-wrap #ama-app[data-page="ama-social"],
.ama-wrap #ama-app[data-page="ama-publish-content"],
.ama-wrap #ama-app[data-page="ama-topic-research"],
.ama-wrap #ama-app[data-page="ama-psu-hr"],
.ama-wrap #ama-app[data-page="ama-content-pipeline"],
.ama-wrap #ama-app[data-page="ama-budget-roi"] {
	max-width: 1900px;
}

.ama-loading {
	padding: 40px;
	text-align: center;
	color: #6b7280;
	font-size: 14px;
}

.ama-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #111827;
	color: #fff;
	padding: 20px 24px;
	border-radius: 8px;
	margin: 16px 0;
}
.ama-header h1 { color: #fff; margin: 0; font-size: 20px; }
.ama-header .ama-badge { background: #2563eb; padding: 4px 10px; border-radius: 999px; font-size: 12px; }

.ama-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.ama-tabs a {
	padding: 8px 14px;
	border-radius: 6px;
	text-decoration: none;
	color: #374151;
	background: #f3f4f6;
	font-size: 13px;
	font-weight: 500;
}
.ama-tabs a.active { background: #2563eb; color: #fff; }

.ama-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }

.ama-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 18px;
}
.ama-card h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.ama-card .ama-metric { font-size: 26px; font-weight: 700; color: #111827; }
.ama-card .ama-metric-sub { font-size: 12px; color: #9ca3af; margin-top: 4px; }

.ama-status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.ama-status-ok { background: #16a34a; }
.ama-status-warning { background: #d97706; }
.ama-status-error, .ama-status-critical { background: #dc2626; }
.ama-status-unknown { background: #9ca3af; }

.ama-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.ama-panel h2 { margin-top: 0; font-size: 16px; }
.ama-panel p.description { color: #6b7280; font-size: 13px; }

.ama-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ama-table th { text-align: left; padding: 8px 10px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.ama-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.ama-table tr:last-child td { border-bottom: none; }

/* Client-flagged (Aug 2026): Instagram's "All Posts" table gained 5 new
   real-metric columns (Total Interactions, Skip Rate, Crossposted Views,
   Reel Avg/Total Watch) on top of its existing 11 - forcing all 16+ into
   the panel's full width (.ama-table's own width:100%) crushed every
   column into an unreadable, misaligned mess. Scoped to this one table's
   own wrapper ID only (#ama-instagram-all-posts-table) - not a global
   .ama-table change, so no other table anywhere else in the plugin is
   affected - so it scrolls horizontally with a sane per-column minimum
   width instead of shrinking to illegibility. */

/* Fix (Aug 2026, "All posts, top performing sections in Instagram and
   facebook should be UI same as YouTube Top Performing Videos section -
   filters tab, inner scrolling bar, sticky header with all metrics,
   color combination... All modules should have similar UI" - confirmed
   real regression found while re-verifying before the client's planned
   reinstall: this exact treatment was already built once (basic
   horizontal-scroll-only block below), then a fuller version replacing
   it apparently reverted at some point without being caught - this
   rebuild replaces it with the SAME real treatment YouTube's own tables
   use, not a new design: max-height 620px vertical scroll (YouTube's own
   proven "~10 rows visible" sizing), sticky header, ONE sticky leading
   column (Title/Caption - Facebook/Instagram lead with three always-
   shown columns rather than YouTube's two, so freezing all three would
   eat too much space in a narrower panel), and the same dark "client"
   theme color matching (var(--ama-bg-1)/var(--ama-bg-2)) YouTube's own
   sticky cells use. Covers all four real tables: Facebook/Instagram All
   Posts AND Top Performing - the exact same treatment, not two
   different designs. */
/* Client request (Sep 2026, "360 degree performance of each post... fix
   post title and left metrics can be scrolling bar"): LinkedIn's new
   per-post "360 view" table added to this same ID-based group - the
   exact same real, already-built-and-proven sticky-title/scrollable-
   metrics treatment Instagram/Facebook's own post tables use below, not
   a new design. Deliberately added HERE (the Social Media-safe ID group)
   rather than the .ama-organic-scroll-table CLASS further down, which is
   explicitly reserved for the Organic tab only per an earlier client
   instruction not to touch Social Media with that shared class. */
/* Fix (Oct 2026, real client report - "Top Performing post section UI
   Alingment missed, its expanding right end but it shoule bd sticky
   header and right part sticky as like all posts section"): confirmed
   gap - the "All Posts" table's own wrapper id
   (#ama-linkedin-post-performance-table) was already in this group, but
   its sibling "Top Performing Posts" table's wrapper id
   (#ama-linkedin-top-performing-table, set in
   linkedinTopPerformingPostsSection()) was never added here, so it never
   got the sticky-header/sticky-first-column/internal-scroll treatment
   and just expanded the page instead. Added to every real selector group
   below alongside #ama-linkedin-post-performance-table - the exact same
   treatment, not a new design. */
#ama-linkedin-post-performance-table,
#ama-linkedin-top-performing-table,
#ama-facebook_page-all-posts-table,
#ama-instagram-all-posts-table,
#ama-facebook-top-performing-table,
#ama-instagram-top-performing-table,
/* Sept 2026 (client requirement, verbatim: "ensure side scrolling bar,
   section should show 10 trail reels and rest can be shows by scrolling
   bar down as like all posts secton with scrolling tab") - Trial Reel
   Performance joins this same shared internal-scroll/sticky-header
   treatment, not a new design. */
#ama-ig-trial-reel-table,
#ama-competitor-pages-table,
#ama-competitor-management-table,
#ama-competitor-keywords-table,
#ama-competitor-gsc-table,
#ama-competitor-comparison-table,
#ama-serp-top-pages-overview-table,
#ama-serp-trending-up-table,
#ama-serp-trending-down-table,
#ama-serp-top-pages-table { overflow: auto; max-height: 620px; max-width: 100%; -webkit-overflow-scrolling: touch; }
#ama-linkedin-post-performance-table .ama-table,
#ama-linkedin-top-performing-table .ama-table,
#ama-facebook_page-all-posts-table .ama-table,
#ama-instagram-all-posts-table .ama-table,
#ama-facebook-top-performing-table .ama-table,
#ama-instagram-top-performing-table .ama-table,
#ama-competitor-pages-table .ama-table { width: auto; min-width: 2600px; border-collapse: separate; border-spacing: 0; }
/* Fix (Aug 2026, real live report - "columns of the width are not fit"):
   these narrower tables have far fewer columns than the wide, many-
   column tables above (14+ columns for Instagram/Facebook All Posts,
   11 for Competitor Spy) - forcing the same 2600px minimum onto a
   genuinely 3-5 column table stretched each column absurdly wide
   instead of sizing naturally to its real content. Kept as their own
   real rule - auto width, no forced minimum - while still sharing
   every other real part of the same treatment (sticky header, sticky
   first column, internal scroll) via the selector groups below. */
#ama-ig-trial-reel-table .ama-table,
#ama-competitor-management-table .ama-table,
#ama-competitor-keywords-table .ama-table,
#ama-competitor-gsc-table .ama-table,
#ama-competitor-comparison-table .ama-table,
#ama-serp-top-pages-overview-table .ama-table,
#ama-serp-trending-up-table .ama-table,
#ama-serp-trending-down-table .ama-table,
#ama-serp-top-pages-table .ama-table { width: 100%; border-collapse: separate; border-spacing: 0; }
#ama-linkedin-post-performance-table .ama-table th,
#ama-linkedin-top-performing-table .ama-table th,
#ama-facebook_page-all-posts-table .ama-table th,
#ama-instagram-all-posts-table .ama-table th,
#ama-facebook-top-performing-table .ama-table th,
#ama-instagram-top-performing-table .ama-table th,
#ama-ig-trial-reel-table .ama-table th,
#ama-competitor-pages-table .ama-table th,
#ama-competitor-management-table .ama-table th,
#ama-competitor-keywords-table .ama-table th,
#ama-competitor-gsc-table .ama-table th,
#ama-competitor-comparison-table .ama-table th,
#ama-serp-top-pages-overview-table .ama-table th,
#ama-serp-trending-up-table .ama-table th,
#ama-serp-trending-down-table .ama-table th,
#ama-serp-top-pages-table .ama-table th,
#ama-linkedin-post-performance-table .ama-table td,
#ama-linkedin-top-performing-table .ama-table td,
#ama-facebook_page-all-posts-table .ama-table td,
#ama-instagram-all-posts-table .ama-table td,
#ama-facebook-top-performing-table .ama-table td,
#ama-instagram-top-performing-table .ama-table td,
#ama-ig-trial-reel-table .ama-table td,
#ama-competitor-pages-table .ama-table td,
#ama-competitor-management-table .ama-table td,
#ama-competitor-keywords-table .ama-table td,
#ama-competitor-gsc-table .ama-table td,
#ama-competitor-comparison-table .ama-table td,
#ama-serp-top-pages-overview-table .ama-table td,
#ama-serp-trending-up-table .ama-table td,
#ama-serp-trending-down-table .ama-table td,
#ama-serp-top-pages-table .ama-table td { white-space: nowrap; }

#ama-linkedin-post-performance-table .ama-table thead th,
#ama-linkedin-top-performing-table .ama-table thead th,
#ama-facebook_page-all-posts-table .ama-table thead th,
#ama-instagram-all-posts-table .ama-table thead th,
#ama-facebook-top-performing-table .ama-table thead th,
#ama-instagram-top-performing-table .ama-table thead th,
#ama-ig-trial-reel-table .ama-table thead th,
#ama-competitor-pages-table .ama-table thead th,
#ama-competitor-management-table .ama-table thead th,
#ama-competitor-keywords-table .ama-table thead th,
#ama-competitor-gsc-table .ama-table thead th,
#ama-competitor-comparison-table .ama-table thead th,
#ama-serp-top-pages-overview-table .ama-table thead th,
#ama-serp-trending-up-table .ama-table thead th,
#ama-serp-trending-down-table .ama-table thead th,
#ama-serp-top-pages-table .ama-table thead th { position: sticky; top: 0; z-index: 5; background: #f9fafb; }

#ama-linkedin-post-performance-table .ama-table td:first-child,
#ama-linkedin-top-performing-table .ama-table td:first-child,
#ama-facebook_page-all-posts-table .ama-table td:first-child,
#ama-instagram-all-posts-table .ama-table td:first-child,
#ama-facebook-top-performing-table .ama-table td:first-child,
#ama-instagram-top-performing-table .ama-table td:first-child,
#ama-ig-trial-reel-table .ama-table td:first-child,
#ama-competitor-pages-table .ama-table td:first-child,
#ama-competitor-management-table .ama-table td:first-child,
#ama-competitor-keywords-table .ama-table td:first-child,
#ama-competitor-gsc-table .ama-table td:first-child,
#ama-competitor-comparison-table .ama-table td:first-child,
#ama-serp-top-pages-overview-table .ama-table td:first-child,
#ama-serp-trending-up-table .ama-table td:first-child,
#ama-serp-trending-down-table .ama-table td:first-child,
#ama-serp-top-pages-table .ama-table td:first-child,
#ama-linkedin-post-performance-table .ama-table th:first-child,
#ama-linkedin-top-performing-table .ama-table th:first-child,
#ama-facebook_page-all-posts-table .ama-table th:first-child,
#ama-instagram-all-posts-table .ama-table th:first-child,
#ama-facebook-top-performing-table .ama-table th:first-child,
#ama-instagram-top-performing-table .ama-table th:first-child,
#ama-ig-trial-reel-table .ama-table th:first-child,
#ama-competitor-pages-table .ama-table th:first-child,
#ama-competitor-management-table .ama-table th:first-child,
#ama-competitor-keywords-table .ama-table th:first-child,
#ama-competitor-gsc-table .ama-table th:first-child,
#ama-competitor-comparison-table .ama-table th:first-child,
#ama-serp-top-pages-overview-table .ama-table th:first-child,
#ama-serp-trending-up-table .ama-table th:first-child,
#ama-serp-trending-down-table .ama-table th:first-child,
#ama-serp-top-pages-table .ama-table th:first-child {
	position: sticky; left: 0; z-index: 2; background: #fff;
	white-space: normal; width: 260px; min-width: 260px; max-width: 260px;
	overflow: hidden;
}
#ama-linkedin-post-performance-table .ama-table thead th:first-child,
#ama-linkedin-top-performing-table .ama-table thead th:first-child,
#ama-facebook_page-all-posts-table .ama-table thead th:first-child,
#ama-instagram-all-posts-table .ama-table thead th:first-child,
#ama-facebook-top-performing-table .ama-table thead th:first-child,
#ama-instagram-top-performing-table .ama-table thead th:first-child,
#ama-ig-trial-reel-table .ama-table thead th:first-child,
#ama-competitor-pages-table .ama-table thead th:first-child,
#ama-competitor-management-table .ama-table thead th:first-child,
#ama-competitor-keywords-table .ama-table thead th:first-child,
#ama-competitor-gsc-table .ama-table thead th:first-child,
#ama-competitor-comparison-table .ama-table thead th:first-child,
#ama-serp-top-pages-overview-table .ama-table thead th:first-child,
#ama-serp-trending-up-table .ama-table thead th:first-child,
#ama-serp-trending-down-table .ama-table thead th:first-child,
#ama-serp-top-pages-table .ama-table thead th:first-child { z-index: 6; background: #f9fafb; }

#ama-app[data-theme="client"] #ama-linkedin-post-performance-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-linkedin-top-performing-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-facebook_page-all-posts-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-instagram-all-posts-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-facebook-top-performing-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-instagram-top-performing-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-ig-trial-reel-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-competitor-pages-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-competitor-management-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-competitor-keywords-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-competitor-gsc-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-competitor-comparison-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-serp-top-pages-overview-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-serp-trending-up-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-serp-trending-down-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-serp-top-pages-table .ama-table thead th {
	background: var(--ama-bg-2); color: var(--ama-text-3); border-bottom-color: var(--ama-card-border);
}
#ama-app[data-theme="client"] #ama-linkedin-post-performance-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-linkedin-top-performing-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-facebook_page-all-posts-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-instagram-all-posts-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-facebook-top-performing-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-instagram-top-performing-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-ig-trial-reel-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-competitor-pages-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-competitor-management-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-competitor-keywords-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-competitor-gsc-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-competitor-comparison-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-serp-top-pages-overview-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-serp-trending-up-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-serp-trending-down-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-serp-top-pages-table .ama-table td:first-child {
	background: var(--ama-bg-1); color: var(--ama-text-2); border-bottom-color: var(--ama-card-border);
	box-shadow: 2px 0 4px -1px rgba(0, 0, 0, .4);
}
#ama-app[data-theme="client"] #ama-linkedin-post-performance-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-linkedin-top-performing-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-facebook_page-all-posts-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-instagram-all-posts-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-facebook-top-performing-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-instagram-top-performing-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-ig-trial-reel-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-competitor-pages-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-competitor-management-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-competitor-keywords-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-competitor-gsc-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-competitor-comparison-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-serp-top-pages-overview-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-serp-trending-up-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-serp-trending-down-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-serp-top-pages-table .ama-table tr:hover td:first-child {
	background: var(--ama-bg-2); color: var(--ama-text-1);
}

/* Fix (Aug 2026, real client request - "sticky headers is the
   observation for all rest of the blocks... complete the organic
   tab"): a real, reusable CLASS version of the exact same treatment
   as the ID-based rules above, since the remaining Organic-tab tables
   (Total Visits/Search Intent/Engagement/Technical SEO Audit/GEO
   Tracking/Organic Leads/Organic Conversions) are numerous enough that
   adding one more unique ID per table each time doesn't scale -
   identical sticky-header/sticky-first-column/internal-scroll/dark-
   theme behavior, applied by adding class="ama-organic-scroll-table"
   to a table's wrapper div instead of a unique id. Scoped to the
   Organic tab, per explicit client instruction not to touch Social
   Media - this class is never applied anywhere in the Social Media
   tab's own markup. (Reused, unmodified, in the Paid Ads tab's own
   later "Cross-Platform Campaigns" table too - a plain CSS utility
   class works the same way regardless of which tab uses it; only
   Organic tab CODE itself stays untouched per that lock, not this
   shared class.) */
.ama-organic-scroll-table { overflow: auto; max-height: 620px; max-width: 100%; -webkit-overflow-scrolling: touch; }
.ama-organic-scroll-table .ama-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ama-organic-scroll-table .ama-table th,
.ama-organic-scroll-table .ama-table td { white-space: nowrap; }
.ama-organic-scroll-table .ama-table thead th { position: sticky; top: 0; z-index: 5; background: #f9fafb; }
.ama-organic-scroll-table .ama-table td:first-child,
.ama-organic-scroll-table .ama-table th:first-child {
	position: sticky; left: 0; z-index: 2; background: #fff;
	white-space: normal; width: 260px; min-width: 260px; max-width: 260px;
	overflow: hidden;
}
.ama-organic-scroll-table .ama-table thead th:first-child { z-index: 6; background: #f9fafb; }
#ama-app[data-theme="client"] .ama-organic-scroll-table .ama-table thead th {
	background: var(--ama-bg-2); color: var(--ama-text-3); border-bottom-color: var(--ama-card-border);
}
#ama-app[data-theme="client"] .ama-organic-scroll-table .ama-table td:first-child {
	background: var(--ama-bg-1); color: var(--ama-text-2); border-bottom-color: var(--ama-card-border);
	box-shadow: 2px 0 4px -1px rgba(0, 0, 0, .4);
}
#ama-app[data-theme="client"] .ama-organic-scroll-table .ama-table tr:hover td:first-child {
	background: var(--ama-bg-2); color: var(--ama-text-1);
}

/* Fix (Aug 2026, real client request - "clickable links shows blue
   color... instead of blue can we make white color? apply to all
   clickable links in all sections of all blocks"): scoped by theme
   rather than applied unconditionally, since a literal white link
   would be invisible against the default (light) theme's white/light
   backgrounds - real, visible white only where it will actually work
   (the dark "client" theme, matching that theme's own existing light
   text colors), and a neutral dark color (not blue) with an underline
   for the default light theme, so both themes get "not blue" without
   either one losing real link visibility. Scoped to organicUrlCell()'s
   own real links (every URL made clickable this session) via the
   .ama-organic-scroll-table wrapper every one of those cells already
   sits inside - never touches Social Media, which uses its own
   separate tables/wrappers untouched by this rule. */
.ama-organic-scroll-table a { color: var(--ama-text-1, #111827); text-decoration: underline; }
.ama-organic-scroll-table a:hover { opacity: .8; }
#ama-app[data-theme="client"] .ama-organic-scroll-table a { color: #fff; }
/* Fix (Aug 2026, real live report - "clickable links are still in blue
   color" - a real, confirmed gap found: these Organic-tab tables use
   their own individual IDs rather than the shared class above (the
   "narrow" ID group from the earlier column-width fix), so the
   class-based link-color rule above never reached them. Every one of
   these IDs is Organic-tab-only - confirmed against the same audit
   used for the column-width fix - so adding them here cannot affect
   Social Media's own, separate Instagram/Facebook table IDs. */
#ama-competitor-pages-table a,
#ama-competitor-management-table a,
#ama-competitor-keywords-table a,
#ama-competitor-gsc-table a,
#ama-competitor-comparison-table a,
#ama-serp-top-pages-overview-table a,
#ama-serp-trending-up-table a,
#ama-serp-trending-down-table a,
#ama-serp-top-pages-table a { color: #111827; text-decoration: underline; }
#ama-app[data-theme="client"] #ama-competitor-pages-table a,
#ama-app[data-theme="client"] #ama-competitor-management-table a,
#ama-app[data-theme="client"] #ama-competitor-keywords-table a,
#ama-app[data-theme="client"] #ama-competitor-gsc-table a,
#ama-app[data-theme="client"] #ama-competitor-comparison-table a,
#ama-app[data-theme="client"] #ama-serp-top-pages-overview-table a,
#ama-app[data-theme="client"] #ama-serp-trending-up-table a,
#ama-app[data-theme="client"] #ama-serp-trending-down-table a,
#ama-app[data-theme="client"] #ama-serp-top-pages-table a { color: #fff; }

/* Fix (Aug 2026, real client polish request - "Current freeze only
   Campaign Type, freeze till Status"): the shared .ama-organic-
   scroll-table class only ever freezes the first column - this table
   specifically needs 5 real frozen columns (Campaign Type/Campaign
   Name/Ad Group Name/Ad Name/Status), which needs its own fixed-width,
   cumulative-offset rule rather than the shared single-column
   treatment. Scoped to this one real table id only - every other
   table using the shared class keeps its existing single-column
   freeze unchanged. */
#ama-google-ads-glance-table .ama-table th,
#ama-google-ads-glance-table .ama-table td { white-space: normal; }
#ama-google-ads-glance-table .ama-table th:nth-child(1),
#ama-google-ads-glance-table .ama-table td:nth-child(1) { position: sticky; left: 0; width: 100px; min-width: 100px; max-width: 100px; z-index: 3; background: #fff; }
#ama-google-ads-glance-table .ama-table th:nth-child(2),
#ama-google-ads-glance-table .ama-table td:nth-child(2) { position: sticky; left: 100px; width: 170px; min-width: 170px; max-width: 170px; z-index: 3; background: #fff; }
#ama-google-ads-glance-table .ama-table th:nth-child(3),
#ama-google-ads-glance-table .ama-table td:nth-child(3) { position: sticky; left: 270px; width: 160px; min-width: 160px; max-width: 160px; z-index: 3; background: #fff; }
#ama-google-ads-glance-table .ama-table th:nth-child(4),
#ama-google-ads-glance-table .ama-table td:nth-child(4) { position: sticky; left: 430px; width: 160px; min-width: 160px; max-width: 160px; z-index: 3; background: #fff; }
#ama-google-ads-glance-table .ama-table th:nth-child(5),
#ama-google-ads-glance-table .ama-table td:nth-child(5) { position: sticky; left: 590px; width: 100px; min-width: 100px; max-width: 100px; z-index: 3; background: #fff; box-shadow: 2px 0 4px -1px rgba(0,0,0,.15); }
#ama-google-ads-glance-table .ama-table thead th:nth-child(1),
#ama-google-ads-glance-table .ama-table thead th:nth-child(2),
#ama-google-ads-glance-table .ama-table thead th:nth-child(3),
#ama-google-ads-glance-table .ama-table thead th:nth-child(4),
#ama-google-ads-glance-table .ama-table thead th:nth-child(5) { z-index: 6; background: #f9fafb; }
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table td:nth-child(1),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table td:nth-child(2),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table td:nth-child(3),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table td:nth-child(4),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table td:nth-child(5) { background: var(--ama-bg-1); }
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table thead th:nth-child(1),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table thead th:nth-child(2),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table thead th:nth-child(3),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table thead th:nth-child(4),
#ama-app[data-theme="client"] #ama-google-ads-glance-table .ama-table thead th:nth-child(5) { background: var(--ama-bg-2); }


/* Fix (Aug 2026, real client UI reports on "All Ads — Performance At a
   Glance" - "left frozen column gets overridden while scrolling right"
   and "need scrolling bar top to bottom within section, limit to
   about 5 rows with sticky header and internal scrolling"): this
   table's own real dedicated id, separate from the shared
   .ama-organic-scroll-table class other tables use, since it needs
   both a genuinely solid sticky first column (the real cause of
   content visually bleeding through the frozen column while scrolling
   right was a missing/inconsistent solid background+z-index on that
   column) and a smaller real max-height (~5 real rows, not the
   ~620px default sized for far larger tables) with its own internal
   vertical scroll. */
#ama-all-ads-table { overflow: auto; max-height: 280px; max-width: 100%; -webkit-overflow-scrolling: touch; }
#ama-all-ads-table .ama-table { width: auto; min-width: 2400px; border-collapse: separate; border-spacing: 0; }
#ama-all-ads-table .ama-table th,
#ama-all-ads-table .ama-table td { white-space: nowrap; }
#ama-all-ads-table .ama-table thead th { position: sticky; top: 0; z-index: 5; background: #f9fafb; }
#ama-all-ads-table .ama-table td:first-child,
#ama-all-ads-table .ama-table th:first-child {
	position: sticky; left: 0; z-index: 3; background: #fff;
	white-space: normal; width: 220px; min-width: 220px; max-width: 220px;
	overflow: hidden; box-shadow: 2px 0 4px -1px rgba(0,0,0,.15);
}
#ama-all-ads-table .ama-table thead th:first-child { z-index: 6; background: #f9fafb; }
#ama-app[data-theme="client"] #ama-all-ads-table .ama-table thead th {
	background: var(--ama-bg-2); color: var(--ama-text-3); border-bottom-color: var(--ama-card-border);
}
#ama-app[data-theme="client"] #ama-all-ads-table .ama-table td:first-child {
	background: var(--ama-bg-1); color: var(--ama-text-2); border-bottom-color: var(--ama-card-border);
}


/* Client request, round 3 (Aug 2026, "Maintain horizontal scrolling
   inside each Long Videos/Shorts table, but make the Video column
   sticky/frozen on the left while horizontally scrolling. If practical,
   also freeze Published. Maintain the existing limited-height/internal
   vertical scrolling so users do not have to scroll through 100+ videos
   before reaching the next YouTube section. Do not allow the table to
   expand the overall page width"): both scroll axes live on the SAME
   container so sticky positioning works for both the header row (top)
   and the first two columns (left) at once. `border-collapse: separate`
   is deliberately used here instead of the shared .ama-table's own
   `collapse` (see admin.css's shared rule) - `position: sticky` on a
   <td>/<th> is unreliable with border-collapse:collapse in Safari, a
   real cross-browser compatibility issue, not a style preference -
   scoped to these two table IDs only, so no other table anywhere else
   in the plugin is affected. max-height contains vertical scrolling to
   the table itself; overflow-x:auto never lets the table's real width
   (2400px+ across 15+ columns) push the surrounding page wider - only
   an internal scrollbar appears.

   Round 4 (client-found real overlap bugs from live screenshots, both
   confirmed by reading the actual rendered markup, not guessed): (1)
   youtubeVideoTitleCell() in admin.js never actually CSS-truncated the
   title text - only limited its character count in JS - so a title well
   under that character limit could still be visually wider than the
   frozen column and bleed straight into Published/metric cells no
   matter how correct the sticky positioning was; fixed there with real
   text-overflow:ellipsis, and backstopped here with overflow:hidden on
   both frozen columns so nothing can ever visually escape its own box
   again. (2) the sticky cells' hardcoded `background:#fff` never
   accounted for this dashboard's separate dark "client" theme
   (#ama-app[data-theme="client"], translucent rgba() panel backgrounds
   over a dark gradient - see that theme's own block above) - solid
   white sticky cells on top of that theme is exactly the "conflicts
   with the dark dashboard" the client described. A true translucent
   match isn't possible for an opaque sticky cell (opacity is the whole
   point - content must never show through when scrolled), so this uses
   a solid approximation from the theme's own real palette
   (var(--ama-bg-1)/var(--ama-bg-2)) instead of an invented color.
   Published's `left` offset (260px) is kept in exact lockstep with
   Video's real column width via an explicit `width` (not just
   min/max-width, which could otherwise let the two drift out of sync -
   the client's own root-caused complaint) - both are 260px/140px
   exactly, no browser-dependent auto-sizing gap between them. */
#ama-youtube-top-performing-table,
#ama-youtube-paid-content-table,
#ama-youtube-ad-revenue-table,
#ama-youtube-long-table,
#ama-youtube-shorts-table { overflow: auto; max-height: 620px; max-width: 100%; -webkit-overflow-scrolling: touch; }
#ama-youtube-top-performing-table .ama-table,
#ama-youtube-paid-content-table .ama-table,
#ama-youtube-ad-revenue-table .ama-table,
#ama-youtube-long-table .ama-table,
#ama-youtube-shorts-table .ama-table { width: auto; min-width: 4600px; border-collapse: separate; border-spacing: 0; }
#ama-youtube-top-performing-table .ama-table th,
#ama-youtube-paid-content-table .ama-table th,
#ama-youtube-ad-revenue-table .ama-table th,
#ama-youtube-top-performing-table .ama-table td,
#ama-youtube-paid-content-table .ama-table td,
#ama-youtube-ad-revenue-table .ama-table td,
#ama-youtube-long-table .ama-table th,
#ama-youtube-long-table .ama-table td,
#ama-youtube-shorts-table .ama-table th,
#ama-youtube-shorts-table .ama-table td { white-space: nowrap; }

#ama-youtube-top-performing-table .ama-table thead th,
#ama-youtube-paid-content-table .ama-table thead th,
#ama-youtube-ad-revenue-table .ama-table thead th,
#ama-youtube-long-table .ama-table thead th,
#ama-youtube-shorts-table .ama-table thead th { position: sticky; top: 0; z-index: 5; background: #f9fafb; }

#ama-youtube-top-performing-table .ama-table td:first-child,
#ama-youtube-paid-content-table .ama-table td:first-child,
#ama-youtube-ad-revenue-table .ama-table td:first-child,
#ama-youtube-top-performing-table .ama-table th:first-child,
#ama-youtube-paid-content-table .ama-table th:first-child,
#ama-youtube-ad-revenue-table .ama-table th:first-child,
#ama-youtube-long-table .ama-table td:first-child,
#ama-youtube-long-table .ama-table th:first-child,
#ama-youtube-shorts-table .ama-table td:first-child,
#ama-youtube-shorts-table .ama-table th:first-child {
	position: sticky; left: 0; z-index: 2; background: #fff;
	white-space: normal; width: 260px; min-width: 260px; max-width: 260px;
	overflow: hidden;
}
#ama-youtube-top-performing-table .ama-table td:nth-child(2),
#ama-youtube-paid-content-table .ama-table td:nth-child(2),
#ama-youtube-ad-revenue-table .ama-table td:nth-child(2),
#ama-youtube-top-performing-table .ama-table th:nth-child(2),
#ama-youtube-paid-content-table .ama-table th:nth-child(2),
#ama-youtube-ad-revenue-table .ama-table th:nth-child(2),
#ama-youtube-long-table .ama-table td:nth-child(2),
#ama-youtube-long-table .ama-table th:nth-child(2),
#ama-youtube-shorts-table .ama-table td:nth-child(2),
#ama-youtube-shorts-table .ama-table th:nth-child(2) {
	position: sticky; left: 260px; z-index: 2; background: #fff;
	width: 140px; min-width: 140px; max-width: 140px;
	overflow: hidden;
	box-shadow: 2px 0 4px -1px rgba(0, 0, 0, .12);
}
#ama-youtube-top-performing-table .ama-table thead th:first-child,
#ama-youtube-paid-content-table .ama-table thead th:first-child,
#ama-youtube-ad-revenue-table .ama-table thead th:first-child,
#ama-youtube-top-performing-table .ama-table thead th:nth-child(2),
#ama-youtube-paid-content-table .ama-table thead th:nth-child(2),
#ama-youtube-ad-revenue-table .ama-table thead th:nth-child(2),
#ama-youtube-long-table .ama-table thead th:first-child,
#ama-youtube-long-table .ama-table thead th:nth-child(2),
#ama-youtube-shorts-table .ama-table thead th:first-child,
#ama-youtube-shorts-table .ama-table thead th:nth-child(2) { z-index: 6; background: #f9fafb; }

/* Dark "client" theme equivalents - same sticky mechanics, opaque
   solid-color approximations of that theme's real translucent palette
   instead of the light theme's white/off-white (see this rule block's
   own comment above for why an exact translucent match isn't possible
   for an opaque sticky cell). */
#ama-app[data-theme="client"] #ama-youtube-top-performing-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-youtube-paid-content-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-youtube-ad-revenue-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-youtube-long-table .ama-table thead th,
#ama-app[data-theme="client"] #ama-youtube-shorts-table .ama-table thead th {
	background: var(--ama-bg-2); color: var(--ama-text-3); border-bottom-color: var(--ama-card-border);
}
#ama-app[data-theme="client"] #ama-youtube-top-performing-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-youtube-paid-content-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-youtube-ad-revenue-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-youtube-top-performing-table .ama-table td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-paid-content-table .ama-table td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-ad-revenue-table .ama-table td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-long-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-youtube-long-table .ama-table td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-shorts-table .ama-table td:first-child,
#ama-app[data-theme="client"] #ama-youtube-shorts-table .ama-table td:nth-child(2) {
	background: var(--ama-bg-1); color: var(--ama-text-2); border-bottom-color: var(--ama-card-border);
	box-shadow: 2px 0 4px -1px rgba(0, 0, 0, .4);
}
/* Requirement: hover state must also stay opaque on sticky cells (a
   translucent hover tint here would let scrolled-under metric text show
   through) - approximated with a slightly lighter solid tone from the
   same palette rather than the ordinary rows' real rgba() hover tint. */
#ama-app[data-theme="client"] #ama-youtube-top-performing-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-youtube-paid-content-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-youtube-ad-revenue-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-youtube-top-performing-table .ama-table tr:hover td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-paid-content-table .ama-table tr:hover td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-ad-revenue-table .ama-table tr:hover td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-long-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-youtube-long-table .ama-table tr:hover td:nth-child(2),
#ama-app[data-theme="client"] #ama-youtube-shorts-table .ama-table tr:hover td:first-child,
#ama-app[data-theme="client"] #ama-youtube-shorts-table .ama-table tr:hover td:nth-child(2) {
	background: var(--ama-bg-2); color: var(--ama-text-1);
}

.ama-field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.ama-field .desc { color: #6b7280; font-size: 12px; margin-top: 4px; }
.ama-field input[type=text], .ama-field input[type=password], .ama-field input[type=number], .ama-field input[type=date], .ama-field select, .ama-field textarea {
	width: 100%; max-width: 460px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px;
}
.ama-field input[type=checkbox] { margin-right: 8px; }

.ama-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .ama-row-2col { grid-template-columns: 1fr; } }

/* Phase 14.1 ("Paid Ads Command Center") - the macro-to-micro dashboard
   grid: panels auto-fit into however many columns the available width
   allows (a wide monitor gets 3-4 columns, a laptop gets 1-2), replacing
   the old fixed single-column stack for everything below the KPI/All-Ads
   row. Panels inside it manage their own bottom margin via the grid gap,
   not the default .ama-panel margin-bottom (which would double up). */
.ama-mega-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
	align-items: start;
}
.ama-mega-grid .ama-panel { margin-bottom: 0; }
.ama-span-2 { grid-column: span 2; }
@media (max-width: 1000px) { .ama-span-2 { grid-column: span 1; } }

/* Phase 14.1 - inline AI recommendation badge shown next to an ad/format
   row (All Ads leaderboard, Performance by Ad Format, and the Top
   Campaigns drill-down tree) - a compact, tooltip-carrying pointer to the
   full recommendation rather than requiring a trip to AI Insights to see
   whether something needs attention. */
.ama-ai-badge {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	cursor: help;
	background: #eef2ff;
	color: #3730a3;
	white-space: nowrap;
}
.ama-ai-badge.severity-critical, .ama-ai-badge.severity-high { background: #fee2e2; color: #991b1b; }
.ama-ai-badge.severity-medium, .ama-ai-badge.severity-warning { background: #fef3c7; color: #92400e; }

/* Phase 14.1 - "All Ads" leaderboard row tinting so the best/worst
   performer is visible without reading every column: green for top-ROAS
   rows, red for rows with spend but zero conversions. */
.ama-row-best td { background: #f0fdf4; }
.ama-row-worst td { background: #fef2f2; }
.ama-creative-preview { color: #6b7280; font-size: 12px; max-width: 240px; display: inline-block; white-space: normal; }

.ama-btn {
	display: inline-block;
	background: #2563eb;
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.ama-btn:hover { background: #1d4ed8; }
.ama-btn.secondary { background: #f3f4f6; color: #111827; }
.ama-btn.secondary:hover { background: #e5e7eb; }
.ama-btn[disabled] { opacity: .6; cursor: not-allowed; }

.ama-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.ama-pill-connected { background: #dcfce7; color: #166534; }
.ama-pill-disconnected { background: #fee2e2; color: #991b1b; }
.ama-pill-coming_soon { background: #f3f4f6; color: #6b7280; }

/* Phase 14: Top Campaigns drill-down toggle (campaign -> ad set/asset group
   -> ad -> creative). Plain arrow button matching the .ama-btn aesthetic but
   compact enough to sit inline in a table cell next to the campaign name. */
.ama-drilldown-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-right: 4px;
	padding: 0;
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	vertical-align: middle;
}
.ama-drilldown-toggle:hover { background: #e5e7eb; }
.ama-drilldown-toggle[aria-expanded="true"] { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Fix (Aug 2026, real live report - "notification or alert popped
   behind the existing window so I could not see it clearly"): every
   modal overlay uses z-index:100000 (see .ama-modal-overlay below) -
   toasts were only ever 9999, so any alert triggered while a modal was
   open rendered visually behind it. Now always above every modal. */
.ama-toast {
	position: fixed; top: 40px; right: 24px; z-index: 100001;
	background: #111827; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 13px;
	box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.ama-toast.error { background: #b91c1c; }
.ama-toast.success { background: #15803d; }
/* Fix (Aug 2026 round 7) - a comparison-fetch failure (see admin.js's
   fetchComparePeriodDeck()) is a real, non-fatal degrade (primary period
   still shows fine), not a full error - its own amber tone keeps it
   visually distinct from a real hard failure (red) or a real success
   (green). */
.ama-toast.warning { background: #b45309; }

.ama-log-level { font-weight: 700; font-size: 11px; text-transform: uppercase; }
.ama-log-level.error, .ama-log-level.critical { color: #dc2626; }
.ama-log-level.warning { color: #d97706; }
.ama-log-level.info { color: #2563eb; }
.ama-log-level.debug { color: #6b7280; }

.ama-empty { color: #9ca3af; font-size: 13px; padding: 20px; text-align: center; }

/* Daily Trend chart hover layer (crosshair + tooltip) - see the dataviz
   interaction spec: values lead, tooltip enhances but every value is also
   visible via the Spend by Platform table alongside it. */
.ama-trend-chart-wrap { position: relative; }
.ama-trend-crosshair { stroke: #9ca3af; stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.ama-trend-point { pointer-events: none; }
/* Class-based (not #ama-trend-svg) since Phase 14.1 can render more than
   one trend chart on the same page (Performance's main Daily Trend plus
   its GA4 grid's chart) - each gets a unique ID via buildTrendSvg()'s
   idSuffix param, but all of them still need this same cursor style. */
.ama-trend-svg { cursor: crosshair; touch-action: none; }
.ama-chart-tooltip {
	position: absolute;
	pointer-events: none;
	z-index: 5;
	background: #111827;
	color: #fff;
	font-size: 12px;
	line-height: 1.6;
	padding: 8px 12px;
	border-radius: 8px;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
	opacity: 0;
	transform: translateX(-50%);
	transition: opacity .08s ease;
	white-space: nowrap;
}
.ama-chart-tooltip.visible { opacity: 1; }
.ama-chart-tooltip .ama-tooltip-row { display: flex; align-items: center; gap: 6px; }
.ama-chart-tooltip .ama-tooltip-key { display: inline-block; width: 10px; height: 2px; border-radius: 1px; flex-shrink: 0; }
.ama-chart-tooltip .ama-tooltip-value { font-weight: 700; }

/* Floating "Ask AI Agent" widget - fixed bottom-right quick-access chat,
   in addition to (not instead of) the full AI Insights tab.

   Fix (real client report on the Presentation tab's fullscreen mode -
   see openPresentationFullscreen()'s own comment in admin.js): this
   widget's z-index used to be 9990, which is also wp-admin core's own
   z-index for #adminmenuwrap - the two were never actually compared
   against each other before, only against this plugin's own overlay, so
   the collision went unnoticed until the Presentation tab's fullscreen
   overlay was raised above wp-admin's chrome and needed this widget
   raised to match, to keep sitting above that overlay everywhere it's
   used, exactly as before. */
.ama-float-ask { position: fixed; right: 24px; bottom: 24px; z-index: 1000000; font-family: inherit; }
.ama-float-ask-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 13px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(37, 99, 235, .35);
}
.ama-float-ask-toggle:hover { background: #1d4ed8; }
.ama-float-ask-toggle .ama-float-ask-icon { font-size: 15px; line-height: 1; }
/* Real client report (Sept 2026) - AI Agent icon added alongside the
   existing star on this blue toggle button, not replacing it. */
.ama-float-ask-toggle .ama-float-ask-agent-icon { display: flex; align-items: center; line-height: 1; }

/* Real client report (Sept 2026) - a pending chat turn (see
   sendPresentationChatMessage()) shows a real spinning hourglass icon next
   to its own "Getting ready…" status text, so it stays visibly obvious the
   presentation is still actually working, not already done. */
.ama-chat-pending { display: inline-flex; align-items: center; gap: 6px; color: #6b7280; }
.ama-chat-pending-icon { display: inline-flex; animation: ama-chat-pending-spin 1.1s linear infinite; }
@keyframes ama-chat-pending-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}
/* Real client gap report (Sept 2026 round 4) - "there should be speaker
   popup or AI Agent Icon talking Animation so its gives impression that AI
   Agent is talking". Applied (via setAgentSpeaking() in admin.js) to the
   AI Agent icon on the toggle button and to the small matching icon in the
   open panel's own header, only while a spoken reply is actually playing. */
.ama-agent-speaking { animation: ama-agent-speaking-pulse 1s ease-in-out infinite; }
@keyframes ama-agent-speaking-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.18); opacity: .72; }
}
.ama-float-ask-panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 12px);
	width: 360px;
	max-width: calc(100vw - 32px);
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 20px 48px rgba(17, 24, 39, .2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
/* The `display: flex` above otherwise beats the browser's default
   `[hidden] { display: none }` UA-stylesheet rule (author CSS always wins
   over UA styles regardless of selector specificity), which would leave
   the panel visibly open even while its `hidden` attribute is true - found
   via Playwright testing, where the panel rendered open on first page load
   despite JS never having toggled it. */
.ama-float-ask-panel[hidden] { display: none; }
.ama-float-ask-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	background: #111827;
	color: #fff;
	font-size: 13px;
}
/* Real client gap report (Sept 2026 round 4) - wraps the title and the new
   speaking-indicator icon so they sit inline together on the left side of
   the header, while .ama-float-ask-header's own justify-content:
   space-between still keeps this whole group apart from the actions on
   the right (History / minimize / close). */
.ama-float-ask-header-title { display: flex; align-items: center; gap: 6px; }
.ama-float-ask-header-actions { display: flex; align-items: center; gap: 10px; }
.ama-float-ask-header select { font-size: 12px; padding: 3px 6px; border-radius: 6px; border: none; }
.ama-float-ask-header a { color: #93c5fd; font-size: 12px; text-decoration: none; }
.ama-float-ask-header a:hover { text-decoration: underline; }
/* Real client gap report (Sept 2026 round 4) - "give minimise option
   between history and closing icon" - styled to match .ama-float-ask-close
   below so both header icon-buttons look like one consistent pair. */
.ama-float-ask-minimize { background: transparent; border: none; color: #fff; font-size: 15px; cursor: pointer; line-height: 1; padding: 0; }
.ama-float-ask-close { background: transparent; border: none; color: #fff; font-size: 15px; cursor: pointer; line-height: 1; padding: 0; }
.ama-float-chat-messages { padding: 12px; height: 320px; overflow-y: auto; background: #fafafa; }
.ama-float-chat-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e5e7eb; background: #fff; }
.ama-float-chat-input-row textarea {
	flex: 1;
	resize: none;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-family: inherit;
	font-size: 13px;
}
@media (max-width: 480px) {
	.ama-float-ask { right: 12px; bottom: 12px; }
	.ama-float-ask-panel { width: calc(100vw - 24px); }
}

/* Phase 15 ("Organic Brand Visibility Intelligence Engine") - the Organic
   tab's hover-expand module cards, KPI strip, and full-screen modal
   workspace, ported from the approved standalone prototype's design into
   this plugin's existing light theme/component vocabulary (.ama-card,
   .ama-panel, .ama-pill, .ama-table) rather than the prototype's own dark
   theme, which was a design reference only. */

.ama-organic-custom-range { display: flex; align-items: flex-end; gap: 8px; }
/* Same `[hidden]` vs author-CSS specificity issue already solved for
   .ama-float-ask-panel above (see that rule's comment) - `display: flex`
   on this class would otherwise beat the browser's default
   `[hidden] { display: none }` UA rule and leave the custom date-range
   row visibly open even while its `hidden` attribute is true. */
.ama-organic-custom-range[hidden] { display: none; }

.ama-section-heading { margin: 28px 0 12px; }
.ama-section-heading h2 { margin: 0 0 4px; font-size: 16px; color: #111827; }
.ama-section-heading p.description { margin: 0; color: #6b7280; font-size: 13px; }

.ama-organic-kpi-strip {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.ama-organic-module-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
	align-items: start;
}

.ama-organic-module-card {
	position: relative;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	padding: 20px;
	cursor: pointer;
	transition: transform .42s cubic-bezier(.22,.85,.3,1.15), box-shadow .42s ease, border-color .4s ease;
	will-change: transform;
}
.ama-organic-module-card:hover,
.ama-organic-module-card:focus-visible {
	transform: translateY(-8px) scale(1.05);
	box-shadow: 0 25px 60px rgba(17, 24, 39, .16);
	border-color: #c7d2fe;
	outline: none;
	z-index: 30;
}
.ama-organic-module-card.is-gated:hover,
.ama-organic-module-card.is-gated:focus-visible { transform: translateY(-3px) scale(1); }

.ama-organic-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ama-organic-card-icon {
	width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
	font-size: 17px; flex-shrink: 0;
}

.ama-organic-module-card h3 { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 12px 0 0; }
.ama-organic-card-title-text { font-size: 15.5px; font-weight: 700; letter-spacing: -.1px; }
.ama-organic-card-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

.ama-organic-headline-number { font-size: 28px; font-weight: 800; margin-top: 14px; line-height: 1.15; }
.ama-organic-headline-caption { font-size: 12px; margin-top: 2px; }

.ama-organic-mini-stats { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.ama-organic-mini-stat-row {
	display: flex; justify-content: space-between; align-items: center; gap: 10px;
	font-size: 12.5px; padding-bottom: 7px; border-bottom: 1px dashed rgba(17, 24, 39, .1);
}
.ama-organic-mini-stat-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ama-organic-mini-stat-row b { font-weight: 700; flex-shrink: 0; }

.ama-organic-card-expand-hint { margin-top: 14px; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ama-organic-card-expand-hint::after { content: "→"; transition: transform .3s; }
.ama-organic-module-card:hover .ama-organic-card-expand-hint::after { transform: translateX(4px); }

.ama-organic-card-extra {
	max-height: 0; opacity: 0; overflow: hidden;
	transition: max-height .5s ease, opacity .4s ease .05s, margin-top .5s ease;
}
.ama-organic-module-card:hover .ama-organic-card-extra,
.ama-organic-module-card:focus-visible .ama-organic-card-extra { max-height: 140px; opacity: 1; margin-top: 14px; }
.ama-organic-mini-chart-box { width: 100%; height: 70px; }

.ama-organic-module-teaser { margin: 12px 0 0; font-size: 13px; line-height: 1.5; }

/* Full-screen modal workspace components (Phase 17.10) */
.ama-organic-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ama-organic-stat-card { border-radius: 12px; padding: 12px 14px; }
.ama-organic-stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.ama-organic-stat-value { font-size: 19px; font-weight: 800; margin-top: 6px; }

/* Phase 18 ("GEO Tracking") - comparison stat cards (headline value +
   period, a divider, then the previous period's value with an arrow and a
   hike/decline pill), matching the client-approved "Total Visitors" card
   design - richer than the plain .ama-organic-stat-row cards above, used
   only where a module actually shows a period-over-period comparison. */
.ama-organic-compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ama-organic-compare-card { border-radius: 14px; padding: 16px 18px; }
.ama-organic-compare-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.ama-organic-compare-value { font-size: 27px; font-weight: 800; margin-top: 8px; line-height: 1.15; }
.ama-organic-compare-period { font-size: 12px; margin-top: 2px; font-weight: 600; }
.ama-organic-compare-divider { height: 1px; margin: 14px 0; }
.ama-organic-compare-prev-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ama-organic-compare-prev-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.ama-organic-compare-prev-value { font-size: 14px; font-weight: 700; margin-top: 2px; }
.ama-organic-compare-arrow { font-size: 14px; font-weight: 600; }
.ama-organic-compare-delta { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }

.ama-organic-panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.ama-organic-panel-grid.thirds { grid-template-columns: repeat(3, 1fr); }
.ama-organic-panel { border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.ama-organic-panel:last-child { margin-bottom: 0; }
.ama-organic-panel-title { font-size: 13px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ama-organic-panel-title .hint { font-size: 10.5px; font-weight: 500; }
.ama-organic-chart-box { position: relative; width: 100%; height: 230px; }
.ama-organic-chart-box.short { height: 180px; }


.ama-organic-tag-pill { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-block; }

.ama-organic-gauge-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ama-organic-gauge-card { text-align: center; }
.ama-organic-gauge-box { width: 108px; height: 108px; margin: 0 auto; position: relative; }
.ama-organic-gauge-value { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14.5px; font-weight: 800; }
.ama-organic-gauge-label { font-size: 12px; margin-top: 8px; font-weight: 600; }
.ama-organic-gauge-status { font-size: 10.5px; margin-top: 2px; font-weight: 700; }

.ama-organic-region-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ama-organic-region-tile { border-radius: 12px; padding: 14px; }
.ama-organic-region-tile .r-name { font-weight: 700; font-size: 13px; }
.ama-organic-region-tile .r-value { font-size: 17px; font-weight: 800; margin-top: 8px; }
.ama-organic-region-tile .r-caption { font-size: 10.5px; margin-top: 2px; }

@media (max-width: 1280px) {
	.ama-organic-module-grid { grid-template-columns: repeat(2, 1fr); }
	.ama-organic-panel-grid, .ama-organic-panel-grid.thirds { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
	.ama-organic-module-grid { grid-template-columns: 1fr; }
	.ama-organic-gauge-row { grid-template-columns: 1fr; }
}

.ama-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .55);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
}
.ama-modal-overlay.visible { display: flex; }
.ama-modal-shell {
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 960px;
	max-height: 88vh;
	overflow-y: auto;
	padding: 24px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
/* Phase 26 (client design request - "freeze the header or top part inside
   the module... move Export CSV and Export PDF options at top freezed
   heading"). The header was already `position: sticky` before this phase,
   but in the dark "client" theme its background was almost fully
   transparent (rgba(255,255,255,.02)) - see the data-theme="client"
   override below - so scrolled body content (table rows, panel text) was
   still visible bleeding through behind the "frozen" title, which is what
   actually read as broken/not-frozen to the client. It's now a full-width,
   opaque bar (edge-to-edge via negative margin, matching the shell's own
   rounded top corners) that fully occludes whatever scrolls underneath,
   and also now holds the Export CSV/PDF buttons (see
   .ama-modal-header-actions) that used to live inside the scrolling body -
   see openOrganicModal()/reopenOrganicModalBody() in admin.js. */
.ama-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	position: sticky;
	top: -24px;
	z-index: 5;
	background: #fff;
	margin: -24px -24px 16px;
	padding: 18px 24px;
	border-radius: 12px 12px 0 0;
	border-bottom: 1px solid #e5e7eb;
}
.ama-modal-header-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ama-modal-header h2 { margin: 0; font-size: 18px; color: #111827; }
.ama-modal-header-subtitle { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; color: #6b7280; }
.ama-modal-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ama-modal-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ama-modal-header-actions .ama-btn { padding: 7px 12px; font-size: 12px; }
.ama-modal-close {
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 0 4px;
}
.ama-modal-close:hover { color: #111827; }
.ama-modal-body h3 { font-size: 14px; margin: 20px 0 8px; color: #111827; }
.ama-modal-body h3:first-child { margin-top: 0; }
.ama-modal-body ul, .ama-modal-body ol { margin: 0; padding-left: 20px; font-size: 13px; }
.ama-modal-body li { margin-bottom: 6px; }

/* Phase 25.2 (client feedback - "SWOT analysis looks too lengthy and font
   size is more... Recommdations area is also looks not good need reduce
   font size and make it decent"). The AI Growth Agent panel (#ama-organic-
   swot-panel, see renderOrganicSwotUI() in admin.js) renders directly in
   the Organic tab body, NOT inside .ama-modal-body, so it never picked up
   that block's smaller list font-size above - it was falling back to the
   browser/theme default, which read oversized next to every other panel
   on the tab. Scoped to this one panel only, so no other .ama-card/.ama-
   grid usage elsewhere in the plugin (e.g. Performance dashboard KPI
   cards) is affected. */
#ama-organic-swot-panel .ama-grid { gap: 12px; margin-bottom: 14px; }
#ama-organic-swot-panel .ama-card { padding: 14px 16px; }
#ama-organic-swot-panel .ama-card h3 { font-size: 12px; margin-bottom: 8px; }
#ama-organic-swot-panel .ama-card ul,
#ama-organic-swot-panel ol { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.5; }
#ama-organic-swot-panel .ama-card li,
#ama-organic-swot-panel ol li { margin-bottom: 6px; }
#ama-organic-swot-panel > h3 { font-size: 14px; margin: 16px 0 8px; }
#ama-organic-swot-panel ol li strong { font-size: 10.5px; }
#ama-organic-swot-panel .description { font-size: 12px; }

/* ==========================================================================
   "User Dashboard" client theme (Phase 16 - White-Label Client Dashboard).
   Applied via #ama-app[data-theme="client"], toggled in shell() (admin.js)
   from the SAME NAV.requiresManage flag that already separates the "user
   dashboard" tabs (Performance, Organic, AI Insights, Autonomous Actions,
   Reports, Campaign Planner, WhatsApp - everything a dashboard_user account
   can see) from admin/config-only tabs (Connectors, Settings, Logs, System
   Health, etc.), which intentionally keep the original light admin theme
   above untouched - those screens are where an agency admin sets up which
   backend tools/APIs power the dashboard, so they're allowed to name them.
   Design tokens ported from the approved organic-dashboard-prototype
   reference. Reuses every existing class name already in place (.ama-card,
   .ama-panel, .ama-table, .ama-btn, .ama-pill, .ama-mega-grid,
   .ama-organic-*, .ama-modal-*) - only the skin changes here, not markup,
   so one theme block covers every client tab without a rewrite.

   A handful of client-tab elements were built with literal inline
   `style="color:#6b7280"`-type light-theme colors (pre-dating this theme)
   instead of a class - those are neutralized below via `[style*="..."]`
   attribute overrides (with !important, since inline style otherwise always
   wins over any class selector) rather than hunting down and rewriting
   every occurrence in admin.js. */

#ama-app[data-theme="client"] {
	--ama-bg-0: #05070d;
	--ama-bg-1: #0a0f1c;
	--ama-bg-2: #0d1526;
	--ama-card: rgba(255, 255, 255, .045);
	--ama-card-strong: rgba(255, 255, 255, .07);
	--ama-card-border: rgba(255, 255, 255, .09);
	--ama-card-border-hover: rgba(129, 140, 248, .55);
	--ama-text-1: #f3f5fa;
	--ama-text-2: #a8b3c7;
	--ama-text-3: #6b7690;
	--ama-accent: #7c8cf8;
	--ama-accent-2: #a78bfa;
	--ama-accent-3: #38bdf8;
	--ama-good: #34d399;
	--ama-good-bg: rgba(52, 211, 153, .12);
	--ama-warn: #fbbf24;
	--ama-warn-bg: rgba(251, 191, 36, .12);
	--ama-bad: #fb7185;
	--ama-bad-bg: rgba(251, 113, 133, .12);

	background:
		radial-gradient(circle at 8% -10%, rgba(124, 140, 248, .16) 0%, transparent 42%),
		radial-gradient(circle at 96% 0%, rgba(167, 139, 250, .14) 0%, transparent 40%),
		radial-gradient(circle at 50% 120%, rgba(56, 189, 248, .08) 0%, transparent 55%),
		var(--ama-bg-0);
	border-radius: 20px;
	padding: 20px;
	color: var(--ama-text-1);
}

#ama-app[data-theme="client"] .ama-header {
	background: rgba(6, 9, 18, .82);
	border: 1px solid var(--ama-card-border);
}
#ama-app[data-theme="client"] .ama-header .ama-badge { background: linear-gradient(135deg, var(--ama-accent), var(--ama-accent-2)); }
#ama-app[data-theme="client"] .ama-account { color: var(--ama-text-2); }

#ama-app[data-theme="client"] .ama-tabs a { background: var(--ama-card-strong); color: var(--ama-text-2); border: 1px solid var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-tabs a:hover { background: rgba(124, 140, 248, .18); color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-tabs a.active { background: linear-gradient(135deg, var(--ama-accent), var(--ama-accent-2)); color: #fff; border-color: transparent; }

#ama-app[data-theme="client"] .ama-card,
#ama-app[data-theme="client"] .ama-panel,
#ama-app[data-theme="client"] .ama-organic-module-card {
	background: var(--ama-card);
	border: 1px solid var(--ama-card-border);
	color: var(--ama-text-1);
	border-radius: 18px;
	transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
#ama-app[data-theme="client"] .ama-card:hover,
#ama-app[data-theme="client"] .ama-organic-module-card:hover,
#ama-app[data-theme="client"] .ama-organic-module-card:focus-visible {
	border-color: var(--ama-card-border-hover);
	box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
	transform: translateY(-3px);
}
#ama-app[data-theme="client"] .ama-card h3,
#ama-app[data-theme="client"] .ama-panel p.description,
#ama-app[data-theme="client"] .ama-organic-module-teaser,
#ama-app[data-theme="client"] .ama-card .ama-metric-sub,
#ama-app[data-theme="client"] .ama-section-heading p.description { color: var(--ama-text-3); }
#ama-app[data-theme="client"] .ama-card .ama-metric,
#ama-app[data-theme="client"] .ama-panel h2,
#ama-app[data-theme="client"] .ama-organic-module-card h3,
#ama-app[data-theme="client"] .ama-section-heading h2 { color: var(--ama-text-1); }

#ama-app[data-theme="client"] .ama-table th { background: rgba(255, 255, 255, .04); color: var(--ama-text-3); border-bottom-color: var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-table td { color: var(--ama-text-2); border-bottom-color: var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-table tr:hover td { background: rgba(124, 140, 248, .06); color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-row-best td { background: rgba(52, 211, 153, .08) !important; }
#ama-app[data-theme="client"] .ama-row-worst td { background: rgba(251, 113, 133, .08) !important; }

#ama-app[data-theme="client"] .ama-btn { background: linear-gradient(135deg, var(--ama-accent), var(--ama-accent-2)); }
#ama-app[data-theme="client"] .ama-btn:hover { filter: brightness(1.1); }
#ama-app[data-theme="client"] .ama-btn.secondary { background: var(--ama-card-strong); color: var(--ama-text-1); border: 1px solid var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-btn.secondary:hover { background: rgba(124, 140, 248, .18); }
#ama-app[data-theme="client"] .ama-btn[disabled] { opacity: .5; }

#ama-app[data-theme="client"] .ama-pill-connected { background: var(--ama-good-bg); color: var(--ama-good); }
#ama-app[data-theme="client"] .ama-pill-disconnected { background: var(--ama-bad-bg); color: var(--ama-bad); }
#ama-app[data-theme="client"] .ama-pill-coming_soon { background: var(--ama-card-strong); color: var(--ama-text-3); }

#ama-app[data-theme="client"] .ama-field label { color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-field .desc { color: var(--ama-text-3); }
#ama-app[data-theme="client"] .ama-field input, #ama-app[data-theme="client"] .ama-field select, #ama-app[data-theme="client"] .ama-field textarea {
	background: var(--ama-card-strong); border-color: var(--ama-card-border); color: var(--ama-text-1);
}
#ama-app[data-theme="client"] select, #ama-app[data-theme="client"] input[type=date] {
	background: var(--ama-card-strong); border: 1px solid var(--ama-card-border); color: var(--ama-text-1);
}

#ama-app[data-theme="client"] .ama-empty { color: var(--ama-text-3); }

#ama-app[data-theme="client"] .ama-organic-kpi-strip .ama-card { padding: 16px 16px 14px; }

/* Colored top-accent cycling on KPI cards only - originally a lightweight
   stand-in for the prototype's per-module icon glyphs on the module grid
   too, but Phase 17.10 gave module cards their actual per-module icon
   badge (below), so the extra top-accent border on THOSE would now just
   look like visual noise on top of a real icon; the KPI strip (out of
   scope for the Phase 17.10 wireframe-exact pass) keeps this treatment. */
#ama-app[data-theme="client"] .ama-grid .ama-card,
#ama-app[data-theme="client"] .ama-organic-kpi-strip .ama-card {
	border-top: 3px solid var(--ama-accent);
}
#ama-app[data-theme="client"] .ama-grid .ama-card:nth-child(5n+2),
#ama-app[data-theme="client"] .ama-organic-kpi-strip .ama-card:nth-child(5n+2) { border-top-color: var(--ama-accent-3); }
#ama-app[data-theme="client"] .ama-grid .ama-card:nth-child(5n+3),
#ama-app[data-theme="client"] .ama-organic-kpi-strip .ama-card:nth-child(5n+3) { border-top-color: var(--ama-good); }
#ama-app[data-theme="client"] .ama-grid .ama-card:nth-child(5n+4),
#ama-app[data-theme="client"] .ama-organic-kpi-strip .ama-card:nth-child(5n+4) { border-top-color: var(--ama-accent-2); }
#ama-app[data-theme="client"] .ama-grid .ama-card:nth-child(5n+5),
#ama-app[data-theme="client"] .ama-organic-kpi-strip .ama-card:nth-child(5n+5) { border-top-color: var(--ama-warn); }

/* Phase 17.10 ("wireframe-exact" Organic module cards + modal workspace) -
   the block above (Phase 15) deliberately shipped a "lightweight stand-in"
   for the approved organic-dashboard-prototype's real card anatomy (icon
   badge, headline number, mini-stats, hover-expand sparkline) and modal
   workspace (stat-row/panel-grid/tab-bar/gauges/region-tiles) to ship
   faster. This block replaces the stand-in with the real thing, matching
   the prototype 1:1 using the same --ama-* tokens, scoped so no other
   tab's card/table/modal markup is touched. */
#ama-app[data-theme="client"] .ama-organic-module-card { border-top: 1px solid var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-organic-module-card.is-gated { opacity: .78; }

#ama-app[data-theme="client"] .ama-organic-card-icon {
	background: linear-gradient(135deg, rgba(124, 140, 248, .28), rgba(167, 139, 250, .22));
	border: 1px solid rgba(124, 140, 248, .3);
	color: var(--ama-text-1);
}
#ama-app[data-theme="client"] .ama-organic-card-title-text { color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-organic-card-tag,
#ama-app[data-theme="client"] .ama-organic-headline-caption,
#ama-app[data-theme="client"] .ama-organic-card-expand-hint,
#ama-app[data-theme="client"] .ama-organic-module-teaser { color: var(--ama-text-3); }
#ama-app[data-theme="client"] .ama-organic-headline-number { color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-organic-mini-stat-row { color: var(--ama-text-2); border-bottom-color: rgba(255, 255, 255, .08); }
#ama-app[data-theme="client"] .ama-organic-mini-stat-row b { color: var(--ama-text-1); }

#ama-app[data-theme="client"] .ama-organic-stat-card { background: var(--ama-card); border: 1px solid var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-organic-stat-label { color: var(--ama-text-3); }
#ama-app[data-theme="client"] .ama-organic-stat-value { color: var(--ama-text-1); }

#ama-app[data-theme="client"] .ama-organic-compare-card { background: var(--ama-card); border: 1px solid var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-organic-compare-label,
#ama-app[data-theme="client"] .ama-organic-compare-period,
#ama-app[data-theme="client"] .ama-organic-compare-prev-label,
#ama-app[data-theme="client"] .ama-organic-compare-arrow { color: var(--ama-text-3); }
#ama-app[data-theme="client"] .ama-organic-compare-value { color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-organic-compare-divider { background: var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-organic-compare-prev-value { color: var(--ama-text-2); }
#ama-app[data-theme="client"] .ama-organic-compare-delta.up { color: var(--ama-good); background: var(--ama-good-bg); }
#ama-app[data-theme="client"] .ama-organic-compare-delta.down { color: var(--ama-bad); background: var(--ama-bad-bg); }
#ama-app[data-theme="client"] .ama-organic-compare-delta.flat { color: var(--ama-text-3); background: rgba(255, 255, 255, .06); }

#ama-app[data-theme="client"] .ama-organic-panel { background: var(--ama-card); border: 1px solid var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-organic-panel-title { color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-organic-panel-title .hint { color: var(--ama-text-3); }


#ama-app[data-theme="client"] .ama-organic-tag-pill.pos { color: var(--ama-good); background: var(--ama-good-bg); }
#ama-app[data-theme="client"] .ama-organic-tag-pill.neg { color: var(--ama-bad); background: var(--ama-bad-bg); }
#ama-app[data-theme="client"] .ama-organic-tag-pill.neu { color: var(--ama-accent-3); background: rgba(56, 189, 248, .12); }
/* Phase 21 ("Search Intent Analysis") - 4th tag-pill color, for the
   "Commercial Investigation" intent badge (Transactional/Informational/
   Navigational reuse pos/neu above; General also reuses neu). */
#ama-app[data-theme="client"] .ama-organic-tag-pill.warn { color: var(--ama-warn); background: var(--ama-warn-bg); }

#ama-app[data-theme="client"] .ama-organic-gauge-label { color: var(--ama-text-2); }

#ama-app[data-theme="client"] .ama-organic-region-tile {
	background: linear-gradient(160deg, rgba(124, 140, 248, .18), rgba(124, 140, 248, .04));
	border: 1px solid var(--ama-card-border);
}
#ama-app[data-theme="client"] .ama-organic-region-tile .r-name,
#ama-app[data-theme="client"] .ama-organic-region-tile .r-value { color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-organic-region-tile .r-caption { color: var(--ama-text-3); }

/* Modal workspace */
#ama-app[data-theme="client"] .ama-modal-overlay { background: rgba(3, 5, 10, .86); }
#ama-app[data-theme="client"] .ama-modal-shell { background: var(--ama-bg-2); border: 1px solid var(--ama-card-border); color: var(--ama-text-1); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .65); }
/* Phase 26 - was rgba(255,255,255,.02) (near-transparent), which let
   scrolled body content show through the "frozen" header - see this
   phase's comment on .ama-modal-header above. Now opaque, matching the
   shell's own dark background so the sticky header actually reads as
   frozen. */
#ama-app[data-theme="client"] .ama-modal-header { background: var(--ama-bg-2); border-bottom-color: var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-modal-header h2 { color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-modal-header-subtitle { color: var(--ama-text-3); }
#ama-app[data-theme="client"] .ama-modal-close { background: var(--ama-card-strong); border: 1px solid var(--ama-card-border); color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-modal-close:hover { background: var(--ama-bad-bg); border-color: rgba(251, 113, 133, .5); color: var(--ama-bad); }
#ama-app[data-theme="client"] .ama-modal-body h3 { color: var(--ama-text-1); }

#ama-app[data-theme="client"] .ama-status-unknown { background: var(--ama-text-3); }

/* Floating "Ask AI Agent" widget */
#ama-app[data-theme="client"] .ama-float-ask-panel { background: var(--ama-bg-2); border: 1px solid var(--ama-card-border); color: var(--ama-text-1); }
#ama-app[data-theme="client"] .ama-float-chat-messages { background: rgba(255, 255, 255, .02) !important; }
#ama-app[data-theme="client"] .ama-float-chat-input-row { background: var(--ama-bg-2); border-top-color: var(--ama-card-border); }
#ama-app[data-theme="client"] .ama-float-chat-input-row textarea { background: var(--ama-card-strong); border-color: var(--ama-card-border); color: var(--ama-text-1); }

/* Inline AI recommendation badge */
#ama-app[data-theme="client"] .ama-ai-badge { background: rgba(124, 140, 248, .18) !important; color: var(--ama-accent) !important; }
#ama-app[data-theme="client"] .ama-ai-badge.severity-critical, #ama-app[data-theme="client"] .ama-ai-badge.severity-high { background: var(--ama-bad-bg) !important; color: var(--ama-bad) !important; }
#ama-app[data-theme="client"] .ama-ai-badge.severity-medium, #ama-app[data-theme="client"] .ama-ai-badge.severity-warning { background: var(--ama-warn-bg) !important; color: var(--ama-warn) !important; }

#ama-app[data-theme="client"] .ama-trend-crosshair { stroke: var(--ama-text-3); }
#ama-app[data-theme="client"] .ama-chart-tooltip { background: var(--ama-bg-2); border: 1px solid var(--ama-card-border); }

/* Neutralize the fixed set of literal light-theme inline colors used
   throughout the client-tab render functions (see block comment above) -
   every hex value here was found by auditing Performance/Organic/AI
   Insights/Autonomous Actions/Reports/Campaign Planner/WhatsApp's inline
   `style="..."` strings in admin.js. */
#ama-app[data-theme="client"] [style*="background:#fff"],
#ama-app[data-theme="client"] [style*="background: #fff"] { background: var(--ama-card-strong) !important; }
#ama-app[data-theme="client"] [style*="background:#fafafa"] { background: rgba(255, 255, 255, .02) !important; }
#ama-app[data-theme="client"] [style*="background:#f9fafb"] { background: rgba(255, 255, 255, .04) !important; }
#ama-app[data-theme="client"] [style*="background:#f3f4f6"] { background: var(--ama-card-strong) !important; }
#ama-app[data-theme="client"] [style*="background:#eef2ff"] { background: rgba(124, 140, 248, .18) !important; }
#ama-app[data-theme="client"] [style*="#e5e7eb"] { border-color: var(--ama-card-border) !important; }
#ama-app[data-theme="client"] [style*="#d1d5db"] { border-color: var(--ama-card-border) !important; }
#ama-app[data-theme="client"] [style*="color:#6b7280"] { color: var(--ama-text-3) !important; }
#ama-app[data-theme="client"] [style*="color:#9ca3af"] { color: var(--ama-text-3) !important; }
#ama-app[data-theme="client"] [style*="color:#111827"] { color: var(--ama-text-1) !important; }
#ama-app[data-theme="client"] [style*="color:#374151"] { color: var(--ama-text-2) !important; }
#ama-app[data-theme="client"] [style*="color:#3730a3"] { color: var(--ama-accent) !important; }

@media (max-width: 480px) {
	#ama-app[data-theme="client"] { border-radius: 0; padding: 14px; }
}

/* Nov 2026: post titles in the LinkedIn All Posts and Top Performing tables were dark blue on the dark
   background. Light, readable link colour - only links inside these two tables. */
#ama-linkedin-post-performance-table a,
#ama-linkedin-top-performing-table a,
#ama-linkedin-post-performance-table a:visited,
#ama-linkedin-top-performing-table a:visited { color: #a5b4fc; }
#ama-linkedin-post-performance-table a:hover,
#ama-linkedin-top-performing-table a:hover { color: #e0e7ff; }
