:root {
  --ts-primary: #1c5cab;
  --ts-primary-dark: #104281;
  --ts-sidebar: #0f2545;
  --ts-sidebar-text: #c7d3e6;
  --ts-bg: #f4f6fa;
  --ts-card-border: #e3e8f0;
  --ts-primary-subtle: #e3eefb;
  --ts-primary-border: #b7d3f6;
  --bs-primary: var(--ts-primary);
  --bs-primary-rgb: 28, 92, 171;
  --bs-link-color: var(--ts-primary);
  --bs-link-color-rgb: 28, 92, 171;
  --bs-link-hover-color: var(--ts-primary-dark);
  --bs-body-bg: var(--ts-bg);
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.btn-primary { --bs-btn-bg: var(--ts-primary); --bs-btn-border-color: var(--ts-primary); --bs-btn-hover-bg: var(--ts-primary-dark); --bs-btn-hover-border-color: var(--ts-primary-dark); --bs-btn-active-bg: var(--ts-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--ts-primary); --bs-btn-border-color: var(--ts-primary); --bs-btn-hover-bg: var(--ts-primary); --bs-btn-hover-border-color: var(--ts-primary); }
.text-bg-primary { background-color: var(--ts-primary) !important; }
.form-control:focus, .form-select:focus { border-color: #86b6ef; box-shadow: 0 0 0 .2rem rgba(28,92,171,.15); }

body { background: var(--ts-bg); font-size: .925rem; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--ts-sidebar); color: var(--ts-sidebar-text); position: sticky; top: 0; height: 100vh; padding: 1rem .75rem; }
.sidebar .nav-link { color: var(--ts-sidebar-text); border-radius: .5rem; padding: .55rem .8rem; display: flex; align-items: center; gap: .7rem; font-weight: 500; }
.sidebar .nav-link i { font-size: 1.1rem; width: 1.2rem; text-align: center; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: var(--ts-primary); color: #fff; }
.brand-logo { max-width: 170px; object-fit: contain; }
.sidebar-foot { margin-top: auto; padding: .75rem .8rem 0; }
.sidebar-foot .text-secondary { color: rgba(199,211,230,.6) !important; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; padding: .25rem .5rem 1.25rem; }
.brand strong { display: block; color: #fff; line-height: 1.1; }
.brand small { color: var(--ts-sidebar-text); font-size: .75rem; }
.brand-mark { width: 38px; height: 38px; border-radius: .6rem; background: var(--ts-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: .5px; flex: 0 0 38px; }
.sidebar-offcanvas { background: var(--ts-sidebar); color: var(--ts-sidebar-text); width: 270px; }
.sidebar-offcanvas .btn-close { filter: invert(1); }
.sidebar-offcanvas .nav-link { color: var(--ts-sidebar-text); padding: .7rem .8rem; display: flex; gap: .7rem; align-items: center; font-size: 1rem; }
.sidebar-offcanvas .brand strong { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--ts-card-border); display: flex; align-items: center; padding: 0 1.25rem; gap: .75rem; position: sticky; top: 0; z-index: 1020; }
.topbar-title { font-weight: 600; font-size: 1.05rem; }
.content { padding: 1.25rem; }
@media (max-width: 575px) { .content { padding: .9rem; } .topbar { padding: 0 .75rem; } }

.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ts-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }
.notif-menu { width: 340px; max-height: 420px; overflow: auto; }
.notif-item { white-space: normal; border-bottom: 1px solid #f0f0f0; padding: .55rem 1rem; }
.notif-item.unread { background: var(--ts-primary-subtle); }

.card { border: 1px solid var(--ts-card-border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(15,37,69,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--ts-card-border); font-weight: 600; padding: .8rem 1rem; }
.kpi { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; }
.kpi .kpi-icon { width: 44px; height: 44px; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex: 0 0 44px; }
.kpi .kpi-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.kpi .kpi-label { color: #6b7280; font-size: .8rem; }
.kpi-blue .kpi-icon { background: var(--ts-primary-subtle); color: var(--ts-primary); }
.kpi-red .kpi-icon { background: #fde4e4; color: #d03b3b; }
.kpi-orange .kpi-icon { background: #ffeadf; color: #d95926; }
.kpi-green .kpi-icon { background: #dff5e9; color: #0ca30c; }
.kpi-gray .kpi-icon { background: #eceff3; color: #52514e; }
.kpi-purple .kpi-icon { background: #e9e6fa; color: #4a3aa7; }
.kpi-yellow .kpi-icon { background: #fff3d6; color: #b47400; }
a.kpi-link { text-decoration: none; color: inherit; display: block; }
a.kpi-link:hover .card { border-color: var(--ts-primary-border); }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; font-weight: 600; border-bottom-width: 1px; background: #fafbfd; }
.table-hover tbody tr:hover { background: #f5f8fc; }
.table a.tlink { text-decoration: none; color: inherit; font-weight: 600; }
.table a.tlink:hover { color: var(--ts-primary); }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 #d03b3b; }
.row-urgent td:first-child { box-shadow: inset 3px 0 0 #d95926; }
.code { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: #6b7280; }
.badge { font-weight: 600; }
.badge.bg-success-subtle, .badge.bg-warning-subtle, .badge.bg-danger-subtle { font-weight: 500; }

.filters .form-control, .filters .form-select { min-width: 140px; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.chart-box.short { height: 200px; }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: #e3e8f0; }
.timeline li { position: relative; padding-left: 34px; padding-bottom: .9rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--ts-primary-border); }
.timeline li.hl::before { border-color: var(--ts-primary); background: var(--ts-primary); }
.timeline .tl-time { font-size: .75rem; color: #6b7280; }
.comment { border: 1px solid var(--ts-card-border); border-radius: .6rem; padding: .7rem .9rem; margin-bottom: .6rem; background: #fff; }
.comment.internal { background: #fff8e6; border-color: #f5dfa0; }
.comment .who { font-weight: 600; font-size: .85rem; }
.thumb { width: 96px; height: 96px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--ts-card-border); }
.dl dt { color: #6b7280; font-weight: 500; font-size: .8rem; }
.dl dd { margin-bottom: .6rem; font-weight: 500; }
.sticky-actions { position: sticky; top: 76px; }
.big-check { width: 1.25em; height: 1.25em; }
.status-strip { display: flex; gap: .5rem; flex-wrap: wrap; }
.status-strip .pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 2rem; border: 1px solid var(--ts-card-border); background: #fff; text-decoration: none; color: inherit; font-size: .85rem; }
.status-strip .pill.active { border-color: var(--ts-primary); background: var(--ts-primary-subtle); color: var(--ts-primary-dark); font-weight: 600; }
.status-strip .pill .n { background: #eceff3; border-radius: 1rem; padding: 0 .5rem; font-size: .75rem; font-weight: 600; }
.progress-thin { height: 6px; }
.stock-low { color: #d03b3b; font-weight: 700; }
.stock-out { color: #d03b3b; font-weight: 700; text-decoration: underline; }
.qr-card { border: 1px dashed #999; border-radius: .75rem; padding: 1rem; text-align: center; page-break-inside: avoid; background: #fff; }
.qr-card .room { font-size: 1.8rem; font-weight: 800; }
.tech-load .bar { height: 10px; border-radius: 5px; background: var(--ts-primary-subtle); overflow: hidden; }
.tech-load .bar > span { display: block; height: 100%; background: var(--ts-primary); }
.heat { display: grid; grid-template-columns: 44px repeat(24, 1fr); gap: 2px; font-size: .7rem; }
.heat .cell { aspect-ratio: 1; border-radius: 3px; background: #cde2fb; }
.heat .lbl { color: #6b7280; display: flex; align-items: center; }
.rating i { color: #eda100; }
.empty { text-align: center; color: #6b7280; padding: 2rem 1rem; }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .5; }

/* Misafir / giriş */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ts-sidebar), var(--ts-primary)); padding: 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.guest-wrap { min-height: 100vh; background: linear-gradient(180deg, var(--ts-sidebar) 0, var(--ts-sidebar) 220px, var(--ts-bg) 220px); padding: 1.25rem .9rem; }
.guest-card { max-width: 560px; margin: 0 auto; }
.demo-users .btn { text-align: left; }

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .qr-grid { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

.table-sm { font-size: .85rem; }
.table-sm .badge { font-size: .7rem; }

.text-money, td.text-end { white-space: nowrap; }

.nav-pills { --bs-nav-pills-link-active-bg: var(--ts-primary); }
.form-check-input:checked { background-color: var(--ts-primary); border-color: var(--ts-primary); }
.page-item.active .page-link { background-color: var(--ts-primary); border-color: var(--ts-primary); }
.dept-badge { font-weight: 600; }
/* Misafir: departman kutuları ve katalog */
.dept-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.dept-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1.25rem .75rem; border-radius: .9rem; border: 2px solid var(--ts-card-border); background: #fff; text-decoration: none; color: inherit; text-align: center; min-height: 120px; transition: transform .1s, border-color .1s; }
.dept-tile:hover, .dept-tile:active { transform: translateY(-2px); border-color: var(--tile-color, var(--ts-primary)); }
.dept-tile i { font-size: 2rem; color: var(--tile-color, var(--ts-primary)); }
.dept-tile .label { font-weight: 600; line-height: 1.2; }
.catalog { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 480px) { .catalog { grid-template-columns: repeat(3, 1fr); } }
.cat-item { border: 2px solid var(--ts-card-border); border-radius: .8rem; padding: .75rem .5rem; text-align: center; background: #fff; position: relative; }
.cat-item.selected { border-color: var(--ts-primary); background: var(--ts-primary-subtle); }
.cat-item i.ic { font-size: 1.7rem; color: var(--ts-primary); display: block; margin-bottom: .25rem; }
.cat-item .nm { font-size: .85rem; font-weight: 600; line-height: 1.15; min-height: 2.3em; display: flex; align-items: center; justify-content: center; }
.cat-item .price { font-size: .75rem; color: #6b7280; }
.cat-item .qty { display: flex; align-items: center; justify-content: center; gap: .35rem; margin-top: .4rem; }
.cat-item .qty button.inc, .cat-item .qty button.dec { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ts-primary-border); background: #fff; color: var(--ts-primary); font-weight: 700; line-height: 1; }
.cat-item .qty button.toggle { white-space: nowrap; min-width: 80px; }
.cat-item.selected .qty button.toggle { background: var(--ts-primary); color: #fff; border-color: var(--ts-primary); }
.cat-item .qty .n { min-width: 1.4em; text-align: center; font-weight: 700; }
.cat-item .sla { position: absolute; top: .35rem; right: .45rem; font-size: .65rem; color: #6b7280; }
.summary-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--ts-card-border); padding: .75rem; margin: 1rem -1.5rem -1.5rem; border-radius: 0 0 .75rem .75rem; }
.ticket-items li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--ts-card-border); }
.ticket-items li:last-child { border-bottom: 0; }
.theme-swatch { width: 100%; height: 56px; border-radius: .6rem; display: flex; overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.theme-swatch span { flex: 1; }
.theme-swatch.active { border-color: #0b0b0b; }
.lang-editor td input { width: 100%; }
.lang-editor .missing input { border-color: #d03b3b; background: #fff5f5; }
