/*
 * Module: ΑΑΔΕ · Ψηφιακό Πελατολόγιο — styles
 * Tokens only (mcms-global.css § 1). Phone first: one hand, big plate box,
 * the finalize button always reachable at the bottom.
 *
 * SECTIONS
 *   1. Top bar refresh, bot banner
 *   2. New entry (plate box, check result)
 *   3. Tabs + list rows
 *   4. Marks (badges)
 *   5. Sheets (mark, finalize)
 *   6. Finalize bar
 */

/* ==================================================================
   1. TOP BAR REFRESH, BOT BANNER
   ================================================================== */
.mcms-wrap .mcms-aade__refresh {
	flex-shrink: 0;
}

.mcms-aade__refresh.is-spinning svg {
	animation: mcms-spin .9s linear infinite;
}

.mcms-aade__banner {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var(--mcms-radius-md);
	border: 1px solid transparent;
}

.mcms-aade__banner--warn  { background: var(--mcms-warning-soft); color: var(--mcms-warning); border-color: rgba(138, 83, 0, .2); }
.mcms-aade__banner--error { background: var(--mcms-danger-soft);  color: var(--mcms-danger);  border-color: rgba(180, 35, 24, .2); }

.mcms-aade__banner-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mcms-aade__banner-sub {
	font-size: var(--mcms-text-xs);
	opacity: .85;
}

.mcms-wrap .mcms-aade__banner .mcms-btn {
	flex-shrink: 0;
}

/* ==================================================================
   2. NEW ENTRY
   The plate box is the biggest thing on the screen: typed standing up,
   with one thumb, often in a hurry.
   ================================================================== */
.mcms-aade__add-label {
	display: block;
	margin-bottom: 8px;
	font-size: var(--mcms-text-sm);
	font-weight: 700;
	color: var(--mcms-text-muted);
}

.mcms-aade__add-row {
	display: flex;
	gap: 8px;
}

.mcms-wrap .mcms-aade__plate-input {
	flex: 1;
	min-width: 0;
	min-height: 60px;
	font-family: var(--mcms-font-mono);
	font-size: 28px;
	font-weight: 800;
	letter-spacing: .08em;
	text-align: center;
	text-transform: uppercase;
}

.mcms-wrap .mcms-aade__plate-input::placeholder {
	font-weight: 600;
	letter-spacing: .08em;
	opacity: .35;
}

.mcms-wrap .mcms-aade__check {
	min-height: 60px;
	padding: 0 18px;
	flex-shrink: 0;
}

@media (max-width: 400px) {
	.mcms-wrap .mcms-aade__check {
		padding: 0 12px;
	}
	.mcms-wrap .mcms-aade__check svg {
		display: none;
	}
}

.mcms-aade__result:empty {
	display: none;
}

.mcms-aade__result {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 14px;
}

.mcms-aade__busy {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--mcms-text-muted);
}

.mcms-aade__car {
	display: flex;
	align-items: center;
	gap: 12px;
}

.mcms-aade__car .mcms-plate {
	height: 30px;
	font-size: 16px;
	flex-shrink: 0;
}

.mcms-aade__car-text {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mcms-aade__car-name {
	font-size: var(--mcms-text-md);
	font-weight: 700;
	overflow-wrap: anywhere;
}

.mcms-aade__actions {
	display: flex;
	gap: 8px;
}

.mcms-wrap .mcms-aade__addbtn {
	flex: 1;
	min-height: 56px;
	font-size: var(--mcms-text-md);
}

.mcms-aade__dup {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px 14px;
	border-radius: var(--mcms-radius-md);
	background: var(--mcms-warning-soft);
	color: var(--mcms-warning);
}

.mcms-wrap .mcms-aade__dup-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: var(--mcms-tap);
	margin: 0;
	padding: 8px 12px;
	border: 1px solid rgba(138, 83, 0, .25);
	border-radius: var(--mcms-radius-sm);
	background: var(--mcms-surface);
	color: var(--mcms-text);
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.mcms-aade__dup-go {
	margin-left: auto;
	color: var(--mcms-brand-strong);
}

/* ==================================================================
   3. TABS + LIST ROWS
   ================================================================== */
.mcms-aade__tabs {
	margin-top: 4px;
}

.mcms-aade__count {
	display: inline-block;
	min-width: 20px;
	margin-left: 6px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--mcms-brand-soft);
	color: var(--mcms-brand-strong);
	font-size: var(--mcms-text-xs);
	line-height: 20px;
}

.mcms-wrap .mcms-aade-row {
	width: 100%;
	margin: 0;
	border: 0;
	border-top: 1px solid var(--mcms-line);
	border-radius: 0;
	background: var(--mcms-surface);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.mcms-wrap .mcms-aade-row:first-child {
	border-top: 0;
}

.mcms-wrap .mcms-aade-row.is-done {
	background: var(--mcms-surface-muted);
}

.mcms-wrap .mcms-aade-row.has-error {
	box-shadow: inset 3px 0 0 var(--mcms-danger);
}

.mcms-aade-row__car {
	font-size: var(--mcms-text-md);
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mcms-aade-row__error {
	padding: 6px 10px;
	border-radius: var(--mcms-radius-sm);
	background: var(--mcms-danger-soft);
	color: var(--mcms-danger);
	font-size: var(--mcms-text-xs);
	font-weight: 600;
	white-space: normal;
}

/* Skeleton rows while the first list loads. */
.mcms-aade-row--skel {
	cursor: default;
}

.mcms-aade-skel {
	display: block;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--mcms-surface-muted) 25%, var(--mcms-line) 50%, var(--mcms-surface-muted) 75%);
	background-size: 200% 100%;
	animation: mcms-aade-shimmer 1.2s ease-in-out infinite;
}

.mcms-aade-skel--plate { width: 96px; height: 24px; }
.mcms-aade-skel--line  { width: 60%;  height: 14px; margin-top: 4px; }

@keyframes mcms-aade-shimmer {
	from { background-position: 200% 0; }
	to   { background-position: -200% 0; }
}

/* Filter rows: a small label, then chips on one line that scrolls
   sideways on phones (like the product groups). */
.mcms-aade__filters {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mcms-aade__frow {
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 2px;
}

.mcms-aade__frow::-webkit-scrollbar {
	display: none;
}

.mcms-aade__flabel {
	flex-shrink: 0;
	min-width: 76px;
	font-size: var(--mcms-text-xs);
	font-weight: 700;
	color: var(--mcms-text-muted);
}

.mcms-wrap .mcms-aade__frow .mcms-chip {
	flex-shrink: 0;
	min-height: 36px;
	padding: 0 12px;
	white-space: nowrap;
}

/* ==================================================================
   4. MARKS
   Δωρεάν blue · Απόδειξη violet · Τιμολόγιο dark — clearly different
   from the status badges (amber / green / red).
   ================================================================== */
.mcms-aade-mark--dorean    { background: #E3ECFA; color: var(--mcms-info); }
.mcms-aade-mark--apodeixi  { background: #EEE8FA; color: #5B3FB0; }
.mcms-aade-mark--timologio { background: var(--mcms-text); color: #fff; }

/* ==================================================================
   5. SHEETS
   ================================================================== */
.mcms-aade-sheet {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.mcms-wrap .mcms-aade-choice .mcms-chip {
	min-height: 46px;
	padding: 0 16px;
	font-size: var(--mcms-text-md);
}

.mcms-aade-sheet__more summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--mcms-text-muted);
	margin-bottom: 8px;
}

.mcms-aade-finlist {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mcms-aade-fin {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--mcms-line);
	border-radius: var(--mcms-radius-md);
	background: var(--mcms-surface);
}

.mcms-aade-fin.is-off {
	opacity: .5;
}

.mcms-aade-fin__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.mcms-aade-fin__car {
	font-weight: 600;
	color: var(--mcms-text-muted);
	min-width: 0;
	overflow-wrap: anywhere;
}

.mcms-aade-fin__receipt {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.mcms-aade-fin__receipt .mcms-aade-choice {
	grid-column: 1 / -1;
}

.mcms-aade-fin__state:empty {
	display: none;
}

.mcms-aade-fin__state {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: var(--mcms-text-sm);
}

.mcms-aade-fin__state.is-ok    { color: var(--mcms-brand-strong); }
.mcms-aade-fin__state.is-error { color: var(--mcms-danger); }
.mcms-aade-fin__state.is-busy  { color: var(--mcms-text-muted); }

/* ==================================================================
   6. FINALIZE BAR — stays at the bottom of the screen while scrolling.
   ================================================================== */
.mcms-aade__page {
	padding-bottom: 120px;
}

.mcms-aade__finbar {
	position: sticky;
	bottom: 0;
	z-index: 15;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 16px;
	padding: 10px var(--mcms-pad);
	padding-bottom: max(10px, env(safe-area-inset-bottom));
	background: var(--mcms-surface);
	border-top: 1px solid var(--mcms-line);
	box-shadow: 0 -4px 16px rgba(32, 32, 32, .08);
}

.mcms-wrap .mcms-aade__finbar .mcms-btn {
	min-height: 52px;
	font-size: var(--mcms-text-md);
}

.mcms-aade__finnote:empty {
	display: none;
}

.mcms-aade__finnote {
	font-size: var(--mcms-text-xs);
	font-weight: 600;
	color: var(--mcms-text-muted);
	text-align: center;
}

/* ==================================================================
   7. FOREIGN CARS + RECEIPT IN THE MARK SHEET
   ================================================================== */
.mcms-wrap .mcms-aade__foreign-toggle {
	margin-top: 8px;
	font-size: var(--mcms-text-sm);
}

.mcms-aade__foreign {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 8px;
	padding-top: 12px;
	border-top: 1px dashed var(--mcms-line-strong);
}

/* A foreign plate: no blue GR strip. */
.mcms-plate.mcms-aade-plate--foreign::before {
	display: none;
}

.mcms-aade-sheet__receipt {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
