/* GRS – Gebäude Reinigung System
   Fresh "clean" palette: water blue → aqua → spring green, with a sunny accent.
   Only CSS logical properties (margin-inline-start …) so Arabic (dir="rtl") mirrors automatically.
   No external fonts/CDNs (GDPR). Breakpoints: phone < 760px · tablet 760–1199px · desktop ≥ 1200px. */

:root {
  --blue: #0a7cc4;
  --blue-dark: #075a8f;
  --aqua: #12b3a6;
  --green: #4cbf5a;
  --green-soft: #6fd45a;
  --sun: #ffb020;
  --coral: #f05a4f;
  --navy: #0b2a45;
  --navy-2: #0f3d5f;

  --c-primary: var(--blue);
  --c-primary-hover: var(--blue-dark);
  --c-primary-soft: #e3f3fc;
  --c-bg: #f2f8fc;
  --c-surface: #ffffff;
  --c-text: #14283a;
  --c-muted: #5d7183;
  --c-border: #d8e6ef;
  --c-danger: #d63a2f;
  --c-danger-soft: #fdecea;
  --c-warn: #a35f00;
  --c-warn-soft: #fff4dd;
  --c-ok: #1d8a4a;
  --c-ok-soft: #e5f6ea;
  --c-info-soft: #e6f3fb;

  --grad: linear-gradient(135deg, var(--blue) 0%, var(--aqua) 55%, var(--green-soft) 100%);
  --grad-go: linear-gradient(135deg, #1fae5b 0%, #4cbf5a 50%, #8fdc4f 100%);
  --grad-stop: linear-gradient(135deg, #f05a4f 0%, #ff7a45 60%, #ffa23a 100%);
  --grad-side: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);

  --radius: 16px;
  --shadow: 0 1px 2px rgb(11 42 69 / 6%), 0 8px 24px rgb(11 42 69 / 6%);
  --shadow-lg: 0 18px 40px rgb(11 42 69 / 14%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --side-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--c-text);
  background:
    radial-gradient(circle at 92% 6%, rgb(18 179 166 / 9%) 0 140px, transparent 141px),
    radial-gradient(circle at 4% 96%, rgb(10 124 196 / 7%) 0 180px, transparent 181px),
    var(--c-bg);
  background-attachment: fixed;
}
a { color: var(--c-primary); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin-block: 0 .75rem; }
h1 { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }
h2 { font-size: 1.08rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: #eef5fa; padding: .05rem .35rem; border-radius: 6px; }
.muted { color: var(--c-muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.hint { display: block; font-size: .8rem; color: var(--c-muted); font-weight: normal; margin-block-start: .25rem; }
[hidden] { display: none !important; }
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }

/* ---------- buttons & forms ---------- */
.btn, .btn-reset { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .5rem 1.05rem; border: 1px solid var(--c-border); border-radius: 12px;
  background: var(--c-surface); color: var(--c-text); text-decoration: none; cursor: pointer; font-weight: 600;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: #f1f8fc; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 16px rgb(10 124 196 / 28%); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.05); box-shadow: 0 8px 22px rgb(10 124 196 / 34%); }
.btn-go { background: var(--grad-go); border: 0; color: #fff; box-shadow: 0 6px 16px rgb(31 174 91 / 30%); }
.btn-go:hover { background: var(--grad-go); filter: brightness(1.05); }
.btn-danger { color: var(--c-danger); border-color: #f4c6c1; }
.btn-danger:hover { background: var(--c-danger-soft); }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 34px; padding: .25rem .7rem; border-radius: 9px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-link { background: none; border: 0; padding: .5rem 0; color: var(--c-primary); text-decoration: underline; cursor: pointer; font: inherit; }
.btn-reset { background: none; border: 0; cursor: pointer; text-align: start; width: 100%; color: inherit; padding: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; flex: none; }
.icon-btn:hover { background: rgb(10 124 196 / 8%); }
.icon-btn .ico { width: 24px; height: 24px; }
:focus-visible { outline: 3px solid #7fd3f5; outline-offset: 2px; }

.form { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
input, select, textarea {
  font: inherit; font-weight: normal; min-height: 44px; padding: .55rem .8rem;
  border: 1.5px solid var(--c-border); border-radius: 12px; background: #fff; color: var(--c-text); width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgb(18 179 166 / 15%); outline: none; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 20px; padding: 0; accent-color: var(--aqua); flex: none; }
input[type=file] { padding: .45rem; background: #f6fbfe; border-style: dashed; }
.code-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; }
.actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.stack { display: flex; flex-direction: column; gap: .5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

.alert { padding: .8rem 1rem; border-radius: 12px; margin-block-end: 1rem; border-inline-start: 4px solid transparent; }
.alert ul { margin: 0; padding-inline-start: 1.2rem; }
.alert-error { background: var(--c-danger-soft); color: var(--c-danger); border-color: var(--c-danger); }
.alert-ok { background: var(--c-ok-soft); color: var(--c-ok); border-color: var(--c-ok); }
.alert-info { background: var(--c-info-soft); border-color: var(--blue); }

.badge { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #e9f1f7; color: var(--c-text); white-space: nowrap; }
.badge-green { background: var(--c-ok-soft); color: var(--c-ok); }
.badge-red { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-amber { background: var(--c-warn-soft); color: var(--c-warn); }
.badge-grey { background: #edf1f4; color: var(--c-muted); }
.text-ok { color: var(--c-ok); }
.text-bad { color: var(--c-danger); }

.lang-switch { display: flex; gap: .25rem; flex-wrap: wrap; }
.lang-btn { font: inherit; font-size: .85rem; padding: .3rem .7rem; min-height: 34px; border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-surface); cursor: pointer; color: var(--c-text); }
.lang-btn.is-active { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo img { display: block; width: 40px; height: 40px; filter: drop-shadow(0 4px 8px rgb(10 124 196 / 30%)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-mark { font-weight: 800; font-size: 1.35rem; letter-spacing: .1em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.brand-sub { font-size: .76rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- soap bubbles (decoration) ---------- */
.bubble { position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 32% 28%, rgb(255 255 255 / 95%) 0 12%, rgb(255 255 255 / 25%) 30%, rgb(190 240 255 / 30%) 70%, rgb(255 255 255 / 55%) 100%);
  border: 1.5px solid rgb(255 255 255 / 55%); animation: float 9s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 1.5rem 1.25rem 2.75rem; }
.auth-hero-inner { position: relative; max-width: 460px; margin-inline: auto; text-align: center; }
.auth-hero-logo { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 8px 22px rgb(0 0 0 / 18%); }
.auth-hero-name { font-weight: 800; letter-spacing: .2em; margin: .35rem 0 0; font-size: 1.1rem; }
.auth-tagline { font-size: clamp(1.25rem, 1rem + 1.4vw, 2.1rem); margin: .6rem 0 .3rem; }
.auth-tagline-sub { margin: 0 auto; opacity: .92; max-width: 36ch; font-size: .95rem; }
.auth-illustration { display: none; }
.auth-hero .bubble-1 { width: 90px; height: 90px; inset-inline-start: -20px; top: 30%; }
.auth-hero .bubble-2 { width: 46px; height: 46px; inset-inline-end: 12%; top: 12%; animation-delay: -2s; }
.auth-hero .bubble-3 { width: 22px; height: 22px; inset-inline-end: 30%; bottom: 14%; animation-delay: -4s; }
.auth-hero .bubble-4 { width: 140px; height: 140px; inset-inline-end: -50px; bottom: -40px; animation-delay: -6s; }
.auth-hero .bubble-5 { width: 16px; height: 16px; inset-inline-start: 22%; top: 10%; animation-delay: -3s; }
.auth-panel { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 0 1rem 2rem; margin-block-start: -1.5rem; position: relative; }
.auth-card { width: 100%; max-width: 440px; background: var(--c-surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 1.75rem 1.5rem; }
.auth-card .brand { margin-block-end: 1.25rem; }
.steps { padding-inline-start: 1.2rem; }
.qr { display: flex; justify-content: center; margin-block: 1rem; }
.qr svg { width: 200px; height: 200px; padding: 8px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; text-align: center; word-break: break-all; background: #eef6fb; padding: .55rem; border-radius: 10px; }

@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(380px, 1.05fr) 1fr; }
  .auth-hero { display: flex; align-items: center; padding: 3rem; }
  .auth-hero-inner { text-align: start; margin: 0; }
  .auth-tagline-sub { margin: 0; }
  .auth-illustration { display: block; width: 100%; max-width: 420px; height: auto; margin-block-start: 2rem; filter: drop-shadow(0 18px 30px rgb(0 0 0 / 15%)); }
  .auth-panel { justify-content: center; margin: 0; padding: 2rem; }
}

/* ---------- GM layout ---------- */
.gm-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.gm-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 1.25rem;
  background: var(--grad-side); color: #dbe9f4; padding: 1.1rem .8rem; z-index: 30;
}
.gm-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-inline: .3rem; }
.gm-sidebar .brand-sub { color: #9fbcd3; }
.gm-sidebar .brand-mark { background: linear-gradient(135deg, #7fd3f5, #8de6a0); -webkit-background-clip: text; background-clip: text; }
.nav-close { display: none; color: #fff; }
.gm-nav { display: flex; flex-direction: column; gap: .2rem; }
.nav-item {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 12px;
  color: #c9dceb; text-decoration: none; font-weight: 500; position: relative; transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.nav-item.is-active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgb(18 179 166 / 30%); font-weight: 700; }
.nav-icon { width: 22px; height: 22px; }
.gm-sidebar-foot { margin-block-start: auto; display: flex; flex-direction: column; gap: .15rem; border-block-start: 1px solid rgb(255 255 255 / 10%); padding-block-start: .8rem; }
.gm-sidebar-foot .nav-item { font-size: .88rem; padding-block: .45rem; }
.user-chip { display: flex; align-items: center; gap: .65rem; padding: .35rem .8rem .55rem; color: #fff; font-weight: 600; min-width: 0; }
.user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; }
.gm-overlay { display: none; }
.gm-main { min-width: 0; display: flex; flex-direction: column; }
.gm-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .8rem 1.5rem;
  background: rgb(255 255 255 / 86%); backdrop-filter: blur(10px); border-block-end: 1px solid var(--c-border);
}
.nav-toggle { display: none; color: var(--c-primary); }
.gm-title { margin: 0; flex: 1; min-width: 0; font-size: clamp(1.1rem, .95rem + .8vw, 1.4rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-content { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; max-width: 1500px; width: 100%; }

.card { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; border: 1px solid rgb(216 230 239 / 60%); min-width: 0; }
.card.narrow { max-width: 760px; }
.card h3 { font-size: .95rem; margin-block: 1rem .3rem; color: var(--c-muted); }

.welcome { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.3rem 1.5rem; border-radius: var(--radius); background: var(--grad); color: #fff; box-shadow: 0 12px 28px rgb(10 124 196 / 22%); }
.welcome h2 { font-size: 1.35rem; margin: 0 0 .2rem; }
.welcome p { margin: 0; opacity: .92; }
.welcome-art .ico { width: 64px; height: 64px; color: rgb(255 255 255 / 85%); filter: drop-shadow(0 4px 10px rgb(0 0 0 / 15%)); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; }
.tile {
  --tile: var(--blue); position: relative; overflow: hidden; display: block;
  background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.15rem; color: inherit; text-decoration: none;
  border: 1px solid rgb(216 230 239 / 60%); border-inline-start: 4px solid var(--aqua); transition: transform .15s ease, box-shadow .15s ease;
}
.tile:has(.tile-icon) { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .9rem; align-items: center; border-inline-start-width: 1px; border-inline-start-color: rgb(216 230 239 / 60%); }
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile::after { content: ""; position: absolute; inset-inline-end: -26px; top: -26px; width: 90px; height: 90px; border-radius: 50%; background: var(--tile); opacity: .08; }
.tile-icon { grid-row: span 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--tile); color: #fff; box-shadow: 0 6px 14px rgb(11 42 69 / 15%); }
.tile-icon .ico { width: 24px; height: 24px; }
.tile-value { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.tile-label { display: block; color: var(--c-muted); font-size: .88rem; }
.tile-blue { --tile: var(--blue); }
.tile-teal { --tile: var(--aqua); }
.tile-green { --tile: var(--green); }
.tile-amber { --tile: var(--sun); }
.tile-warn { border-inline-start-color: var(--sun); }
.tile-attention .tile-value { color: var(--c-warn); }

.toolbar { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: end; }
.filters { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
.filters label { flex: 1 1 170px; min-width: 0; }
.filters .btn { flex: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table-wrap .table { min-width: 620px; }
.table th, .table td { text-align: start; padding: .65rem .55rem; border-block-end: 1px solid var(--c-border); vertical-align: top; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); background: #f5fafd; }
.table tbody tr:hover { background: #f5fbff; }
.table td input:not([type=checkbox]), .table td select { min-height: 38px; padding: .3rem .5rem; }
.table tfoot td { border-block-end: 0; }
.details span { display: inline-block; margin-inline-end: .5rem; color: var(--c-muted); }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-block-start: 1rem; flex-wrap: wrap; }
.pager .muted { margin-inline-end: auto; }
.row-warn { background: var(--c-danger-soft); }
.input-sm { max-width: 120px; }

.detail-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.25rem; align-items: start; }
.grid-main-side > aside { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-money { margin-block-start: 1rem; }
.kv-money dd { text-align: end; }
.otp { font-size: 1.4rem; letter-spacing: .1em; padding: .25rem .6rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.assign-form { margin-block-start: 1rem; border-block-start: 1px solid var(--c-border); padding-block-start: 1rem; }

.tabs { display: flex; gap: .25rem; overflow-x: auto; border-block-end: 2px solid var(--c-border); scrollbar-width: none; }
.tab { padding: .65rem 1rem; text-decoration: none; color: var(--c-muted); font-weight: 600; border-block-end: 3px solid transparent; margin-block-end: -2px; white-space: nowrap; }
.tab.is-active { color: var(--c-primary); border-block-end-color: var(--aqua); }

/* review inbox */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 1rem; }
.review-card { position: relative; background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border: 1px solid rgb(216 230 239 / 60%); }
.review-select { position: absolute; inset-block-start: .55rem; inset-inline-start: .55rem; background: #fff; border-radius: 8px; padding: .25rem; z-index: 1; box-shadow: var(--shadow); }
.review-media img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e3eef5; }
.review-tag { position: absolute; inset-block-start: .55rem; inset-inline-end: .55rem; background: rgb(11 42 69 / 70%); color: #fff; font-size: .75rem; padding: .12rem .55rem; border-radius: 999px; }
.review-text { margin: 0; padding: 2.6rem 1rem 0; font-style: italic; min-height: 120px; white-space: pre-wrap; background: linear-gradient(180deg, #f1f9fd, transparent); }
.review-meta { padding: .75rem 1rem; flex: 1; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: 0 1rem 1rem; }
.review-actions .btn { width: 100%; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .75rem; }
.photo-strip figure { margin: 0; }
.photo-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #e3eef5; }

/* quotes & settings */
.logo-preview { max-width: 100%; max-height: 120px; display: block; margin-block-end: .5rem; background: #f1f8fc; padding: .5rem; border-radius: 10px; }
.pricing-switch { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-block-end: .75rem; }
.offer-total { font-weight: 800; font-size: 1.05rem; color: var(--blue-dark); margin: .75rem 0 0; padding: .6rem .9rem; background: var(--c-info-soft); border-radius: 12px; }
.offer-total:empty { display: none; }
.pdf-card { padding: .75rem; }
.pdf-frame { width: 100%; height: 75vh; min-height: 420px; border: 1px solid var(--c-border); border-radius: 12px; background: #fff; margin-block-end: .75rem; }
.status-row { display: flex; gap: .5rem; margin-block-start: 1rem; flex-wrap: wrap; }

/* reports */
.meter { position: relative; min-width: 110px; height: 22px; background: #e8f1f7; border-radius: 999px; overflow: hidden; }
.meter-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, var(--aqua), var(--green-soft)); border-radius: 999px; }
.meter-near .meter-fill { background: linear-gradient(90deg, #ffc94d, var(--sun)); }
.meter-over .meter-fill { background: linear-gradient(90deg, #ff8a5c, var(--coral)); }
.meter-label { position: relative; display: block; text-align: center; font-size: .78rem; line-height: 22px; font-weight: 700; }
.meter-w0 { width: 0; } .meter-w1 { width: 10%; } .meter-w2 { width: 20%; } .meter-w3 { width: 30%; }
.meter-w4 { width: 40%; } .meter-w5 { width: 50%; } .meter-w6 { width: 60%; } .meter-w7 { width: 70%; }
.meter-w8 { width: 80%; } .meter-w9 { width: 90%; } .meter-w10 { width: 100%; }

/* ---------- GM responsive ---------- */
@media (max-width: 1199px) and (min-width: 760px) {
  /* tablet: icon rail */
  :root { --side-w: 78px; }
  .gm-sidebar { padding-inline: .6rem; align-items: center; }
  .gm-sidebar .brand-text, .gm-sidebar .nav-label { display: none; }
  .gm-sidebar-head { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: .7rem; width: 52px; }
  .gm-nav, .gm-sidebar-foot { align-items: center; }
  .user-chip { padding: .3rem 0 .6rem; justify-content: center; }
  .grid-main-side { grid-template-columns: minmax(0, 1fr); }
  .grid-main-side > aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 759px) {
  /* phone: off-canvas drawer */
  .gm-shell { grid-template-columns: minmax(0, 1fr); }
  .gm-sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: min(84vw, 300px); height: 100%;
    transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .gm-sidebar { transform: translateX(105%); }
  body.nav-open .gm-sidebar { transform: none; }
  body.nav-open .gm-overlay { display: block; position: fixed; inset: 0; background: rgb(11 42 69 / 45%); z-index: 25; }
  body.nav-open { overflow: hidden; }
  .nav-toggle, .nav-close { display: inline-grid; }
  .gm-topbar { padding: .55rem .75rem; gap: .4rem; flex-wrap: wrap; }
  .gm-topbar .lang-switch { width: 100%; justify-content: flex-end; }
  .gm-content { padding: 1rem .75rem 2rem; gap: 1rem; }
  .card { padding: 1rem; border-radius: 14px; }
  .grid-main-side { grid-template-columns: minmax(0, 1fr); }
  .welcome { padding: 1rem 1.1rem; }
  .welcome-art { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .tile:has(.tile-icon) { grid-template-columns: 1fr; padding: .85rem; }
  .tile-icon { grid-row: auto; width: 40px; height: 40px; margin-block-end: .4rem; }
  .tile-value { font-size: 1.5rem; }
  .actions > .btn { flex: 1 1 auto; }
  .toolbar > .btn, .toolbar > .actions { flex: 1 1 100%; }
  .pdf-frame { height: 60vh; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dt { color: var(--c-muted); font-size: .82rem; margin-block-start: .4rem; }
  .kv-money dd { text-align: start; }
}

/* ---------- Worker app (mobile-first, one-hand use) ---------- */
.page-w { background: var(--c-bg); }
.w-shell { min-height: 100vh; display: flex; flex-direction: column; max-width: 560px; margin-inline: auto; background: var(--c-surface); position: relative; }
.w-header {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem 1.6rem; padding-block-start: max(.9rem, env(safe-area-inset-top));
  background: var(--grad); color: #fff; border-end-start-radius: 26px; border-end-end-radius: 26px;
}
.w-header .bubble-1 { width: 70px; height: 70px; inset-inline-end: -14px; top: -18px; }
.w-header .bubble-2 { width: 26px; height: 26px; inset-inline-end: 70px; bottom: 6px; animation-delay: -3s; }
.w-logo { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 6px 14px rgb(0 0 0 / 18%); }
.w-header-text { display: flex; flex-direction: column; min-width: 0; }
.w-hello { font-weight: 800; font-size: 1.1rem; }
.w-company { font-size: .8rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-content { flex: 1; padding: 1rem; padding-block-end: 5.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.w-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1rem; text-align: center; }
#step-idle .w-center { min-height: 55vh; }
.w-idle-art { width: min(100%, 300px); opacity: .95; }
.w-idle-art img { width: 100%; height: auto; display: block; }
.w-big-btn {
  width: 100%; min-height: 112px; border: 0; border-radius: 26px; font: inherit; font-size: 1.5rem; font-weight: 800;
  letter-spacing: .03em; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .75rem;
  transition: transform .12s ease, filter .15s ease;
}
.w-big-btn .ico { width: 34px; height: 34px; }
.w-big-btn:active { transform: scale(.98); }
.w-start { background: var(--grad-go); box-shadow: 0 14px 28px rgb(31 174 91 / 35%); }
.w-stop { background: var(--grad-stop); box-shadow: 0 14px 28px rgb(240 90 79 / 35%); }
.w-big-btn:disabled { opacity: .45; cursor: not-allowed; }
.w-section h2 { font-size: 1rem; }
.w-list-btn { display: flex; align-items: center; width: 100%; min-height: 58px; padding: .75rem 1rem; margin-block-end: .55rem; border: 1px solid var(--c-border); border-radius: 16px; background: var(--c-surface); color: var(--c-text); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; text-align: start; box-shadow: var(--shadow); }
.w-foot { text-align: center; }
.w-tabbar {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 10; display: flex; max-width: 560px; margin-inline: auto;
  background: rgb(255 255 255 / 92%); backdrop-filter: blur(10px); border-block-start: 1px solid var(--c-border);
  padding-block-end: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px rgb(11 42 69 / 6%);
}
.w-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem 0; min-height: 64px; color: var(--c-muted); text-decoration: none; font-size: .82rem; font-weight: 600; }
.w-tab .ico { width: 26px; height: 26px; }
.w-tab.is-active { color: var(--c-primary); }
.w-tab.is-active .ico { color: var(--aqua); }

.w-step { display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.w-step h2 { font-size: 1.25rem; margin: 0; }
.w-project { display: block; width: 100%; text-align: start; padding: 1rem 1.1rem; min-height: 74px; border: 2px solid var(--c-border); border-radius: 18px; background: var(--c-surface); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.w-project strong { display: block; font-size: 1.1rem; }
.w-project.is-selected { border-color: var(--aqua); background: linear-gradient(135deg, #e7f7fb, #ecfbe8); }
.w-camera { position: relative; background: var(--navy); border-radius: 22px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 58vh; box-shadow: var(--shadow-lg); }
.w-camera video, .w-camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.w-hint { text-align: center; font-size: .9rem; color: var(--c-muted); }
.w-row { display: flex; gap: .75rem; }
.w-row > * { flex: 1; }
.w-btn { min-height: 64px; font-size: 1.1rem; font-weight: 800; border-radius: 18px; }
.w-shutter { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; border: 6px solid #fff; background: var(--grad); color: #fff; margin: 0 auto; cursor: pointer; box-shadow: 0 0 0 3px var(--aqua), 0 10px 22px rgb(10 124 196 / 35%); }
.w-shutter .ico { width: 32px; height: 32px; }
.w-shutter:active { transform: scale(.95); }
.w-timer-ring { position: relative; width: min(70vw, 260px, 36vh); aspect-ratio: 1; margin: .5rem auto .25rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from 0deg, var(--blue), var(--aqua), var(--green-soft), var(--blue)); }
.w-timer-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--c-surface); }
.w-timer-glow { position: absolute; inset: -12px; border-radius: 50%; background: radial-gradient(circle, rgb(18 179 166 / 25%), transparent 70%); animation: pulse 2.4s ease-in-out infinite; z-index: -1; }
@keyframes pulse { 0%, 100% { transform: scale(.96); opacity: .6; } 50% { transform: scale(1.04); opacity: 1; } }
.w-timer { position: relative; font-size: clamp(2.1rem, 10vw, 3.1rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--navy); }
.w-running-project { text-align: center; font-weight: 700; font-size: 1.15rem; margin: 0; }
.w-sync { text-align: center; font-size: .85rem; color: var(--c-muted); margin: 0; }
.w-sync.is-offline { color: var(--c-warn); font-weight: 700; }
.w-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.w-thumbs figure { position: relative; margin: 0; }
.w-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.w-thumbs button { position: absolute; inset-block-start: 3px; inset-inline-end: 3px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgb(11 42 69 / 70%); color: #fff; cursor: pointer; }
.w-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.w-chip { padding: .5rem .95rem; min-height: 42px; border-radius: 999px; border: 1.5px solid #bfe3f0; background: #f1fafd; color: var(--blue-dark); font: inherit; font-weight: 600; cursor: pointer; }
.w-chip:active { background: #dff3fa; }
.w-done { display: grid; place-items: center; width: 140px; height: 140px; margin: 3rem auto 0; border-radius: 50%; background: var(--grad-go); color: #fff; box-shadow: 0 16px 34px rgb(31 174 91 / 35%); }
.w-done .ico { width: 72px; height: 72px; }
.w-banner { padding: .7rem 1rem; border-radius: 14px; background: var(--c-warn-soft); color: var(--c-warn); font-size: .9rem; font-weight: 600; }
.w-privacy { line-height: 1.6; }
.w-privacy h3 { font-size: 1rem; margin-block: 1rem .25rem; color: var(--blue-dark); }
.w-wipe { display: block; margin: 2rem auto 0; width: 36px; height: 36px; border: 0; background: none; color: #c5d4de; font-size: 1.1rem; cursor: pointer; border-radius: 50%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.w-wipe.is-pressing { background: var(--c-danger-soft); color: var(--c-danger); }

@media (min-width: 600px) {
  .page-w { padding-block: 1.5rem; }
  .w-shell { min-height: calc(100vh - 3rem); border-radius: 28px; box-shadow: var(--shadow-lg); overflow: hidden; }
  .w-tabbar { inset-block-end: 1.5rem; border-end-start-radius: 28px; border-end-end-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble, .w-timer-glow { animation: none !important; }
  .btn, .tile, .gm-sidebar, .w-big-btn { transition: none !important; }
}

/* ---------- Documents ---------- */
.docs-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.docs-tree { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; padding: .9rem; }
.tree { list-style: none; margin: 0; padding-inline-start: .9rem; border-inline-start: 1px dashed var(--c-border); }
.tree-root { padding-inline-start: 0; border: 0; margin-block-start: .25rem; }
.tree li { margin: .1rem 0; }
.tree-item { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: 10px; color: var(--c-text); text-decoration: none; font-size: .92rem; }
.tree-item:hover { background: #eef7fc; }
.tree-item.is-active { background: linear-gradient(135deg, #e3f3fc, #e6f8f1); font-weight: 700; color: var(--blue-dark); }
.tree-item span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { font-size: .72rem; background: #e6f0f6; color: var(--c-muted); border-radius: 999px; padding: 0 .45rem; }
.folder-ico { color: #8cc7e8; width: 20px; height: 20px; }
.folder-sys { color: var(--aqua); }
.docs-azure { margin: 1rem 0 0; display: flex; gap: .4rem; align-items: flex-start; }
.docs-azure .ico { color: var(--blue); }
.docs-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-block-end: 1rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .95rem; }
.crumbs a { text-decoration: none; }
.docs-search input { min-width: 220px; }
.docs-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: .75rem; margin-block-end: 1rem; align-items: center; }
.upload-box { display: flex; gap: .5rem; align-items: center; }
.upload-drop { flex: 1; flex-direction: row; align-items: center; gap: .75rem; padding: .6rem .9rem; border: 2px dashed #a9d8ee; border-radius: 14px; background: linear-gradient(135deg, #f2faff, #f1fbf4); cursor: pointer; font-weight: 500; position: relative; min-width: 0; }
.upload-drop > .ico { width: 28px; height: 28px; color: var(--aqua); }
.upload-drop > span { display: flex; flex-direction: column; min-width: 0; }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.upload-drop.has-files { border-style: solid; border-color: var(--aqua); }
.inline-form { display: flex; gap: .5rem; align-items: center; }
.inline-form input { min-width: 0; flex: 1; }
.inline-forms { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-block-start: .6rem; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .75rem; margin-block-end: 1rem; }
.folder-card { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .85rem .9rem; border-radius: 14px; border: 1px solid var(--c-border); background: #fbfdff; text-decoration: none; color: var(--c-text); transition: transform .12s ease, box-shadow .15s ease; }
.folder-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.folder-big { width: 38px; height: 38px; }
.folder-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.doc-name { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.doc-name a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.ext { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; font-size: .68rem; font-weight: 800; text-transform: uppercase; color: #fff; background: #8aa1b3; }
.ext-pdf { background: linear-gradient(135deg, #f05a4f, #ff8a5c); }
.ext-xlsx, .ext-ods, .ext-csv { background: linear-gradient(135deg, #1fae5b, #6fd45a); }
.ext-docx, .ext-odt, .ext-txt { background: linear-gradient(135deg, #0a7cc4, #4fb4ea); }
.ext-pptx { background: linear-gradient(135deg, #ff9a2e, #ffb020); }
.ext-png, .ext-jpg, .ext-jpeg, .ext-webp { background: linear-gradient(135deg, #8b5cf6, #c084fc); }
.row-actions { display: flex; gap: .2rem; justify-content: flex-end; align-items: center; }
.row-actions .icon-btn { width: 38px; height: 38px; color: var(--c-muted); }
.more-menu { position: relative; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-panel { position: absolute; inset-inline-end: 0; top: 100%; z-index: 15; width: 270px; display: flex; flex-direction: column; gap: .75rem; padding: .9rem; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.row-new { background: #ecfbf1; }
.folder-settings { margin-block-start: 1rem; }
.folder-settings > summary { cursor: pointer; color: var(--c-muted); }
.generate-card h2 { display: flex; align-items: center; gap: .5rem; }
.generate-card h2 .ico { color: var(--sun); }
.docs-table td { vertical-align: middle; }
@media (max-width: 1199px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } .docs-tree { position: static; max-height: none; } }
@media (max-width: 759px) {
  .docs-actions { grid-template-columns: minmax(0, 1fr); }
  .upload-box, .inline-form { flex-wrap: wrap; }
  .upload-box .btn, .inline-form .btn { flex: 1 1 100%; }
  .docs-search, .docs-search input { width: 100%; min-width: 0; }
  .more-panel { width: min(80vw, 270px); }
}
