/* Staff Area Riservata — frontend styles */

:root {
	--sar-bg:        #f4f6fb;
	--sar-surface:   #ffffff;
	--sar-border:    #d0d5e8;
	--sar-accent:    #2558c1;
	--sar-accent-lt: #1a45a0;
	--sar-text:      #1a1e2e;
	--sar-text-mute: #5a6080;
	--sar-success:   #27ae60;
	--sar-radius:    6px;
	--sar-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ─── Wrapper ─────────────────────────────────────────── */
.staff-ar-wrap {
	font-family: var(--sar-font);
	color: var(--sar-text);
	max-width: 900px;
	margin: 0 auto;
	padding: 0 0 40px;
}

/* ─── Header row ──────────────────────────────────────── */
.staff-ar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 28px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--sar-accent);
}

.staff-ar-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--sar-text);
	letter-spacing: 0.02em;
}

/* ─── Button — colore gestito da Themeco ──────────────── */
.staff-ar-btn {
	display: inline-block;
	white-space: nowrap;
	vertical-align: middle;
	cursor: pointer;
	text-decoration: none;
}

.staff-ar-btn-ghost {
	display: inline-block;
	padding: 10px 24px;
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	background: transparent;
	color: var(--sar-text-mute);
	font-family: var(--sar-font);
	font-size: 0.9rem;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color .15s, color .15s;
}

.staff-ar-btn-ghost:hover {
	border-color: var(--sar-text-mute);
	color: var(--sar-text);
}

/* ─── Logout confirmation modal ───────────────────────── */
.staff-ar-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.staff-ar-modal {
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	padding: 32px 36px;
	max-width: 360px;
	width: 90%;
	box-shadow: 0 8px 40px rgba(0, 0, 0, .18);
	text-align: center;
	font-family: var(--sar-font);
}

.staff-ar-modal-msg {
	margin: 0 0 24px;
	font-size: 1rem;
	color: var(--sar-text);
	line-height: 1.5;
}

.staff-ar-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
}

/* ─── Cambio password ─────────────────────────────────── */
.staff-ar-pw-section {
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid var(--sar-border);
}

.staff-ar-pw-title {
	margin: 0 0 16px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--sar-text-mute);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* ─── Post-logout confirmation ────────────────────────── */
.staff-ar-logout-confirm {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

/* ─── Login modal extras ──────────────────────────────── */
.staff-ar-modal--login {
	max-width: 420px;
	text-align: left;
}

.staff-ar-modal-title {
	margin: 0 0 20px;
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--sar-text);
}

.staff-ar-field-remember {
	margin-bottom: 20px;
	font-size: 0.875rem;
	color: var(--sar-text-mute);
}

.staff-ar-field-remember label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.staff-ar-login-error {
	margin-bottom: 16px;
}

/* ─── PDF export form (inline, allineato verticalmente) ── */
.staff-ar-period-filter,
.staff-ar-pdf-form {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0;
}

/* ─── Notice ──────────────────────────────────────────── */
.staff-ar-notice {
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-left: 4px solid var(--sar-accent);
	border-radius: var(--sar-radius);
	padding: 16px 20px;
	color: var(--sar-text-mute);
	font-size: 0.9rem;
}

/* ─── Login wall ──────────────────────────────────────── */
.staff-ar-login-wall {
	text-align: center;
	padding: 48px 24px;
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
}

.staff-ar-login-wall p {
	margin: 0 0 20px;
	color: var(--sar-text-mute);
	font-size: 1rem;
}

/* ─── Periodo section ─────────────────────────────────── */
.staff-ar-periodo {
	margin-bottom: 36px;
}

.staff-ar-periodo-title {
	margin: 0 0 12px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--sar-accent);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* ─── Table ───────────────────────────────────────────── */
.staff-ar-wrap .staff-ar-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--sar-radius);
	border: 1px solid var(--sar-border) !important;
}

.staff-ar-wrap .staff-ar-table {
	width: 100%;
	border-collapse: collapse !important;
	font-size: 0.9rem;
	background: var(--sar-surface);
}

.staff-ar-wrap .staff-ar-table thead tr {
	background: #eef0f8;
}

.staff-ar-wrap .staff-ar-table th {
	padding: 11px 16px !important;
	text-align: left !important;
	font-size: 0.78rem;
	font-weight: 700 !important;
	color: var(--sar-text-mute) !important;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	border-bottom: 1px solid var(--sar-border) !important;
	white-space: nowrap;
}

.staff-ar-wrap .staff-ar-table td {
	padding: 10px 16px !important;
	border-bottom: 1px solid var(--sar-border) !important;
	color: var(--sar-text) !important;
	vertical-align: middle;
	background: transparent;
}

.staff-ar-wrap .staff-ar-table tbody tr:last-child td {
	border-bottom: none !important;
}

.staff-ar-wrap .staff-ar-table tbody tr:hover td {
	background: #f0f3fc !important;
}

/* Right-align numeric column */
.staff-ar-wrap .staff-ar-table th.staff-ar-num,
.staff-ar-wrap .staff-ar-table td.staff-ar-num {
	text-align: right !important;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
	.staff-ar-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.staff-ar-table th,
	.staff-ar-table td {
		padding: 8px 12px;
		font-size: 0.85rem;
	}
}

/* ─── Header actions (period filter + PDF btn) ────────── */
.staff-ar-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.staff-ar-period-select {
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	color: var(--sar-text);
	font-size: 0.875rem;
	font-family: var(--sar-font);
	padding: 8px 12px;
	line-height: 1.5;
	cursor: pointer;
	vertical-align: middle;
}

/* ─── Farmacia info card ──────────────────────────────── */
.staff-ar-farmacia-card {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	padding: 14px 20px;
	margin-bottom: 28px;
}

.staff-ar-farmacia-field {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 6px 24px 6px 0;
	min-width: 160px;
}

.staff-ar-farmacia-field + .staff-ar-farmacia-field {
	padding-left: 24px;
	border-left: 1px solid var(--sar-border);
}

.staff-ar-farmacia-label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--sar-text-mute);
}

.staff-ar-farmacia-value {
	font-size: 0.95rem;
	color: var(--sar-text);
}

/* ─── Total / highlight rows ──────────────────────────── */
.staff-ar-wrap .staff-ar-table tr.staff-ar-row-total td {
	font-weight: 700 !important;
	background: #eef2fc !important;
	border-top: 2px solid var(--sar-accent) !important;
	border-bottom: 1px solid var(--sar-border) !important;
	color: var(--sar-accent) !important;
}

/* ─── Services teaser ─────────────────────────────────── */
.staff-ar-services {
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid var(--sar-border);
}

.staff-ar-services-title {
	margin: 0 0 16px;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--sar-text-mute);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.staff-ar-services-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.staff-ar-service-card {
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	opacity: 0.65;
	position: relative;
}

.staff-ar-service-icon {
	font-size: 1.5rem;
	line-height: 1;
}

.staff-ar-service-name {
	font-size: 0.875rem;
	color: var(--sar-text);
}

.staff-ar-service-desc {
	margin: 0;
	font-size: 0.78rem;
	color: var(--sar-text-mute);
	line-height: 1.45;
	flex: 1;
}

.staff-ar-service-badge {
	display: inline-block;
	margin-top: 6px;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sar-text-mute);
	border: 1px solid var(--sar-border);
	border-radius: 20px;
	padding: 2px 8px;
}

.staff-ar-services-cta {
	font-size: 0.8rem;
	color: var(--sar-text-mute);
	margin: 0;
}

/* ─── User menu (gear dropdown) ──────────────────────── */
.staff-ar-user-menu {
	position: relative;
}

.staff-ar-user-btn {
	font-size: 1.25rem;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
}

.staff-ar-user-dropdown {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: 300px;
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	box-shadow: 0 8px 32px rgba(0,0,0,.12);
	padding: 18px;
	z-index: 9999;
}

.staff-ar-user-dropdown[hidden] {
	display: none;
}

.staff-ar-user-dropdown-title {
	margin: 0 0 12px;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--sar-text-mute);
}

.staff-ar-user-dropdown .staff-ar-field {
	margin-bottom: 10px;
}

.staff-ar-user-dropdown .staff-ar-field label {
	font-size: 0.78rem;
}

.staff-ar-user-dropdown .staff-ar-field input {
	font-size: 0.875rem;
	padding: 7px 10px;
}

/* ─── Operator import page ────────────────────────────── */
.sar-op-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 48px;
}
@media (max-width: 640px) {
	.sar-op-grid { grid-template-columns: 1fr; }
}

.sar-op-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	padding: 18px;
	text-decoration: none;
	color: inherit;
	transition: border-color .15s, box-shadow .15s;
}
.sar-op-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,.07);
}

.sar-op-card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--sar-border);
}

.sar-op-card-title {
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--sar-text);
	line-height: 1.3;
}

.sar-op-badge {
	flex-shrink: 0;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: 20px;
	padding: 2px 8px;
	white-space: nowrap;
}
.sar-op-badge--adv  { background: #fff3cd; color: #7a4a00; }
.sar-op-badge--demo { background: #fdeaea; color: #8b1a1a; }
.sar-op-badge--live { background: #edfaf3; color: #1a6b3a; }

.sar-op-card-desc {
	font-size: 0.8rem;
	color: var(--sar-text-mute);
	line-height: 1.45;
	flex: 1;
	margin: 0;
}

.sar-op-card-link {
	font-size: 0.8rem;
	color: var(--sar-accent);
	font-weight: 600;
	margin-top: 4px;
}

.sar-op-section {
	display: none;
	margin-bottom: 48px;
	scroll-margin-top: 20px;
}
.sar-op-section.is-open {
	display: block;
}
.sar-op-card.is-active {
	border-color: var(--sar-accent);
}

.sar-op-section-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--sar-text);
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--sar-border);
}

.sar-op-notice {
	border-radius: var(--sar-radius);
	padding: 14px 18px;
	margin-bottom: 20px;
	border-left: 4px solid;
}
.sar-op-notice strong {
	display: block;
	font-size: .875rem;
	margin-bottom: 4px;
}
.sar-op-notice p {
	font-size: .8rem;
	color: var(--sar-text-mute);
	margin: 0;
}
.sar-op-notice a { color: var(--sar-accent); }

.sar-op-disabled-form {
	opacity: 0.4;
	pointer-events: none;
	user-select: none;
	filter: grayscale(30%);
}
.sar-op-notice--adv  { background: #fff8e1; border-color: #c8860a; }
.sar-op-notice--demo { background: #fdeaea; border-color: #c0392b; }

/* ─── Documents section ──────────────────────────────── */
.staff-ar-docs-section {
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid var(--sar-border);
}

.staff-ar-docs-title {
	margin: 0 0 16px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--sar-text-mute);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.staff-ar-doc-badge {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	background: #eef0f8;
	color: var(--sar-accent);
	border-radius: 3px;
	padding: 2px 6px;
	letter-spacing: 0.04em;
}

.staff-ar-doc-dl--demo {
	font-size: 0.85rem;
	color: var(--sar-text-mute);
	opacity: 0.55;
	cursor: default;
}

.staff-ar-doc-dl--demo em {
	font-style: normal;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: #f0f0f0;
	border-radius: 3px;
	padding: 1px 5px;
}

.staff-ar-docs-note {
	font-size: 0.8rem;
	color: var(--sar-text-mute);
	margin: 12px 0 0;
}

/* ─── Form registrazione / import operatore ───────────── */
.staff-ar-register-wrap,
.staff-ar-import-wrap {
	max-width: 480px;
}

.staff-ar-subtitle {
	color: var(--sar-text-mute);
	font-size: 0.9rem;
	margin: -8px 0 20px;
}

.staff-ar-form {
	background: var(--sar-surface);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	padding: 24px;
	margin-top: 16px;
}

.staff-ar-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 18px;
}

.staff-ar-field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--sar-text-mute);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.staff-ar-field input[type="email"],
.staff-ar-field input[type="text"],
.staff-ar-field input[type="password"],
.staff-ar-field input[type="file"] {
	background: var(--sar-bg);
	border: 1px solid var(--sar-border);
	border-radius: var(--sar-radius);
	color: var(--sar-text);
	font-size: 0.95rem;
	padding: 9px 12px;
	width: 100%;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.staff-ar-field input:focus {
	outline: none;
	border-color: var(--sar-accent);
}

.staff-ar-field-hint {
	font-size: 0.78rem;
	color: var(--sar-text-mute);
}

/* ─── Alert ───────────────────────────────────────────── */
.staff-ar-alert {
	border-radius: var(--sar-radius);
	padding: 14px 18px;
	margin-bottom: 16px;
	font-size: 0.9rem;
	border-left: 4px solid;
}

.staff-ar-alert-success {
	background: #edfaf3;
	border-color: var(--sar-success);
	color: #1a6b3a;
}

.staff-ar-alert-error {
	background: #fdeaea;
	border-color: #e05252;
	color: #8b1a1a;
}

.staff-ar-alert-warning {
	background: #fdf6ea;
	border-color: #e0a052;
	color: #7a4a00;
}

