.machines-page {
  padding: 1rem 0 2.4rem;
  display: grid;
  gap: 0.72rem;
}

.machines-menu-btn {
  display: none;
}

.machines-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0;
  color: #a0a7b3;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.67rem;
  font-weight: 700;
}

.machines-hero h1 {
  margin: 0.16rem 0 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.subtitle {
  margin: 0.34rem 0 0;
  color: #b4b9c3;
  max-width: 680px;
}

.hero-balance {
  border: 1px solid rgba(142, 149, 161, 0.28);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(34, 37, 44, 0.72), rgba(26, 28, 33, 0.78));
  padding: 0.66rem 0.82rem;
  min-width: 230px;
}

.hero-balance span {
  display: block;
  font-size: 0.74rem;
  color: #a3aab6;
}

.hero-balance strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 1.18rem;
  font-family: "Orbitron", sans-serif;
  color: #eef0f3;
}

.hero-balance small {
  display: block;
  margin-top: 0.22rem;
  color: #9aa2ae;
  font-size: 0.76rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.62rem;
}

.summary-card {
  border: 1px solid rgba(138, 146, 160, 0.22);
  border-radius: 12px;
  background: linear-gradient(170deg, rgba(34, 37, 44, 0.9), rgba(24, 26, 31, 0.82));
  box-shadow: 0 14px 32px rgba(4, 9, 24, 0.48);
  padding: 0.6rem 0.64rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(155, 164, 179, 0.4);
}

.summary-card p {
  margin: 0;
  color: #9da4b1;
  font-size: 0.8rem;
}

.summary-card strong {
  display: block;
  margin-top: 0.16rem;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  color: #f0f6ff;
}

.summary-card small {
  display: block;
  margin-top: 0.24rem;
  color: #939ba8;
  font-size: 0.72rem;
}

.summary-grid .summary-card:nth-child(1) {
  border-color: rgba(132, 154, 141, 0.34);
  box-shadow: 0 14px 30px rgba(10, 13, 11, 0.38);
}

.summary-grid .summary-card:nth-child(1) strong {
  color: #dbe7df;
}

.summary-grid .summary-card:nth-child(2) {
  border-color: rgba(131, 147, 170, 0.34);
}

.summary-grid .summary-card:nth-child(2) strong {
  color: #dce4f0;
}

.summary-grid .summary-card:nth-child(3) {
  border-color: rgba(170, 151, 126, 0.34);
}

.summary-grid .summary-card:nth-child(3) strong {
  color: #e6ddd0;
}

.summary-grid .summary-card:nth-child(4) {
  border-color: rgba(131, 164, 162, 0.34);
}

.summary-grid .summary-card:nth-child(4) strong {
  color: #dae9e8;
}

.summary-grid .summary-card:nth-child(5) {
  border-color: rgba(150, 136, 168, 0.34);
}

.summary-grid .summary-card:nth-child(5) strong {
  color: #e2ddef;
}

.summary-grid .summary-card:nth-child(6) {
  border-color: rgba(168, 131, 139, 0.34);
}

.summary-grid .summary-card:nth-child(6) strong {
  color: #eadcdf;
}

.machine-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.74rem;
}

.controls-main {
  display: grid;
  gap: 0.42rem;
}

.controls-side {
  display: grid;
  gap: 0.42rem;
  justify-items: end;
}

.filter-row,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.filter-chip,
.status-chip {
  border: 1px solid rgba(136, 145, 159, 0.3);
  border-radius: 999px;
  background: rgba(34, 37, 44, 0.72);
  color: #b4bbc7;
  padding: 0.32rem 0.66rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.status-chip {
  font-size: 0.74rem;
}

.filter-chip:hover,
.status-chip:hover {
  border-color: rgba(166, 175, 189, 0.48);
  color: #f0f2f5;
  transform: translateY(-1px);
}

.filter-chip.active,
.status-chip.active {
  border-color: rgba(172, 181, 196, 0.58);
  background: linear-gradient(130deg, rgba(74, 80, 92, 0.78), rgba(58, 63, 73, 0.74));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(168, 176, 191, 0.42), 0 6px 16px rgba(0, 0, 0, 0.4);
}

.search-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
  min-width: 330px;
  border: 1px solid rgba(137, 145, 160, 0.28);
  border-radius: 10px;
  background: rgba(28, 31, 37, 0.78);
  padding: 0.38rem 0.56rem;
}

.search-wrap svg {
  width: 16px;
  height: 16px;
  color: #9fa7b3;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #eceef2;
  background: transparent;
  font: inherit;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid rgba(136, 144, 157, 0.34);
  border-radius: 10px;
  overflow: hidden;
}

.view-btn {
  width: 42px;
  height: 34px;
  border: 0;
  background: rgba(34, 37, 43, 0.76);
  color: #afb6c2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.view-btn.active {
  background: linear-gradient(140deg, rgba(76, 82, 93, 0.82), rgba(58, 62, 71, 0.82));
  color: #eef6ff;
}

.view-btn svg {
  width: 16px;
  height: 16px;
}

.inventory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.inventory-head h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
}

.inventory-head p {
  margin: 0;
  color: #9ca4b2;
  font-size: 0.84rem;
}

.machines-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.machines-grid.view-list {
  grid-template-columns: 1fr;
}

.machine-card-x {
  border: 1px solid rgb(0 0 0);
  border-radius: 15px;
  background: linear-gradient(165deg, rgb(3 14 47), rgb(4 7 14));
  box-shadow: 0 16px 34px rgba(4, 10, 26, 0.5);
  padding: 0.66rem;
  display: grid;
  gap: 0.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.machine-card-x:hover {
  transform: translateY(-4px);
  border-color: rgba(111, 195, 255, 0.5);
  box-shadow: 0 22px 38px rgba(4, 10, 26, 0.6), 0 0 18px rgba(72, 146, 255, 0.2);
}

.machine-card-x.cat-pcs {
  border-color: rgba(120, 130, 148, 0.3);
}

.machine-card-x.cat-pcs .machine-image {
  background: radial-gradient(circle at 50% 18%, rgba(121, 153, 221, 0.28), transparent 52%),
    linear-gradient(160deg, rgba(11, 20, 41, 0.94), rgba(7, 12, 26, 0.94));
}

.machine-card-x.cat-rigs {
  border-color: rgba(150, 114, 124, 0.34);
}

.machine-card-x.cat-rigs .machine-image {
  background: radial-gradient(circle at 50% 18%, rgba(255, 106, 106, 0.28), transparent 52%),
    linear-gradient(160deg, rgba(37, 11, 26, 0.9), rgba(14, 7, 18, 0.95));
}

.machine-card-x.cat-mobile {
  border-color: rgba(118, 147, 130, 0.34);
}

.machine-card-x.cat-mobile .machine-image {
  background: radial-gradient(circle at 50% 18%, rgba(80, 224, 160, 0.26), transparent 52%),
    linear-gradient(160deg, rgba(8, 28, 26, 0.92), rgba(7, 16, 22, 0.94));
}

.machine-card-x.cat-future {
  border-color: rgba(132, 124, 152, 0.34);
}

.machine-card-x.cat-future .machine-image {
  background: radial-gradient(circle at 50% 18%, rgba(167, 118, 255, 0.28), transparent 52%),
    linear-gradient(160deg, rgba(19, 14, 42, 0.94), rgba(12, 8, 28, 0.94));
}

.machine-card-x.cat-elite {
  border-color: rgba(171, 154, 129, 0.38);
  box-shadow: 0 16px 36px rgba(20, 16, 10, 0.45), 0 0 14px rgba(160, 145, 118, 0.16);
}

.machine-card-x.cat-elite .machine-image {
  background: radial-gradient(circle at 50% 18%, rgba(244, 184, 99, 0.3), transparent 52%),
    linear-gradient(160deg, rgba(38, 24, 11, 0.9), rgba(18, 12, 8, 0.95));
}

.machine-main {
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 0.7rem;
}

.machine-image {
  border: 1px solid rgba(113, 144, 224, 0.35);
  border-radius: 12px;
  min-height: 138px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 18%, rgba(102, 153, 255, 0.26), transparent 52%),
    linear-gradient(160deg, rgba(13, 22, 43, 0.92), rgba(8, 13, 28, 0.94));
}

.machine-image img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(4, 8, 18, 0.56));
}

.machine-icon-fallback {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(123, 164, 241, 0.42);
  background: linear-gradient(150deg, rgba(41, 86, 168, 0.44), rgba(73, 54, 148, 0.42));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.machine-icon-fallback svg {
  width: 24px;
  height: 24px;
  color: #deecff;
}

.machine-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.52rem;
}

.machine-head h3 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
}

.machine-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(116, 149, 231, 0.38);
  background: rgba(29, 41, 70, 0.58);
  color: #d7e5ff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.16rem 0.46rem;
}

.badge.mk {
  border-color: rgba(101, 177, 255, 0.48);
}

.badge.status-online {
  border-color: rgba(90, 232, 180, 0.5);
  color: #d3ffe9;
}

.badge.status-syncing {
  border-color: rgba(99, 209, 255, 0.54);
  color: #d8f5ff;
}

.badge.status-upgrading {
  border-color: rgba(255, 198, 110, 0.56);
  color: #ffeac5;
}

.badge.status-offline {
  border-color: rgba(255, 115, 136, 0.5);
  color: #ffd9e0;
}

.machine-metrics {
  margin-top: 0.54rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.metric {
  border: 1px solid rgba(109, 142, 224, 0.26);
  border-radius: 9px;
  background: rgba(18, 27, 50, 0.56);
  padding: 0.32rem 0.38rem;
}

.metric span {
  display: block;
  color: #95abd9;
  font-size: 0.72rem;
}

.metric strong {
  display: block;
  margin-top: 0.08rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.76rem;
}

.machine-bars {
  display: grid;
  gap: 0.28rem;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a8badf;
  font-size: 0.74rem;
}

.progress {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(36, 50, 84, 0.65);
  border: 1px solid rgba(100, 132, 211, 0.28);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(63, 174, 255, 0.88), rgba(122, 98, 255, 0.86));
  box-shadow: 0 0 8px rgba(88, 174, 255, 0.34);
}

.spark-wrap {
  margin-top: 0.38rem;
  border: 1px solid rgba(102, 133, 210, 0.2);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(23, 35, 66, 0.44), rgba(14, 22, 43, 0.34));
  padding: 0.24rem;
}

.spark-wrap canvas {
  width: 100%;
  height: 54px;
  display: block;
}

.machine-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.34rem;
}

.machine-btn {
  border-radius: 10px;
  border: 1px solid rgba(109, 145, 227, 0.34);
  background: rgba(29, 42, 73, 0.64);
  color: #d8e6ff;
  min-height: 34px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.machine-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 190, 255, 0.54);
  box-shadow: 0 8px 16px rgba(10, 29, 80, 0.32);
}

.machine-btn.primary {
  border-color: rgba(113, 180, 255, 0.66);
  background: linear-gradient(130deg, rgba(38, 88, 178, 0.76), rgba(73, 48, 148, 0.72));
  color: #f0f7ff;
}

.machine-btn.warn {
  border-color: rgba(255, 188, 98, 0.52);
  color: #ffe5be;
  background: rgba(76, 49, 23, 0.58);
}

.machine-btn.danger {
  border-color: rgba(255, 121, 142, 0.52);
  color: #ffdbe4;
  background: rgba(73, 28, 42, 0.56);
}

.machine-btn.action-on {
  border-color: rgba(120, 152, 134, 0.5);
  color: #d9e8df;
  background: rgba(39, 56, 47, 0.66);
}

.machine-btn.action-off,
.machine-btn.action-sell {
  border-color: rgba(158, 123, 131, 0.5);
  color: #e9dadd;
  background: rgba(61, 40, 45, 0.66);
}

.machine-btn.action-upgrade {
  border-color: rgba(146, 130, 174, 0.56);
  background: linear-gradient(135deg, rgba(67, 60, 90, 0.84), rgba(84, 74, 102, 0.8));
}

.machine-btn.action-maintenance {
  border-color: rgba(164, 150, 122, 0.52);
  color: #eae3d5;
  background: rgba(62, 53, 38, 0.68);
}

.machine-btn.action-details {
  border-color: rgba(104, 177, 255, 0.5);
}

.machine-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.machines-empty {
  margin: 0;
  color: #91a8db;
  text-align: center;
  border: 1px dashed rgba(109, 143, 231, 0.38);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(14, 22, 41, 0.52);
}

@media (max-width: 1300px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 920px) {
  .machines-menu-btn {
    display: inline-flex;
    margin-bottom: 0.2rem;
  }

  .machines-hero {
    flex-direction: column;
  }

  .hero-balance {
    width: 100%;
    min-width: 0;
  }

  .machine-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-side {
    justify-items: stretch;
  }

  .search-wrap {
    min-width: 0;
    width: 100%;
  }

  .machine-main {
    grid-template-columns: 1fr;
  }

  .machine-image {
    min-height: 170px;
  }

  .machine-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .machine-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .machine-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Theme Sync: Dashboard -> Maquinas */
.machines-page .panel {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(175deg, rgba(10, 12, 16, 0.9), rgba(0, 0, 0, 0.87)), rgb(30 33 39);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 0 0 1px rgba(255, 140, 58, 0.06);
}

.machines-hero {
  padding: 0.92rem;
  border-color: rgba(255, 165, 90, 0.34);
  background:
    radial-gradient(circle at 84% -10%, rgba(255, 112, 72, 0.16), transparent 46%),
    radial-gradient(circle at 12% 120%, rgba(67, 187, 255, 0.12), transparent 46%),
    linear-gradient(168deg, rgba(10, 13, 18, 0.94), rgba(8, 10, 14, 0.88));
}

.hero-balance {
  border-color: rgba(54, 230, 181, 0.58);
  background: linear-gradient(145deg, rgba(5, 20, 25, 0.88), rgba(8, 13, 20, 0.88));
  box-shadow: inset 0 1px 0 rgba(164, 255, 224, 0.16), 0 10px 20px rgba(0, 0, 0, 0.32);
}

.hero-balance span {
  color: #66f7d1;
}

.hero-balance strong {
  color: #edfff7;
  text-shadow: 0 0 10px rgba(84, 246, 201, 0.2);
}

.hero-balance small {
  color: #97dcc8;
}

.summary-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(7, 11, 21, 0.94), rgba(5, 8, 16, 0.88));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.summary-card p {
  font-weight: 600;
}

.summary-card strong {
  font-size: 1.05rem;
}

.summary-grid .summary-card:nth-child(1) {
  border-color: rgba(66, 246, 183, 0.66);
}

.summary-grid .summary-card:nth-child(1) p,
.summary-grid .summary-card:nth-child(1) small {
  color: #5ff3cb;
}

.summary-grid .summary-card:nth-child(2) {
  border-color: rgba(71, 169, 255, 0.66);
}

.summary-grid .summary-card:nth-child(2) p,
.summary-grid .summary-card:nth-child(2) small {
  color: #5fb8ff;
}

.summary-grid .summary-card:nth-child(3) {
  border-color: rgba(255, 163, 78, 0.66);
}

.summary-grid .summary-card:nth-child(3) p,
.summary-grid .summary-card:nth-child(3) small {
  color: #ffb264;
}

.summary-grid .summary-card:nth-child(4) {
  border-color: rgba(60, 243, 226, 0.66);
}

.summary-grid .summary-card:nth-child(4) p,
.summary-grid .summary-card:nth-child(4) small {
  color: #45f1e2;
}

.summary-grid .summary-card:nth-child(5) {
  border-color: rgba(190, 119, 255, 0.66);
}

.summary-grid .summary-card:nth-child(5) p,
.summary-grid .summary-card:nth-child(5) small {
  color: #c496ff;
}

.summary-grid .summary-card:nth-child(6) {
  border-color: rgba(255, 96, 96, 0.66);
}

.summary-grid .summary-card:nth-child(6) p,
.summary-grid .summary-card:nth-child(6) small {
  color: #ff7d7d;
}

.filter-chip,
.status-chip {
  border-color: rgba(255, 255, 255, 0.24);
  background: linear-gradient(160deg, rgba(10, 13, 20, 0.88), rgba(7, 10, 16, 0.88));
  color: #d6e2f8;
}

.filter-chip.active,
.status-chip.active {
  border-color: rgba(255, 157, 71, 0.78);
  background: linear-gradient(120deg, rgba(63, 31, 15, 0.9), rgba(39, 17, 10, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 194, 125, 0.3), 0 8px 18px rgba(0, 0, 0, 0.44);
}

.search-wrap,
.view-switch {
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(160deg, rgba(8, 12, 20, 0.9), rgba(6, 9, 16, 0.9));
}

.view-btn {
  background: transparent;
  color: #b9c8e4;
}

.view-btn.active {
  background: linear-gradient(140deg, rgba(26, 52, 91, 0.82), rgba(17, 35, 67, 0.82));
  color: #eaf4ff;
}

.machine-card-x {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 16px;
  background: linear-gradient(175deg, rgba(10, 12, 16, 0.92), rgba(0, 0, 0, 0.9)), rgb(30 33 39);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.machine-card-x:hover {
  border-color: rgba(255, 166, 88, 0.74);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 127, 74, 0.18);
}

.machine-card-x.cat-pcs {
  border-color: rgba(92, 171, 255, 0.52);
}

.machine-card-x.cat-rigs {
  border-color: rgba(255, 114, 92, 0.52);
}

.machine-card-x.cat-mobile {
  border-color: rgba(76, 245, 194, 0.52);
}

.machine-card-x.cat-future {
  border-color: rgba(172, 118, 255, 0.54);
}

.machine-card-x.cat-elite {
  border-color: rgba(255, 189, 102, 0.66);
}

.badge.status-online {
  border-color: rgba(82, 244, 178, 0.6);
  color: #cafde9;
  background: rgba(17, 52, 40, 0.52);
}

.badge.status-syncing {
  border-color: rgba(79, 200, 255, 0.62);
  color: #cbf2ff;
  background: rgba(15, 43, 58, 0.5);
}

.badge.status-upgrading {
  border-color: rgba(255, 177, 84, 0.62);
  color: #ffe7c5;
  background: rgba(62, 38, 18, 0.5);
}

.badge.status-offline {
  border-color: rgba(255, 100, 100, 0.62);
  color: #ffd6d6;
  background: rgba(62, 18, 18, 0.5);
}

.machine-btn {
  border-radius: 11px;
}

.machine-btn.action-upgrade {
  border-color: rgba(255, 121, 86, 0.62);
  background: linear-gradient(135deg, rgb(69 208 160), rgb(68 206 159));
  color: #1d382e;
  box-shadow: inset 0 1px 0 rgba(255, 196, 178, 0.24), 0 10px 18px rgba(0, 0, 0, 0.3);
}

.machine-btn.action-off,
.machine-btn.action-sell {
  border-color: rgba(255, 106, 106, 0.56);
  background: linear-gradient(135deg, rgba(76, 18, 18, 0.88), rgba(50, 10, 10, 0.88));
  color: #ffe8e8;
}

/* Machines Sync with Market/Header Style */
.machines-page .panel {
  border: 1px solid rgb(35 26 26);
  border-radius: 18px;
  background: linear-gradient(175deg, rgba(10, 12, 16, 0.9), rgba(0, 0, 0, 0.87)), rgb(30 33 39);
  box-shadow: 0 18px 36px rgb(0 0 0 / 44%), inset 0 1px 0 rgb(24 13 13), inset 0 0 0 1px rgb(2 2 2);
}

.machines-page .machines-hero {
  min-height: 84px;
  padding: 0.56rem 0.55rem;
  gap: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid rgb(0 0 0);
  background:
    radial-gradient(circle at 10% -70%, rgb(0 0 0 / 68%), transparent 50%),
    radial-gradient(circle at 82% -45%, rgba(255, 87, 58, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(18, 21, 27, 0.72);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.machines-hero .eyebrow {
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  color: #9da5b2;
}

.machines-hero h1 {
  margin-top: 0.08rem;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

.machines-hero .subtitle {
  margin-top: 0.14rem;
  max-width: 56ch;
  font-size: 0.8rem;
  line-height: 1.2;
  color: #a0a7b4;
}

.machines-hero .hero-balance {
  min-height: 0;
  width: min(100%, 494px);
  border-radius: 12px;
  padding: 0.34rem 0.62rem;
  display: grid;
  align-content: center;
  gap: 0.04rem;
  border: 1px solid rgba(64, 231, 183, 0.38);
  box-shadow: inset 0 1px 0 rgba(131, 255, 222, 0.1), 0 0 0 1px rgba(64, 231, 183, 0.1);
  background: linear-gradient(165deg, rgba(8, 10, 14, 0.96), rgba(12, 15, 21, 0.9));
}

.machines-hero .hero-balance span {
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  color: #1bffb1;
}

.machines-hero .hero-balance strong {
  font-size: 0.88rem;
  margin-top: 0.04rem;
  font-family: "Orbitron", sans-serif;
  color: #f5f8ff;
  text-shadow: 0 0 10px rgba(80, 238, 193, 0.2);
}

.machines-hero .hero-balance small {
  margin-top: 0;
  font-size: 0.74rem;
  color: #9ea7b7;
}

.filter-chip:hover,
.status-chip:hover {
  border-color: rgb(255 255 255 / 57%);
}

.filter-chip.active,
.status-chip.active {
  border-color: rgb(0 255 212 / 78%);
  background: linear-gradient(120deg, rgb(10 9 9 / 90%), rgba(39, 17, 10, 0.9));
  box-shadow: inset 0 0 0 1px rgb(8 8 8), 0 8px 18px rgba(0, 0, 0, 0.44);
}

.search-wrap svg {
  color: #07caa8;
}

@media (max-width: 920px) {
  .machines-page .machines-hero {
    min-height: 0;
    padding: 0.86rem;
    grid-template-columns: 1fr;
  }

  .machines-hero .subtitle {
    max-width: 100%;
  }

  .machines-hero .hero-balance {
    width: 100%;
  }
}

/* Responsive Hardening */
.machines-page,
.machine-controls,
.machines-grid,
.machine-card-x,
.machine-main {
  min-width: 0;
}

.machine-image img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 760px) {
  .machines-page {
    gap: 0.62rem;
  }

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

  .filter-row,
  .status-row {
    gap: 0.34rem;
  }

  .filter-chip,
  .status-chip {
    font-size: 0.76rem;
    padding-inline: 0.54rem;
  }

  .machine-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .summary-grid,
  .machine-metrics,
  .machine-actions {
    grid-template-columns: 1fr;
  }

  .inventory-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .view-switch {
    width: 100%;
  }

  .view-btn {
    width: 100%;
  }
}

/* Button Palette Sync (reference: dashboard global actions) */
.machine-actions .machine-btn {
  min-height: 38px;
  border-radius: 12px;
  border-width: 1px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.machine-actions .machine-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 20px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.machine-actions .machine-btn.action-on {
  border-color: rgba(105, 241, 192, 0.42);
  background: linear-gradient(135deg, rgb(13 22 18), rgb(16 29 23));
  color: #cbffe9;
}

.machine-actions .machine-btn.action-off,
.machine-actions .machine-btn.action-sell {
  border-color: rgba(255, 94, 94, 0.62);
  background: linear-gradient(135deg, rgb(92 14 14), rgb(56 6 6));
  color: #ffe4e4;
}

.machine-actions .machine-btn.action-upgrade {
  border-color: rgba(104, 236, 206, 0.8);
  background: linear-gradient(135deg, rgb(95 220 194), rgb(68 206 159));
  color: #143f31;
  box-shadow: inset 0 1px 0 rgba(213, 255, 245, 0.38), 0 10px 18px rgba(0, 0, 0, 0.3);
}

.machine-actions .machine-btn.action-maintenance {
  border-color: rgba(255, 201, 133, 0.46);
  background: linear-gradient(135deg, rgb(58 46 29), rgb(44 35 24));
  color: #ffe6bf;
}

.machine-actions .machine-btn.action-details {
  border-color: rgba(90, 160, 255, 0.72);
  background: linear-gradient(135deg, rgb(124 156 228), rgb(80 121 212));
  color: #152a54;
  box-shadow: inset 0 1px 0 rgba(228, 238, 255, 0.46), 0 10px 18px rgba(0, 0, 0, 0.28);
}
