/* ΕΟΦ Ελλείψεις Φαρμακείων — public styles. Scoped under .esm-app. */
.esm-app {
	--esm-ink: #10302f; --esm-surface: #ffffff; --esm-bg: #f4f7f6; --esm-line: #dfe8e5; --esm-teal: #0e7c7b; --esm-teal-dark: #0a5f5e;
	--esm-danger: #c8394a; --esm-danger-bg: #fdeef0; --esm-ok: #1f7a52; --esm-ok-bg: #e9f5ee; --esm-muted: #5c6f6c; --esm-placeholder: #718783; --esm-radius: 14px;
	--esm-shadow: 0 1px 2px rgba(16, 48, 47, .06), 0 8px 24px rgba(16, 48, 47, .06); box-sizing: border-box; width: 100%; max-width: 1160px;
	margin: 0 auto; padding-top: 72px; scroll-margin-top: 92px; color: var(--esm-ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
}
.esm-app *,
.esm-app *::before,
.esm-app *::after {
	box-sizing: border-box;
}
/* Header */
.esm-app__head {
	margin-bottom: 22px;
}
.esm-app__title {
	display: flex; align-items: center; gap: 12px;
}
.esm-app__title h2 {
	margin: 0; color: var(--esm-ink); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); font-weight: 800; letter-spacing: -.02em;
	text-transform: none;
}
.esm-app .esm-mark {
	position: relative; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(150deg, var(--esm-teal), var(--esm-teal-dark));
	box-shadow: 0 4px 12px rgba(14, 124, 123, .35);
}
.esm-app .esm-mark span {
	position: absolute; top: 50%; left: 50%; border-radius: 2px; background: #fff; transform: translate(-50%, -50%);
}
.esm-app .esm-mark span:first-child {
	width: 14px; height: 4px;
}
.esm-app .esm-mark span:last-child {
	width: 4px; height: 14px;
}
.esm-app__intro {
	max-width: 62ch; margin: 12px 0 0; color: var(--esm-muted);
}
.esm-app__meta {
	display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.esm-app .esm-chip {
	display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid var(--esm-line); border-radius: 999px;
	background: var(--esm-surface); color: var(--esm-muted); font-size: .85rem;
}
.esm-app .esm-chip strong {
	color: var(--esm-ink); font-size: 1rem;
}
.esm-app .esm-chip--danger {
	border-color: #f6d3d8; background: var(--esm-danger-bg); color: #8f2230;
}
.esm-app .esm-chip--danger strong {
	color: var(--esm-danger);
}
.esm-app .esm-chip--muted {
	background: transparent;
}
/* Controls */
.esm-controls {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px;
}
.esm-search {
	position: relative; flex: 1 1 420px;
}
.esm-search__icon {
	position: absolute; top: 50%; left: 18px; z-index: 2; display: block; width: 17px; height: 17px; color: var(--esm-muted); pointer-events: none; transform: translateY(-50%);
}
.esm-search__input,
.esm-app .esm-search input.esm-search__input {
	width: 100%; padding: 13px 16px 13px 58px !important; text-indent: 0 !important; border: 1px solid var(--esm-line); border-radius: var(--esm-radius); background: var(--esm-surface);
	box-shadow: var(--esm-shadow); color: var(--esm-ink); font-size: 1rem; transition: border-color .15s ease, box-shadow .15s ease;
}
.esm-search__input::-webkit-search-decoration,
.esm-search__input::-webkit-search-results-button,
.esm-search__input::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
}
.esm-search__input::placeholder {
	color: var(--esm-placeholder); opacity: 1;
}
.esm-search__input:focus {
	border-color: var(--esm-teal); outline: none; box-shadow: 0 0 0 3px rgba(14, 124, 123, .16);
}
.esm-filters {
	display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--esm-line); border-radius: var(--esm-radius); background: var(--esm-surface);
}
.esm-app .esm-filter {
	appearance: none; margin: 0; padding: 9px 14px; border: 0 !important; border-radius: 10px; background: transparent !important;
	background-image: none !important; box-shadow: none !important; color: var(--esm-muted) !important; font: inherit; font-size: .9rem;
	font-weight: 600; line-height: 1.2; text-transform: none; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.esm-app .esm-filter:hover,
.esm-app .esm-filter:focus,
.esm-app .esm-filter:active {
	background: #edf4f2 !important; color: var(--esm-ink) !important;
}
.esm-app .esm-filter.is-active,
.esm-app .esm-filter.is-active:hover,
.esm-app .esm-filter.is-active:focus,
.esm-app .esm-filter.is-active:active {
	background: var(--esm-ink) !important; color: #fff !important;
}
.esm-app .esm-filter:focus-visible {
	outline: 2px solid var(--esm-teal); outline-offset: 2px;
}
.esm-resultbar {
	min-height: 1.2em; margin: 0 0 10px; color: var(--esm-muted); font-size: .85rem;
}
/* Meaning notice — sits between the filters and the results, not in a footer.
   Compact by design: two short lines, an icon that costs one flex column, and
   no card shadow, so it reads as guidance rather than as an error. */
.esm-app .esm-notice {
	display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 10px; padding: 12px 14px;
	border: 1px solid #cfe6e4; border-left: 3px solid var(--esm-teal); border-radius: 12px;
	background: #f2f9f8; color: var(--esm-ink);
}
.esm-app .esm-notice__icon {
	display: flex; flex: 0 0 auto; align-items: center; justify-content: center; margin-top: 1px; color: var(--esm-teal);
}
.esm-app .esm-notice__body {
	min-width: 0;
}
.esm-app .esm-notice__lead {
	margin: 0; font-size: .86rem; font-weight: 600; line-height: 1.5;
}
.esm-app .esm-notice__meta {
	margin: 4px 0 0; color: var(--esm-muted); font-size: .8rem; line-height: 1.5;
}

/* Table */
.esm-tablewrap {
	width: 100%; border: 1px solid var(--esm-line); border-radius: var(--esm-radius); background: var(--esm-surface); box-shadow: var(--esm-shadow);
	overflow-x: auto; overflow-y: hidden;
}
.esm-table {
	width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: fixed;
}
/* Barcode | Φάρμακο | Δραστική ουσία | ATC | Κατάσταση | Από | Μέχρι */
.esm-col-barcode {
	width: 13%;
}
.esm-col-product {
	width: 30%;
}
.esm-col-substance {
	width: 16%;
}
.esm-col-atc {
	width: 7%;
}
/* Wide enough for «Αποκαταστάθηκε» — the longest label — on a single line.
   The badge sets white-space: nowrap, so a column that is too narrow does not
   wrap the text, it overflows the pill. */
.esm-col-status {
	width: 15%;
}
.esm-col-from,
.esm-col-until {
	width: 9.5%;
}
.esm-table thead th {
	padding: 12px 14px; border-right: 1px solid var(--esm-line); border-bottom: 1px solid var(--esm-line); background: #f8faf9;
	color: var(--esm-muted); font-size: .76rem; font-weight: 700; letter-spacing: 0; text-align: left; text-transform: none; white-space: nowrap;
}
.esm-table thead th:last-child {
	border-right: 0;
}
.esm-table thead th[data-orderby] {
	cursor: pointer; user-select: none;
}
.esm-table thead th[data-orderby]:hover {
	color: var(--esm-ink);
}
.esm-app .esm-table thead th[data-orderby]:focus-visible {
	outline: none;
	color: var(--esm-ink);
	box-shadow: inset 0 0 0 2px var(--esm-teal);
}
.esm-table thead th.is-sorted::after {
	display: inline-block; margin-left: 6px; content: "▾";
}
.esm-table thead th.is-sorted.is-asc::after {
	content: "▴";
}
.esm-table tbody tr {
	border-bottom: 1px solid var(--esm-line); transition: background .1s ease;
}
.esm-table tbody tr:last-child {
	border-bottom: 0;
}
.esm-table tbody tr:nth-child(even) {
	background: #fafcfb;
}
.esm-table tbody tr:hover {
	background: #f4f8f7;
}
.esm-table td {
	padding: 13px 14px; border-right: 1px solid var(--esm-line); vertical-align: middle; overflow-wrap: anywhere;
}
.esm-table td:last-child {
	border-right: 0;
}
.esm-cell-barcode,
.esm-cell-atc,
.esm-atc {
	color: var(--esm-muted); font-family: Consolas, Monaco, "Courier New", monospace; font-size: .76rem; font-variant-numeric: tabular-nums;
}
.esm-product {
	color: var(--esm-ink); font-weight: 700;
}
.esm-substance {
	color: var(--esm-muted);
}
.esm-date {
	font-variant-numeric: tabular-nums; white-space: nowrap;
}
.esm-app .esm-badge {
	display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border-radius: 999px; font-size: .78rem;
	font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.esm-app .esm-badge::before {
	flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: "";
}
.esm-app .esm-badge--danger {
	background: var(--esm-danger-bg); color: var(--esm-danger);
}
.esm-app .esm-badge--ok {
	background: var(--esm-ok-bg); color: var(--esm-ok);
}
/* Empty + loading */
.esm-error {
	max-width: 760px;
	margin: 18px auto;
	padding: 14px 16px;
	border: 1px solid #f1c8ce;
	border-left: 4px solid var(--esm-danger, #c8394a);
	border-radius: 10px;
	background: var(--esm-danger-bg, #fdeef0);
	color: #7f1f2c;
	font-weight: 600;
}
.esm-empty {
	padding: 48px 20px; color: var(--esm-muted); text-align: center;
}
.esm-empty[hidden] {
	display: none !important;
}
.esm-table.is-loading tbody {
	opacity: .4; transition: opacity .15s ease;
}
.esm-app[aria-busy="true"] .esm-tablewrap {
	cursor: progress;
}
/* Pager */
.esm-pager {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 20px;
}
.esm-app .esm-pager button {
	appearance: none; min-width: 40px; margin: 0; padding: 9px 12px; border: 1px solid var(--esm-line) !important; border-radius: 10px;
	background: var(--esm-surface) !important; background-image: none !important; box-shadow: none !important; color: var(--esm-ink) !important;
	font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; transition: border-color .12s ease, background-color .12s ease;
}
.esm-app .esm-pager button:hover:not(:disabled) {
	border-color: var(--esm-teal) !important; background: #edf4f2 !important; color: var(--esm-ink) !important;
}
.esm-app .esm-pager button:disabled {
	opacity: .45; cursor: default;
}
.esm-app .esm-pager button.is-current,
.esm-app .esm-pager button.is-current:hover {
	border-color: var(--esm-teal) !important; background: var(--esm-teal) !important; color: #fff !important;
}
.esm-app .esm-pager button:focus-visible {
	outline: 2px solid var(--esm-teal); outline-offset: 2px;
}
.esm-pager__gap {
	padding: 0 4px; color: var(--esm-muted);
}
/* Mobile: table becomes cards */
@media (max-width: 760px) {
.esm-app {
	padding: 42px 12px 0; scroll-margin-top: 62px;
}
.esm-controls {
	display: block;
}
.esm-search {
	margin-bottom: 10px;
}
.esm-filters {
	/* Two rows of two on narrow screens: the fourth filter («Νέα σε έλλειψη»)
	   would otherwise be squeezed out of a fixed three-column grid. */
	display: grid; grid-template-columns: repeat(2, 1fr); width: 100%;
}
.esm-app .esm-filter {
	padding: 9px 6px; font-size: .78rem; white-space: normal;
}
.esm-app .esm-notice {
	gap: 9px; margin: 14px 0 8px; padding: 11px 12px; border-radius: 11px;
}
.esm-app .esm-notice__lead {
	font-size: .84rem;
}
.esm-app .esm-notice__meta {
	font-size: .78rem;
}
.esm-tablewrap {
	border: 0; background: transparent; box-shadow: none; overflow: visible;
}
	.esm-table,
	.esm-table tbody,
	.esm-table tr,
.esm-table td {
	display: block; width: 100%; min-width: 0;
}
.esm-table thead {
	display: none;
}
.esm-table tbody tr {
	margin-bottom: 12px; border: 1px solid var(--esm-line); border-radius: var(--esm-radius); background: var(--esm-surface);
	box-shadow: var(--esm-shadow); overflow: hidden;
}
.esm-table tbody td {
	display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-right: 0; border-bottom: 1px solid var(--esm-line);
}
.esm-table tbody td:last-child {
	border-bottom: 0;
}
.esm-table td[data-label]::before {
	display: block; color: var(--esm-muted); content: attr(data-label); font-size: .74rem; font-weight: 700; letter-spacing: 0;
	text-transform: none;
}
.esm-table td.esm-cell-product {
	display: block; padding: 13px 12px; background: #f8faf9;
}
.esm-table td.esm-cell-product::before {
	display: block; margin-bottom: 4px; color: var(--esm-muted); content: attr(data-label); font-size: .74rem; font-weight: 700;
	text-transform: none;
}
.esm-product {
	font-size: 1rem;
}
.esm-date {
	white-space: normal;
}
}
@media (max-width: 760px) {
	.esm-empty {
		border: 1px solid var(--esm-line);
		border-radius: var(--esm-radius);
		background: var(--esm-surface);
		box-shadow: var(--esm-shadow);
	}
}

@media (max-width: 420px) {
.esm-filters {
	grid-template-columns: 1fr;
}
.esm-app .esm-notice__icon {
	display: none;
}
.esm-app .esm-notice__meta {
	margin-top: 3px;
}
.esm-table tbody td {
	grid-template-columns: 96px minmax(0, 1fr);
}
}
@media (prefers-reduced-motion: reduce) {
.esm-app * {
	transition: none !important;
}
}
/* ΙΦΕΤ emergency-coverage marker, shown next to the product name. */
.esm-source {
	display: inline-block;
	margin-top: 2px;
	padding: 1px 6px;
	border: 1px solid currentColor;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.6;
	opacity: 0.75;
	white-space: nowrap;
}

/*
 * Inferred last-seen date, shown in the «Μέχρι» column when the ΕΟΦ never
 * declared an end date. Visually lighter than a real date on purpose: it is an
 * observation about our own snapshots, not a date the ΕΟΦ published.
 */
.esm-last-seen {
	display: inline-block;
	font-size: 12px;
	line-height: 1.5;
	opacity: 0.8;
}

/* The observed date a medicine left the ΕΟΦ list. Same restrained treatment
   as .esm-last-seen: it is secondary to a declared «Μέχρι» date, never a
   replacement for one. */
.esm-resolved-on {
	display: inline-block;
	font-size: 12px;
	line-height: 1.5;
	opacity: 0.8;
}

