/**
 * Dropleather for WooCommerce — Admin Styles
 */

/* Typography — Geist for headings, Inter for body. Variable fonts BUNDLED
 * locally (assets/fonts/) rather than loaded from Google/Vercel CDNs:
 * remote font embedding is a GDPR liability (LG München, Google-Fonts
 * ruling) and WP.org guidelines discourage calling home. Latin subsets,
 * ~30-48 KB each, font-display swap so text never blocks. Scoped to
 * .dropleather-wrap so the rest of wp-admin is untouched. */
@font-face {
	font-family: 'Geist';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/geist-latin.woff2') format('woff2');
}

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/inter-latin.woff2') format('woff2');
}

.dropleather-wrap,
.dropleather-wrap p,
.dropleather-wrap td,
.dropleather-wrap th,
.dropleather-wrap input,
.dropleather-wrap button,
.dropleather-wrap select,
.dropleather-wrap label {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dropleather-wrap h1,
.dropleather-wrap h2,
.dropleather-wrap h3,
.dropleather-wrap h4,
.dropleather-wrap .dropleather-stat-value,
.dropleather-wrap .dropleather-hero-title {
	font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Layout
 *
 * Full-width admin pages. WordPress core already supplies the correct gutters
 * for admin screens (#wpcontent has padding-left:20px, .wrap has its own
 * margin), and WooCommerce's own settings/status screens leave .wrap
 * unconstrained — so dropping the max-width is all that's needed to go
 * edge-to-edge while respecting native admin padding. We deliberately do NOT
 * add custom margin/padding here, which would double up on core's gutters. */
.dropleather-wrap {
	max-width: none;
}

.dropleather-page-title {
	font-size: 24px;
	font-weight: 600;
	margin-bottom: 12px;
	line-height: 1;
}

/* The logo header (h1.dropleather-page-title) was removed from the settings,
 * status, and support templates as part of the redesign. templates/dashboard.php
 * is owned by another agent and still renders this h1 + logo — hide the logo
 * here so the look stays consistent until that h1 line is removed by hand.
 * (See report: dashboard.php h1 should be deleted manually later.) */
.dropleather-page-title .dropleather-logo {
	display: none;
}

.dropleather-nav {
	margin-bottom: 20px;
}

/* Cards */
.dropleather-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px 24px;
	margin-bottom: 16px;
}

.dropleather-card h2 {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 12px;
}

.dropleather-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.dropleather-card-header h2 {
	margin: 0;
}

.dropleather-card-actions {
	display: flex;
	gap: 8px;
}

/* Stats Grid */
.dropleather-stats-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 16px;
}

.dropleather-stat-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px;
	text-align: center;
}

.dropleather-stat-label {
	display: block;
	font-size: 12px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.dropleather-stat-value {
	display: block;
	font-size: 28px;
	font-weight: 700;
	color: #1d2327;
}

.dropleather-profit-card {
	text-align: center;
	margin-bottom: 16px;
}

.dropleather-profit-value {
	color: #16a34a;
}

/* Status dots */
.dropleather-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.dropleather-dot--ok {
	background: #16a34a;
}

.dropleather-dot--error {
	background: #dc2626;
}

.dropleather-dot--warn {
	background: #f59e0b;
}

.dropleather-dot--muted {
	background: #9ca3af;
}

/* Status badges */
.dropleather-status {
	display: inline-block;
	font-size: 12px;
	font-weight: 500;
	padding: 2px 10px;
	/* Full capsule (Upwork air3-token convention) — applies to sync badges
	   (Success stays green), lifecycle badges and connection pills alike. */
	border-radius: 10rem;
}

.dropleather-status--connected {
	background: #dcfce7;
	color: #16a34a;
}

.dropleather-status--processing {
	background: #dbeafe;
	color: #2563eb;
}

.dropleather-status--shipped {
	background: #f3e8ff;
	color: #7c3aed;
}

.dropleather-status--delivered {
	background: #dcfce7;
	color: #16a34a;
}

.dropleather-status--unpaid,
.dropleather-status--overdue {
	background: #fef3c7;
	color: #d97706;
}

.dropleather-status--expired {
	background: #fee2e2;
	color: #dc2626;
}

/* Per-order Dropleather sync-status badges (dashboard orders table) */
.dropleather-status--synced {
	background: #dcfce7;
	color: #16a34a;
}

.dropleather-status--pending {
	background: #fef3c7;
	color: #d97706;
}

.dropleather-status--failed {
	background: #fee2e2;
	color: #dc2626;
}

.dropleather-status--not-eligible {
	background: #f3f4f6;
	color: #6b7280;
}

/* Failure / not-eligible reason (truncated, full text in title attr) */
.dropleather-reason {
	color: #6b7280;
	font-size: 12px;
}

.dropleather-reason-empty {
	color: #9ca3af;
}

.dropleather-retry-error {
	display: block;
	margin-top: 4px;
	color: #dc2626;
	font-size: 12px;
}

/* Tables */
.dropleather-orders-table th,
.dropleather-orders-table td {
	padding: 10px 12px;
	vertical-align: middle;
}

/* Status page — one wide Name | Description | Status table */
.dropleather-status-table th,
.dropleather-status-table td {
	padding: 10px 12px;
	vertical-align: middle;
}

.dropleather-status-name {
	font-weight: 500;
	width: 220px;
}

.dropleather-status-desc {
	color: #50575e;
}

.dropleather-status-state {
	width: 220px;
}

/* Coloured dot + status word (templates/partials/status-cell.php) */
.dropleather-status-cell {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.dropleather-status-word {
	color: #1d2327;
}

/* Log entries */
.dropleather-log-container {
	max-height: 400px;
	overflow-y: auto;
	border: 1px solid #eee;
	border-radius: 4px;
}

.dropleather-log-table {
	border: 0;
}

.dropleather-log-time {
	width: 160px;
	font-size: 12px;
	color: #888;
	font-family: monospace;
}

.dropleather-log-level {
	width: 70px;
}

.dropleather-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 3px;
	text-transform: uppercase;
}

.dropleather-badge--error {
	background: #fee2e2;
	color: #dc2626;
}

.dropleather-badge--warning {
	background: #fef3c7;
	color: #d97706;
}

.dropleather-badge--info {
	background: #dbeafe;
	color: #2563eb;
}

.dropleather-log-context {
	color: #888;
	font-family: monospace;
	font-size: 11px;
}

.dropleather-count {
	font-size: 12px;
	font-weight: 400;
	color: #888;
	margin-left: 4px;
}

/* Connect hero (not-connected state)
 *
 * Centered onboarding screen: the hero fills the available admin content area
 * and centers its content both vertically and horizontally, so the not-yet-
 * connected store sees a focused "Connect to Dropleather" prompt rather than a
 * top-of-page fragment. Shown on every Dropleather admin page until connected
 * (Dashboard, Settings, Status, Support) via templates/partials/connect-hero.php. */
.dropleather-hero {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 65vh;
	padding: 48px 20px;
}

.dropleather-hero-inner {
	max-width: 480px;
	width: 100%;
	text-align: center;
}

/* Beat wp-admin core's `.wrap h1 { font-size: 23px }` (class+element = higher
   specificity than a lone class) — qualify with the wrap + element. */
.dropleather-wrap h1.dropleather-hero-title {
	font-size: 36px;
	font-weight: 500;
	margin: 0 0 20px;
	color: #1d2327;
}

.dropleather-hero-logo {
	display: block;
	height: 56px;
	width: auto;
	max-width: 100%;
	margin: 0 auto 20px;
}

.dropleather-hero-text {
	font-size: 13px;
	color: #50575e;
	margin: 0 0 24px;
	line-height: 1.6;
}

.dropleather-hero-cta {
	margin-bottom: 8px;
}

/* Hide the CTA button once the token form has been revealed. */
#dropleather-reveal-connect.is-revealed {
	display: none;
}

/* Reveal panel — collapsed by default; [hidden] removes it from layout + a11y
   tree. settings.js animates max-height/opacity for a smooth reveal and clears
   the inline max-height afterwards so the panel can grow with inline messages. */
.dropleather-connect-reveal {
	text-align: left;
	margin: 16px auto 0;
	max-width: 400px;
}

.dropleather-connect-reveal.is-animating {
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* Connect form */
/* Revealed block: steps + form share ONE left edge. The <ol> indents its
   TEXT past the 1. 2. 3. markers by its padding-left; the form gets the
   same indent so "API Token" + the input align with the step TEXT (not
   with the numbers). */
.dropleather-connect-reveal {
	max-width: 420px;
	margin: 0 auto;
	text-align: left;
}

.dropleather-steps {
	margin: 0 0 16px;
	padding-left: 22px; /* room for the list markers */
}

.dropleather-connect-form {
	max-width: 400px;
	margin: 0 0 0 22px; /* same indent as the steps' text edge */
	text-align: left;
}

.dropleather-connect-form .dropleather-field label {
	text-align: left;
}

.dropleather-field {
	margin-bottom: 16px;
}

.dropleather-field label {
	display: block;
	font-weight: 500;
	margin-bottom: 4px;
}

.dropleather-message {
	margin-top: 8px;
}

.dropleather-message.success {
	color: #16a34a;
}

.dropleather-message.error {
	color: #dc2626;
}

/* Empty state */
.dropleather-empty {
	text-align: center;
	color: #888;
	padding: 24px;
}

/* Connection table */
.dropleather-connection-table th {
	width: 120px;
	font-weight: 500;
}

/* Responsive */
@media (max-width: 782px) {
	.dropleather-stats-grid {
		grid-template-columns: 1fr;
	}

	.dropleather-card-header {
		flex-direction: column;
		gap: 8px;
		align-items: flex-start;
	}
}

/* === dashboard orders table v2 === */

/* Order-lifecycle badges (Status column). Reuse the .dropleather-status base
   (inline-block pill) and add per-state colours. Greens/ambers/reds chosen to
   match the existing badge palette above. */
.dropleather-lifecycle--unpaid {
	background: #f3f4f6;
	color: #6b7280;
}

.dropleather-lifecycle--processing {
	background: #dbeafe;
	color: #2563eb;
}

.dropleather-lifecycle--shipped {
	background: #ccfbf1;
	color: #0f766e;
}

.dropleather-lifecycle--delivered {
	background: #dcfce7;
	color: #16a34a;
}

.dropleather-lifecycle--overdue {
	background: #fef3c7;
	color: #d97706;
}

.dropleather-lifecycle--expired,
.dropleather-lifecycle--returned {
	background: #fee2e2;
	color: #dc2626;
}

.dropleather-lifecycle--unknown {
	background: #f3f4f6;
	color: #6b7280;
}

/* Total column */
.dropleather-total-cell {
	white-space: nowrap;
}

/* Tracking chip — Upwork air3-token spec: full capsule (radius 10rem),
   bg #f3f5f7, text #1a1a1a, 24px tall, 0 12px padding, 14px font. */
.dropleather-tracking-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 24px;
	max-height: 24px;
	padding: 0 6px 0 12px;
	border: 0;
	border-radius: 10rem;
	background: #f3f5f7;
	max-width: 100%;
}

.dropleather-tracking-num {
	font-size: 14px;
	line-height: 1;
	color: #1a1a1a;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Empty tracking state — "Unfulfilled", muted plain text. */
.dropleather-unfulfilled {
	color: #818b97;
	font-size: 13px;
}

a.dropleather-tracking-num:hover {
	text-decoration: underline;
}

.dropleather-copy-tracking {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: 0;
	background: transparent;
	padding: 2px;
	cursor: pointer;
	color: #646970;
	line-height: 1;
	border-radius: 3px;
}

.dropleather-copy-tracking:hover,
.dropleather-copy-tracking:focus {
	color: #135e96;
	background: #fff;
}

.dropleather-copy-tracking .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.dropleather-copy-tracking.is-copied {
	color: #16a34a;
}

.dropleather-copy-feedback {
	font-size: 11px;
	font-weight: 500;
	color: #16a34a;
}

.dropleather-copy-feedback[aria-hidden='true'] {
	display: none;
}

/* Action column — keep the Open + Retry buttons on one tidy row */
.dropleather-action-cell {
	white-space: nowrap;
}

.dropleather-action-cell .button {
	margin-right: 4px;
}

/* Plain blue text link (no button box, no icon) — by request. Inherits
   wp-admin's link blue; nowrap keeps it on one line in the action cell. */
.dropleather-open-app {
	text-decoration: none;
	white-space: nowrap;
	margin-right: 8px;
}
.dropleather-open-app:hover {
	text-decoration: underline;
}

/* === disabled nav tabs (pre-connection) === */
/* Settings/Status/Support are inert until the store is connected — visible
   so the seller knows they exist, but clearly not clickable. */
.dropleather-nav-tab--disabled {
	opacity: 0.45;
	cursor: not-allowed;
	user-select: none;
}
