:root {
  --navy: #1d1d1f;
  --navy-2: #ff6a00;
  --ink: #1d1d1f;
  --muted: #86868b;
  --line: rgba(60, 60, 67, 0.12);
  --bg: #f5f5f7;
  --paper: #ffffff;
  --accent: #ff6a00;
  --ok: #34c759;
  --warn: #ff9f0a;
  --bad: #ff3b30;
  --info: #2563eb;
  --fill: #f2f2f7;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f5f7;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border-radius: 22px;
  padding: 36px 32px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.auth-card p { margin: 0 0 22px; color: var(--muted); }
.brand-mark {
  font-weight: 650;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.role-picks { display: grid; gap: 10px; }
.role-picks a {
  display: block;
  padding: 16px 16px;
  border: none;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  background: var(--fill);
}
.role-picks a:hover { background: #e8e8ed; }
.role-picks strong { font-weight: 600; }
.role-picks small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; font-weight: 400; }

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.side {
  background: rgba(245, 245, 247, 0.92);
  color: var(--ink);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--line);
}
.side .logo {
  color: var(--accent);
  font-weight: 800;
  padding: 8px 12px 18px;
  text-decoration: none;
  font-size: 17px;
  letter-spacing: -0.03em;
}
.side .logo span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.nav-label {
  margin: 14px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.side a.nav {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}
.side a.nav:hover { background: rgba(0, 0, 0, 0.04); }
.side a.nav.is-on { background: #fff; color: var(--accent); font-weight: 600; }
.side .foot { margin-top: auto; padding: 12px 0 0; }
.side a.nav-out {
  display: block;
  margin: 0 0 8px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #ffecec;
  color: var(--bad);
  font-weight: 700;
  text-align: center;
}
.side a.nav-out:hover { background: var(--bad); color: #fff; }
.side .foot-site { font-size: 13px; color: var(--muted); text-align: center; display: block; }

.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.top {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.top h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.top .grow { flex: 1; }

.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: none;
  color: #3a3a3c;
  display: inline-block;
  background: #e8e8ed;
  line-height: 1.4;
}
.chip.ok { color: #0b5d1e; background: #d4f4dc; }
.chip.warn { color: #633806; background: #ffe08a; }
.chip.bad { color: #8b1219; background: #ffd0d0; }
.chip.info { color: #0b3d91; background: #d6e4ff; }

.page { display: none; padding: 28px 32px 48px; max-width: 1080px; }
.page.is-on { display: block; }

h1.page-title {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.sub { color: var(--muted); margin: 0 0 22px; font-size: 15px; max-width: 42em; }

.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.35fr 1fr; }
.grid.form { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--paper);
  border: none;
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.kpi b { display: block; font-size: 28px; letter-spacing: -0.04em; font-weight: 650; }
.kpi span { color: var(--muted); font-size: 13px; }

label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 14px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(0, 122, 255, 0.35);
  background: #fff;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 980px;
  border: none;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}
.btn.sec { background: var(--fill); color: var(--ink); }
.page-back { margin: 0 0 8px; }
.btn-back svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn.warn { background: var(--warn); color: #1d1d1f; }
.btn.danger { background: #ffecec; color: var(--bad); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.data a { color: var(--accent); font-weight: 600; }
table.data a.btn { color: #fff; }
table.data a.btn.sec { color: var(--ink); background: var(--fill); }
table.data a.btn.danger { color: var(--bad); background: #ffecec; }
table.data .chip.ok { color: #0b5d1e; background: #d4f4dc; }
table.data .chip.warn { color: #633806; background: #ffe08a; }
table.data .chip.bad { color: #8b1219; background: #ffd0d0; }
table.data .chip.info { color: #0b3d91; background: #d6e4ff; }
table.data td.actions, table.data th.actions { white-space: nowrap; width: 1%; }
table.data input[type="text"],
table.data input[type="number"],
table.data input:not([type]) {
  width: 100%;
  min-width: 72px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: var(--fill);
  color: var(--ink);
}
.table-wrap { overflow-x: auto; }
.row-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.row-actions form { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.row-actions .btn { padding: 8px 14px; font-size: 13px; }

.dt-container { font-size: 13px; }
.dt-container .dt-layout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
}
.dt-container .dt-search input {
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: var(--fill);
  min-width: 200px;
}
.dt-container .dt-length select {
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: var(--fill);
}
.dt-container .dt-paging .dt-paging-button {
  border: none;
  background: var(--fill);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 0 2px;
  cursor: pointer;
}
.dt-container .dt-paging .dt-paging-button.current {
  background: var(--accent);
  color: #fff;
}
.dt-container table.data { margin: 0; }

.flatpickr-calendar { font-family: var(--font); }
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent);
  border-color: var(--accent);
}

.list a, .list .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  align-items: center;
}
.list a:last-child, .list .row:last-child { border-bottom: 0; }
.list a:hover { color: var(--ink); }
.list a:hover > span:not(.chip) { color: var(--accent); }
.list a .chip.ok { color: #0b5d1e; }
.list a .chip.warn { color: #633806; }
.list a .chip.bad { color: #8b1219; }
.list a .chip.info { color: #0b3d91; }

.steps { display: flex; gap: 0; margin-bottom: 18px; background: var(--fill); border-radius: 10px; padding: 3px; }
.steps span {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 4px;
  border-bottom: none;
  border-radius: 8px;
  color: var(--muted);
}
.steps span.on { background: #fff; color: var(--accent); font-weight: 700; }
.steps span.done { color: var(--ok); background: transparent; }

.map {
  height: 240px;
  border-radius: 16px;
  border: none;
  background:
    linear-gradient(#0000 49%, #e5e5ea 49% 51%, #0000 51%),
    linear-gradient(90deg, #0000 49%, #e5e5ea 49% 51%, #0000 51%),
    #f2f2f7;
  background-size: 28px 28px, 28px 28px, auto;
  position: relative;
  margin-bottom: 12px;
}
.gmap {
  height: 280px;
  width: 100%;
  border-radius: 16px;
  border: none;
  margin-bottom: 8px;
  overflow: hidden;
  z-index: 1;
}
.place-picker .field { position: relative; }
.place-suggest {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  background: #fff;
  border: 1px solid #e6e2dc;
  border-radius: 10px;
  max-height: 200px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.place-suggest li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.place-suggest li:hover { background: #fff4eb; }
.pac-container {
  z-index: 12000 !important;
  font-family: var(--font);
  border-radius: 12px;
  border: none;
}
.dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.dot.b { background: var(--ok); }
.dot.d { width: 14px; height: 14px; background: var(--navy); }

.timeline { border-left: 2px solid var(--line); margin: 0 0 0 8px; padding-left: 16px; }
.timeline li { list-style: none; margin: 0 0 14px; font-size: 14px; }
.timeline time { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; font-size: 13px; }

.chat { display: flex; flex-direction: column; gap: 8px; min-height: 260px; margin-bottom: 12px; }
.bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
}
.me { align-self: flex-end; background: var(--accent); color: #fff; }
.them { align-self: flex-start; background: var(--fill); }

.banner {
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: var(--fill);
  margin-bottom: 16px;
  font-size: 14px;
}
.banner.ok { background: #e4f8e9; }
.banner.warn { background: #fff4d6; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.photos div {
  height: 84px;
  background: var(--fill);
  border-radius: 12px;
  border: none;
}

.tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--fill);
  padding: 3px;
  border-radius: 10px;
  width: fit-content;
}
.tabs a {
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  border: none;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
}
.tabs a.is-on { background: #fff; color: var(--ink); }

.phone-wrap {
  min-height: 100vh;
  display: block;
  background: var(--bg);
  padding: 0;
}
.phone {
  width: 100%;
  max-width: 880px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  border: none;
}
.phone .p-top {
  padding: 16px 16px 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 20;
}
.phone .p-top strong { display: block; font-size: 18px; font-weight: 800; color: var(--accent); }
.phone .p-top small { color: var(--muted); font-size: 12px; }
.p-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.notify-wrap { position: relative; }
.bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.bell-btn svg { width: 20px; height: 20px; }
.bell-btn .n-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
}
.notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 30;
}
.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.notify-panel-head strong { font-size: 14px; color: var(--ink); }
.linkish {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.notify-list { max-height: 360px; overflow: auto; }
.notify-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.notify-item:last-child { border-bottom: 0; }
.notify-item strong { display: block; font-size: 14px; }
.notify-item span { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.notify-item small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.notify-item.is-unread, .list a.is-unread, .list .row.is-unread { background: #fff4ec; }
.notify-empty { padding: 16px 14px; margin: 0; }
.notify-all {
  display: block;
  text-align: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}
.phone .p-signout {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 13px;
  margin: 0;
}
.phone .page { display: none; padding: 8px 16px 24px; flex: 1; overflow: auto; }
.phone .page.is-on { display: block; }
.phone h1.page-title { font-size: 28px; margin-bottom: 10px; }

.bnav {
  display: flex;
  border-top: 1px solid var(--line);
  margin-top: auto;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  padding: 6px 0 10px;
}
.bnav a {
  flex: 1;
  text-align: center;
  padding: 6px 2px 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bnav a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bnav a.is-on { color: var(--accent); font-weight: 600; }
.bnav a.out { color: var(--bad); font-weight: 700; }

.toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #fff;
}
.sw {
  width: 51px;
  height: 31px;
  background: #e5e5ea;
  border-radius: 99px;
  position: relative;
  cursor: pointer;
}
.sw.on { background: var(--ok); }
.sw i {
  width: 27px;
  height: 27px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  display: block;
}
.sw.on i { left: 22px; }

.muted { color: var(--muted); font-size: 13px; }
.mb { margin-bottom: 12px; }

.hint-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

body.is-auth .side,
body.is-auth .top,
body.is-auth .mobile-nav { display: none; }
body.is-auth .shell { grid-template-columns: 1fr; }
body.is-auth .shell .page { max-width: 440px; margin: 56px auto; padding: 0 20px; }

.mobile-nav {
  display: none;
  overflow-x: auto;
  gap: 6px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.mobile-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 980px;
  background: var(--fill);
}

.extra-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--fill);
  border-radius: 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.extra-row.is-on { background: #fff4ec; }
.extra-row span { flex: 1; font-weight: 500; }
.extra-row strong { font-size: 14px; }
.extra-row input { width: 18px; height: 18px; accent-color: var(--accent); }

.veh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.veh {
  display: block;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  background: var(--fill);
  color: inherit;
  text-decoration: none;
  border: 2px solid transparent;
}
.veh.is-on { border-color: var(--accent); background: #fff4ec; }
.veh b { display: block; font-size: 15px; }
.veh span { font-size: 12px; color: var(--muted); }

.map-stage { display: none; }
.map-stage.is-open { display: block; margin-top: 14px; }
.gmap.sm { height: 240px; border-radius: 12px; }
#btn-show-map { width: 100%; justify-content: center; border-radius: 8px; }
.booker-inapp .booker-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 4px;
}
.booker-inapp .booker-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 18px;
}
.booker-inapp .booker-dot.b { background: var(--ok); }

.inv-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.inv-line.total { font-weight: 700; border-bottom: 0; font-size: 16px; }

.req { color: var(--bad); font-size: 12px; font-weight: 600; }
.opt { color: var(--muted); font-size: 12px; }

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 0 0 16px; }
.kv div { margin: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 600; }
.veh-block { padding: 12px 0; border-bottom: 1px solid var(--line); }
.veh-block:last-child { border-bottom: 0; }
.route-km {
  margin: 8px 0 0 22px;
  font-weight: 700;
  color: var(--accent);
}
.km-line {
  margin: 8px 0;
  font-weight: 700;
  color: var(--accent);
  font-size: 16px;
}
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast {
  display: block;
  background: #1d1d1f;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.toast strong { display: block; font-size: 14px; }
.toast span { display: block; font-size: 13px; color: #d1d1d6; margin-top: 4px; }
.n-badge {
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.pager-meta { font-size: 13px; color: var(--muted); }
.pager-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}
.pager-btn.is-on { background: var(--accent); color: #fff; }
.pager-btn.is-off { opacity: 0.4; pointer-events: none; }

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  align-items: center;
}
.list-toolbar input[type="search"],
.list-toolbar select {
  padding: 11px 14px;
  border: none;
  border-radius: 12px;
  background: var(--fill);
  min-width: 220px;
}
.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.status-tabs a {
  padding: 7px 14px;
  border-radius: 980px;
  background: var(--fill);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.status-tabs a.is-on { background: var(--accent); color: #fff; }
.route-cell span { display: block; max-width: 240px; }
.route-cell small { display: block; max-width: 240px; }
.nowrap { white-space: nowrap; }

.shell .page { max-width: 1200px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .grid.kpis, .grid.two, .grid.form, .grid.three, .veh-grid { grid-template-columns: 1fr; }
  .mobile-nav { display: flex; }
  h1.page-title { font-size: 26px; }
  .page { padding: 18px 16px 40px; }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--fill);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}
.lang-switch a {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.lang-switch a.is-on { background: #fff; color: var(--accent); }

html[dir="rtl"] {
  font-family: "IBM Plex Sans Arabic", var(--font);
}
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  font-family: "IBM Plex Sans Arabic", var(--font);
  letter-spacing: 0;
}
html[dir="rtl"] .btn-back svg { transform: scaleX(-1); }
html[dir="rtl"] .shell { direction: rtl; }
html[dir="rtl"] .side .logo span { letter-spacing: 0; }
html[dir="rtl"] .p-top { flex-direction: row; }
html[dir="rtl"] .notify-panel { right: auto; left: 0; }
html[dir="rtl"] .toast-stack { right: auto; left: 16px; }
html[dir="rtl"] .n-badge { margin-left: 0; margin-right: 4px; }
html[dir="rtl"] .bell-btn .n-badge { right: auto; left: 4px; }

dialog.doc-preview-dialog {
  width: min(960px, 96vw);
  height: min(88vh, 900px);
  max-width: 96vw;
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #111;
  color: #fff;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
dialog.doc-preview-dialog:not([open]) { display: none !important; }
dialog.doc-preview-dialog[open] { display: flex; }
dialog.doc-preview-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.doc-preview-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 12px;
  background: #1d1d1f;
  flex-shrink: 0;
}
.doc-preview-tab {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  margin-right: auto;
}
.doc-preview-body {
  flex: 1;
  min-height: 0;
  background: #0b0b0c;
  position: relative;
}
.doc-preview-body img,
.doc-preview-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
  background: #0b0b0c;
}
html[dir="rtl"] .doc-preview-tab { margin-right: 0; margin-left: auto; }

.paper-list { list-style: none; margin: 0; padding: 0; }
.paper-row { border-bottom: 1px solid var(--line); padding: 14px 0; }
.paper-row:last-child { border-bottom: 0; }
.paper-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.paper-main strong { margin-right: 8px; }
.paper-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.paper-actions-start { margin: 0 0 8px; }
.paper-link { font-weight: 600; font-size: 14px; }
.paper-sub { margin-top: 22px; }
.paper-edit { display: none; margin-top: 12px; padding: 12px; background: var(--fill); border-radius: 12px; }
.paper-edit.is-open,
.paper-edit:target { display: block; }
html[dir="rtl"] .paper-main strong { margin-right: 0; margin-left: 8px; }

