/**
 * NazTools front-end staff pages — Check-In and Roster shortcodes.
 *
 * The previous admin-page surfaces relied on wp-admin's .wrap and
 * .widefat styles. On the front-end those classes don't exist (or
 * the theme overrides them inconsistently), so this file ships a
 * self-contained look for tables, buttons, and headers.
 *
 * Scoped to .naztools-staff so the rules can't leak into the rest
 * of the theme's content area.
 */

.naztools-staff {
	/* Brand palette aligned with Astra's global color palette
	 * (Customize → Global → Colors). Source-of-truth values live in
	 * the `astra-settings` option's global-color-palette[]:
	 *   color-0 #3AA6B9 teal       — site primary, matches logo
	 *   color-1 #4b3f82 purple     — secondary
	 *   color-2 #09406c deep navy  — accent
	 *   color-3 #454F5E dark slate — text
	 *   color-6 #CAE6E8 light teal — section tint
	 *   color-7 #181823 near-black
	 * Earlier versions of this file matched the etndi-directory plugin's
	 * own --etndi-* tokens, which use a different blue palette and don't
	 * line up with Astra's theme. The user wants staff surfaces to match
	 * the actual site theme (logo + nav + footer all use teal/deep-navy),
	 * so map to Astra's palette. */
	--nt-teal:          #3AA6B9;  /* primary brand */
	--nt-navy:          #09406c;  /* accent, headers, primary buttons */
	--nt-accent:        #09406c;
	--nt-accent-light:  #3AA6B9;  /* hover / secondary accent */
	--nt-accent-soft:   #CAE6E8;  /* table-head tint, soft button bg */
	--nt-accent-strong: #09406c;

	/* Text shades — Astra's color-3 + neutral derivatives so text reads
	 * the same as the surrounding theme. */
	--nt-text-strong:   #181823;
	--nt-text-body:     #454F5E;
	--nt-text-muted:    #6b7280;
	--nt-text-light:    #9ca3af;

	/* Surface */
	--nt-bg:            #ffffff;
	--nt-section-bg:    #ebf8fa;  /* matches Astra color-4 alpha-flattened */
	--nt-section-bg-2:  #CAE6E8;
	--nt-row-zebra:     #f7fbfc;
	--nt-row-hover:     #e3f2f4;

	/* Rules — derived from teal at lower saturation so they read on white
	 * tables but blend with the section tints. --nt-rule is the visible
	 * border for tables, cards, button outlines; --nt-rule-light is for
	 * subtle inner separators (pill backgrounds, inactive-row tints). */
	--nt-rule:          #9fc7cd;
	--nt-rule-light:    #d6e7e9;

	/* Status — functional, kept distinct from brand */
	--nt-success:       #38a169;
	--nt-success-soft:  #d1f5e0;
	--nt-warning:       #d4a017;
	--nt-warning-soft:  #fffbe6;
	--nt-error:         #b32d2e;
	--nt-error-soft:    #fcf0f1;

	max-width: 1200px;
	margin: 0 auto;
	padding: 0 0 32px;
	color: var(--nt-text-strong);
	font-size: 15px;
	line-height: 1.5;
}

.naztools-staff-header {
	margin: 0 0 18px 0;
	padding: 14px 18px 12px;
	background: var(--nt-section-bg);
	border: 1px solid var(--nt-rule);
	border-radius: 6px;
}
.naztools-staff-header h1 {
	margin: 0 0 4px 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--nt-accent-strong);
}
.naztools-staff-header p {
	margin: 0;
	color: var(--nt-text-body);
	font-size: 14px;
}

.naztools-staff-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.naztools-staff-section {
	margin: 0 0 22px 0;
	padding: 14px 16px 16px;
	background: var(--nt-section-bg);
	border: 1px solid var(--nt-rule);
	border-radius: 8px;
}
.naztools-staff-section h2 {
	margin: 0 0 10px 0;
	padding-bottom: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--nt-accent-strong);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-bottom: 1px solid var(--nt-rule);
}

/* ----- buttons ----- */
.naztools-staff-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 38px;
	padding: 7px 14px;
	font-size: 14px;
	font-weight: 500;
	color: var(--nt-text-strong);
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--nt-rule);
	border-radius: 4px;
	cursor: pointer;
	line-height: 1.2;
	box-sizing: border-box;
}
.naztools-staff-btn:hover {
	background: var(--nt-section-bg);
	color: var(--nt-text-strong);
	border-color: var(--nt-text-muted);
}
.naztools-staff-btn-primary {
	background: var(--nt-accent);
	border-color: var(--nt-accent);
	color: #fff;
}
.naztools-staff-btn-primary:hover {
	background: var(--nt-accent-strong);
	border-color: var(--nt-accent-strong);
	color: #fff;
}
.naztools-staff-btn-small {
	min-height: 30px;
	padding: 4px 10px;
	font-size: 13px;
}

/* ----- tables -----
 * Safari/WebKit drops outer borders when border-collapse: collapse is
 * combined with border-radius + overflow: hidden — the rounded clipping
 * region eats the merged borders. Drop both from the table itself so
 * borders draw consistently across all browsers; the surrounding
 * .naztools-staff-section card already provides the rounded outer
 * appearance, so square table edges read as a clean nested element.
 */
.naztools-staff-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid var(--nt-rule);
	font-size: 14px;
}
.naztools-staff-table thead th {
	background: var(--nt-accent-soft);
	border-bottom: 2px solid var(--nt-accent);
	padding: 10px 12px;
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--nt-accent-strong);
}
.naztools-staff-table tbody td {
	padding: 10px 12px;
	border-top: 1px solid var(--nt-rule);
	vertical-align: middle;
}
/* Explicit bottom border on the last row so the table closes cleanly
 * even when border-collapse merges it with the table's own border in
 * a way Safari otherwise renders as missing. */
.naztools-staff-table tbody tr:last-child td {
	border-bottom: 1px solid var(--nt-rule);
}
.naztools-staff-table tbody tr:nth-child(odd) td { background: var(--nt-row-zebra); }
.naztools-staff-table tbody tr:hover td { background: var(--nt-row-hover); }
.naztools-staff-table code {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 12.5px;
	background: rgba(0,0,0,0.04);
	padding: 1px 5px;
	border-radius: 3px;
}
.naztools-staff-num-col {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.naztools-staff-actions-cell {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
}

/* ----- empty / error / denied states ----- */
.naztools-staff-loggedout,
.naztools-staff-denied,
.naztools-staff-error {
	max-width: 480px;
	margin: 32px auto;
	padding: 18px 22px;
	text-align: center;
	background: var(--nt-section-bg);
	border: 1px solid var(--nt-rule);
	border-radius: 8px;
}
.naztools-staff-error { background: var(--nt-error-soft); border-color: var(--nt-error-soft); }
.naztools-staff-denied { background: var(--nt-warning-soft); border-color: var(--nt-warning); }

/* ----- page-title suppression -----
 *
 * On pages whose content includes one of our shortcodes, PageChrome filters
 * `the_title` for the main loop AND adds this body class. The CSS below is
 * the safety net for themes that bypass `the_title` (block-theme post-title
 * blocks, Elementor page header widgets, hand-rolled `single.php` markup).
 *
 * The selectors target what title primitives are commonly named — neutral
 * enough to clear the duplicated h1 above our content without touching nav
 * menus, related-post lists, or breadcrumbs.
 */
body.naztools-suppress-page-title h1.entry-title,
body.naztools-suppress-page-title h1.page-title,
body.naztools-suppress-page-title .wp-block-post-title,
body.naztools-suppress-page-title .elementor-widget-theme-post-title,
body.naztools-suppress-page-title .elementor-page-title,
body.naztools-suppress-page-title header.entry-header > h1,
body.naztools-suppress-page-title .page-header > h1 {
	display: none !important;
}

/* Tighten common theme content-area top padding so the hero gap collapses
 * once the redundant title disappears. Targets common WP / page-builder
 * wrappers; safe to skip if a theme uses something else (the worst case is
 * the gap stays). */
body.naztools-suppress-page-title .entry-content,
body.naztools-suppress-page-title .site-main > article,
body.naztools-suppress-page-title .site-content {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* ----- dashboard page-header (only rendered when shortcode passes title="…") ----- */
.naztools-dashboard-header {
	margin: 0 0 14px 0;
	padding: 14px 18px 12px;
	background: var(--nt-bg);
	border: 1px solid var(--nt-rule);
	border-radius: 6px;
}
.naztools-dashboard-header h1 {
	margin: 0;
	font-size: 26px;
	line-height: 1.2;
	color: var(--nt-accent-strong);
}

/* ----- kiosk shell on the FRONT-END (no wp-admin chrome to hide) ----- */
.naztools-kiosk-shell {
	max-width: 1100px;
	margin: 0 auto;
	padding: 12px;
	min-height: 100vh;
	box-sizing: border-box;
}
body.naztools-kiosk-mode {
	margin: 0;
	padding: 0;
	background: var(--nt-section-bg);
}
body.naztools-kiosk-mode #wpadminbar { display: none !important; }
