/* Gringo KDS — touch-friendly kitchen dashboard */

/* Standalone full-screen page (/gringo-kds) */
body.gringo-kds-standalone {
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #f0f2f5;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.gringo-kds-standalone-wrap {
	margin: 0;
	height: 100vh;
}

.gringo-kds-standalone .gringo-kds-app {
	min-height: 100vh;
	height: 100vh;
}

/* PIN belépő képernyő */
.gringo-kds-pin-screen {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1e2a3a;
	padding: 20px;
}

.gringo-kds-pin-card {
	background: #fff;
	border-radius: 12px;
	padding: 32px 40px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.gringo-kds-pin-card h1 {
	margin: 0 0 16px;
	font-size: 1.75rem;
	color: #1e2a3a;
}

.gringo-kds-pin-card p {
	margin: 0 0 16px;
	color: #444;
	font-size: 1.05rem;
}

.gringo-kds-pin-form input,
.gringo-kds-pin-form button,
.gringo-kds-pin-login {
	min-height: 56px;
	font-size: 1.1rem;
	width: 100%;
	margin-top: 8px;
	border-radius: 8px;
}

.gringo-kds-pin-form input {
	border: 2px solid #ccc;
	padding: 12px 16px;
	text-align: center;
	letter-spacing: 0.2em;
}

.gringo-kds-pin-form button,
.gringo-kds-pin-login {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #1976d2;
	color: #fff;
	border: none;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.gringo-kds-pin-alt {
	margin-top: 20px !important;
	font-size: 0.95rem !important;
}

.gringo-kds-pin-alt a {
	color: #1976d2;
}

.gringo-kds-wrap {
	margin: 0;
}

.gringo-kds-app {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	color: #1a1a1a;
	background: #f0f2f5;
	min-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
}

/* Header */
.kds-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px 16px;
	background: #1e2a3a;
	color: #fff;
	min-height: 56px;
}

.kds-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
}

.kds-clock {
	font-size: 1.25rem;
	font-weight: 600;
	margin-left: 16px;
	font-variant-numeric: tabular-nums;
}

.kds-header-right {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.kds-poll-status {
	font-size: 0.9rem;
	opacity: 0.9;
}

.kds-poll-status.kds-error {
	color: #ff8a80;
}

/* Body layout */
.kds-body {
	display: grid;
	grid-template-columns: 140px 1fr 200px;
	flex: 1;
	gap: 0;
	min-height: 0;
}

@media (max-width: 1100px) {
	.kds-body {
		grid-template-columns: 120px 1fr;
	}
	.kds-sidebar {
		grid-column: 1 / -1;
		border-top: 2px solid #ccc;
	}
}

/* Filters */
.kds-filters {
	background: #2c3e50;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.kds-filter {
	min-height: 56px;
	padding: 10px 8px;
	border: none;
	border-radius: 6px;
	background: #3d5166;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
}

.kds-filter:hover,
.kds-filter.active {
	background: #e67e22;
}

/* Orders area */
.kds-orders {
	padding: 12px;
	overflow-y: auto;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 12px;
	align-content: start;
}

.kds-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px;
	font-size: 1.2rem;
	color: #666;
}

/* Cards */
.kds-card {
	background: #fff;
	border-radius: 8px;
	border: 3px solid #ccc;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.kds-status-new { border-color: #2196f3; }
.kds-status-printed { border-color: #ff9800; }
.kds-status-preparing { border-color: #ffeb3b; background: #fffde7; }
.kds-status-ready { border-color: #4caf50; }
.kds-status-courier { border-color: #9e9e9e; }
.kds-status-done { border-color: #607d8b; opacity: 0.7; }

.kds-late {
	box-shadow: 0 0 0 3px #f44336, 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kds-blink {
	animation: kds-blink 1s ease-in-out infinite;
}

@keyframes kds-blink {
	0%, 100% { box-shadow: 0 0 0 4px #2196f3; }
	50% { box-shadow: 0 0 0 4px transparent; }
}

.kds-card-head {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding: 10px 12px;
	background: #fafafa;
	border-bottom: 1px solid #eee;
}

.kds-order-num {
	font-size: 1.4rem;
	font-weight: 800;
}

.kds-badge {
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 700;
}

.kds-badge-status {
	background: #e0e0e0;
	color: #333;
}

.kds-pay-paid {
	background: #4caf50;
	color: #fff;
}

.kds-pay-unpaid {
	background: #ffeb3b;
	color: #333;
}

.kds-card-meta {
	padding: 10px 12px;
	font-size: 0.95rem;
}

.kds-card-meta > div {
	margin-bottom: 4px;
}

.kds-elapsed {
	color: #e65100;
	font-weight: 600;
}

.kds-note {
	background: #fff3e0;
	padding: 8px;
	border-radius: 4px;
	margin-top: 6px;
}

.kds-card-items {
	padding: 8px 12px;
	border-top: 1px solid #eee;
	flex: 1;
	max-height: 220px;
	overflow-y: auto;
}

.kds-item {
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px dashed #ddd;
}

.kds-item-head {
	font-weight: 600;
	margin-bottom: 4px;
}

.kds-item-price {
	color: #666;
	font-weight: 400;
	font-size: 0.9rem;
}

.kds-item-options {
	margin: 4px 0 0 16px;
	padding: 0;
	list-style: disc;
	font-size: 0.9rem;
}

.kds-opt-label {
	font-weight: 600;
}

/* Actions */
.kds-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 12px;
	background: #f5f5f5;
	border-top: 1px solid #eee;
}

.kds-btn {
	min-height: 56px;
	min-width: 56px;
	padding: 10px 14px;
	border: none;
	border-radius: 6px;
	background: #1976d2;
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	touch-action: manipulation;
}

.kds-btn:hover {
	background: #1565c0;
}

.kds-btn:active {
	transform: scale(0.98);
}

.kds-btn-secondary {
	background: #546e7a;
}

.kds-btn-toggle[data-on="0"] {
	background: #757575;
}

.kds-header .kds-btn {
	min-height: 48px;
	font-size: 0.95rem;
}

/* Sidebar */
.kds-sidebar {
	background: #eceff1;
	padding: 12px;
	border-left: 1px solid #ccc;
	overflow-y: auto;
}

.kds-sidebar h2 {
	margin: 0 0 12px;
	font-size: 1.1rem;
}

.kds-courier-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 48px;
	padding: 8px 10px;
	background: #fff;
	border-radius: 6px;
	margin-bottom: 6px;
	font-weight: 600;
}

.kds-courier-count {
	background: #37474f;
	color: #fff;
	border-radius: 20px;
	min-width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
}

.kds-assign-panel {
	margin-top: 16px;
	padding: 12px;
	background: #fff;
	border-radius: 8px;
	border: 2px solid #1976d2;
}

.kds-assign-panel .kds-btn {
	width: 100%;
	margin-bottom: 6px;
}

#kds-courier-buttons {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 10px 0;
}

/* Modal */
.kds-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.kds-modal[hidden] {
	display: none !important;
}

.kds-modal-inner {
	background: #fff;
	border-radius: 10px;
	max-width: 700px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	padding: 16px;
}

.kds-modal-close {
	position: absolute;
	top: 8px;
	right: 12px;
	border: none;
	background: none;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	color: #333;
	min-height: 48px;
	min-width: 48px;
}

/* Print fallback */
.kds-print-fallback[hidden] {
	display: none !important;
}

.kds-print-pre {
	font-family: "Courier New", monospace;
	font-size: 12px;
	white-space: pre-wrap;
}

@media print {
	body * {
		visibility: hidden;
	}
	.kds-print-fallback,
	.kds-print-fallback * {
		visibility: visible;
	}
	.kds-print-fallback {
		position: absolute;
		left: 0;
		top: 0;
		width: 80mm;
	}
}

/* Shortcode / PIN */
.gringo-kds-shortcode {
	margin: 0;
}

.gringo-kds-pin-form {
	max-width: 320px;
	padding: 20px;
}

.gringo-kds-pin-form input,
.gringo-kds-pin-form button {
	min-height: 48px;
	font-size: 1rem;
	width: 100%;
	margin-top: 8px;
}

/* Shortcode notice (legacy) */
.gringo-kds-shortcode-notice {
	font-size: 1.1rem;
	padding: 16px;
}
