:root {
  --bg: #faf9f7;
  --panel: #ffffff;
  --panel-2: #f3f1ee;
  --ink: #1b1a18;
  --muted: #756c60;
  --line: #e5e2dd;
  --brand: #146b70;
  --brand-dark: #0f5458;
  --brand-soft: #e3f1f1;
  --accent: #b4740e;
  --danger: #b0402c;
  --danger-soft: #fbe9e5;
  --ok: #1e7f4f;
  --ok-soft: #e5f4ec;
  --warn: #b4740e;
  --warn-soft: #faf0dc;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(27,26,24,.04), 0 1px 8px rgba(27,26,24,.04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--brand); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: var(--panel); color: var(--ink); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 0;
}
.sidebar .logo { padding: 0 22px 18px; font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.3; }
.sidebar .logo small { display:block; font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; margin: 1px 10px; padding: 8px 12px; border-radius: 6px;
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; cursor: pointer; border: none; background: none; width: calc(100% - 20px); text-align: left;
}
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
.sidebar .foot { margin-top: auto; padding: 16px 22px 0; }
.sidebar .foot a { color: var(--brand); font-size: 12.5px; text-decoration: none; }
.sidebar .whoami { color: var(--muted); }

.main { flex: 1; padding: 26px 32px; overflow-x: hidden; }
.page-title { margin: 0 0 4px; font-size: 22px; }
.page-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

/* ---------- Cards / grid ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); }
.stat .n { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 11.5px; margin-top: 4px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.stat.brand { background: var(--brand-soft); border-color: transparent; }
.stat.brand .n { color: var(--brand-dark); }
.stat.accent .n { color: var(--accent); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 650; letter-spacing: -0.005em; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }

/* ---------- Giris ekrani ---------- */
.login-bg { display: none; position: fixed; inset: 0; background: var(--brand-dark); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.login-bg.open { display: flex; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px 26px; width: 100%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.login-card h2 { margin: 0 0 6px; font-size: 20px; color: var(--ink); }
.login-card p { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.login-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px; margin-bottom: 12px; }
.login-card .btn { width: 100%; padding: 11px; font-size: 15px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }

/* ---------- Musaitlik Takvimi ---------- */
table.cal { border-collapse: separate; border-spacing: 0; min-width: 720px; }
table.cal th, table.cal td { border: 1px solid var(--line); padding: 0; }
.cal-corner, .cal-room { background: var(--bg); font-weight: 700; color: var(--ink); text-transform: none; font-size: 14px; text-align: center; padding: 8px 12px; position: sticky; left: 0; z-index: 1; white-space: nowrap; }
.cal-day { text-align: center; padding: 6px 4px; line-height: 1.15; min-width: 44px; }
.cal-day .cal-wd { display:block; font-size: 10px; color: var(--muted); }
.cal-day .cal-dn { display:block; font-size: 15px; font-weight: 700; color: var(--ink); }
.cal-day .cal-mo { display:block; font-size: 9px; color: var(--muted); text-transform: uppercase; }
.cal-day.today { background: var(--brand); }
.cal-day.today .cal-wd, .cal-day.today .cal-dn, .cal-day.today .cal-mo { color: #fff; }
.cal-day.wknd { background: #eef1f5; }
.cal-cell { height: 40px; position: relative; }
.cal-cell.free.wknd { background: #f5f7fa; }
.cal-cell.busy { background: var(--brand); }
.cal-cell.busy.booking { background: #2f6fb0; }
.cal-cell.busy.airbnb { background: #d05a6e; }
.cal-cell.busy.direct { background: var(--brand); }
.cal-guest { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; z-index: 2; pointer-events: none; }
.cal-legend { display:flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.cal-legend i.dot { display:inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.cal-legend .booking { background: #2f6fb0; } .cal-legend .airbnb { background: #d05a6e; }
.cal-legend .direct { background: var(--brand); } .cal-legend .free-dot { background: #fff; border: 1px solid var(--line); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.badge.temiz, .badge.confirmed { background: var(--ok-soft); color: var(--ok); }
.badge.kirli, .badge.yeni { background: var(--danger-soft); color: var(--danger); }
.badge.bakimda { background: var(--warn-soft); color: var(--warn); }
.badge.in-house { background: var(--brand-soft); color: var(--brand-dark); }
.badge.tamamlandi, .badge.islemde { background: var(--panel-2); color: var(--muted); }
.badge.checked-out { background: var(--panel-2); color: var(--muted); }
.badge.kontrol { background: var(--brand-soft); color: var(--brand-dark); }
.badge.accent-badge { background: var(--warn-soft); color: var(--warn); }
.badge.booking { background: var(--brand-soft); color: var(--brand-dark); }
.badge.airbnb { background: var(--danger-soft); color: var(--danger); }
.badge.direct { background: var(--ok-soft); color: var(--ok); }

/* ---------- Gunluk rapor / ayarlar ---------- */
.sec { margin: 22px 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.back-link { display:inline-block; color: var(--brand); cursor:pointer; font-size:13.5px; margin-bottom:8px; font-weight:600; }
.whoami { display:block; color:#9fc3c0; font-size:12px; margin-top:8px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--brand-dark); color:#fff; padding: 13px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(12px); transition: all .3s; z-index: 200; }
.toast.show { opacity: 1; transform: translateY(0); }
.back-link:hover { text-decoration: underline; }
.settings-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.settings-card { display:flex; gap:14px; align-items:center; background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding:15px 17px; cursor:pointer; box-shadow: var(--shadow); transition: border-color .12s; }
.settings-card:hover { border-color: var(--brand); }
.settings-card .ic { font-size: 24px; flex-shrink:0; }
.id-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.id-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.qr-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.qr-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; text-align:center; }
.qr-card img { width: 100%; max-width: 240px; }
.qr-hotel { font-weight: 700; color: var(--brand-dark); font-size: 15px; }
.qr-room { font-size: 22px; font-weight: 800; color: var(--ink); margin: 4px 0 8px; }
.qr-note { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
@media print {
  .sidebar, .no-print, .back-link, .page-sub, .btn, .row .spacer { display: none !important; }
  .main { padding: 0 !important; }
  .app { display: block !important; }
  .qr-grid { grid-template-columns: 1fr 1fr; }
  .qr-card { break-inside: avoid; page-break-inside: avoid; }
}

/* ---------- Buttons / forms ---------- */
.btn { background: var(--brand); color:#fff; border: 1px solid var(--brand); padding: 8px 15px; border-radius: 6px; font-size: 13.5px; cursor: pointer; font-weight: 600; box-shadow: var(--shadow); }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.row { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
.spacer { flex: 1; }

label { display:block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; font-family: inherit; background: var(--panel); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
textarea { resize: vertical; min-height: 60px; }
.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,18,.5); display:none; align-items:center; justify-content:center; z-index: 50; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; width: 520px; max-width: 100%; max-height: 90vh; overflow:auto; box-shadow: 0 20px 60px rgba(20,20,18,.25); }
.modal h3 { margin: 0 0 6px; font-weight: 650; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.empty { text-align:center; color: var(--muted); padding: 30px; }

/* ---------- Guest chat ---------- */
.chat-wrap { max-width: 640px; margin: 0 auto; min-height: 100vh; display:flex; flex-direction:column; background: var(--panel); box-shadow: var(--shadow); }
.chat-head { background: var(--brand-dark); color:#fff; padding: 18px 22px; }
.chat-head.book { background: linear-gradient(135deg, var(--brand-dark), var(--accent)); }
.chat-head h1 { margin:0; font-size: 18px; }
.chat-head p { margin: 3px 0 0; font-size: 13px; color:#a7ccc9; }
.room-bar { display:flex; align-items:center; gap: 8px; padding: 10px 20px; background:#eef4f3; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--brand-dark); flex-wrap: wrap; }
.room-bar input { width: 90px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.room-bar .btn.sm { padding: 6px 12px; font-size: 13px; }
.room-bar.done { background:#e7f2ec; }
.room-bar .change { margin-left:auto; background:none; border:none; color: var(--brand); cursor:pointer; font-size: 12.5px; text-decoration: underline; }
.room-bar .err { color:#b3462e; }
.chat-body { flex:1; padding: 20px; overflow-y:auto; display:flex; flex-direction:column; gap: 12px; background:#f7f9fb; }
.msg { max-width: 80%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--brand); color:#fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background:#fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chips { display:flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 10px; background:#f7f9fb; }
.chip { background:#fff; border:1px solid var(--line); border-radius: 18px; padding: 7px 13px; font-size: 13px; cursor:pointer; color: var(--brand-dark); }
.chip:hover { background: var(--brand); color:#fff; border-color: var(--brand); }
.chat-input { display:flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background:#fff; }
.chat-input input { flex:1; }
.typing { font-size: 13px; color: var(--muted); padding: 0 4px; }

/* ---------- Misafir paneli (portal) ---------- */
.head-row { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.lang-row { display:flex; gap:4px; flex-shrink:0; }
.lang-btn { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.3); color:#fff; border-radius:6px; padding:4px 8px; font-size:11.5px; font-weight:700; cursor:pointer; font-family:inherit; }
.lang-btn:hover { background:rgba(255,255,255,.25); }
.lang-btn.active { background:#fff; color:var(--brand-dark); border-color:#fff; }
.lang-gate { text-align:center; padding: 34px 10px; }
.lang-gate .lg-icon { font-size: 44px; }
.lang-gate .lg-title { font-size: 15px; font-weight: 600; color: var(--muted); line-height: 1.7; margin: 12px 0 22px; }
.lang-gate .lg-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 360px; margin: 0 auto; }
.lg-btn { display:flex; flex-direction:column; align-items:center; gap:6px; background: var(--panel); border:1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 10px; font-size: 15px; font-weight: 700; color: var(--ink); cursor:pointer; font-family:inherit; transition: border-color .12s, transform .08s; }
.lg-btn:hover { border-color: var(--brand); }
.lg-btn:active { transform: scale(.96); }
.lg-btn .lg-flag { font-size: 30px; }
.ptabs { display:flex; background:#fff; border-bottom: 1px solid var(--line); }
.ptab { flex:1; padding: 12px 6px; background:none; border:none; border-bottom: 3px solid transparent; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor:pointer; font-family: inherit; }
.ptab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.ptab-page { flex:1; overflow-y:auto; background:#f7f9fb; padding: 16px; display:flex; flex-direction:column; gap: 14px; }
.ptab-page .chat-body { border-radius: 12px; }
.pcard { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.pcard h3 { margin: 0 0 10px; font-size: 15.5px; color: var(--ink); }
.pinfo-row { display:flex; justify-content:space-between; align-items:center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pinfo-row:last-child { border-bottom: none; }
.pinfo-row b { text-align:right; }
.pinfo-block { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.pinfo-block:last-child { border-bottom: none; }
.portal .chat-input { border-top: none; padding-top: 10px; }
.svc-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.svc-info b { font-size: 14.5px; color: var(--ink); }
.svc-price { font-weight: 700; color: var(--brand-dark); font-size: 14px; margin-top: 2px; }
.svc-form { padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.grid2p { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2p input, .svc-form textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
.grid2p label { display:block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.portal-main { flex:1; overflow-y:auto; background:#f7f9fb; padding: 16px; }
.menu-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-card { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 14px; text-align:center; cursor:pointer; transition: transform .1s, border-color .1s; }
.menu-card:active { transform: scale(.97); }
.menu-card:hover { border-color: var(--brand); }
.menu-card .mic { font-size: 30px; }
.menu-card .mtitle { font-weight: 700; font-size: 15px; margin-top: 6px; color: var(--ink); }
.menu-card .mdesc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.io-actions { display:flex; gap: 10px; margin-bottom: 14px; }
.io-btn { flex:1; border:none; border-radius: var(--radius-lg); padding: 16px 8px; font-size: 16px; font-weight: 700; color:#fff; cursor:pointer; font-family:inherit; line-height:1.2; }
.io-btn span { display:block; font-size: 11px; font-weight: 400; opacity: .85; margin-top: 2px; }
.io-btn.in { background: var(--brand); } .io-btn.in:active { background: var(--brand-dark); }
.io-btn.out { background: var(--accent); } .io-btn.out:active { filter: brightness(.92); }
.ptitle { font-size: 20px; margin: 4px 0 14px; color: var(--ink); }
.call-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; text-decoration:none; color: var(--ink); }
.call-row:last-child { border-bottom:none; }
.call-row b { color: var(--brand-dark); }
.acc { border-bottom: 1px solid var(--line); }
.acc:last-child { border-bottom: none; }
.acc-q { width:100%; text-align:left; background:none; border:none; padding: 13px 0; font-size: 15px; font-weight: 600; color: var(--ink); cursor:pointer; display:flex; justify-content:space-between; align-items:center; font-family:inherit; }
.acc-q span { color: var(--brand); font-size: 20px; }
.acc-a { display:none; padding: 0 0 13px; font-size: 14px; line-height: 1.6; color: var(--muted); white-space: normal; }
.acc.open .acc-a { display:block; }
.acc.open .acc-q span { transform: rotate(45deg); }
.weather-card { display:flex; align-items:center; gap: 18px; background: linear-gradient(135deg, #eef7f6, #fdf6ec); }
.w-icon { font-size: 52px; }
.w-desc { font-weight: 700; font-size: 17px; color: var(--ink); }
.w-temp { font-size: 26px; font-weight: 800; color: var(--brand-dark); }

@media (max-width: 720px) {
  .sidebar { width: 60px; }
  .sidebar .logo, .nav a span, .sidebar .foot { display:none; }
  .main { padding: 18px; }
  .grid2 { grid-template-columns: 1fr; }
}
