/* ============================================================
   WMS GRAPID — Foglio di stile principale
   Mobile-first · Tema industriale
   ============================================================ */

/* --- Variabili colore --- */
:root {
	--wms-primary:       #007992;
	--wms-primary-light: rgba(0, 121, 146, 0.10);
	--wms-primary-dark:  #005e72;
	--wms-success:       #2d8c4e;
	--wms-success-light: rgba(45, 140, 78, 0.15);
	--wms-danger:        #d93025;
	--wms-danger-light:  rgba(217, 48, 37, 0.10);
	--wms-warning:       #e09600;
	--wms-warning-light: rgba(224, 150, 0, 0.12);
	--wms-bg:            #e4ecf4;
	--wms-card:          #ffffff;
	--wms-text:          #1a2c35;
	--wms-text-muted:    #5c7480;
	--wms-border:        #c8d6df;
	--wms-secondary-bg:  #d5e0e8;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
	background: var(--wms-bg);
	color: var(--wms-text);
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
	margin: 0;
	padding: 0;
}

/* --- Frame contenitore mobile --- */
.wms-frame {
	max-width: 480px;
	min-height: 100vh;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	background: var(--wms-bg);
}

/* --- Bottom Navigation --- */
.wms-bottom-nav {
	position: fixed;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	max-width: 480px;
	width: 100%;
	background: var(--wms-card);
	border-top: 1px solid var(--wms-border);
	box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
	display: flex;
	justify-content: space-around;
	align-items: flex-end;
	padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
	z-index: 200;
}

.wms-bottom-nav .bnav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: var(--wms-text-muted);
	font-size: 0.62rem;
	font-weight: 600;
	padding: 6px 0 2px;
	min-width: 56px;
	position: relative;
	transition: color 0.15s;
}

.wms-bottom-nav .bnav-item i {
	font-size: 1.25rem;
	margin-bottom: 2px;
}

.wms-bottom-nav .bnav-item.active {
	color: var(--wms-primary);
}

.wms-bottom-nav .bnav-item.disabled {
	opacity: 0.35;
	pointer-events: none;
}

.wms-bottom-nav .bnav-item .bnav-badge {
	position: absolute;
	top: 0;
	right: 4px;
	background: var(--wms-danger);
	color: white;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.6rem;
	font-weight: 700;
	line-height: 1;
}

.wms-bottom-nav .fab-add {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: var(--wms-primary);
	color: white;
	border: 3px solid var(--wms-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: -22px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.18);
	font-size: 1.4rem;
	text-decoration: none;
	transition: transform 0.10s;
}

.wms-bottom-nav .fab-add:active { transform: scale(0.92); }
.wms-bottom-nav .fab-add:hover  { text-decoration: none; color: white; opacity: 0.92; }

/* --- Screen Header --- */
.wms-screen-header {
	background: var(--wms-card);
	padding: 10px 14px;
	border-bottom: 1px solid var(--wms-border);
	display: flex;
	align-items: center;
	gap: 10px;
}

.wms-screen-header h1 {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--wms-text);
	margin: 0;
	line-height: 1.2;
}

.wms-screen-header .subtitle {
	font-size: 0.78rem;
	color: var(--wms-text-muted);
	margin-top: 1px;
}

.wms-logo-badge {
	font-size: 0.68rem;
	font-weight: 900;
	color: var(--wms-primary);
	letter-spacing: 0.06em;
	flex-shrink: 0;
}

/* --- Pulsante indietro --- */
.btn-back {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px 10px 6px 4px;
	color: var(--wms-text);
	font-size: 1.15rem;
	line-height: 1;
	flex-shrink: 0;
	text-decoration: none;
}

.btn-back:hover { color: var(--wms-primary); }

/* --- Area contenuto --- */
.wms-content {
	padding: 14px;
	padding-bottom: 80px;
	flex: 1;
}

/* --- Bottoni industriali --- */
.btn-industrial {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 18px 16px;
	font-size: 1.05rem;
	font-weight: 700;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: transform 0.10s, opacity 0.15s;
	text-align: center;
	text-decoration: none;
	min-height: 60px;
	gap: 10px;
}

.btn-industrial:active   { transform: scale(0.97); text-decoration: none; }
.btn-industrial:hover    { text-decoration: none; opacity: 0.92; }
.btn-industrial:disabled { opacity: 0.40; cursor: not-allowed; }

.btn-industrial-primary   { background: var(--wms-primary);  color: white; }
.btn-industrial-success   { background: var(--wms-success);  color: white; }
.btn-industrial-danger    { background: var(--wms-danger);   color: white; }
.btn-industrial-warning   { background: var(--wms-warning);  color: #1a1a1a; }
.btn-industrial-secondary { background: var(--wms-secondary-bg); color: var(--wms-text); }

/* --- Grid mode selection (home) --- */
.wms-mode-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.btn-mode {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: var(--wms-primary);
	color: white;
	border: none;
	border-radius: 16px;
	aspect-ratio: 1 / 1;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.10s, opacity 0.15s;
}

.btn-mode:active { transform: scale(0.96); }
.btn-mode:hover  { text-decoration: none; color: white; opacity: 0.92; }
.btn-mode.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-mode i { font-size: 2.2rem; }

/* --- Campo scan --- */
.scan-field {
	border: 2px dashed var(--wms-primary);
	background: var(--wms-primary-light);
	border-radius: 12px;
	padding: 22px 16px;
	text-align: center;
	cursor: pointer;
	transition: background 0.15s;
}

.scan-field:hover { background: rgba(0, 121, 146, 0.16); }

.scan-icon {
	font-size: 2rem;
	color: var(--wms-primary);
	display: block;
	margin-bottom: 8px;
}

.scan-text  { color: var(--wms-text-muted); font-size: 0.9rem; }
.scan-ok    { color: var(--wms-success); font-weight: 700; font-size: 0.9rem; }

@keyframes pulse-scan {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.55; }
}
.scan-pulse { animation: pulse-scan 1.6s ease-in-out infinite; }

/* --- Badge stato --- */
.badge-stato {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 99px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.badge-pronta      { background: var(--wms-success-light); color: var(--wms-success); }
.badge-lavorazione { background: var(--wms-primary-light); color: var(--wms-primary); }
.badge-confermata  { background: rgba(0,121,146,0.22);     color: var(--wms-primary); }
.badge-elaborata   { background: var(--wms-warning-light); color: var(--wms-warning); }
.badge-bloccata    { background: var(--wms-danger-light);  color: var(--wms-danger);  }
.badge-libero      { background: var(--wms-success-light); color: var(--wms-success); }
.badge-occupato    { background: var(--wms-danger-light);  color: var(--wms-danger);  }
.badge-precarico   { background: var(--wms-success-light); color: var(--wms-success); }
.badge-standard    { background: var(--wms-danger-light);  color: var(--wms-danger);  }

/* --- Card WMS --- */
.card-wms {
	background: var(--wms-card);
	border: 1px solid var(--wms-border);
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 10px;
}

.card-wms-bordered { border: 2px solid var(--wms-border); }

.card-wms-primary  { background: var(--wms-primary-light); border: 2px solid var(--wms-primary); }
.card-wms-success  { background: var(--wms-success-light); border: 2px solid var(--wms-success); }
.card-wms-warning  { background: var(--wms-warning-light); border: 2px solid var(--wms-warning); }
.card-wms-danger   { background: var(--wms-danger-light);  border: 2px solid var(--wms-danger);  }

/* --- Messaggi --- */
.msg-wms {
	border-radius: 10px;
	padding: 12px 16px;
	font-size: 0.85rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
	border-width: 2px;
	border-style: solid;
}
.msg-success { background: var(--wms-success-light); color: var(--wms-success); border-color: var(--wms-success); }
.msg-error   { background: var(--wms-danger-light);  color: var(--wms-danger);  border-color: var(--wms-danger);  }
.msg-warning { background: var(--wms-warning-light); color: #856404;            border-color: var(--wms-warning); }
.msg-info    { background: var(--wms-primary-light); color: var(--wms-primary); border-color: var(--wms-primary); }

/* --- Visualizzazione ubicazione grande --- */
.ubicazione-display {
	font-size: 2.4rem;
	font-weight: 900;
	letter-spacing: 0.12em;
	color: var(--wms-text);
	text-align: center;
	padding: 8px 0 4px;
}

/* --- Controllo quantità --- */
.qty-control {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.qty-btn {
	width: 50px;
	height: 54px;
	border-radius: 10px;
	background: var(--wms-secondary-bg);
	border: none;
	font-size: 1.4rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.08s;
}

.qty-btn:active { transform: scale(0.93); }

.qty-btn-lg {
	font-size: 1rem;
	font-weight: 900;
	letter-spacing: -0.05em;
}

.qty-value {
	font-size: 3rem;
	font-weight: 900;
	color: var(--wms-text);
	min-width: 80px;
	text-align: center;
}

/* --- Input stile WMS --- */
.input-wms {
	width: 100%;
	padding: 13px 15px;
	background: var(--wms-card);
	border: 2px solid var(--wms-border);
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--wms-text);
	outline: none;
	transition: border-color 0.15s;
}

.input-wms:focus { border-color: var(--wms-primary); }
.input-wms::placeholder { font-weight: 400; color: var(--wms-text-muted); }

.input-wms-lg { font-size: 1.2rem; padding: 15px; }

.input-wms-center {
	text-align: center;
	font-size: 1.8rem;
	letter-spacing: 0.10em;
	border-bottom: 2px solid var(--wms-border);
	border-top: none;
	border-left: none;
	border-right: none;
	border-radius: 0;
	padding: 6px 0;
}

/* --- Toggle vista ordini/articoli --- */
.view-toggle {
	display: flex;
	background: var(--wms-secondary-bg);
	border-radius: 10px;
	padding: 4px;
	gap: 4px;
	margin-bottom: 12px;
}

.view-toggle-btn {
	flex: 1;
	padding: 8px;
	border-radius: 7px;
	border: none;
	font-weight: 600;
	font-size: 0.85rem;
	cursor: pointer;
	background: transparent;
	color: var(--wms-text-muted);
	transition: all 0.15s;
	text-align: center;
	text-decoration: none;
}

.view-toggle-btn.active, .view-toggle-btn:hover {
	background: var(--wms-card);
	color: var(--wms-primary);
	box-shadow: 0 1px 3px rgba(0,0,0,0.10);
	text-decoration: none;
}

/* --- Tipologia prelievo --- */
.tipologia-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.tipologia-btn {
	padding: 12px 6px;
	border-radius: 10px;
	border: 2px solid var(--wms-border);
	background: var(--wms-card);
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	transition: all 0.15s;
	text-align: center;
	text-decoration: none;
	color: var(--wms-text);
	display: block;
}

.tipologia-btn.active,
.tipologia-btn:hover {
	background: var(--wms-primary);
	color: white;
	border-color: var(--wms-primary);
	text-decoration: none;
}

/* --- Item impegno / ordine (cliccabili) --- */
.list-item-wms {
	display: block;
	width: 100%;
	background: var(--wms-card);
	border: 2px solid var(--wms-border);
	border-radius: 12px;
	padding: 14px;
	text-align: left;
	text-decoration: none;
	color: var(--wms-text);
	margin-bottom: 10px;
	transition: border-color 0.15s;
}

.list-item-wms:hover, .list-item-wms:focus {
	border-color: var(--wms-primary);
	text-decoration: none;
	color: var(--wms-text);
}

/* --- Card percorso picking --- */
.percorso-card {
	border-radius: 12px;
	border: 2px solid var(--wms-border);
	overflow: hidden;
	margin-bottom: 10px;
}

.percorso-card.prelevato { border-color: rgba(45,140,78,0.45); }

.percorso-header {
	padding: 10px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.percorso-header-normal { background: var(--wms-primary-light); }
.percorso-header-done   { background: var(--wms-success-light); }

.percorso-ubicazione {
	font-size: 1.2rem;
	font-weight: 900;
	letter-spacing: 0.08em;
	color: var(--wms-text);
}

.percorso-body {
	padding: 12px 14px;
	background: var(--wms-card);
}

/* --- Barra azioni inferiore --- */
.wms-action-bar {
	padding: 12px 14px;
	border-top: 1px solid var(--wms-border);
	background: var(--wms-card);
	position: sticky;
	bottom: 0;
}

/* --- Info box tipo alert --- */
.info-box-wms {
	background: var(--wms-primary-light);
	border: 1px solid rgba(0,121,146,0.30);
	border-radius: 10px;
	padding: 11px 13px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.82rem;
	color: var(--wms-text-muted);
}

.info-box-wms i { color: var(--wms-primary); margin-top: 1px; flex-shrink: 0; }

/* --- Modal overlay --- */
.wms-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.52);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 200;
	padding: 20px;
}

.wms-modal {
	background: var(--wms-card);
	border-radius: 16px;
	border: 2px solid var(--wms-warning);
	width: 100%;
	max-width: 400px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,0.28);
}

.wms-modal-header {
	background: var(--wms-warning-light);
	padding: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.wms-modal-body   { padding: 16px; }
.wms-modal-footer { padding: 14px 16px; border-top: 1px solid var(--wms-border); }

/* --- Griglia dettagli ubicazione (corridoio/scaffale/ripiano) --- */
.ubicazione-dettaglio {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-top: 10px;
}

.ubicazione-dettaglio-item {
	background: var(--wms-card);
	border-radius: 10px;
	padding: 10px 8px;
	text-align: center;
}

/* --- Statistiche completamento --- */
.stat-grid {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

.stat-item {
	background: var(--wms-card);
	border: 1px solid var(--wms-border);
	border-radius: 12px;
	padding: 14px 18px;
	text-align: center;
	min-width: 80px;
}

.stat-value {
	font-size: 1.8rem;
	font-weight: 900;
	color: var(--wms-text);
	line-height: 1;
}

.stat-label {
	font-size: 0.72rem;
	color: var(--wms-text-muted);
	margin-top: 4px;
}

/* --- Icona cerchio successo/errore --- */
.icon-circle {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.icon-circle-success { background: var(--wms-success-light); }
.icon-circle-danger  { background: var(--wms-danger-light);  }
.icon-circle-warning { background: var(--wms-warning-light); }

.icon-circle i { font-size: 2.5rem; }
.icon-circle-success i { color: var(--wms-success); }
.icon-circle-danger  i { color: var(--wms-danger);  }
.icon-circle-warning i { color: var(--wms-warning); }

/* --- Input search inline con bottone --- */
.input-search-group {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.input-search-group .input-wms { flex: 1; }

.btn-search-inline {
	background: var(--wms-primary);
	color: white;
	border: none;
	border-radius: 10px;
	padding: 0 14px;
	font-size: 1rem;
	cursor: pointer;
	flex-shrink: 0;
}

/* --- Mezzo card --- */
.mezzo-card {
	background: var(--wms-card);
	border: 2px solid var(--wms-border);
	border-radius: 14px;
	padding: 14px 16px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: border-color 0.15s;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.mezzo-card.selected  { border-color: var(--wms-primary); }
.mezzo-card.occupato  { opacity: 0.52; cursor: not-allowed; }

/* --- Fornitore trovato box --- */
.fornitore-trovato {
	background: var(--wms-card);
	border: 1px solid var(--wms-border);
	border-radius: 12px;
	padding: 14px;
}

/* --- Etichetta sezione --- */
.sezione-label {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wms-text-muted);
	margin-bottom: 8px;
}

/* --- Utlità spaziatura --- */
.space-y > * + *    { margin-top: 12px; }
.space-y-sm > * + * { margin-top: 8px; }

/* --- Testo utilità --- */
.text-primary-wms { color: var(--wms-primary); }
.text-success-wms { color: var(--wms-success); }
.text-danger-wms  { color: var(--wms-danger);  }
.text-warning-wms { color: var(--wms-warning); }
.text-muted-wms   { color: var(--wms-text-muted); }
.text-mono        { font-family: 'Courier New', monospace; }
.fw-black         { font-weight: 900; }

/* --- Login --- */
.login-container {
	max-width: 400px;
	margin: 40px auto;
	padding: 0 20px;
}

.login-logo {
	text-align: center;
	margin-bottom: 32px;
}

.login-logo .wms-logo     { font-size: 2.5rem; color: var(--wms-primary); }
.login-logo .wms-logo-sub { font-size: 1rem; color: var(--wms-text-muted); margin-top: 4px; }

.login-card {
	background: var(--wms-card);
	border-radius: 16px;
	padding: 28px 24px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-card label { font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; display: block; }

.input-login {
	width: 100%;
	padding: 14px 16px;
	background: var(--wms-bg);
	border: 2px solid var(--wms-border);
	border-radius: 10px;
	font-size: 1rem;
	color: var(--wms-text);
	outline: none;
	transition: border-color 0.15s;
	margin-bottom: 16px;
}

.input-login:focus { border-color: var(--wms-primary); }

.alert-login {
	background: var(--wms-danger-light);
	border: 1px solid var(--wms-danger);
	color: var(--wms-danger);
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 0.9rem;
	margin-bottom: 16px;
}

.card-prodotto-warning {
  border-left: 4px solid var(--wms-warning);
}

.card-prodotto-success {
  border-left: 4px solid var(--wms-success);
}

.card-prodotto-danger {
  border-left: 4px solid var(--wms-danger);
}