/* Tivaos Buchungs-App – mobile-first */
:root {
	--accent: #8E1C1D;       /* Antalya brand red (Elementor accent) */
	--accent-dark: #6f1517;
	--copper: #B87333;        /* brand secondary */
	--bg: #F5F3EF;            /* brand warm neutral */
	--card: #fff;
	--line: #e7e3dc;
	--text: #1d2327;
	--muted: #6b7177;
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	padding-bottom: calc(70px + var(--safe-b));
}
a { color: var(--accent); }

/* Top bar */
.topbar {
	position: sticky; top: 0; z-index: 50;
	background: var(--accent); color: #fff;
	display: flex; align-items: center; justify-content: space-between;
	padding: calc(12px + var(--safe-t)) 16px 12px;
	box-shadow: 0 1px 6px rgba(0,0,0,.15);
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 24px; width: auto; display: block; filter: brightness(0) invert(1); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.logout { color: #fff; text-decoration: none; font-size: 20px; line-height: 1; }

.lang { display: inline-flex; gap: 3px; }
.lang-btn {
	display: inline-block; min-width: 30px; text-align: center;
	padding: 3px 6px; border-radius: 5px; font-size: 11px; font-weight: 700;
	text-decoration: none; color: #fff; background: rgba(255,255,255,.18);
}
.lang-btn.on { background: #fff; color: var(--accent); }

/* Content */
.content { padding: 14px 14px 24px; max-width: 720px; margin: 0 auto; }
.content h2 { font-size: 15px; margin: 22px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.empty { color: var(--muted); font-style: italic; }

/* KPI grid */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.kpi-num { font-size: 26px; font-weight: 800; }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; }
.res-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.res-time { color: var(--accent); font-weight: 800; }
.res-name { font-size: 16px; font-weight: 700; margin: 4px 0 2px; }
.res-meta { font-size: 13px; color: var(--muted); }
.res-meta a { text-decoration: none; }
.res-msg { font-size: 13px; color: #444; background: #f7f7f8; border-radius: 7px; padding: 7px 9px; margin-top: 7px; }
.res-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

.daysep { font-weight: 700; font-size: 13px; color: var(--muted); margin: 16px 0 8px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 11px; color: #fff; font-size: 11px; font-weight: 700; }

/* Buttons */
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px; padding: 9px 13px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: #b32d2e; border-color: #e3b5b5; }
.btn[disabled] { opacity: .5; }

/* Filters / fields */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.filters input[type="search"] { flex: 1; min-width: 140px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.field input, .field select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; background: #fff; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 14px; }
.block-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Bottom nav */
.bottomnav {
	position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
	background: #fff; border-top: 1px solid var(--line);
	display: flex; justify-content: space-around;
	padding-bottom: var(--safe-b);
}
.nav-item {
	flex: 1; min-width: 0; text-align: center; padding: 9px 2px 7px;
	color: var(--muted); text-decoration: none; font-size: 10px;
	display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.on { color: var(--accent); }

/* Statistics */
.segmented { display: flex; gap: 6px; margin-bottom: 14px; }
.seg { flex: 1; text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.seg.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.stats-kpis { grid-template-columns: repeat(3, 1fr); }
.stats-kpis .kpi { padding: 12px 8px; }
.stats-kpis .kpi-num { font-size: 22px; }
.stats-kpis .kpi-label { font-size: 11px; }
.bars { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.bar-label { width: 30px; color: var(--muted); font-weight: 600; }
.bar-track { flex: 1; height: 10px; background: #ece8e1; border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.bar-val { width: 28px; text-align: right; font-weight: 700; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 30px 26px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 6px 30px rgba(0,0,0,.08); }
.login-logo-img { width: 220px; max-width: 74%; height: auto; display: block; margin: 0 auto 10px; }
.login-card h1 { font-size: 22px; margin: 8px 0 2px; }
.login-sub { color: var(--muted); margin: 0 0 18px; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.login-card label { display: block; text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.login-card input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 16px; margin-top: 5px; }
.login-card button { width: 100%; background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 13px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 4px; }
.login-err { background: #fde8e8; color: #b32d2e; border-radius: 8px; padding: 9px; font-size: 13px; margin-bottom: 14px; }
.login-card .lang { justify-content: center; margin-top: 18px; }
.login-card .lang-btn { background: #eee; color: var(--muted); }
.login-card .lang-btn.on { background: var(--accent); color: #fff; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
.modal-box { background: #fff; border-radius: 16px 16px 0 0; padding: 22px 20px calc(22px + var(--safe-b)); width: 100%; max-width: 480px; position: relative; max-height: 86vh; overflow: auto; }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 28px; color: #999; cursor: pointer; }
.modal-box h3 { margin: 0 0 12px; }
.mrow { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f1f1f1; font-size: 14px; }
.mrow span { color: var(--muted); }
.mrow textarea { width: 100%; min-height: 56px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-top: 6px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Help button */
.help-fab {
	position: fixed; left: 14px; bottom: calc(78px + var(--safe-b));
	width: 40px; height: 40px; border-radius: 50%;
	background: var(--accent); color: #fff; border: 0;
	font-size: 20px; font-weight: 800; line-height: 40px; text-align: center;
	cursor: pointer; z-index: 60; box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.help-list { margin: 8px 0 0; padding-left: 18px; }
.help-list li { margin: 9px 0; font-size: 14px; line-height: 1.45; color: #333; }

.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* --- Calendar (FullCalendar) brand theming --- */
#tvr-cal {
	background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-size: 13px;
	--fc-button-bg-color: var(--accent);
	--fc-button-border-color: var(--accent);
	--fc-button-hover-bg-color: var(--accent-dark);
	--fc-button-hover-border-color: var(--accent-dark);
	--fc-button-active-bg-color: var(--accent-dark);
	--fc-button-active-border-color: var(--accent-dark);
	--fc-today-bg-color: rgba(142,28,29,.06);
	--fc-now-indicator-color: var(--accent);
	--fc-border-color: #ece8e1;
	--fc-neutral-bg-color: #faf8f5;
}
.fc .fc-toolbar.fc-header-toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fc .fc-toolbar-title { font-size: 17px; font-weight: 700; }
.fc .fc-button { padding: 6px 10px; font-size: 12.5px; font-weight: 600; border-radius: 8px; box-shadow: none !important; text-transform: capitalize; }
.fc .fc-button-group > .fc-button { border-radius: 0; }
.fc .fc-button-group > .fc-button:first-child { border-radius: 8px 0 0 8px; }
.fc .fc-button-group > .fc-button:last-child { border-radius: 0 8px 8px 0; }
.fc .fc-timegrid-event, .fc .fc-daygrid-event { border-radius: 6px; font-size: 12px; padding: 1px 4px; font-weight: 600; }
.fc .fc-event { cursor: pointer; }
.fc .fc-list-event:hover td { background: var(--fc-today-bg-color); }
.fc .fc-list-event-title { font-weight: 600; }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: #555; text-decoration: none; }
.fc .fc-timegrid-now-indicator-line { border-color: var(--accent); }
@media (max-width: 520px) {
	#tvr-cal { padding: 8px; }
	.fc .fc-toolbar-title { font-size: 15px; }
	.fc .fc-button { padding: 6px 8px; font-size: 12px; }
	.fc .fc-toolbar.fc-header-toolbar { justify-content: center; }
}

/* --- Floating action buttons --- */
.add-fab {
	position: fixed; right: 16px; bottom: calc(80px + var(--safe-b));
	width: 54px; height: 54px; border-radius: 50%;
	background: var(--accent); color: #fff; border: 0;
	font-size: 30px; line-height: 54px; text-align: center; font-weight: 400;
	cursor: pointer; z-index: 60; box-shadow: 0 5px 16px rgba(142,28,29,.42);
}
.add-fab:active { transform: scale(.95); }

/* --- Manual add form --- */
#tvr-addform h3, #tvr-help h3 { margin: 0 0 14px; font-size: 19px; }
.aform label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 11px; }
.aform input, .aform textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 16px; margin-top: 5px; background: #fff; }
.aform .frow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.aform .acheck { display: flex; align-items: center; gap: 8px; font-weight: 400; color: #333; font-size: 13px; margin: 2px 0 4px; }
.aform .acheck input { width: auto; margin: 0; }
.aform-submit { width: 100%; margin-top: 8px; padding: 13px; font-size: 16px; }

/* --- Desktop (PC) --- */
@media (min-width: 820px) {
	.content { max-width: 940px; padding: 22px 22px 30px; }
	.kpis { grid-template-columns: repeat(4, 1fr); }
	.stats-kpis { grid-template-columns: repeat(6, 1fr); }
	.bottomnav { max-width: 940px; left: 50%; transform: translateX(-50%); border-radius: 14px 14px 0 0; }
	.add-fab { right: calc(50% - 470px + 16px); }
	.help-fab { left: calc(50% - 470px + 16px); }
	.modal { align-items: center; }
	.modal-box { border-radius: 16px; }
	#tvr-cal { min-height: 70vh; }
}
