/* ============================================================
   Akbulut Geçiş — Salon Cockpit (/app)
   ============================================================ */

/* ---------- Login ---------- */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.login-card { width: min(430px, 100%); padding: 30px 28px; }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.login-brand .brand-mark { width: 46px; height: 46px; }
.login-brand h1 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.login-brand p { color: var(--muted-2); font-size: 13.5px; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12.5px; margin: 18px 0; }
.login-or::before, .login-or::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .form-error { color: var(--red); font-size: 13.5px; min-height: 17px; margin: 0; }
.login-foot { margin-top: 20px; text-align: center; color: var(--muted-2); font-size: 13.5px; }
.login-foot a { color: var(--gold-h); }

/* ---------- Shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(9, 9, 11, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.app-header-inner { max-width: 1380px; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; gap: 14px; min-height: 46px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { font-size: 15.5px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.brand-text em { font-style: normal; color: var(--gold); }
.app-title { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.app-title > span:first-child { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header-actions { display: flex; gap: 8px; }
.app-body { flex: 1; display: flex; max-width: 1380px; width: 100%; margin: 0 auto; }

/* ---------- Sidebar (Desktop) ---------- */
.app-sidebar {
  display: flex; flex-direction: column; gap: 4px; width: 252px; flex: none;
  padding: 22px 10px 30px 18px; position: sticky; top: 76px; align-self: flex-start;
}
.side-item {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 11px 13px; border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--muted);
  border: 1px solid transparent; transition: background 0.15s, color 0.15s;
}
.side-item svg { width: 18px; height: 18px; flex: none; }
.side-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.side-item.active { color: var(--gold-h); background: var(--gold-soft); border-color: rgba(212, 165, 42, 0.28); }

/* ---------- Main / Tabs ---------- */
.app-main { flex: 1; min-width: 0; padding: 22px 18px 96px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.22s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.tab-head-actions { display: flex; gap: 8px; }

/* ---------- Terminal ---------- */
.terminal-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.terminal-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.status-display {
  padding: 34px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg-2); border-color: var(--border-2); transition: background 0.3s, border-color 0.3s; min-height: 220px; justify-content: center;
}
.sd-icon svg { width: 44px; height: 44px; color: var(--muted-2); }
.sd-title { font-size: clamp(19px, 2.4vw, 26px); font-weight: 800; letter-spacing: -0.01em; }
.sd-sub { color: var(--muted); font-size: 14px; max-width: 380px; }
.sd-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.sd-result-note { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.status-display.flash { animation: displayFlash 0.4s ease; }
@keyframes displayFlash { 0% { transform: scale(0.985); } 55% { transform: scale(1.008); } 100% { transform: none; } }
.status-display[data-state="approved"] { background: var(--green-soft); border-color: rgba(16, 185, 129, 0.5); }
.status-display[data-state="approved"] .sd-icon svg { color: var(--green); }
.status-display[data-state="approved"] .sd-title { color: #34d399; }
.status-display[data-state="expired"], .status-display[data-state="invalid"], .status-display[data-state="wrong_tenant"], .status-display[data-state="duplicate"], .status-display[data-state="expired_token"] { background: var(--red-soft); border-color: rgba(239, 68, 68, 0.5); }
.status-display[data-state="expired"] .sd-icon svg, .status-display[data-state="invalid"] .sd-icon svg, .status-display[data-state="wrong_tenant"] .sd-icon svg, .status-display[data-state="duplicate"] .sd-icon svg, .status-display[data-state="expired_token"] .sd-icon svg { color: var(--red); }
.status-display[data-state="expired"] .sd-title, .status-display[data-state="invalid"] .sd-title, .status-display[data-state="wrong_tenant"] .sd-title, .status-display[data-state="duplicate"] .sd-title, .status-display[data-state="expired_token"] .sd-title { color: #f87171; }
.status-display[data-state="frozen"], .status-display[data-state="out_of_hours"] { background: var(--blue-soft); border-color: rgba(59, 130, 246, 0.5); }
.status-display[data-state="frozen"] .sd-icon svg, .status-display[data-state="out_of_hours"] .sd-icon svg { color: var(--blue); }
.status-display[data-state="frozen"] .sd-title, .status-display[data-state="out_of_hours"] .sd-title { color: #60a5fa; }

.checkin-controls { padding: 14px; position: relative; }
.quick-search { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 0 12px; }
.quick-search:focus-within { border-color: var(--gold); }
.quick-search svg { width: 17px; height: 17px; color: var(--muted-2); flex: none; }
.quick-search input { background: none; border: none; outline: none; padding: 13px 0; width: 100%; font-size: 15px; }
.quick-search input::placeholder { color: var(--muted-2); }
.qs-suggestions { position: absolute; left: 14px; right: 14px; top: calc(100% - 6px); z-index: 40; padding: 6px; max-height: 290px; overflow-y: auto; box-shadow: var(--shadow); }
.qs-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 10px; border-radius: 9px; font-size: 14px; }
.qs-item:hover { background: rgba(255, 255, 255, 0.05); }
.qs-item .mono { color: var(--gold-h); font-size: 12.5px; flex: none; }
.qs-item b { font-weight: 600; }
.qs-item .badge { margin-left: auto; }
.terminal-btns { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.terminal-btns .btn { flex: 1; min-width: 160px; }

.camera-panel { overflow: hidden; }
.camera-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.camera-head svg { width: 16px; height: 16px; color: var(--gold); }
.camera-head .modal-close { margin-left: auto; width: 30px; height: 30px; }
.camera-view { position: relative; background: #000; aspect-ratio: 4 / 3; }
.camera-view video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: absolute; inset: 0; margin: auto; width: 62%; aspect-ratio: 1; border: 2px solid rgba(212, 165, 42, 0.85); border-radius: 18px; box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.42); }
.camera-hint { padding: 11px 14px; color: var(--muted-2); font-size: 12px; letter-spacing: 0.02em; }

/* ---------- Live-Feed ---------- */
.terminal-right { min-width: 0; display: flex; flex-direction: column; }
.feed-card { display: flex; flex-direction: column; min-height: 420px; flex: 1; }
.feed-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.feed-head .badge { margin-left: auto; }
.feed-list { list-style: none; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 7px; flex: 1; max-height: 560px; }
.feed-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; font-size: 13.5px; }
.feed-list li.fresh { animation: feedIn 0.5s ease; border-color: rgba(212, 165, 42, 0.4); }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.feed-list .f-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.f-dot.ok { background: var(--green); } .f-dot.err { background: var(--red); } .f-dot.blue { background: var(--blue); }
.feed-list .f-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-list .f-meta { color: var(--muted-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-list .f-time { margin-left: auto; color: var(--muted-2); font-size: 12px; white-space: nowrap; }
.feed-list .empty { justify-content: center; color: var(--muted-2); padding: 30px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; flex: none; }
.live-dot span { position: absolute; inset: -4px; border-radius: 50%; background: rgba(16, 185, 129, 0.35); animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Filter-Chips ---------- */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-2);
  font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg-2); transition: all 0.15s;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--gold-soft); border-color: rgba(212, 165, 42, 0.45); color: var(--gold-h); }

/* ---------- Mitgliederliste ---------- */
.member-list { display: flex; flex-direction: column; gap: 10px; }
.member-row {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.mr-id { min-width: 0; }
.mr-id .mr-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-id .mr-sub { color: var(--muted-2); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.mr-id .mr-sub .mono { color: var(--gold-h); }
.mr-pkg { font-size: 13.5px; color: var(--muted); }
.mr-pkg b { display: block; color: var(--text); font-size: 14px; }
.mr-pkg span { font-size: 12px; }
.mr-badges { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.mr-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mr-actions .btn { padding: 7px 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.icon-btn svg { width: 15px; height: 15px; }
.empty-state { text-align: center; color: var(--muted-2); padding: 44px 16px; }

/* ---------- Kasa ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted-2); text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.kpi-label svg { width: 13px; height: 13px; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.kpi-sub { font-size: 12px; color: var(--muted-2); }
.kasa-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; }
.card-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.card-title svg { width: 16px; height: 16px; color: var(--gold); }
.pending-list { display: flex; flex-direction: column; }
.pending-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.pending-item:last-child { border-bottom: none; }
.pending-item b { font-weight: 700; }
.pending-item .p-meta { color: var(--muted-2); font-size: 12.5px; }
.pending-item .p-amt { margin-left: auto; font-weight: 800; color: #f87171; white-space: nowrap; }
.density-chart { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding: 16px; }
.d-bar { flex: 1; background: linear-gradient(180deg, var(--gold), rgba(212, 165, 42, 0.35)); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; transition: filter 0.15s; }
.d-bar:hover { filter: brightness(1.2); }
.d-bar .d-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1c1c22; border: 1px solid var(--border-2); padding: 4px 8px; border-radius: 7px;
  font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.d-bar:hover .d-tip { opacity: 1; }
.d-labels { display: flex; gap: 3px; padding: 0 16px 12px; }
.d-labels span { flex: 1; text-align: center; font-size: 9.5px; color: var(--muted-2); }

/* ---------- Ayarlar ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.settings-card { padding-bottom: 18px; display: flex; flex-direction: column; gap: 13px; }
.settings-card .card-title { padding-bottom: 13px; margin-bottom: 2px; }
.settings-card .field { padding: 0 16px; }
.settings-card .btn { margin: 2px 16px 0; align-self: flex-start; }
.settings-note { color: var(--muted-2); font-size: 12.5px; padding: 0 16px; margin: -4px 0; }
.price-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px; }
.sub-card > div:not(.card-title) { padding: 0 16px; }
.sub-plan { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.sub-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); padding: 3px 0; }
.sub-row b { color: var(--text); }
.sub-card .btn { margin: 8px 16px 4px; }
.settings-actions { display: flex; flex-direction: column; gap: 9px; padding: 0 16px; }
.settings-actions .btn { margin: 0; }

/* ---------- Bottom-Bar (Mobile) ---------- */
.bottom-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  background: rgba(13, 13, 16, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-2);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(4, 1fr);
}
.bb-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px; font-size: 10.5px; font-weight: 600; color: var(--muted-2); border-radius: 10px; }
.bb-item svg { width: 20px; height: 20px; }
.bb-item.active { color: var(--gold-h); }

/* ---------- Modalspezifisch ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid .form-error { grid-column: 1 / -1; color: var(--red); font-size: 13px; min-height: 16px; margin: 0; }
.form-grid .btn-block { grid-column: 1 / -1; }
.freeze-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.freeze-opts.four { grid-template-columns: repeat(4, 1fr); }
.fz-opt {
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 14px 8px; text-align: center;
  display: flex; flex-direction: column; gap: 3px; transition: border-color 0.15s, background 0.15s;
}
.fz-opt:hover { border-color: rgba(212, 165, 42, 0.55); background: var(--gold-soft); }
.fz-opt b { font-size: 15.5px; font-weight: 800; }
.fz-opt span { font-size: 11.5px; color: var(--muted-2); }
.fz-note { font-size: 12.5px; color: var(--muted-2); margin-top: 14px; line-height: 1.55; }

/* ---------- CSV-Import ---------- */
#importModal .modal-sub { margin-bottom: 14px; }
.import-drop {
  margin-top: 14px; border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  padding: 26px 18px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: border-color 0.15s, background 0.15s; outline: none;
}
.import-drop:hover, .import-drop:focus-visible, .import-drop.dragover { border-color: rgba(212, 165, 42, 0.6); background: var(--gold-soft); }
.import-drop > svg, .import-drop [data-icon] { width: 26px; height: 26px; color: var(--gold); }
.import-drop b { font-size: 14.5px; }
.import-drop #importDropHint { font-size: 11.5px; color: var(--muted-2); max-width: 360px; line-height: 1.5; }
#importSubmit { margin-top: 14px; }
.qrc-wrap { display: flex; flex-direction: column; gap: 14px; }
.qrc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sim-salon { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
.qrc-name { font-size: 18px; font-weight: 800; margin-top: 2px; }
.qrc-cred { padding: 4px 14px; }
.qrc-cred > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.qrc-cred > div:last-child { border-bottom: none; }
.qrc-cred span { color: var(--muted-2); }
.qrc-cred b { font-weight: 700; word-break: break-all; text-align: right; }
.qrc-note { font-size: 12.5px; color: var(--muted-2); line-height: 1.55; }

/* ---------- Salon-QR-Afişi ---------- */
.stand-wrap { background: #fff; border-radius: 14px; overflow: hidden; }
.stand-inner { padding: 30px 26px; color: #101014; text-align: center; }
.stand-brand { display: flex; align-items: center; gap: 13px; text-align: left; margin-bottom: 20px; justify-content: center; }
.stand-brand .brand-mark { width: 44px; height: 44px; }
.stand-brand b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.stand-brand span { font-size: 12px; color: #52525b; }
.stand-qr { width: min(300px, 78%); margin: 0 auto 20px; }
.stand-steps { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #3f3f46; font-weight: 600; }
.stand-actions { margin-top: 14px; }

/* ---------- Print (Salon-QR-Afişi) ---------- */
@media print {
  body { background: #fff; }
  body.printing-stand > * { display: none !important; }
  body.printing-stand #standModal { display: block !important; position: static; opacity: 1; background: none; backdrop-filter: none; }
  body.printing-stand #standModal .modal { transform: none; border: none; max-height: none; }
  body.printing-stand .stand-actions { display: none; }
  .stand-wrap { border-radius: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .terminal-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kasa-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-sidebar { display: none; }
  .app-main { padding: 16px 14px 108px; }
  .bottom-bar { display: grid; }
  .member-row { grid-template-columns: 1fr; gap: 10px; }
  .mr-badges { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .mr-actions { justify-content: flex-start; }
  .settings-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .freeze-opts { grid-template-columns: repeat(3, 1fr); }
  .freeze-opts.four { grid-template-columns: repeat(2, 1fr); }
  .price-inputs { grid-template-columns: repeat(2, 1fr); }
  .terminal-btns .btn { min-width: 100%; }
}
