/* =========================================================================
   AhojNet Notifikácie – Zoznam + Formulár + Kalendár
   Tokeny: --r-control 6px (interaktívne prvky), --r-surface 0 (plochy),
   --gap-tile 6px. Farby a zaoblenia sa dajú prepísať v Elementore
   (štýlové ovládače nastavujú tieto premenné na wrapperi widgetu).
   ========================================================================= */

.ahn-nt {
	--ahn-nt-accent: #111827;
	--ahn-nt-accent-text: #ffffff;
	--ahn-nt-text: #1f2937;
	--ahn-nt-muted: #6b7280;
	--ahn-nt-surface: #ffffff;
	--ahn-nt-subtle: #f5f6f8;
	--ahn-nt-border: #e5e7eb;
	--ahn-nt-danger: #b42318;
	--ahn-nt-success: #067647;
	--r-control: 6px;
	--r-surface: 0;
	--gap-tile: 6px;

	color: var(--ahn-nt-text);
	font-size: 15px;
	line-height: 1.5;
}

.ahn-nt *,
.ahn-nt *::before,
.ahn-nt *::after {
	box-sizing: border-box;
}

.ahn-nt [hidden] {
	display: none !important;
}

/* --- Hlavička ---------------------------------------------------------- */
.ahn-nt-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin-bottom: 12px;
}

.ahn-nt-title {
	margin: 0;
	font-size: 1.25em;
	line-height: 1.3;
}

.ahn-nt-count {
	color: var(--ahn-nt-muted);
	font-size: .875em;
}

.ahn-nt-head .ahn-nt-btn-primary {
	margin-left: auto;
}

/* --- Hlášky ------------------------------------------------------------ */
.ahn-nt-notice {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-left: 3px solid var(--ahn-nt-muted);
	background: var(--ahn-nt-subtle);
	border-radius: var(--r-surface);
	outline: none;
}

.ahn-nt-notice-error {
	border-left-color: var(--ahn-nt-danger);
	color: var(--ahn-nt-danger);
}

.ahn-nt-notice-success {
	border-left-color: var(--ahn-nt-success);
	color: var(--ahn-nt-success);
}

.ahn-nt-loading,
.ahn-nt-empty {
	color: var(--ahn-nt-muted);
	margin: 12px 0;
}

/* --- Tlačidlá ---------------------------------------------------------- */
.ahn-nt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-control);
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
	font: inherit;
	font-size: .875em;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.ahn-nt-btn:hover {
	border-color: var(--ahn-nt-muted);
}

.ahn-nt-btn:focus-visible,
.ahn-nt-chip:focus-visible,
.ahn-nt-day:focus-visible,
.ahn-nt-link:focus-visible,
.ahn-nt-input:focus-visible {
	outline: 2px solid var(--ahn-nt-accent);
	outline-offset: 2px;
}

.ahn-nt-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.ahn-nt-btn-primary {
	background: var(--ahn-nt-accent);
	border-color: var(--ahn-nt-accent);
	color: var(--ahn-nt-accent-text);
}

.ahn-nt-btn-primary:hover {
	border-color: var(--ahn-nt-accent);
	opacity: .9;
}

.ahn-nt-btn-danger {
	background: var(--ahn-nt-danger);
	border-color: var(--ahn-nt-danger);
	color: #fff;
}

.ahn-nt-btn-ghost-danger {
	color: var(--ahn-nt-danger);
}

.ahn-nt-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ahn-nt-accent);
	font: inherit;
	font-size: .875em;
	text-decoration: underline;
	cursor: pointer;
}

.ahn-nt-link-danger {
	color: var(--ahn-nt-danger);
}

/* --- Filtre ------------------------------------------------------------ */
.ahn-nt-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.ahn-nt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gap-tile);
}

.ahn-nt-chip {
	padding: 5px 12px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: 999px;
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
	font: inherit;
	font-size: .8125em;
	cursor: pointer;
}

.ahn-nt-chip[aria-pressed="true"] {
	background: var(--ahn-nt-accent);
	border-color: var(--ahn-nt-accent);
	color: var(--ahn-nt-accent-text);
}

/* --- Zoznam ------------------------------------------------------------ */
.ahn-nt-items {
	display: grid;
	gap: var(--gap-tile);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ahn-nt-item {
	padding: 14px 16px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-surface);
	background: var(--ahn-nt-surface);
}

.ahn-nt-item-paused,
.ahn-nt-item-done {
	background: var(--ahn-nt-subtle);
}

.ahn-nt-item-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 10px;
}

.ahn-nt-item-title {
	font-size: 1em;
	overflow-wrap: anywhere;
}

.ahn-nt-badge {
	padding: 1px 8px;
	border-radius: var(--r-control);
	background: var(--ahn-nt-subtle);
	border: 1px solid var(--ahn-nt-border);
	color: var(--ahn-nt-muted);
	font-size: .75em;
}

.ahn-nt-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 16px;
	margin-top: 4px;
	font-size: .875em;
}

.ahn-nt-schedule {
	font-weight: 600;
}

.ahn-nt-muted {
	color: var(--ahn-nt-muted);
}

.ahn-nt-status {
	margin: 8px 0 0;
	font-size: .875em;
	color: var(--ahn-nt-muted);
}

.ahn-nt-status-paused {
	color: var(--ahn-nt-danger);
}

.ahn-nt-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--gap-tile);
	margin-top: 12px;
}

.ahn-nt-confirm {
	font-size: .875em;
	font-weight: 600;
}

/* --- Formulár ---------------------------------------------------------- */
.ahn-nt-grid {
	display: grid;
	gap: 14px;
	margin-top: 8px;
}

.ahn-nt-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.ahn-nt-field {
	display: grid;
	gap: 4px;
}

.ahn-nt-label {
	font-size: .8125em;
	font-weight: 600;
	color: var(--ahn-nt-text);
}

.ahn-nt-input {
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-control);
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
	font: inherit;
}

textarea.ahn-nt-input {
	min-height: 96px;
	resize: vertical;
}

.ahn-nt-input-num {
	width: 90px;
}

.ahn-nt-select-sm {
	width: auto;
	min-height: 32px;
	padding: 4px 8px;
	font-size: .8125em;
}

.ahn-nt-has-error .ahn-nt-input,
.ahn-nt-input[aria-invalid="true"] {
	border-color: var(--ahn-nt-danger);
}

.ahn-nt-error {
	margin: 0;
	color: var(--ahn-nt-danger);
	font-size: .8125em;
}

.ahn-nt-counter,
.ahn-nt-hint {
	margin: 0;
	color: var(--ahn-nt-muted);
	font-size: .75em;
}

.ahn-nt-counter {
	justify-self: end;
}

.ahn-nt-sub {
	display: grid;
	gap: 6px;
	padding: 10px 12px;
	background: var(--ahn-nt-subtle);
	border-radius: var(--r-surface);
}

.ahn-nt-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ahn-nt-inline .ahn-nt-input {
	width: auto;
	flex: 1 1 140px;
}

.ahn-nt-inline .ahn-nt-input-num {
	flex: 0 0 90px;
}

.ahn-nt-days {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gap-tile);
}

.ahn-nt-day {
	min-width: 44px;
	min-height: 36px;
	padding: 4px 8px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-control);
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
	font: inherit;
	font-size: .875em;
	cursor: pointer;
}

.ahn-nt-day[aria-pressed="true"] {
	background: var(--ahn-nt-accent);
	border-color: var(--ahn-nt-accent);
	color: var(--ahn-nt-accent-text);
}

.ahn-nt-recipients {
	display: grid;
	gap: 8px;
	justify-items: start;
	margin-top: -6px;
}

.ahn-nt-recipient-list {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: .875em;
}

.ahn-nt-recipient-list li {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: baseline;
}

.ahn-nt-add-email {
	display: grid;
	gap: 4px;
	width: 100%;
}

.ahn-nt-preview {
	padding: 12px 14px;
	border: 1px dashed var(--ahn-nt-border);
	border-radius: var(--r-surface);
}

.ahn-nt-preview:empty {
	display: none;
}

.ahn-nt-preview-text {
	margin: 0 0 6px;
	font-weight: 600;
}

.ahn-nt-preview-list {
	margin: 4px 0 8px;
	padding-left: 18px;
	font-size: .875em;
}

.ahn-nt-login {
	padding: 16px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-surface);
}

/* --- Zvonček a koliesko ------------------------------------------------- */
.ahn-nt-tools {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.ahn-nt-head .ahn-nt-tools {
	margin-left: auto;
}

.ahn-nt-head .ahn-nt-btn-primary + .ahn-nt-tools {
	margin-left: 0;
}

.ahn-nt-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-control);
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
	cursor: pointer;
	text-decoration: none;
}

.ahn-nt-icon-btn:hover {
	border-color: var(--ahn-nt-muted);
}

.ahn-nt-icon-btn:focus-visible {
	outline: 2px solid var(--ahn-nt-accent);
	outline-offset: 2px;
}

/* „!“ – predplatné bez pripomienky (nie počet, len výzva). */
.ahn-nt-bell-badge {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--ahn-nt-danger);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
}

.ahn-nt-bell-wrap {
	position: relative;
}

.ahn-nt-pop {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 50;
	width: min(320px, calc(100vw - 32px));
	padding: 12px 14px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-surface);
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
	box-shadow: 0 8px 24px rgba(17, 24, 39, .12);
	font-size: 14px;
	text-align: left;
}

/* Zvonček pri ľavom okraji (napr. hlavička) – okno sa otvára doprava. */
.ahn-nt-pop.ahn-nt-pop-start {
	right: auto;
	left: 0;
}

.ahn-nt-pop-title {
	margin: 0 0 8px;
	font-weight: 600;
}

.ahn-nt-pop .ahn-nt-notice {
	font-size: .9em;
}

.ahn-nt-offer {
	display: grid;
	gap: 4px;
	margin-bottom: 10px;
	padding: 10px;
	background: var(--ahn-nt-subtle);
}

.ahn-nt-offer .ahn-nt-actions {
	margin-top: 4px;
}

.ahn-nt-pop-links {
	display: grid;
	gap: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--ahn-nt-border);
}

.ahn-nt-pop-links a {
	color: var(--ahn-nt-accent);
}

.ahn-nt-bell-widget {
	display: inline-block;
}

/* --- Nastavenia ---------------------------------------------------------- */
.ahn-nt-section {
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.ahn-nt-subtitle {
	margin: 0 0 6px;
	font-size: 1.05em;
}

.ahn-nt-switch {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 6px 0;
	cursor: pointer;
}

.ahn-nt-switch-end {
	margin: 0 0 0 auto;
	font-size: .875em;
}

/* Prepínač: skutočný checkbox (prístupnosť), vizuál cez .ahn-nt-switch-ui. */
.ahn-nt-switch-input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.ahn-nt-switch-ui {
	position: relative;
	flex: none;
	width: 38px;
	height: 22px;
	border-radius: 999px;
	background: var(--ahn-nt-border);
	transition: background-color .15s ease;
}

.ahn-nt-switch-ui::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform .15s ease;
}

.ahn-nt-switch-input:checked + .ahn-nt-switch-ui {
	background: var(--ahn-nt-accent);
}

.ahn-nt-switch-input:checked + .ahn-nt-switch-ui::after {
	transform: translateX(16px);
}

.ahn-nt-switch-input:focus-visible + .ahn-nt-switch-ui {
	outline: 2px solid var(--ahn-nt-accent);
	outline-offset: 2px;
}

.ahn-nt-switch-input:disabled + .ahn-nt-switch-ui {
	opacity: .5;
}

.ahn-nt-sub-editor {
	display: grid;
	gap: 10px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--ahn-nt-border);
}

.ahn-nt-offsets {
	display: grid;
	gap: 6px;
}

.ahn-nt-offsets .ahn-nt-link {
	justify-self: start;
}

.ahn-nt-item-focus {
	outline: 2px solid var(--ahn-nt-accent);
	outline-offset: -2px;
}

/* Notifikácie odberov v kalendári – odlíšené čiarkovaným okrajom. */
.ahn-nt-cal-item.ahn-nt-cal-sub,
.ahn-nt-cal-entry.ahn-nt-cal-sub {
	border-left-style: dashed;
}

.ahn-nt-badge-sub {
	border-style: dashed;
}

.ahn-nt-cal-entry-meta a {
	color: var(--ahn-nt-accent);
}

/* --- Kalendár ---------------------------------------------------------- */
.ahn-nt-cal-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin-bottom: 12px;
}

/* Navigácia vpravo; min. šírka nadpisu obdobia – tlačidlá pri prepínaní neposkakujú. */
.ahn-nt-cal-navs {
	display: flex;
	align-items: center;
	gap: var(--gap-tile);
	margin-left: auto;
}

.ahn-nt-cal-label {
	min-width: 8.5em;
	margin: 0;
	font-size: 1.05em;
	text-align: center;
	white-space: nowrap;
}

.ahn-nt-cal-nav {
	min-width: 36px;
	font-size: 1.1em;
}

/* 7 stĺpcov; minmax(0, 1fr) – dlhý predmet nesmie roztiahnuť stĺpec. */
.ahn-nt-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--ahn-nt-border);
	background: var(--ahn-nt-border);
	border-radius: var(--r-surface);
	overflow: hidden;
	transition: opacity .15s ease;
}

.ahn-nt-cal-grid[aria-busy="true"] {
	opacity: .55;
}

.ahn-nt-cal-wd {
	padding: 6px 4px;
	background: var(--ahn-nt-subtle);
	color: var(--ahn-nt-muted);
	font-size: .75em;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.ahn-nt-cal-day {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 3px;
	min-height: 92px;
	padding: 6px;
	border: 0;
	border-radius: 0;
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
	font: inherit;
	font-size: .8125em;
	text-align: left;
	cursor: pointer;
}

.ahn-nt-cal-day:hover {
	background: var(--ahn-nt-subtle);
}

.ahn-nt-cal-day:focus-visible {
	position: relative;
	z-index: 1;
	outline: 2px solid var(--ahn-nt-accent);
	outline-offset: -2px;
}

.ahn-nt-cal-out,
.ahn-nt-cal-past {
	color: var(--ahn-nt-muted);
}

.ahn-nt-cal-out {
	background: var(--ahn-nt-subtle);
}

.ahn-nt-cal-num {
	font-weight: 600;
	line-height: 1.6;
}

.ahn-nt-cal-today .ahn-nt-cal-num {
	align-self: flex-start;
	min-width: 1.6em;
	padding: 0 .35em;
	border-radius: var(--r-control);
	background: var(--ahn-nt-accent);
	color: var(--ahn-nt-accent-text);
	text-align: center;
}

/* Názov dňa v bunke len v týždni na mobile (inde je hlavička stĺpca). */
.ahn-nt-cal-wdname {
	display: none;
}

.ahn-nt-cal-items {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.ahn-nt-cal-item {
	overflow: hidden;
	padding: 1px 4px;
	border-left: 2px solid var(--ahn-nt-accent);
	background: var(--ahn-nt-subtle);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ahn-nt-cal-time {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.ahn-nt-cal-more {
	color: var(--ahn-nt-muted);
	font-size: .9em;
}

.ahn-nt-cal-dot {
	display: none;
}

/* Stav termínu: farba okraja a textu stavu. */
.ahn-nt-cal-st-sent {
	border-left-color: var(--ahn-nt-success);
}

.ahn-nt-cal-st-failed,
.ahn-nt-cal-st-limited {
	border-left-color: var(--ahn-nt-danger);
}

.ahn-nt-cal-st-skipped {
	border-left-color: var(--ahn-nt-muted);
}

.ahn-nt-cal-is-week .ahn-nt-cal-day {
	min-height: 160px;
}

.ahn-nt-cal-is-week .ahn-nt-cal-item {
	white-space: normal;
	overflow-wrap: anywhere;
}

/* --- Okno dňa ---------------------------------------------------------- */
.ahn-nt-cal-dialog {
	width: min(480px, calc(100vw - 32px));
	max-height: calc(100vh - 64px);
	padding: 18px 20px;
	border: 1px solid var(--ahn-nt-border);
	border-radius: var(--r-surface);
	background: var(--ahn-nt-surface);
	color: var(--ahn-nt-text);
}

.ahn-nt-cal-dialog::backdrop {
	background: rgba(17, 24, 39, .45);
}

.ahn-nt-cal-dialog-head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 12px;
}

.ahn-nt-cal-dialog-title {
	flex: 1;
	margin: 0;
	font-size: 1.05em;
}

.ahn-nt-cal-close {
	padding: 0 6px;
	border: 0;
	border-radius: var(--r-control);
	background: none;
	color: var(--ahn-nt-muted);
	font: inherit;
	font-size: 1.5em;
	line-height: 1;
	cursor: pointer;
}

.ahn-nt-cal-close:focus-visible {
	outline: 2px solid var(--ahn-nt-accent);
}

.ahn-nt-cal-list {
	display: grid;
	gap: var(--gap-tile);
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}

.ahn-nt-cal-entry {
	display: flex;
	gap: 12px;
	padding: 8px 10px;
	border-left: 3px solid var(--ahn-nt-accent);
	background: var(--ahn-nt-subtle);
}

.ahn-nt-cal-entry-main {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.ahn-nt-cal-entry .ahn-nt-cal-subject {
	overflow-wrap: anywhere;
}

.ahn-nt-cal-entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	font-size: .8125em;
	color: var(--ahn-nt-muted);
}

.ahn-nt-cal-st-sent .ahn-nt-cal-state {
	color: var(--ahn-nt-success);
}

.ahn-nt-cal-st-failed .ahn-nt-cal-state,
.ahn-nt-cal-st-limited .ahn-nt-cal-state {
	color: var(--ahn-nt-danger);
}

.ahn-nt-cal-dialog .ahn-nt-empty {
	margin: 0 0 14px;
}

/* Mobil: mesiac len čísla s počtom, týždeň ako zvislý zoznam dní. */
@media (max-width: 640px) {
	.ahn-nt-cal-navs {
		order: 5; /* navigácia pod nadpisom, zvonček ostane hore vpravo */
		width: 100%;
		margin-left: 0;
	}

	.ahn-nt-cal-toolbar .ahn-nt-tools {
		margin-left: auto;
	}

	.ahn-nt-cal-label {
		flex: 1;
		min-width: 0;
	}

	.ahn-nt-cal-day {
		min-height: 52px;
		padding: 4px;
		align-items: center;
		text-align: center;
	}

	.ahn-nt-cal-items {
		display: none;
	}

	.ahn-nt-cal-dot {
		display: inline-block;
		min-width: 1.5em;
		padding: 0 .3em;
		border-radius: 999px;
		background: var(--ahn-nt-subtle);
		border: 1px solid var(--ahn-nt-border);
		font-size: .75em;
		line-height: 1.4;
	}

	.ahn-nt-cal-today .ahn-nt-cal-num {
		align-self: center;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-grid {
		grid-template-columns: 1fr;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-wd {
		display: none;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-day {
		flex-direction: row;
		align-items: flex-start;
		min-height: 48px;
		padding: 8px 10px;
		text-align: left;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-num {
		display: flex;
		gap: 6px;
		min-width: 4.5em;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-today .ahn-nt-cal-num {
		align-self: flex-start;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-wdname {
		display: inline;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-items {
		display: grid;
		flex: 1;
	}

	.ahn-nt-cal-is-week .ahn-nt-cal-dot {
		display: none;
	}
}

@media (max-width: 480px) {
	.ahn-nt-row {
		grid-template-columns: 1fr;
	}

	.ahn-nt-head .ahn-nt-btn-primary {
		margin-left: 0;
	}
}
