/* App demo — phone frame on desktop, full screen on mobile */
html, body { height: 100%; }
body { background: var(--bg-2); }
.stage { min-height: 100%; display: flex; justify-content: center; align-items: flex-start; gap: 40px; padding: 28px 16px; }
.side { width: 300px; padding-top: 24px; color: var(--ink-2); font-size: 14px; }
.side h1 { font-size: 20px; color: var(--ink); margin: 10px 0 6px; line-height: 1.3; }
.side p { margin: 0 0 12px; }
.side .back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.side ul { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 2px; }
.side li a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); }
.side li a:hover, .side li a.active { background: var(--surface-3); color: var(--ink); }
.side .note { font-size: 12.5px; color: var(--ink-3); border-left: 3px solid var(--brand); padding-left: 10px; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; display: block; }

.phone { width: 400px; height: min(860px, calc(100vh - 56px)); min-height: 620px; border-radius: 44px; background: #0d0d0d; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); flex: none; }
.screen { position: relative; height: 100%; width: 100%; border-radius: 34px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }

@media (max-width: 860px) {
  .side { display: none; }
  .stage { padding: 0; display: block; height: 100%; }
  .phone { width: 100%; height: 100%; min-height: 0; border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .screen { border-radius: 0; }
}

/* Top bar (activity_dashboard.xml: hamburger · title · avatar) */
.topbar { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; background: var(--bg-2); border-bottom: 1px solid var(--line); flex: none; }
.iconbtn { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.iconbtn:hover { background: var(--surface-3); }
.iconbtn:focus-visible, .chip:focus-visible, .btn:focus-visible, .card-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.titles { flex: 1; min-width: 0; }
.titles .t1 { font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titles .t2 { font-size: 12px; color: var(--ink-3); }
.lang { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.demo-banner { background: var(--brand-soft); color: var(--ink); font-size: 12px; padding: 6px 14px; display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); flex: none; }
.demo-banner b { color: var(--brand-dark); }

main#view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 14px 90px; scroll-behavior: smooth; }

/* Drawer (drawer_layout.xml: gradient header "Tazı Yenileme Merkezi") */
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1000; }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; width: 82%; max-width: 320px; background: var(--bg); transform: translateX(-102%); transition: transform .22s ease; z-index: 1001; display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,.2); }
.screen.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.screen.drawer-open .drawer { transform: none; }
.drawer-head { background: linear-gradient(135deg, var(--brand), var(--brand-light)); color: #1A1A1A; padding: 22px 18px 16px; }
.drawer-head .avatar { background: #1A1A1A; color: var(--brand); width: 48px; height: 48px; font-size: 16px; }
.drawer-head .n { font-weight: 800; font-size: 17px; margin-top: 10px; }
.drawer-head .r { font-size: 13px; opacity: .8; }
.drawer nav { overflow-y: auto; padding: 8px 8px 20px; }
.drawer .sec { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 14px 12px 4px; }
.drawer a, .drawer button.navitem { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 0; background: none; cursor: pointer; text-align: left; font-size: 14.5px; }
.drawer a:hover, .drawer button.navitem:hover { background: var(--surface-2); }
.drawer a.active { background: var(--brand-soft); font-weight: 700; }
.drawer a.active .icon { color: var(--brand-dark); }
.drawer .muted { color: var(--ink-3); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h3 .icon { color: var(--brand-dark); }
.card .sub { color: var(--ink-3); font-size: 12px; margin-top: -6px; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.grid2 .card { margin: 0; }
.stat { padding: 12px 14px; }
.stat .v { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.stat.accent { background: linear-gradient(135deg, var(--brand), var(--brand-light)); border: 0; color: #1A1A1A; }
.stat.accent .l { color: #3a2c08; }
.card-link { display: flex; gap: 10px; align-items: center; text-decoration: none; cursor: pointer; }
.card-link .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.card-link .tt { font-weight: 700; font-size: 14px; }
.card-link .ss { font-size: 12px; color: var(--ink-3); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.kv:first-of-type { border-top: 0; }
.kv span:first-child { color: var(--ink-2); }
.kv span:last-child { font-weight: 600; text-align: right; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.brand { background: var(--brand); color: #1A1A1A; }

/* Toolbar: search + chips */
.tools { position: sticky; top: -14px; z-index: 5; background: var(--bg); margin: -14px -14px 10px; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; }
.search input { flex: 1; border: 0; background: transparent; padding: 10px 0; font: inherit; color: var(--ink); outline: none; min-width: 0; }
.search .icon { color: var(--ink-3); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .c { opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.count { font-size: 12px; color: var(--ink-3); margin: 0 2px 8px; }

/* List items (item_depo.xml / item_onarim.xml / item_gorev.xml) */
.item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px 16px; margin-bottom: 8px; overflow: hidden; }
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stripe, var(--line-2)); }
.item .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .no { font-weight: 800; font-size: 15.5px; display: inline-flex; align-items: center; gap: 6px; }
.item .no .icon { color: var(--brand-dark); width: 18px; height: 18px; }
.item .meta { font-size: 12px; color: var(--ink-3); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }
.item .txt { font-size: 13px; color: var(--ink-2); margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.item .txt b { color: var(--ink); font-weight: 600; }
.item .acts { display: flex; gap: 2px; margin-left: auto; }
.item .acts .iconbtn { width: 32px; height: 32px; color: var(--ink-3); }
.st-ok { --stripe: var(--ok); } .st-warn { --stripe: var(--brand); } .st-err { --stripe: var(--err); } .st-info { --stripe: var(--info); }
.more { display: block; width: 100%; margin: 6px 0 16px; padding: 10px; border-radius: 12px; border: 1px dashed var(--line-2); background: transparent; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.empty { text-align: center; color: var(--ink-3); padding: 30px 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; cursor: pointer; background: var(--brand); color: #1A1A1A; font-size: 14px; }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.fab { position: absolute; right: 18px; bottom: 22px; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--brand); color: #1A1A1A; box-shadow: 0 6px 18px rgba(0,0,0,.25); display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 20; }
.fab.show { display: inline-flex; }
.fab .icon { width: 26px; height: 26px; }

.toast { position: absolute; left: 50%; bottom: 92px; transform: translate(-50%, 20px); background: #1A1A1A; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 2000; width: max-content; max-width: 86%; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.chart { position: relative; height: 180px; }
.chart.tall { height: 230px; }
.map { height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 12px; z-index: 0; }
.map.tall { height: 360px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--ink-2); margin: -4px 0 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.bars .b { display: grid; grid-template-columns: 110px 1fr 44px; gap: 8px; align-items: center; font-size: 12.5px; margin: 5px 0; }
.bars .b .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bars .b .track { height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bars .b .fill { height: 100%; background: var(--brand); border-radius: 6px; }
.bars .b .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Shift table */
.week { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.week b { font-size: 14px; }
.shift-table { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 11.5px; table-layout: fixed; }
.shift-table th { font-weight: 700; color: var(--ink-2); font-size: 10.5px; padding: 2px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-table td { text-align: center; padding: 6px 2px; border-radius: 8px; background: var(--surface-2); font-variant-numeric: tabular-nums; line-height: 1.2; }
.shift-table td.d { background: none; text-align: left; font-weight: 600; color: var(--ink-2); }
.shift-table td.today { outline: 2px solid var(--brand); }
.sh-gun { background: var(--brand-soft) !important; color: var(--warn); }
.sh-sabah { background: var(--info-bg) !important; color: var(--info); }
.sh-aksam { background: var(--ok-bg) !important; color: var(--ok); }
.sh-gece { background: #263238 !important; color: #ECEFF1; }
.sh-izin { background: var(--err-bg) !important; color: var(--err); font-weight: 700; }
.notes { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* Handover photo placeholders */
.photos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.photo { aspect-ratio: 1; border-radius: 8px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.photo.on { background: repeating-linear-gradient(45deg, var(--line-2) 0 6px, var(--surface-3) 6px 12px); color: var(--ink-2); }
.photo .icon { width: 18px; height: 18px; }

.leaflet-container { font-family: var(--font); background: var(--surface-2); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.6); } }
.vardiya-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.vardiya-row:first-of-type { border-top: 0; }
.banner-warn { background: var(--err-bg); color: var(--err); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin: 8px 0; }
