:root {
  --ink: #0b0d12;
  --muted: #707987;
  --paper: #f3f5f8;
  --surface: #ffffff;
  --line: #dce1e6;
  --green-950: #152f59;
  --green-800: #1e4079;
  --green-600: #496799;
  --green-100: #e8eef8;
  --amber: #c18722;
  --amber-soft: #fbf3e3;
  --red: #c8473d;
  --red-soft: #fbeceb;
  --blue: #1e4079;
  --blue-soft: #e8eef8;
  --shadow: 0 20px 54px rgba(30, 64, 121, 0.14);
  --app-viewport-height: 100dvh;
  font-family: Arial, "Helvetica Neue", ui-sans-serif, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 22px 24px;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  min-height: 74px;
  padding: 0 6px;
}
.brand-logo { width: 148px; height: auto; display: block; }
.mobile-brand { display: none; width: 96px; height: auto; }

.main-nav { margin-top: 38px; display: grid; gap: 8px; }
.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #747d89;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}
.nav-item.active { color: #fff; background: var(--green-800); }
.nav-item:disabled { opacity: .52; cursor: default; }
.nav-icon { width: 22px; font-size: 18px; text-align: center; }

.sidebar-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #62c584; box-shadow: 0 0 0 4px rgba(98,197,132,.12); }

.main-content { position: relative; min-width: 0; overflow: hidden; padding: 38px 44px 64px; }
.main-content::before { content: ""; position: absolute; z-index: -1; top: -12px; right: -150px; width: 650px; height: 190px; opacity: .17; background: url("https://static.tildacdn.com/tild3962-3737-4331-b631-303234336665/vysotaservis_pattern.svg") right top / contain no-repeat; pointer-events: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--green-800); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); font-weight: 750; letter-spacing: -.035em; text-transform: uppercase; }

.user-switcher {
  min-width: 250px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(30, 64, 121, .06);
}
.avatar { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; background: var(--green-800); color: #fff; font-weight: 750; font-size: 13px; }
.user-copy { flex: 1; min-width: 0; }
.user-copy select { width: 100%; border: 0; padding: 0; appearance: none; background: transparent; color: var(--ink); font-weight: 680; outline: 0; }
.user-copy small { display: block; margin-top: 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { color: var(--muted); }

.stats { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stat-card {
  min-height: 40px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.stat-card:hover { border-color: #aebbd1; box-shadow: 0 5px 16px rgba(30, 64, 121, .08); }
.stat-card.active { border-color: var(--green-800); background: var(--green-800); color: #fff; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.stat-card.active .stat-label { color: #fff; }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }
.dot-green { background: var(--green-600); }
.dot-blue { background: var(--blue); }
.stat-card strong { min-width: 25px; height: 25px; padding: 0 7px; display: inline-grid; place-items: center; margin: 0; border-radius: 6px; background: #eef1f5; color: var(--ink); font-size: 12px; font-weight: 750; line-height: 1; }
.stat-card.active strong { background: #fff; color: var(--green-800); }

.workbench { margin-top: 28px; }
.toolbar { min-height: 46px; display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.filter-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 9px; background: #e6eaf0; }
.filter-tab { border: 0; border-radius: 6px; padding: 8px 13px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.filter-tab.active { background: var(--green-800); color: #fff; box-shadow: 0 2px 9px rgba(30,64,121,.14); }
.search-box { width: min(310px, 36vw); display: flex; align-items: center; gap: 8px; padding: 6px 7px 6px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-dismiss { display: none; flex: 0 0 auto; min-height: 32px; padding: 0 11px; border: 0; border-radius: 7px; background: var(--green-800); color: #fff; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }

.request-list { margin-top: 14px; display: grid; gap: 10px; }
.request-card {
  position: relative;
  min-height: 156px;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) 170px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.request-card:hover, .request-card:focus-visible { transform: translateY(-1px); border-color: #aebbd1; box-shadow: 0 13px 34px rgba(30, 64, 121, .1); outline: 0; }
.priority-rail { background: var(--green-600); }
.request-card.priority-high .priority-rail { background: var(--amber); }
.request-card.priority-emergency .priority-rail { background: var(--red); }
.request-main { padding: 20px 24px; min-width: 0; }
.request-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.status-badge { padding: 4px 8px; border-radius: 7px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.status-offered, .status-transferred, .status-in_progress { color: var(--green-800); background: var(--green-100); }
.status-completed, .status-closed { color: #426b83; background: var(--blue-soft); }
.request-number::before { content: "·"; margin-right: 9px; color: #c8cdd2; }
.request-time { margin-left: auto; }
.request-title { margin: 14px 0 5px; font-size: 21px; font-weight: 700; }
.request-summary { margin: 0; color: #515966; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-location { margin-top: 15px; display: flex; gap: 7px; color: var(--muted); font-size: 13px; }
.location-icon { color: var(--green-600); }
.request-side { padding: 20px; border-left: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-content: space-between; gap: 8px; }
.sla-block span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.sla-block strong { display: block; margin-top: 5px; font-size: 14px; }
.sla-block strong.overdue { color: var(--red); }
.card-counts { align-self: end; color: var(--muted); font-size: 12px; }
.open-button { grid-column: 2; grid-row: 1 / 3; align-self: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--green-800); cursor: pointer; font-size: 18px; }

.empty-state { margin-top: 14px; padding: 66px 20px; border: 1px dashed #c8cdd2; border-radius: 10px; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 12px 0 4px; color: var(--ink); font-weight: 700; }
.empty-state p { margin: 0; }
.empty-icon { width: 44px; height: 44px; margin: auto; border-radius: 50%; display: grid; place-items: center; background: var(--green-100); color: var(--green-800); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15, 25, 42, .4); backdrop-filter: blur(3px); opacity: 1; transition: opacity .2s; }
.request-drawer { position: fixed; z-index: 21; top: 0; right: 0; width: min(590px, 100%); height: 100vh; height: var(--app-viewport-height, 100dvh); overflow: clip; background: #f8f9fb; box-shadow: -20px 0 60px rgba(21,47,89,.24); transform: translateX(100%); transition: transform .25s ease; }
.request-drawer.open { transform: translateX(0); }
#drawer-content { height: 100%; min-height: 0; overflow: clip; display: flex; flex-direction: column; }
.drawer-header { position: relative; overflow: hidden; flex: 0 0 auto; padding: 26px 28px 22px; border-bottom: 0; background: var(--green-800); color: #fff; }
.drawer-header::after { content: ""; position: absolute; right: -65px; top: -20px; width: 280px; height: 90px; opacity: .22; filter: brightness(0) invert(1); background: url("https://static.tildacdn.com/tild3962-3737-4331-b631-303234336665/vysotaservis_pattern.svg") right top / contain no-repeat; pointer-events: none; }
.drawer-header .status-badge { position: relative; z-index: 1; color: #fff; background: rgba(255,255,255,.16); }
.drawer-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-close { position: relative; z-index: 1; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.drawer-header h2 { position: relative; z-index: 1; margin: 20px 0 8px; font-size: 28px; font-weight: 750; }
.drawer-header p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.76); line-height: 1.5; }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; }
.detail-section { padding: 21px 0; border-bottom: 1px solid var(--line); }
.detail-section:first-child { padding-top: 0; }
.detail-section h3 { margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.section-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 6px; border-radius: 10px; background: var(--green-100); color: var(--green-800); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-item { min-width: 0; }
.detail-item span { display: block; color: var(--muted); font-size: 12px; }
.detail-item strong { display: block; margin-top: 4px; font-size: 14px; font-weight: 650; word-break: break-word; }
.deadline-detail { grid-column: 1 / -1; }
.deadline-summary { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.deadline-summary strong { margin-top: 0; }
.deadline-summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.deadline-edit { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid #c7d2e5; border-radius: 7px; background: #f1f4f9; color: var(--green-800); cursor: pointer; font-size: 11px; font-weight: 750; }
.reschedule-form { margin-top: 13px; padding: 14px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 11px; border: 1px solid #c7d2e5; border-radius: 9px; background: #f1f4f9; }
.reschedule-form label { min-width: 0; }
.reschedule-form label > span { margin-bottom: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.reschedule-form input, .reschedule-form textarea { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); outline: none; }
.reschedule-form textarea { resize: vertical; }
.reschedule-form input:focus, .reschedule-form textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(30, 64, 121, .1); }
.reschedule-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 7px; }
.reschedule-actions button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 750; }
.reschedule-actions .reschedule-submit { border-color: var(--green-800); background: var(--green-800); color: #fff; }
.reschedule-actions .reschedule-submit:disabled { opacity: .6; cursor: default; }
.customer-grid { grid-template-columns: minmax(0, .75fr) minmax(260px, 1.25fr); }
.contact-detail { min-width: 0; }
.contact-actions { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 7px; }
.contact-button { min-height: 34px; padding: 7px 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); text-decoration: none; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; transition: .15s ease; }
.contact-button:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(30, 64, 121, .09); }
.contact-button.call { color: var(--green-800); border-color: #c7d2e5; background: #f1f4f9; }
.contact-button.telegram { color: #2076a5; border-color: #c9ddeb; background: #f0f7fb; }
.contact-button.max { color: #5f48a8; border-color: #d9d1ed; background: #f6f3fc; }
.contact-icon { min-width: 17px; height: 17px; display: grid; place-items: center; border-radius: 5px; font-size: 9px; font-weight: 850; }
.contact-button.call .contact-icon { font-size: 13px; }
.field-list { display: grid; gap: 10px; }
.field-row { padding: 12px 14px; border-radius: 8px; background: #eef1f5; }
.field-row span { display: block; color: var(--muted); font-size: 11px; }
.field-row strong { display: block; margin-top: 4px; font-size: 14px; }
.attachment-list { display: grid; gap: 8px; }
.attachment-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: inherit; text-decoration: none; transition: .16s ease; }
.attachment-item:hover { border-color: #aebbd1; box-shadow: 0 6px 18px rgba(30, 64, 121, .07); }
.attachment-preview { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: #e8eef8; color: var(--green-800); font-size: 9px; font-weight: 800; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-copy { min-width: 0; }
.attachment-copy strong, .attachment-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-copy strong { font-size: 13px; }
.attachment-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.attachment-open { color: var(--muted); padding: 6px; }
.upload-form { margin-top: 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.file-picker { min-width: 0; min-height: 60px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px dashed #b5c1d4; border-radius: 9px; background: #f3f6fa; cursor: pointer; }
.file-picker:hover { border-color: var(--green-600); background: #edf2f9; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-picker-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--green-100); color: var(--green-800); font-size: 20px; }
.file-picker strong, .file-picker small { display: block; }
.file-picker strong { font-size: 13px; }
.file-picker small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.upload-submit { border: 0; border-radius: 11px; padding: 0 14px; background: var(--green-800); color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.upload-submit:disabled { background: #c8cdd2; cursor: default; }
.comment { padding: 12px 0; }
.comment + .comment { border-top: 1px solid var(--line); }
.comment-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.comment p { margin: 6px 0 0; line-height: 1.48; }
.comment-attachments { margin-top: 10px; display: grid; gap: 7px; }
.comment-attachments .attachment-item { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 7px; background: #f5f7fa; }
.comment-attachments .attachment-preview { width: 38px; height: 38px; border-radius: 8px; font-size: 8px; }
.comment-form { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.comment-compose { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.comment-form textarea { display: block; width: 100%; min-height: 66px; padding: 11px 12px 8px; border: 0; resize: vertical; background: transparent; font: inherit; outline: 0; }
.comment-file-row { min-height: 35px; padding: 6px 9px; border-top: 1px solid #edf0ed; display: flex; align-items: center; gap: 9px; }
.comment-file-picker { display: inline-flex; align-items: center; gap: 5px; color: var(--green-800); font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.comment-file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.comment-file-icon { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 6px; background: var(--green-100); font-size: 15px; }
.comment-file-status { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.comment-form button { min-width: 92px; border: 0; border-radius: 10px; padding: 0 15px; background: var(--green-800); color: #fff; cursor: pointer; font-weight: 700; }
.comment-form > button[type="submit"] { grid-column: 2; grid-row: 1; }
.comment-form button:disabled { background: #c8cdd2; cursor: default; }
.comment-validation { grid-column: 1 / -1; margin: 0; padding: 9px 11px; border-radius: 8px; background: #fbe9e7; color: #a63831; font-size: 12px; font-weight: 700; }
.drawer-actions { position: relative; flex: 0 0 auto; width: 100%; padding: 16px 28px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); display: flex; gap: 9px; }
.action-button { flex: 1; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: #fff; cursor: pointer; font-weight: 650; }
.action-button.primary { border-color: var(--green-800); background: var(--green-800); color: #fff; }
.action-button.danger { color: var(--red); }

.transfer-modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  height: var(--app-viewport-height, 100dvh);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 36, .54);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .18s ease;
}
.transfer-modal-backdrop.visible { opacity: 1; }
.transfer-dialog {
  width: min(470px, 100%);
  max-height: calc(var(--app-viewport-height, 100dvh) - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: #f8f9fb;
  box-shadow: 0 24px 70px rgba(6, 18, 38, .32);
  transform: translateY(12px) scale(.985);
  transition: transform .2s ease;
}
.transfer-modal-backdrop.visible .transfer-dialog { transform: translateY(0) scale(1); }
.transfer-header { flex: 0 0 auto; padding: 20px 20px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #fff; }
.transfer-eyebrow { color: var(--green-800); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.transfer-header h2 { margin: 5px 0 4px; font-size: 22px; line-height: 1.16; }
.transfer-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.transfer-close { width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); cursor: pointer; font-size: 20px; }
.transfer-form { min-height: 0; display: flex; flex-direction: column; }
.transfer-search { flex: 0 0 auto; margin: 14px 16px 10px; min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); }
.transfer-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.transfer-options { min-height: 0; padding: 0 16px; overflow-y: auto; display: grid; gap: 8px; }
.transfer-option { position: relative; min-width: 0; padding: 11px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 22px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; transition: .15s ease; }
.transfer-option:hover { border-color: #aebbd1; }
.transfer-option:has(input:checked) { border-color: var(--green-800); box-shadow: 0 0 0 2px rgba(30, 64, 121, .1); }
.transfer-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.transfer-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--green-100); color: var(--green-800); font-size: 12px; font-weight: 800; }
.transfer-person { min-width: 0; }
.transfer-person strong, .transfer-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-person strong { font-size: 14px; }
.transfer-person small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.transfer-direction { padding: 5px 7px; border-radius: 7px; background: #eef1f5; color: #566173; font-size: 10px; font-weight: 700; white-space: nowrap; }
.transfer-check { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: transparent; font-size: 12px; font-weight: 800; }
.transfer-option:has(input:checked) .transfer-check { border-color: var(--green-800); background: var(--green-800); color: #fff; }
.transfer-empty { margin: 14px 0; color: var(--muted); text-align: center; }
.transfer-reason { flex: 0 0 auto; margin: 12px 16px 0; }
.transfer-reason > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.transfer-reason textarea { width: 100%; min-height: 68px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; resize: none; outline: 0; background: #fff; color: var(--ink); }
.transfer-reason textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(30, 64, 121, .1); }
.transfer-footer { flex: 0 0 auto; padding: 14px 16px 16px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 8px; }
.transfer-footer button { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 750; }
.transfer-footer .transfer-submit { border-color: var(--green-800); background: var(--green-800); color: #fff; }
.transfer-footer .transfer-submit:disabled { border-color: #c8cdd2; background: #c8cdd2; cursor: default; }

.toast { position: fixed; z-index: 70; left: 50%; bottom: 28px; padding: 12px 18px; border-radius: 8px; background: var(--green-800); color: #fff; box-shadow: var(--shadow); transform: translate(-50%, 120px); opacity: 0; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 76px 1fr; }
  .sidebar { padding-inline: 14px; align-items: center; }
  .brand span:last-child, .nav-item span:last-child, .sidebar-foot span:last-child { display: none; }
  .brand { padding: 0; }
  .nav-item { padding: 12px; }
  .main-content { padding-inline: 28px; }
}

@media (max-width: 650px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 22px 16px 40px; }
  .topbar { align-items: flex-start; }
  .mobile-brand { display: block; margin-bottom: 12px; }
  .eyebrow { display: none; }
  h1 { font-size: 31px; }
  .user-switcher { min-width: 0; width: 54px; padding: 7px; border-radius: 14px; }
  .user-copy, .chevron { display: none; }
  .stats { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; padding-bottom: 0; }
  .stat-card { min-width: 0; justify-content: space-between; }
  .stat-card strong { font-size: 12px; }
  .stat-label { font-size: 11px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .search-box:focus-within { border-color: var(--green-800); box-shadow: 0 0 0 3px rgba(30, 64, 121, .1); }
  .search-box:focus-within .search-dismiss { display: inline-flex; align-items: center; }
  .request-card { grid-template-columns: 4px 1fr; min-height: 0; }
  .request-main { padding: 17px 17px 13px; }
  .request-title { font-size: 19px; }
  .request-summary { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .request-time { display: none; }
  .request-side { grid-column: 2; padding: 0 17px 16px; border: 0; display: flex; align-items: center; justify-content: space-between; }
  .sla-block { display: flex; align-items: baseline; gap: 7px; }
  .sla-block strong { margin: 0; }
  .open-button { display: none; }
  .drawer-header { padding: 16px 16px 14px; }
  .drawer-header h2 { margin: 14px 0 5px; font-size: 24px; line-height: 1.12; }
  .drawer-header p { max-width: calc(100% - 12px); font-size: 14px; line-height: 1.38; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .drawer-close { width: 34px; height: 34px; }
  .drawer-body { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); scroll-padding-block: 72px 150px; }
  .drawer-actions { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .detail-grid { grid-template-columns: 1fr; }
  .reschedule-form { grid-template-columns: 1fr; }
  .customer-grid { grid-template-columns: 1fr; }
  .contact-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .contact-button { justify-content: center; }
  .upload-form { grid-template-columns: 1fr; }
  .upload-submit { min-height: 42px; }
  .comment-form { grid-template-columns: 1fr; }
  .comment-form > button[type="submit"] { grid-column: 1; grid-row: auto; }
  .comment-form button { min-height: 42px; }
  .transfer-modal-backdrop { padding: 0; align-items: flex-end; }
  .transfer-dialog { width: 100%; max-height: 88%; border-radius: 20px 20px 0 0; }
  .transfer-header { padding: 16px 16px 13px; }
  .transfer-header h2 { font-size: 20px; }
  .transfer-search { margin: 11px 12px 8px; }
  .transfer-options { padding-inline: 12px; }
  .transfer-option { grid-template-columns: 38px minmax(0, 1fr) 22px; padding: 10px; gap: 9px; }
  .transfer-avatar { width: 38px; height: 38px; }
  .transfer-direction { grid-column: 2; width: fit-content; margin-top: -4px; }
  .transfer-check { grid-column: 3; grid-row: 1 / 3; }
  .transfer-reason { margin: 10px 12px 0; }
  .transfer-footer { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 650px) {
  body.keyboard-open .drawer-header {
    min-height: 52px;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }
  body.keyboard-open .drawer-header::after,
  body.keyboard-open .drawer-header p { display: none; }
  body.keyboard-open .drawer-topline { display: contents; }
  body.keyboard-open .drawer-topline .status-badge { grid-column: 1; grid-row: 1; white-space: nowrap; }
  body.keyboard-open .drawer-header h2 {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 17px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.keyboard-open .drawer-close {
    grid-column: 3;
    grid-row: 1;
    width: 34px;
    height: 34px;
  }
  body.keyboard-open .drawer-body {
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    scroll-padding-block: 64px 170px;
  }
  body.keyboard-open .drawer-actions { display: none; }
  body.keyboard-open .comment-form:focus-within {
    position: sticky;
    z-index: 6;
    bottom: 0;
    margin: 8px -4px -4px;
    padding: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    border: 1px solid #c7d2e5;
    border-radius: 14px;
    background: rgba(248, 249, 251, .98);
    box-shadow: 0 -10px 28px rgba(21, 47, 89, .14);
  }
  body.keyboard-open .comment-form textarea {
    min-height: 54px;
    max-height: 96px;
    font-size: 16px;
    resize: none;
  }
  body.keyboard-open .comment-form button {
    min-width: 94px;
    min-height: 0;
    padding-inline: 12px;
  }
  body.keyboard-open .comment-form > button[type="submit"] { grid-column: 2; grid-row: 1; }
  body.keyboard-open .comment-validation { grid-column: 1 / -1; }
  body.keyboard-open .reschedule-form { margin-top: 6px; padding: 10px; gap: 8px; }
  body.keyboard-open .reschedule-form input,
  body.keyboard-open .reschedule-form textarea { font-size: 16px; }
  body.keyboard-open .transfer-dialog { max-height: 100%; }
  body.keyboard-open .transfer-header { padding-block: 10px; }
  body.keyboard-open .transfer-header p { display: none; }
  body.keyboard-open .transfer-search input,
  body.keyboard-open .transfer-reason textarea { font-size: 16px; }
  body.keyboard-open .transfer-reason textarea { min-height: 54px; }
  body.keyboard-open .transfer-footer { padding-bottom: 8px; }
}

