:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #647180;
  --line: #d9e0e7;
  --blue: #1769aa;
  --green: #24745a;
  --yellow: #b77800;
  --red: #b83232;
  --violet: #6a4bb8;
  --shadow: 0 16px 42px rgba(32, 45, 58, .14);
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef4f9 0%, #f7f7f3 45%, #edf5ef 100%);
}
.login-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-weight: 800;
  border-radius: 8px;
  margin-bottom: 18px;
}
.login-panel h1, .topbar h1 { margin: 0; }
.login-panel p { color: var(--muted); margin: 8px 0 24px; }
.login-panel small { color: var(--muted); display: block; line-height: 1.45; margin-top: 16px; }
.stack { display: grid; gap: 14px; }
.password-change-box {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.password-change-box summary {
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}
.password-change-box form {
  margin-top: 14px;
}

.app { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  display: grid;
  grid-template-columns: minmax(320px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px 20px;
  background: linear-gradient(180deg, #0f5f9e 0%, #0b4f84 100%);
  border-bottom: 1px solid #0a4572;
  color: #fff;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .view-tabs {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-content: flex-start;
  align-items: center;
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  width: 172px;
  height: 58px;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
}
.topbar h1 {
  color: #fff;
  font-size: 1.62rem;
  line-height: 1.05;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.title-imasic {
  font-family: "Venus Rising", "Eurostile Extended", "Bank Gothic", "Orbitron", "Arial Black", Arial, sans-serif;
  letter-spacing: .04em;
}
.eyebrow { color: var(--blue); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-menu {
  position: relative;
}
.admin-menu summary {
  list-style: none;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary::after {
  content: " ▾";
  font-size: .82rem;
}
.admin-menu[open] summary,
.admin-menu summary:hover {
  background: rgba(255,255,255,.18);
}
.admin-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 230px;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.admin-menu-panel .tab,
.admin-menu-panel .file-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.admin-menu-panel .tab:hover,
.admin-menu-panel .file-button:hover {
  background: #eef4fa;
}
.tab, .ghost-button, .secondary-button, .file-button, .icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 700;
}
.topbar .tab,
.topbar .ghost-button {
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  color: #fff;
}
.topbar .admin-menu-panel .tab,
.topbar .admin-menu-panel .file-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.topbar .admin-menu-panel .tab:hover,
.topbar .admin-menu-panel .file-button:hover {
  background: #eef4fa;
  color: var(--ink);
}
.topbar .tab:hover,
.topbar .ghost-button:hover {
  background: rgba(255,255,255,.18);
}
.tab.active { background: var(--blue); border-color: var(--blue); color: white; }
.topbar .tab.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #0b4f84;
}
.tab span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 20px;
  background: #edf2f6;
  color: var(--ink);
}
.user-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: rgba(255,255,255,.9);
  font-size: .9rem;
}
.user-box .primary-button { white-space: nowrap; }
.topbar .user-box .primary-button {
  background: #ffffff;
  border-color: #ffffff;
  color: #0b4f84;
}
.view { display: none; padding: 16px; }
.active-view { display: block; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 240px; }
input, textarea, select {
  width: 100%;
  border: 1px solid #c9d3dc;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 82px; resize: vertical; }
label { display: grid; gap: 6px; font-weight: 700; color: #283746; }
.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 800;
}
.danger-button {
  border: 1px solid var(--red);
  background: #fff4f4;
  color: var(--red);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 800;
}
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.kanban-board {
  display: flex;
  align-items: stretch;
  gap: 9px;
  overflow-x: auto;
  min-height: calc(100vh - 160px);
  padding-bottom: 10px;
}
.kanban-column {
  background: #e9eef3;
  border: 1px solid #d2dbe3;
  border-radius: 8px;
  min-height: 480px;
  display: grid;
  grid-template-rows: auto 1fr;
  flex: 0 0 236px;
  width: 236px;
}
.kanban-column.empty-column {
  flex-basis: 178px;
  width: 178px;
}
.column-header {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #d2dbe3;
}
.column-header h2 { font-size: .98rem; margin: 0; line-height: 1.2; }
.count-pill { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-weight: 800; }
.column-cards { padding: 8px; display: grid; align-content: start; gap: 9px; min-height: 100%; }
.column-cards.drag-over { outline: 2px solid var(--blue); outline-offset: -5px; }

.equipment-card {
  background: #fff;
  border: 1px solid #d8e0e7;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 11px;
  box-shadow: 0 8px 20px rgba(20, 37, 53, .08);
  display: grid;
  gap: 8px;
}
.equipment-card.moving {
  opacity: .68;
  pointer-events: none;
  position: relative;
}
.equipment-card.moving::after {
  content: "Movendo...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  color: var(--blue);
  font-weight: 900;
}
.equipment-card.sync-highlight {
  animation: syncPulse 1.4s ease-in-out 2;
  box-shadow: 0 0 0 3px rgba(22, 111, 177, .24), 0 8px 20px rgba(20, 37, 53, .08);
}
@keyframes syncPulse {
  0%, 100% { background: #fff; }
  50% { background: #fff7d6; }
}
.equipment-card.high { border-left-color: var(--red); }
.equipment-card.medium { border-left-color: var(--yellow); }
.equipment-card.low { border-left-color: var(--green); }
.equipment-card.warranty {
  border-left-color: #d85b00;
  box-shadow: inset 0 0 0 1px rgba(216, 91, 0, .22), 0 8px 20px rgba(20, 37, 53, .08);
}
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.client-name { font-weight: 800; line-height: 1.15; }
.card-code { color: var(--muted); font-size: .78rem; font-weight: 800; }
.defect { color: #405060; line-height: 1.35; margin: 0; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; color: var(--muted); font-size: .78rem; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { border-radius: 999px; padding: 3px 7px; background: #eef2f5; color: #384755; font-size: .72rem; font-weight: 800; }
.tag.urgent { background: #fff0f0; color: var(--red); }
.tag.waiting { background: #fff7e4; color: var(--yellow); }
.tag.billing { background: #eef0ff; color: var(--violet); }
.tag.done { background: #eaf7f1; color: var(--green); }
.tag.warranty { background: #fff0e6; color: #b44700; }
.supplier-status-card {
  border: 1px solid #f1cf7a;
  background: #fff8df;
  border-radius: 7px;
  padding: 6px 8px;
  max-width: 100%;
}
.supplier-status-card strong {
  color: #162331;
  font-size: .8rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.supplier-status-card span {
  color: #7b4a00;
  font-weight: 900;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.card-delete-button {
  border: 1px solid #f0b9b9;
  background: #fff7f7;
  color: var(--red);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: .76rem;
  font-weight: 900;
}
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.reopen-button {
  border-color: #d85b00;
  color: #b44700;
  background: #fff8f0;
}
.finance-filters label {
  font-size: .86rem;
}
.finance-summary .metric-card strong {
  color: var(--blue);
}
.finance-section {
  margin-top: 14px;
}
.table-scroll {
  overflow-x: auto;
}
.finance-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: collapse;
  font-size: .84rem;
}
.finance-table th,
.finance-table td {
  border: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
}
.finance-table th {
  background: #eef5fb;
  color: #124d7d;
  font-weight: 900;
}
.finance-table tfoot td {
  background: #f6fafc;
  font-weight: 900;
}
.finance-table .money {
  text-align: right;
  white-space: nowrap;
}
.finance-status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2f5;
  color: #384755;
  font-weight: 800;
  white-space: nowrap;
}
.finance-status.received { background: #eaf7f1; color: var(--green); }
.finance-status.pending { background: #fff7e4; color: var(--yellow); }
.finance-status.partial { background: #fff0e6; color: #b44700; }
.finance-status.cancelled { background: #fff0f0; color: var(--red); }
.finance-status.courtesy { background: #eef0ff; color: var(--violet); }
.finance-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.finance-mini-list {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.finance-mini-list h4,
.finance-mini-list p {
  margin: 0;
}
.quote-button {
  border: 1px solid #cbd8e4;
  background: #f8fbfd;
  color: var(--blue);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 800;
  justify-self: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(27, 43, 58, .06);
}
.panel h2 { margin: 0 0 14px; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid h2, .wide { grid-column: 1 / -1; }
.form-section {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfe;
}
.form-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.summary-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.summary-grid strong {
  display: block;
  margin-top: 4px;
}
.form-title h2 { margin: 0 0 4px; }
.form-title p { margin: 0; color: var(--muted); font-weight: 400; }
.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.accessories-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.accessories-field label, .filters-grid label { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.accessories-field input, .filters-grid input[type="checkbox"] { width: auto; }
.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
}
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-top: 14px; }
.history-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(27, 43, 58, .06);
}
.history-card h3 { margin: 0; font-size: 1rem; }
.history-card p { margin: 0; color: var(--muted); line-height: 1.35; }
.restore-button { justify-self: start; }
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.photo-thumb {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px;
  display: grid;
  gap: 6px;
  text-align: left;
  color: var(--muted);
  font-size: .78rem;
}
.photo-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #edf1f4;
}
.empty-gallery { margin: 0; color: var(--muted); }
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(8, 14, 20, .82);
  display: grid;
  place-items: center;
  padding: 28px;
}
.image-viewer img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.image-close {
  position: fixed;
  top: 18px;
  right: 18px;
  background: #fff;
  z-index: 71;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 29, 40, .42);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 60;
}
.modal-panel {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.workflow-modal {
  width: min(760px, 100%);
}
.workflow-modal p {
  color: var(--muted);
  margin: 6px 0 0;
}
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.checklist-grid fieldset,
.payment-options {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfd;
}
.checklist-grid legend,
.payment-options legend {
  font-weight: 800;
  color: var(--ink);
  padding: 0 4px;
}
.check-option,
.payment-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 12px 0 0;
  font-weight: 700;
}
.check-option.invalid-choice {
  color: var(--red);
  background: #fff0f0;
  border-radius: 6px;
  padding: 4px 8px;
}
.form-error {
  min-height: 22px;
  color: var(--red) !important;
  font-weight: 800;
}
.primary-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.metric strong { display: block; font-size: 1.9rem; margin-top: 8px; }
.metric span { color: var(--muted); font-weight: 700; }
.stage-averages { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 210px 1fr 64px; gap: 10px; align-items: center; }
.bar-track { height: 10px; background: #edf1f4; border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); }

.alerts-list, .history-list { display: grid; gap: 9px; }
.alert-item, .history-item, .email-log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.alert-item.unread { border-left: 5px solid var(--blue); }
.no-billing-summary {
  border-left: 5px solid var(--yellow);
  background: #fff8e8;
}
.email-log-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 9px;
}
.email-log-item.failed { border-left: 5px solid var(--red); }
.alert-item p, .history-item p, .email-log-item p { margin: 4px 0 0; color: var(--muted); }
.admin-list { display: grid; gap: 10px; margin-top: 14px; }
.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.admin-row p { margin: 4px 0 0; color: var(--muted); }
.stage-recipients-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.settings-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.settings-add-row {
  max-width: 720px;
  margin-bottom: 12px;
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(18, 29, 40, .42);
  display: flex;
  justify-content: flex-end;
  z-index: 30;
}
.drawer-content {
  width: min(980px, 100%);
  height: 100%;
  overflow: auto;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}
.drawer-header, .drawer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.2rem;
}
.history-section { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.drawer-overview {
  display: grid;
  gap: 12px;
  margin: 4px 0 18px;
}
.overview-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #cdd8e2;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
}
.overview-hero h3 { margin: 3px 0 4px; font-size: 1.45rem; }
.overview-hero p { margin: 0; color: var(--muted); font-weight: 700; }
.overview-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.overview-field {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.overview-field span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}
.overview-field strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.equipment-form-grid {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.form-section-title {
  margin-top: 6px;
  padding: 9px 10px;
  border-left: 4px solid var(--blue);
  background: #eef5fb;
  color: #124d7d;
  border-radius: 6px;
  font-weight: 900;
}
.communication-list { display: grid; gap: 10px; }
.communication-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}
.communication-item p { margin: 5px 0; color: var(--muted); }
.communication-item span { color: var(--muted); font-size: .82rem; }
.quote-list { display: grid; gap: 9px; }
.quote-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.quote-item p { margin: 4px 0 0; color: var(--muted); }
.quote-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.report-modal {
  width: min(920px, 100%);
}
.report-modal textarea {
  min-height: 92px;
}
.technical-report-rows {
  display: grid;
  gap: 9px;
}
.technical-report-item {
  border-left: 4px solid var(--blue);
}
.report-photo-toggle {
  margin-top: 12px;
}
.report-photo-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
}
.report-photo-choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 7px;
  cursor: pointer;
}
.report-photo-choice img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dce5ee;
}
.report-photo-choice span {
  color: var(--muted);
  font-weight: 800;
  font-size: .78rem;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #16202a;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.mobile-entry-page {
  background: #eef3f6;
}
.mobile-shell {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 14px;
}
.mobile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(27, 43, 58, .10);
}
.mobile-card h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
}
.mobile-card p {
  margin: 0 0 16px;
  color: var(--muted);
}
.mobile-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.mobile-stack {
  display: grid;
  gap: 13px;
}
.mobile-stack input,
.mobile-stack textarea,
.mobile-stack select {
  min-height: 46px;
  font-size: 16px;
}
.mobile-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mobile-fieldset legend {
  font-weight: 800;
  color: #283746;
}
.mobile-fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.mobile-fieldset input {
  width: auto;
  min-height: 0;
}
.mobile-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mobile-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mobile-submit {
  min-height: 50px;
}
.mobile-result {
  margin-top: 14px;
  border: 1px solid #b6d9c9;
  background: #ecf8f2;
  color: var(--green);
  border-radius: 8px;
  padding: 12px;
  font-weight: 800;
}
.mobile-result.mobile-error {
  border-color: #e0b2b2;
  background: #fff2f2;
  color: var(--red);
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
    align-items: start;
  }
  .topbar .view-tabs {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .user-box {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }
  .topbar .user-box .primary-button {
    width: auto;
  }
  .admin-menu-panel {
    position: static;
    margin-top: 6px;
    box-shadow: none;
  }
  .form-grid, .filters-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-content { width: 100%; }
  .finance-two-columns { grid-template-columns: 1fr; }
  .checklist-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar {
    position: static;
    padding: 12px;
  }
  .brand-block { align-items: flex-start; }
  .brand-logo { width: 118px; height: 44px; }
  .topbar h1 { font-size: 1.35rem; }
  .view-tabs {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    overflow-x: auto;
    width: 100%;
  }
  .view-tabs .tab,
  .view-tabs .admin-menu {
    flex: 0 0 auto;
  }
  .admin-menu {
    width: 100%;
  }
  .admin-menu summary {
    width: fit-content;
  }
  .admin-menu-panel {
    width: min(260px, 100%);
  }
  .tab, .ghost-button, .secondary-button, .file-button, .primary-button, .danger-button {
    min-height: 42px;
  }
  .user-box {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
  }
  .user-box .primary-button {
    width: auto;
  }
  .view { padding: 10px; }
  .kanban-board {
    gap: 10px;
  }
  .kanban-column {
    flex-basis: 86vw;
    width: 86vw;
    min-height: 420px;
  }
  .kanban-column.empty-column {
    flex-basis: 62vw;
    width: 62vw;
  }
  .drawer-content { padding: 12px; }
  .drawer-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .overview-hero { display: grid; }
  .overview-tags { justify-content: flex-start; }
  .overview-grid { grid-template-columns: 1fr; }
  .mobile-shell { padding: 10px; }
  .mobile-card { padding: 14px; }
  .mobile-header { display: grid; }
  .mobile-fieldset { grid-template-columns: 1fr; }
}

/* Ficha completa da OS */
.drawer-content.os-drawer-form {
  width: min(1180px, calc(100vw - 32px));
  padding: 18px;
  background: #f6f9fc;
}
.os-drawer-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #f6f9fc 0%, rgba(246, 249, 252, .94) 100%);
  padding-bottom: 12px;
}
.os-form-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.os-section {
  grid-column: 1 / -1;
  border: 1px solid #bfd5ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(17, 64, 104, .06);
  overflow: hidden;
}
.os-section-supplier,
.os-section-status,
.os-section-financial,
.os-section-notes {
  grid-column: span 6;
}
.os-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #e8f4ff 0%, #f7fbff 100%);
  border-bottom: 1px solid #cfe0ef;
  color: #075ca2;
}
.os-section-title span {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #0b6fbd;
  color: #fff;
  font-weight: 900;
}
.os-section-title h3 {
  margin: 0;
  font-size: 1.04rem;
}
.os-section-title-accent h3 {
  color: #b42222;
  font-weight: 950;
}
.os-section-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.os-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}
.os-field-stack {
  display: grid;
  gap: 10px;
}
.compact-fields {
  gap: 10px 16px;
}
.os-section label {
  font-size: .84rem;
  color: #142335;
}
.os-section input,
.os-section select,
.os-section textarea {
  margin-top: 5px;
}
.field-note {
  color: #607386;
  font-size: .78rem;
  font-weight: 700;
}
.os-photo-panel {
  border-left: 1px solid #d6e4f0;
  padding-left: 14px;
}
.os-overview-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #cfe0ef;
  border-radius: 10px;
  background: linear-gradient(90deg, #ffffff 0%, #f5faff 100%);
  padding: 14px;
  margin-bottom: 10px;
}
.os-overview-main {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.os-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eaf4ff;
  color: #005caa;
  border: 1px solid #b8d6ee;
  font-weight: 950;
}
.os-overview-main h3 {
  margin: 2px 0 3px;
  font-size: 1.32rem;
}
.os-overview-main p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}
.os-overview-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-end;
}
.status-pill {
  border: 1px solid #efc56d;
  background: #fff8e4;
  color: #815000;
  border-radius: 999px;
  padding: 6px 11px;
  font-weight: 900;
}
.os-progress {
  display: grid;
  grid-template-columns: repeat(10, minmax(72px, 1fr));
  gap: 5px;
  border: 1px solid #d6e4f0;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  margin-bottom: 10px;
  overflow-x: auto;
}
.os-progress-step {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #728397;
  font-size: .75rem;
  white-space: nowrap;
}
.os-progress-step span {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #d9e4ef;
  color: #5a6c7f;
  font-weight: 900;
}
.os-progress-step.done span,
.os-progress-step.active span {
  background: #0b6fbd;
  color: #fff;
}
.os-progress-step.active strong { color: #075ca2; }
.os-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}
.os-summary-card {
  min-height: 68px;
  align-content: center;
}
.os-financial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.document-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.document-card {
  border: 1px solid #d6e4f0;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 8px;
}
.document-card h4 {
  margin: 0;
  color: #075ca2;
}
.communication-card { grid-column: 1 / -1; }
.os-history-list .history-item,
.document-card .history-item,
.document-card .communication-item,
.document-card .quote-item {
  background: #fff;
}
.os-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  justify-content: space-between;
  background: rgba(246, 249, 252, .96);
  border-top: 1px solid #cfe0ef;
  padding-top: 12px;
  margin-top: 14px;
}
@media (max-width: 980px) {
  .drawer-content.os-drawer-form { width: 100%; padding: 12px; }
  .os-section-supplier,
  .os-section-status,
  .os-section-financial,
  .os-section-notes { grid-column: 1 / -1; }
  .os-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-financial-grid,
  .document-grid { grid-template-columns: 1fr; }
  .os-photo-panel { border-left: 0; padding-left: 0; }
}
@media (max-width: 720px) {
  .os-overview-card,
  .os-two-columns { grid-template-columns: 1fr; display: grid; }
  .os-overview-badges { justify-content: flex-start; }
  .os-summary-grid { grid-template-columns: 1fr; }
  .os-section-body { padding: 12px; }
  .os-action-bar { grid-template-columns: 1fr; }
}

/* Refinamentos finais da ficha completa */
.os-overview-card.refined {
  align-items: stretch;
  background: linear-gradient(135deg, #ffffff 0%, #f2f8ff 100%);
}
.os-overview-card.refined .os-overview-main h3 {
  font-size: 1.45rem;
  color: #0d2135;
}
.os-overview-card.refined .os-overview-main p strong {
  color: #0d2135;
}
.os-progress {
  grid-template-columns: repeat(10, minmax(92px, 1fr));
  gap: 8px;
}
.os-progress-step {
  font-size: .82rem;
  font-weight: 800;
}
.os-progress-step span {
  width: 26px;
  height: 26px;
  font-size: .82rem;
}
.os-section-receiving .os-section-title {
  background: linear-gradient(90deg, #e8f4ff 0%, #f7fbff 100%);
}
.os-section-diagnosis .os-section-title {
  background: linear-gradient(90deg, #f1f4f7 0%, #fbfcfd 100%);
}
.os-section-supplier .os-section-title {
  background: linear-gradient(90deg, #fff4df 0%, #fffaf1 100%);
}
.os-section-financial {
  border-color: #b8dfcb;
  background: #f4fbf7;
}
.os-section-financial .os-section-title {
  background: linear-gradient(90deg, #dff7eb 0%, #f5fff9 100%);
  color: #08703f;
}
.os-section-financial .os-section-title span {
  background: #0b8c51;
}
.os-section-documents .os-section-title,
.os-section-history .os-section-title,
.os-section-notes .os-section-title {
  background: linear-gradient(90deg, #f2f6fa 0%, #ffffff 100%);
}
.purchase-links-field {
  display: grid;
  gap: 7px;
}
.purchase-links-field > span {
  font-weight: 900;
  color: #142335;
}
.purchase-links-field small {
  color: #607386;
  font-weight: 700;
}
.purchase-links-field label {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0;
}
.purchase-links-field label span {
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eef5fb;
  color: #0a5f9f;
  font-weight: 900;
}
.document-card {
  box-shadow: 0 7px 16px rgba(17, 64, 104, .05);
}
.document-card h4 {
  display: flex;
  align-items: center;
  gap: 7px;
}
.document-card h4::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0b6fbd;
}
.quote-item,
.communication-tile,
.os-history-list .history-item {
  border: 1px solid #d6e4f0;
  border-left: 4px solid #0b6fbd;
  border-radius: 8px;
  padding: 10px;
}
.communication-tile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
}
.communication-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e8f4ff;
  color: #0b6fbd;
  font-weight: 900;
}
.communication-tile small {
  color: var(--muted);
  font-weight: 700;
}
.os-history-list {
  position: relative;
  padding-left: 14px;
}
.os-history-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #bdd7ee;
}
.os-history-list .history-item {
  position: relative;
  margin-bottom: 8px;
}
.os-history-list .history-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0b6fbd;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #bdd7ee;
}
@media (max-width: 720px) {
  .purchase-links-field label { grid-template-columns: 1fr; }
  .os-progress { grid-template-columns: repeat(10, minmax(105px, 1fr)); }
}

