:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #171717;
  --muted: #6a665e;
  --line: #e8e1d4;
  --gold: #c9972c;
  --gold-dark: #9f6f13;
  --gold-soft: #f8edd2;
  --green: #11834a;
  --green-soft: #e5f6ec;
  --amber-soft: #fff4d8;
  --danger: #9f2f2f;
  --shadow: 0 16px 45px rgba(45, 38, 20, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f5f4f1;
}

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

button {
  border: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(212, 164, 58, 0.16), transparent 34%),
    linear-gradient(180deg, #ffffff, #f6f3ec);
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-dark);
  font-size: 20px;
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.login-card p,
.login-card small {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-error {
  padding: 9px 10px;
  color: var(--danger) !important;
  background: #ffe8e8;
  border: 1px solid #f3b8b8;
  border-radius: 8px;
  font-weight: 800;
}

.wide {
  width: 100%;
}

.login-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  color: white;
  background: linear-gradient(180deg, #080909, #111 46%, #070707);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px 22px;
  color: var(--gold);
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: #f8f8f8;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.sidebar nav button.active,
.sidebar nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar nav button.active svg {
  color: var(--gold);
}

.store-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.store-card span,
.profile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.store-card span {
  color: rgba(255, 255, 255, 0.72);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: white;
  background: linear-gradient(135deg, #e3bd61, #a77518);
  border-radius: 50%;
  font-weight: 800;
}

.main-area {
  min-width: 0;
}

.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 520px) auto auto max-content;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.icon-button,
.ghost-button,
.text-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.primary-button {
  padding: 0 16px;
  color: white;
  background: linear-gradient(180deg, #d4a43a, #a87617);
  box-shadow: 0 9px 20px rgba(169, 117, 23, 0.22);
  font-weight: 700;
}

.primary-button.slim {
  min-height: 36px;
}

.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.text-button {
  min-height: 32px;
  color: var(--gold-dark);
  background: transparent;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  width: min(1240px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 22px;
}

.primary-pane {
  min-width: 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.section-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.section-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.desktop-nav {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 4px 0 0;
}

.desktop-nav button {
  min-height: 32px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.desktop-nav button.active,
.desktop-nav button:hover {
  color: var(--gold-dark);
  background: var(--gold-soft);
  border-color: #ead6a8;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card,
.panel,
.detail-panel,
.modal-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(53, 43, 23, 0.06);
}

.kpi-card {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 12px 13px;
  align-content: center;
}

.kpi-card span,
.detail-block span,
.order-card span,
.maintenance-card span {
  color: var(--muted);
  font-size: 12px;
}

.kpi-card strong {
  font-size: 20px;
  line-height: 1.15;
  white-space: nowrap;
}

.kpi-card small {
  color: var(--green);
  font-size: 11px;
}

.panel {
  padding: 14px;
  margin-bottom: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2 {
  margin: 0;
  font-size: 17px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.status-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.status-filter select {
  min-height: 32px;
  padding: 0 28px 0 9px;
  font-size: 12px;
}

.group-label {
  white-space: nowrap;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.permission-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.lane {
  min-width: 118px;
  padding: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 4px 7px;
  font-size: 12px;
}

.lane-head span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  background: var(--gold-soft);
  border-radius: 8px;
  color: var(--gold-dark);
}

.order-card {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 62px;
  margin-bottom: 6px;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 1px solid #eee6d8;
  border-radius: 8px;
  cursor: pointer;
}

.order-card strong {
  font-size: 13px;
  line-height: 1.12;
}

.order-card small {
  font-size: 11px;
}

.order-card.selected,
.table-row.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(201, 151, 44, 0.2);
}

.order-card em {
  width: fit-content;
  padding: 3px 6px;
  color: var(--gold-dark);
  background: var(--amber-soft);
  border-radius: 8px;
  font-size: 10px;
  font-style: normal;
}

.more-button {
  width: 100%;
  padding: 6px 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}

.detail-panel {
  position: sticky;
  top: 24px;
  height: auto;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 14px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.detail-head h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 14px 0 12px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  padding: 9px 4px;
  color: var(--muted);
  background: transparent;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
}

.tabs button.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
}

.detail-block {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.tab-content {
  display: grid;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.product-block {
  grid-template-columns: 1fr 86px;
  align-items: center;
}

.product-block > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.ring-asset {
  position: relative;
  height: 72px;
}

.ring-asset span {
  position: absolute;
  width: 50px;
  height: 32px;
  border: 8px solid #d6aa47;
  border-left-color: #fff3ca;
  border-radius: 50%;
  transform: rotate(-28deg);
  box-shadow: inset 0 0 0 2px #9d761d, 0 12px 20px rgba(0, 0, 0, 0.12);
}

.ring-asset span:first-child {
  right: 30px;
  top: 24px;
}

.ring-asset span:last-child {
  right: 4px;
  top: 15px;
}

dl {
  display: grid;
  gap: 7px;
  margin: 0;
  font-size: 13px;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
}

.timeline,
.history-list {
  display: grid;
  gap: 9px;
  margin: 2px 0 0;
  padding: 0;
}

.timeline div {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.timeline i {
  width: 10px;
  height: 10px;
  background: #d8dee8;
  border-radius: 50%;
}

.timeline .done {
  color: var(--ink);
  font-weight: 700;
}

.timeline .done i {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.history-list {
  list-style: none;
}

.history-list li {
  padding: 9px 10px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.quick-actions {
  display: grid;
  gap: 9px;
  padding-top: 12px;
}

select,
input,
textarea {
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

textarea {
  min-height: 92px;
  padding-top: 10px;
  resize: vertical;
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 70px minmax(160px, 1.3fr) minmax(140px, 1fr) 150px 110px 120px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.production-list,
.warranty-cards,
.settings-list,
.client-grid {
  display: grid;
  gap: 10px;
}

.role-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.role-switcher button,
.admin-card {
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.role-switcher button {
  display: grid;
  gap: 5px;
  padding: 12px;
  color: var(--muted);
  cursor: pointer;
}

.role-switcher button.active {
  color: var(--gold-dark);
  background: #fffaf0;
  border-color: #d8ab48;
  box-shadow: 0 0 0 2px rgba(197, 143, 36, 0.1);
}

.role-switcher strong {
  color: var(--ink);
}

.role-switcher span {
  font-size: 12px;
  line-height: 1.35;
}

.permission-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.production-item,
.maintenance-card,
.settings-list article,
.client-card {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.production-item {
  grid-template-columns: minmax(240px, 1fr) 160px 190px;
}

.production-item div,
.maintenance-card div,
.settings-list div {
  display: grid;
  gap: 4px;
}

.production-item small,
.maintenance-card small,
.client-card span {
  color: var(--muted);
}

.warranty-grid {
  display: grid;
  grid-template-columns: 170px 190px 1fr;
  gap: 12px;
}

.metric-tile {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-tile svg {
  color: var(--green);
}

.metric-tile strong {
  font-size: 28px;
}

.metric-tile span {
  color: var(--muted);
}

.recent-list {
  display: grid;
  align-content: start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.recent-list div {
  display: grid;
  grid-template-columns: 74px 1fr 140px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.recent-list div:last-child {
  border-bottom: 0;
}

.maintenance-card {
  grid-template-columns: 44px minmax(0, 1fr) 150px;
}

.warranty-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.warranty-actions select {
  width: 150px;
}

.maintenance-card h3 {
  margin: 0;
  font-size: 16px;
}

.maintenance-card p {
  margin: 0;
  color: var(--muted);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border-radius: 8px;
}

.client-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.client-card {
  align-content: start;
}

.client-card svg {
  color: var(--gold-dark);
}

.settings-list article {
  grid-template-columns: 36px 1fr;
}

.settings-list svg {
  color: var(--green);
}

.settings-list p {
  margin: 3px 0 0;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-card {
  padding: 14px;
}

.admin-card.locked {
  opacity: 0.68;
}

.admin-card.locked small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.admin-card ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 17px;
  color: var(--muted);
}

.install-panel,
.backup-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px;
  background: #fffaf0;
  border: 1px solid #e3c16b;
  border-radius: 8px;
}

.install-panel p,
.backup-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.backup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.backup-actions input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.backup-actions label {
  cursor: pointer;
}

.install-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 25px;
  padding: 0 9px;
  color: #6b4c09;
  background: var(--amber-soft);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.em-produção,
.status-pill.em-análise {
  color: #6b4c09;
  background: var(--amber-soft);
}

.status-pill.pronto-para-retirada,
.status-pill.concluído,
.status-pill.entregue {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.pendente {
  color: var(--danger);
  background: #ffe8e8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 10, 10, 0.42);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
}

.modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.message-card textarea {
  width: 100%;
  min-height: 128px;
  margin-top: 12px;
  padding: 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}

.tracking-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.tracking-result {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tracking-result p {
  margin: 0;
  color: var(--muted);
}

.tracking-result dl {
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.modal-form.compact {
  grid-template-columns: 1fr;
}

.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modal-form .wide,
.upload-box {
  grid-column: 1 / -1;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border: 1px dashed #d9b461;
  border-radius: 8px;
  cursor: pointer;
}

.upload-box strong {
  color: var(--text);
  font-size: 13px;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-name {
  overflow: hidden;
  color: var(--gold-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 8px;
  background: #fffaf0;
  border: 1px solid #efd596;
  border-radius: 8px;
}

.attachment-preview img,
.attachment-preview > span {
  width: 52px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
}

.attachment-preview > span {
  display: grid;
  place-items: center;
  color: var(--gold-dark);
  background: linear-gradient(135deg, #fff8e8, #dbb050);
  font-size: 11px;
  font-weight: 800;
}

.attachment-empty {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.mobile-home,
.bottom-nav {
  display: none;
}

.print-job {
  display: none;
}

@media print {
  body > *:not(.print-job) {
    display: none !important;
  }

  .print-job {
    display: block;
    padding: 24px;
    color: #111;
    background: white;
    font-family: Arial, sans-serif;
  }

  .print-job h1 {
    margin: 0 0 10px;
    font-size: 22px;
  }

  .print-job h2 {
    margin: 0 0 18px;
    font-size: 18px;
  }

  .print-job dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 16px;
  }

  .print-job div {
    display: contents;
  }

  .print-job dt {
    font-weight: 700;
  }

  .print-job dd {
    margin: 0;
  }
}

@media (min-width: 821px) {
  .sidebar,
  .topbar {
    display: none !important;
  }

  .pipeline-panel {
    max-height: 455px;
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    height: auto;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .role-switcher,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body {
    background: white;
  }

  .app-shell {
    display: block;
    padding-bottom: 76px;
  }

  .sidebar,
  .topbar,
  .detail-panel,
  .desktop-nav,
  .section-header .ghost-button {
    display: none;
  }

  .main-area {
    display: block;
  }

  .main-area.mobile-dashboard-hidden {
    display: none;
  }

  .content-grid {
    display: block;
    padding: 0 14px 18px;
  }

  .section-header {
    align-items: start;
    padding-top: 14px;
    margin-bottom: 12px;
  }

  .section-header h1 {
    font-size: 24px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    min-height: 104px;
    padding: 14px;
  }

  .kpi-card strong {
    font-size: 22px;
  }

  .kanban {
    grid-template-columns: repeat(5, 78vw);
  }

  .table-row {
    grid-template-columns: 62px 1fr;
    min-height: auto;
    padding: 12px;
  }

  .table-row span:nth-last-child(-n + 2) {
    display: none;
  }

  .production-item,
  .maintenance-card {
    grid-template-columns: 1fr;
  }

  .warranty-grid {
    grid-template-columns: 1fr;
  }

  .recent-list div {
    grid-template-columns: 72px 1fr;
  }

  .recent-list .status-pill {
    grid-column: 2;
  }

  .modal-form {
    grid-template-columns: 1fr;
  }

  .mobile-home {
    display: block;
    padding: 18px 14px 4px;
  }

  .mobile-home header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    margin-bottom: 18px;
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gold-dark);
    font-weight: 800;
  }

  .mobile-home h2 {
    margin: 0;
    font-size: 22px;
  }

  .mobile-home p {
    margin: 4px 0 18px;
    color: var(--muted);
  }

  .mobile-actions {
    display: grid;
    gap: 10px;
  }

  .mobile-actions button {
    display: grid;
    grid-template-columns: 56px 1fr 24px;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 12px;
    color: var(--ink);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: left;
  }

  .mobile-actions strong,
  .mobile-actions small {
    display: block;
  }

  .mobile-actions small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
  }

  .mobile-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: white;
    border-radius: 8px;
  }

  .mobile-icon.gold { background: linear-gradient(180deg, #d4a43a, #a87617); }
  .mobile-icon.sand { background: #bea77d; }
  .mobile-icon.green { background: #128847; }
  .mobile-icon.violet { background: #8362bd; }

  .mobile-install {
    width: 100%;
    min-height: 46px;
    margin-top: 12px;
    color: #6f4c06;
    background: #fff7e6;
    border: 1px solid #d6ad4a;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
  }

  .mobile-install:disabled {
    cursor: not-allowed;
    opacity: 0.72;
  }

  .quick-summary {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .quick-summary div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
  }

  .quick-summary div span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
  }

  .quick-summary strong {
    margin-left: auto;
    color: var(--ink);
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 66px;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

  .bottom-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
  }

  .bottom-nav button.active {
    color: var(--gold-dark);
  }
}

@media (max-width: 430px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 12px;
  }

  .panel-title {
    align-items: flex-start;
  }
}
