/*
 * Admin Pilot — Admin UI Styles
 * Modern, clean, sidebar-based layout
 */

/* ------------------------------------------------------------------
   PANEL ISOLATION
   Admin Pilot panel colors stay fixed and are never overridden by
   WordPress color presets or external admin styles.
   Use !important where needed to beat the dashboard-colors module,
   which applies var(--ap773-fc) and var(--ap773-primary) to the rest
   of the admin area.
------------------------------------------------------------------ */

/* Reset fonts and global colors inside the panel */
.ap773-page,
.ap773-page * {
	font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
	font-size: revert !important;          /* reset theme-driven font-size */
}

/* Fixed text colors — never use var(--ap773-fc) here */
.ap773-page,
.ap773-page p,
.ap773-page li,
.ap773-page td,
.ap773-page th,
.ap773-page label,
.ap773-page span,
.ap773-page div {
	color: revert;   /* reset to the component's natural color */
}

/* Links inside the panel — fixed color, not var(--ap773-primary) */
.ap773-page a {
	color: #6366f1 !important;
}
.ap773-page a:hover {
	color: #4f46e5 !important;
	text-decoration: none !important;
}

/* Buttons — always keep readable text regardless of the theme */
.ap773-btn--primary,
.ap773-btn--primary:hover,
.ap773-btn--primary:focus,
.ap773-btn--primary:visited {
	color: var(--ap773-btn-text, #ffffff) !important;
	background: #6366f1 !important;
}
.ap773-btn--secondary {
	color: #475569 !important;
	background: #f1f5f9 !important;
}
.ap773-btn--secondary:hover {
	color: #1e293b !important;
	background: #e2e8f0 !important;
}
.ap773-btn--danger {
	color: #dc2626 !important;
	background: #fee2e2 !important;
}
.ap773-btn--danger:hover {
	color: #b91c1c !important;
	background: #fecaca !important;
}

/* Cards — always keep a white background */
.ap773-page .ap773-card {
	background: #ffffff !important;
	border-color: #e8edf3 !important;
}

/* Section titles — always dark */
.ap773-page .ap773-section-title { color: #0f172a !important; }
.ap773-page .ap773-section-desc  { color: #64748b !important; }
.ap773-page .ap773-card-title    { color: #0f172a !important; }
.ap773-page .ap773-label         { color: #334155 !important; }
.ap773-page .ap773-desc          { color: #94a3b8 !important; }

/* Inputs — fixed background and text colors */
.ap773-page .ap773-input,
.ap773-page .ap773-select {
	background: #ffffff !important;
	border-color: #e2e8f0 !important;
	color: #1e293b !important;
}

/* Tab nav item */
.ap773-page .ap773-nav-item {
	color: rgba(255,255,255,0.55) !important;
}
.ap773-page .ap773-nav-item:hover {
	color: rgba(255,255,255,0.9) !important;
}
.ap773-page .ap773-nav-item.is-active {
	color: #a5b4fc !important;
}

/* Notices inside the panel */
.ap773-page .ap773-notice--success { color: #15803d !important; }
.ap773-page .ap773-notice--error   { color: #dc2626 !important; }

/* Toggle label */
.ap773-page .ap773-toggle-label    { color: #334155 !important; }
.ap773-page .ap773-checkbox-item   { color: #334155 !important; }
.ap773-page .ap773-role-badge      { color: #6366f1 !important; }

/* ------------------------------------------------------------------
   Reset & base inside our page
------------------------------------------------------------------ */
.ap773-page *,
.ap773-page *::before,
.ap773-page *::after {
	box-sizing: border-box;
}

/* Hide ALL external notices on our pages */
.toplevel_page_pnlrdb-settings .notice,
.toplevel_page_pnlrdb-settings .updated,
.toplevel_page_pnlrdb-settings .update-nag,
.toplevel_page_pnlrdb-settings .error,
.toplevel_page_pnlrdb-settings div.error,
.toplevel_page_pnlrdb-settings div.updated,
.toplevel_page_pnlrdb-settings #update-nag,
.toplevel_page_pnlrdb-settings .update-message {
	display: none !important;
}

/* ------------------------------------------------------------------
   Page layout
------------------------------------------------------------------ */
.ap773-page {
	display: flex;
	align-items: stretch;
	/* Eat WP's padding on #wpcontent (top:10px, right:20px) and .wrap margin */
	margin: -20px -20px 0 -20px;
	/* Fill full height below adminbar (32px) */
	min-height: calc(100vh - 32px);
	font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	background: #f0f2f7;
}

/* ------------------------------------------------------------------
   Sidebar
------------------------------------------------------------------ */
.ap773-sidebar {
	width: 230px;
	flex-shrink: 0;
	background: #0f1117;
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow-y: auto;
}

.ap773-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 24px 20px 20px;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.01em;
	border-bottom: 1px solid rgba(255,255,255,0.07);
}

.ap773-logo svg {
	color: #6366f1;
	flex-shrink: 0;
}

/* Sidebar brand and promo area must stay white regardless of plugin palettes */
.ap773-sidebar .ap773-logo,
.ap773-sidebar .ap773-logo span,
.ap773-sidebar .ap773-logo strong,
.ap773-sidebar .ap773-logo b,
.ap773-sidebar .ap773-logo svg {
	color: #ffffff !important;
	fill: none;
}

.ap773-sidebar .ap773-pro-banner,
.ap773-sidebar .ap773-pro-banner * {
	color: #ffffff !important;
}

.ap773-sidebar .ap773-pro-banner-title,
.ap773-sidebar .ap773-pro-banner-text,
.ap773-sidebar .ap773-pro-banner-badge {
	color: #ffffff !important;
}

.ap773-sidebar .ap773-pro-banner-btn,
.ap773-sidebar .ap773-pro-banner-btn:link,
.ap773-sidebar .ap773-pro-banner-btn:visited,
.ap773-sidebar .ap773-pro-banner-btn:hover,
.ap773-sidebar .ap773-pro-banner-btn:focus,
.ap773-sidebar .ap773-pro-banner-btn:active {
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff !important;
	text-decoration: none !important;
}

/* Nav */
.ap773-nav {
	padding: 12px 10px;
	flex: 1;
}

.ap773-nav-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 8px;
	color: rgba(255,255,255,0.55);
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 500;
	transition: background 0.15s, color 0.15s;
	margin-bottom: 2px;
}

.ap773-nav-item:hover {
	background: rgba(255,255,255,0.07);
	color: rgba(255,255,255,0.9);
	text-decoration: none;
}

.ap773-nav-item.is-active {
	background: rgba(99,102,241,0.2);
	color: #a5b4fc;
}

.ap773-nav-icon {
	font-size: 15px;
	width: 20px;
	text-align: center;
	flex-shrink: 0;
	line-height: 1;
}

/* Pro banner */
.ap773-pro-banner {
	margin: 10px;
	padding: 16px;
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
	border-radius: 12px;
	border: 1px solid rgba(99,102,241,0.3);
}

.ap773-pro-banner-badge {
	display: inline-block;
	background: #6366f1;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 2px 8px;
	border-radius: 20px;
	margin-bottom: 8px;
}

.ap773-pro-banner-title {
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 4px;
}

.ap773-pro-banner-text {
	color: rgba(255,255,255,0.6);
	font-size: 12px;
	line-height: 1.5;
	margin: 0 0 12px;
}

.ap773-pro-banner-btn {
	display: block;
	background: #6366f1;
	color: #fff !important;
	text-align: center;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background 0.15s, transform 0.1s;
}

.ap773-pro-banner-btn:hover {
	background: #4f46e5;
	transform: translateY(-1px);
}

/* Sidebar footer */
.ap773-sidebar-footer {
	padding: 12px 20px;
	border-top: 1px solid rgba(255,255,255,0.07);
	color: rgba(255,255,255,0.3);
	font-size: 11px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ap773-pro-pill {
	background: #6366f1;
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.06em;
	padding: 1px 6px;
	border-radius: 20px;
}

/* ------------------------------------------------------------------
   Main content area
------------------------------------------------------------------ */
.ap773-main {
	flex: 1;
	min-width: 0;
	padding: 32px;
}

.ap773-main-inner {
	max-width: 780px;
}

/* ------------------------------------------------------------------
   Notice
------------------------------------------------------------------ */
.ap773-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 500;
	margin-bottom: 24px;
}

.ap773-notice--success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.ap773-notice--error {
	background: #fef2f2;
	color: #dc2626;
	border: 1px solid #fecaca;
}

/* ------------------------------------------------------------------
   Section headers
------------------------------------------------------------------ */
.ap773-section-title {
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 4px;
	letter-spacing: -0.02em;
}

.ap773-section-desc {
	font-size: 13.5px;
	color: #64748b;
	margin: 0 0 28px;
	line-height: 1.6;
}

/* ------------------------------------------------------------------
   Cards
------------------------------------------------------------------ */
.ap773-card {
	background: #fff;
	border-radius: 14px;
	border: 1px solid #e8edf3;
	padding: 24px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ap773-card-title {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ap773-card-title svg {
	color: #6366f1;
}

/* ------------------------------------------------------------------
   Form fields
------------------------------------------------------------------ */
.ap773-field {
	margin-bottom: 20px;
}

.ap773-field:last-child {
	margin-bottom: 0;
}

.ap773-field-row {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 16px;
	align-items: start;
	padding: 14px 0;
	border-bottom: 1px solid #f8fafc;
}

.ap773-field-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.ap773-label {
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	padding-top: 8px;
}

.ap773-desc {
	font-size: 12px;
	color: #94a3b8;
	margin-top: 4px;
	line-height: 1.5;
}

.ap773-input {
	width: 100%;
	max-width: 340px;
	padding: 8px 12px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	font-size: 13.5px;
	color: #1e293b;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	font-family: inherit;
}

.ap773-input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.ap773-input--sm {
	max-width: 120px;
}

.ap773-select {
	width: 100%;
	max-width: 340px;
	padding: 8px 12px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	font-size: 13.5px;
	color: #1e293b;
	background: #fff;
	cursor: pointer;
	font-family: inherit;
}

.ap773-select:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* Toggle switch */
.ap773-toggle-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ap773-toggle {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
}

.ap773-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.ap773-toggle-slider {
	position: absolute;
	inset: 0;
	background: #e2e8f0;
	border-radius: 22px;
	cursor: pointer;
	transition: background 0.2s;
}

.ap773-toggle-slider::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	top: 3px;
	left: 3px;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ap773-toggle input:checked + .ap773-toggle-slider {
	background: #6366f1;
}

.ap773-toggle input:checked + .ap773-toggle-slider::after {
	transform: translateX(18px);
}

.ap773-toggle-label {
	font-size: 13.5px;
	color: #334155;
	cursor: pointer;
}

/* Checkbox group */
.ap773-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ap773-checkbox-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: #334155;
	cursor: pointer;
}

.ap773-checkbox-item input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: #6366f1;
	cursor: pointer;
	flex-shrink: 0;
}

/* ------------------------------------------------------------------
   Color swatches
------------------------------------------------------------------ */
.ap773-color-field {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* ------------------------------------------------------------------
   Table (menu rename, logs)
------------------------------------------------------------------ */
.ap773-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.ap773-table thead th {
	text-align: left;
	padding: 10px 14px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	background: #f8fafc;
	border-bottom: 1px solid #e8edf3;
}

.ap773-table thead th:first-child { border-radius: 8px 0 0 0; }
.ap773-table thead th:last-child  { border-radius: 0 8px 0 0; }

.ap773-table tbody tr {
	border-bottom: 1px solid #f1f5f9;
	transition: background 0.1s;
}

.ap773-table tbody tr:last-child { border-bottom: none; }
.ap773-table tbody tr:hover { background: #fafbff; }

.ap773-table tbody td {
	padding: 10px 14px;
	color: #334155;
	vertical-align: middle;
}

.ap773-table .ap773-slug {
	font-size: 11px;
	color: #94a3b8;
	font-family: monospace;
}

/* ------------------------------------------------------------------
   Role cards
------------------------------------------------------------------ */
.ap773-role-card {
	background: #fff;
	border: 1px solid #e8edf3;
	border-radius: 12px;
	padding: 18px 20px;
	margin-bottom: 12px;
}

.ap773-role-card-title {
	font-size: 13.5px;
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ap773-role-badge {
	font-size: 10px;
	color: #6366f1;
	background: #eef2ff;
	padding: 1px 7px;
	border-radius: 20px;
	font-weight: 600;
	font-family: monospace;
}

.ap773-menu-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 6px;
}

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------ */
.ap773-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.15s;
	font-family: inherit;
	text-decoration: none;
}

.ap773-btn--primary {
	background: #6366f1;
	color: #fff;
}

.ap773-btn--primary:hover {
	background: #4f46e5;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.ap773-btn--secondary {
	background: #f1f5f9;
	color: #475569;
	border: 1px solid #e2e8f0;
}

.ap773-btn--secondary:hover {
	background: #e2e8f0;
	color: #1e293b;
}

.ap773-btn--danger {
	background: #fee2e2;
	color: #dc2626;
}

.ap773-btn--danger:hover {
	background: #fecaca;
}

/* Form footer */
.ap773-form-footer {
	padding: 20px 0 0;
	border-top: 1px solid #f1f5f9;
	margin-top: 8px;
}

/* ------------------------------------------------------------------
   Warning banner (maintenance active)
------------------------------------------------------------------ */
.ap773-warning-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	color: #92400e;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 20px;
}

/* ------------------------------------------------------------------
   Empty state (logs)
------------------------------------------------------------------ */
.ap773-empty {
	text-align: center;
	padding: 48px 24px;
	color: #94a3b8;
}

.ap773-empty svg {
	margin-bottom: 12px;
	opacity: 0.4;
}

.ap773-empty p {
	font-size: 14px;
	margin: 0;
}

/* ------------------------------------------------------------------
   Responsive tweaks
------------------------------------------------------------------ */
@media screen and (max-width: 960px) {
	.ap773-page { flex-direction: column; }
	.ap773-sidebar { width: 100%; height: auto; position: static; }
	.ap773-nav { display: flex; flex-wrap: wrap; }
	.ap773-main { padding: 20px; }
	.ap773-field-row { grid-template-columns: 1fr; }
}

/* ========================================
   ADMIN PILOT SIDEBAR — COLOR LOCK
   ======================================== */

/* Title Admin Pilot */
.adminpilot-sidebar .adminpilot-logo,
.adminpilot-sidebar .adminpilot-logo *,
.adminpilot-sidebar .adminpilot-title {
    color: #ffffff !important;
}

/* Menu items */
.adminpilot-sidebar,
.adminpilot-sidebar a,
.adminpilot-sidebar li,
.adminpilot-sidebar span {
    color: #ffffff !important;
}

/* PRO BOX */
.adminpilot-sidebar .adminpilot-pro-box,
.adminpilot-sidebar .adminpilot-pro-box * {
    color: #ffffff !important;
}

/* PRO BUTTON */
.adminpilot-sidebar .adminpilot-pro-box .button,
.adminpilot-sidebar .adminpilot-pro-box .button-primary,
.adminpilot-sidebar .adminpilot-pro-box .button-secondary {
    color: #ffffff !important;
}

/* Hover and states */
.adminpilot-sidebar a:hover,
.adminpilot-sidebar a:focus {
    color: #ffffff !important;
}

/* PRO BANNER BUTTON DISABLED */
.ap773-pro-banner-btn-disabled {
	display: block;
	background: #dc2626;
	color: #ffffff !important;
	text-align: center;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none !important;
	cursor: default;
	opacity: 1;
	pointer-events: none;
}

.ap773-pro-banner-btn-disabled:hover {
	background: #dc2626;
	transform: none;
}