/* Hotel POS — frontend stilovi */

.hpos {
	--bg: #f3f1ec;
	--surface: #ffffff;
	--surface-2: #faf8f4;
	--ink: #20201d;
	--muted: #6c6a64;
	--line: #e7e3da;
	--brand: #16433b;
	--brand-2: #1f5a4f;
	--accent: #bb842a;
	--accent-soft: #f6ecd8;
	--danger: #b3261e;
	--ok: #1f7a4d;
	--radius: 16px;
	--radius-sm: 11px;
	--shadow: 0 1px 2px rgba(30, 28, 24, .06), 0 8px 24px rgba(30, 28, 24, .07);
	--shadow-sm: 0 1px 2px rgba(30, 28, 24, .08);

	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.hpos *, .hpos *::before, .hpos *::after { box-sizing: inherit; }
.hpos button { font-family: inherit; cursor: pointer; }
.hpos h1, .hpos h2, .hpos h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: -.01em; margin: 0; }

.hpos-loading {
	padding: 48px 16px;
	text-align: center;
	color: var(--muted);
}

/* Obavijest / nema ovlasti */
.hpos-notice {
	max-width: 520px;
	margin: 24px auto;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 28px 24px;
	text-align: center;
	box-shadow: var(--shadow-sm);
}
.hpos-btn {
	display: inline-block;
	background: var(--brand);
	color: #fff;
	text-decoration: none;
	padding: 11px 20px;
	border-radius: 999px;
	font-weight: 600;
	border: none;
}

/* ---------- Prijava / Odjava ---------- */
.hpos-logout {
	color: #fff !important;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 999px;
	background: rgba(255, 255, 255, .12);
	white-space: nowrap;
	line-height: 1;
	transition: background .15s ease, border-color .15s ease;
}
.hpos-logout:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .55); }
.hpos-logout:active { background: rgba(255, 255, 255, .3); }

.hpos-login {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 40px 16px;
	min-height: 60vh;
}
.hpos-login-card {
	width: 100%;
	max-width: 400px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}
.hpos-login-head {
	background: var(--brand);
	color: #fff;
	padding: 26px 24px 22px;
	text-align: center;
}
.hpos-login-head strong { font-family: Georgia, serif; font-size: 23px; display: block; font-weight: 600; line-height: 1.15; }
.hpos-login-head span { display: inline-block; margin-top: 8px; font-size: 11px; opacity: .85; letter-spacing: .12em; text-transform: uppercase; }
.hpos-login-body { padding: 24px; }
.hpos-login-intro { margin: 0 0 18px; font-size: 14px; color: var(--muted); text-align: center; line-height: 1.45; }
.hpos-login form p { margin: 0 0 14px; }
.hpos-login label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.hpos-login input[type="text"],
.hpos-login input[type="password"] {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 13px 15px;
	font-size: 16px;
	color: var(--ink);
	background: var(--surface-2);
	box-sizing: border-box;
	line-height: 1.4;
	transition: border-color .15s ease, background .15s ease;
}
.hpos-login input[type="text"]:focus,
.hpos-login input[type="password"]:focus {
	outline: none;
	border-color: var(--brand);
	background: var(--surface);
	box-shadow: 0 0 0 3px rgba(22, 67, 59, .12);
}
.hpos-login .login-remember { font-size: 14px; margin-bottom: 18px; }
.hpos-login .login-remember label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); margin: 0; }
.hpos-login .login-remember input { width: 17px; height: 17px; accent-color: var(--brand); }
.hpos-login .login-submit { margin-top: 4px; }
.hpos-login .login-submit input {
	width: 100%;
	border: none;
	background: var(--brand);
	color: #fff;
	padding: 15px;
	border-radius: 13px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: var(--shadow);
	transition: background .15s ease;
}
.hpos-login .login-submit input:hover { background: var(--brand-2); }
.hpos-login .login-submit input:active { transform: translateY(1px); }

/* ---------- Ljuska aplikacije ---------- */
.hpos-app {
	max-width: 1100px;
	margin: 0 auto;
	background: var(--bg);
	border-radius: var(--radius);
	overflow: hidden;
}
.hpos-header {
	position: sticky;
	top: 0;
	z-index: 30;
	background: var(--brand);
	color: #fff;
	padding: 14px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.hpos-header .hpos-brand { display: flex; flex-direction: column; line-height: 1.1; }
.hpos-header .hpos-brand strong { font-family: Georgia, serif; font-size: 19px; font-weight: 600; }
.hpos-header .hpos-brand span { font-size: 12px; opacity: .75; letter-spacing: .04em; text-transform: uppercase; }
.hpos-header a { color: #fff; opacity: .85; text-decoration: none; font-size: 14px; }
.hpos-header a:hover { opacity: 1; }

.hpos-toolbar { padding: 14px 16px 4px; }
.hpos-search {
	width: 100%;
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: 999px;
	padding: 12px 16px;
	font-size: 15px;
	color: var(--ink);
}
.hpos-search:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }

.hpos-chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 12px 16px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.hpos-chips::-webkit-scrollbar { display: none; }
.hpos-chip {
	flex: 0 0 auto;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	padding: 8px 15px;
	border-radius: 999px;
	font-size: 14px;
	white-space: nowrap;
}
.hpos-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Mreža artikala ---------- */
.hpos-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	align-items: stretch;
	gap: 10px;
	padding: 6px 16px 140px;
}
.hpos-card {
	position: relative;
	text-align: left;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 14px;
	min-height: 104px;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: transform .08s ease, box-shadow .12s ease;
	box-shadow: var(--shadow-sm);
}
.hpos-card:active { transform: scale(.97); }
.hpos-card .hpos-card-name {
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 2.6em;
}
.hpos-card .hpos-card-price { margin-top: 10px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.hpos-card .hpos-card-badge {
	position: absolute;
	top: -8px; right: -8px;
	background: var(--brand);
	color: #fff;
	min-width: 26px;
	height: 26px;
	border-radius: 999px;
	display: flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 700;
	box-shadow: var(--shadow-sm);
}
.hpos-empty { padding: 40px 16px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* ---------- Donja traka računa ---------- */
.hpos-cartbar {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: 14px;
	width: calc(100% - 24px);
	max-width: 560px;
	z-index: 40;
	background: var(--brand);
	color: #fff;
	border-radius: 14px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	box-shadow: 0 10px 30px rgba(22, 67, 59, .35);
	border: none;
}
.hpos-cartbar.is-hidden { display: none; }
.hpos-cartbar .hpos-cartbar-left { display: flex; align-items: center; gap: 10px; }
.hpos-cartbar .hpos-cartbar-count {
	background: rgba(255, 255, 255, .18);
	border-radius: 8px; padding: 4px 9px; font-weight: 700; font-size: 14px;
}
.hpos-cartbar .hpos-cartbar-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.hpos-cartbar .hpos-cartbar-cta { font-weight: 600; opacity: .95; }

/* ---------- Donji panel (košarica / pregled) ---------- */
.hpos-sheet-backdrop {
	position: fixed; inset: 0; z-index: 50;
	background: rgba(20, 18, 14, .45);
	display: none;
}
.hpos-sheet-backdrop.is-open { display: block; }
.hpos-sheet {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
	background: var(--surface);
	border-radius: 20px 20px 0 0;
	max-height: 88vh;
	display: flex; flex-direction: column;
	transform: translateY(100%);
	transition: transform .25s ease;
	box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
}
.hpos-sheet.is-open { transform: translateY(0); }
.hpos-sheet-head {
	padding: 16px 18px 10px;
	display: flex; align-items: center; justify-content: space-between;
	border-bottom: 1px solid var(--line);
}
.hpos-sheet-head h2 { font-size: 18px; }
.hpos-x {
	background: var(--surface-2); border: 1px solid var(--line);
	width: 34px; height: 34px; border-radius: 999px; font-size: 18px; color: var(--muted);
	display: flex; align-items: center; justify-content: center;
}
.hpos-sheet-body { overflow-y: auto; padding: 8px 18px; -webkit-overflow-scrolling: touch; }
.hpos-sheet-foot { padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-2); }

.hpos-line {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 0; border-bottom: 1px solid var(--line);
}
.hpos-line:last-child { border-bottom: none; }
.hpos-line-main { flex: 1; min-width: 0; }
.hpos-line-name { font-weight: 600; font-size: 15px; }
.hpos-line-price { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hpos-stepper { display: flex; align-items: center; gap: 6px; }
.hpos-step {
	width: 34px; height: 34px; border-radius: 9px;
	border: 1px solid var(--line); background: var(--surface);
	font-size: 19px; line-height: 1; color: var(--ink);
	display: flex; align-items: center; justify-content: center;
}
.hpos-step:active { background: var(--surface-2); }
.hpos-qty { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.hpos-line-total { min-width: 78px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.hpos-field { margin: 12px 0; }
.hpos-field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.hpos-input, .hpos-select, .hpos-textarea {
	width: 100%; border: 1px solid var(--line); background: var(--surface);
	border-radius: 11px; padding: 12px 14px; font-size: 15px; color: var(--ink);
	line-height: 1.4;
}
.hpos-input, .hpos-select { min-height: 48px; }
.hpos-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 40px;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2320201d' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	text-overflow: ellipsis;
}
.hpos-textarea { resize: vertical; min-height: 56px; }
.hpos-input:focus, .hpos-select:focus, .hpos-textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }

.hpos-totals { margin: 6px 0 14px; }
.hpos-totals .hpos-row { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.hpos-totals .hpos-row.hpos-grand { font-size: 20px; font-weight: 800; padding-top: 8px; }
.hpos-totals .hpos-grand .v { color: var(--brand); }

.hpos-primary {
	width: 100%; border: none; background: var(--brand); color: #fff;
	padding: 16px; border-radius: 13px; font-size: 17px; font-weight: 700;
	box-shadow: var(--shadow);
}
.hpos-primary:disabled { opacity: .5; }
.hpos-primary:active { background: var(--brand-2); }
.hpos-link-danger { background: none; border: none; color: var(--danger); font-size: 14px; padding: 8px; }
.hpos-error { color: var(--danger); font-size: 14px; margin: 4px 0 10px; }

/* ---------- Potvrda (modal + ispis) ---------- */
.hpos-modal {
	position: fixed; inset: 0; z-index: 80;
	background: rgba(20, 18, 14, .55);
	display: none; align-items: flex-start; justify-content: center;
	padding: 20px; overflow-y: auto;
}
.hpos-modal.is-open { display: flex; }
.hpos-receipt-wrap {
	background: var(--surface);
	border-radius: var(--radius);
	width: 100%; max-width: 360px;
	box-shadow: var(--shadow);
	overflow: hidden;
}
.hpos-print-area { padding: 24px 22px; }
.hpos-receipt-brand { text-align: center; }
.hpos-receipt-brand strong { font-family: Georgia, serif; font-size: 20px; display: block; }
.hpos-receipt-brand .hpos-receipt-sub { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
.hpos-receipt-room {
	text-align: center; margin: 16px 0;
	background: var(--accent-soft); border-radius: 12px; padding: 10px;
}
.hpos-receipt-room small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hpos-receipt-room b { font-size: 19px; }
.hpos-receipt-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 10px; }
.hpos-rule { border: none; border-top: 1px dashed var(--line); margin: 12px 0; }
.hpos-receipt-items { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hpos-receipt-items td { padding: 5px 0; vertical-align: top; font-size: 14px; }
.hpos-receipt-items .q { width: 30px; color: var(--muted); }
.hpos-receipt-items .a { text-align: right; white-space: nowrap; font-weight: 600; }
.hpos-receipt-grand { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; margin-top: 8px; }
.hpos-receipt-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.hpos-receipt-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }
.hpos-receipt-actions { display: flex; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.hpos-receipt-actions button { flex: 1; padding: 13px; border-radius: 11px; font-weight: 700; border: none; }
.hpos-btn-print { background: var(--brand); color: #fff; }
.hpos-btn-new { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line) !important; }

/* ---------- Upravljanje ---------- */
.hpos-tabs { display: flex; gap: 6px; padding: 14px 16px 0; flex-wrap: wrap; }
.hpos-tab {
	border: 1px solid var(--line); background: var(--surface); color: var(--ink);
	padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.hpos-tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.hpos-panel { padding: 16px; }
.hpos-toast {
	position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
	background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
	font-size: 14px; z-index: 90; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.hpos-toast.is-show { opacity: 1; }

.hpos-mcard {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
	box-shadow: var(--shadow-sm);
}
.hpos-mcard.is-hidden-item { opacity: .6; }
.hpos-mrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hpos-mrow .hpos-m-name { flex: 1; min-width: 140px; font-weight: 600; }
.hpos-m-cat { font-size: 12px; color: var(--muted); display: block; font-weight: 400; }
.hpos-price-edit { display: flex; align-items: center; gap: 6px; }
.hpos-price-edit input { width: 92px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.hpos-mini {
	border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
	padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 600;
}
.hpos-mini.is-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.hpos-mini.is-danger { color: var(--danger); }
.hpos-badge-hidden { font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 999px; font-weight: 700; }

.hpos-addbox {
	background: var(--surface); border: 1px dashed var(--line);
	border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px;
}
.hpos-addbox h3 { font-size: 16px; margin-bottom: 10px; }
.hpos-add-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }

.hpos-order-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hpos-order-row .hpos-o-room { font-weight: 700; }
.hpos-order-row .hpos-o-meta { font-size: 13px; color: var(--muted); }
.hpos-order-row .hpos-o-total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.hpos-status { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.hpos-status.is-room { background: var(--accent-soft); color: var(--accent); }
.hpos-status.is-completed { background: #e3f3e9; color: var(--ok); }
.hpos-status.is-cancelled { background: #f7e2e0; color: var(--danger); }

/* ---------- Računi po sobama ---------- */
.hpos-orders-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hpos-orders-filter label { font-size: 13px; font-weight: 600; color: var(--muted); }
.hpos-orders-filter .hpos-select { flex: 1 1 150px; min-width: 140px; max-width: 220px; }
.hpos-order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hpos-order-head .hpos-o-room { font-weight: 700; font-size: 16px; }
.hpos-order-head .hpos-o-total { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.hpos-order .hpos-o-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.hpos-order-items { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.hpos-oi { display: flex; gap: 10px; padding: 3px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.hpos-oi-q { color: var(--muted); min-width: 30px; }
.hpos-oi-n { flex: 1; min-width: 0; }
.hpos-oi-a { font-weight: 600; white-space: nowrap; }
.hpos-order-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hpos-move { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.hpos-move-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.hpos-move-sel { flex: 1 1 160px; min-width: 150px; max-width: 240px; min-height: 40px; padding: 8px 34px 8px 12px; font-size: 14px; }

/* ---------- Šire ---------- */
@media (min-width: 600px) {
	.hpos-grid { grid-template-columns: repeat(3, 1fr); }
	.hpos-add-grid { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
}
@media (min-width: 900px) {
	.hpos-grid { grid-template-columns: repeat(4, 1fr); }
	.hpos-sheet { left: auto; right: 18px; bottom: 18px; width: 400px; border-radius: 18px; max-height: 80vh; }
	.hpos-sheet:not(.is-open) { transform: translateY(120%); }
}

@media (prefers-reduced-motion: reduce) {
	.hpos-sheet, .hpos-card { transition: none; }
}

/* ---------- Ispis potvrde ---------- */
@media print {
	body * { visibility: hidden !important; }
	.hpos-print-area, .hpos-print-area * { visibility: visible !important; }
	.hpos-print-area {
		position: absolute; left: 0; top: 0; width: 80mm; padding: 4mm;
		color: #000; box-shadow: none;
	}
	.hpos-no-print { display: none !important; }
	.hpos-receipt-room { background: none; border: 1px dashed #000; }
	.hpos-receipt-room small, .hpos-receipt-brand .hpos-receipt-sub, .hpos-receipt-meta, .hpos-receipt-foot, .hpos-receipt-note { color: #000; }
	@page { margin: 6mm; }
}
