:root {
  --bg: #eef2f7;
  --bg-2: #e7edf5;
  --bg-3: #dde6f1;
  --surface: #ffffff;
  --surface-2: #f7faff;
  --surface-3: #edf3fb;
  --ink: #000000;
  --ink-soft: #000000;
  --ink-dim: #000000;
  --line: #cfd9e6;
  --line-2: #b9c7d8;
  --blue: #2e6be6;
  --blue-2: #4a83ef;
  --blue-dark: #2558be;
  --gray: #6b7785;
  --gray-dark: #394654;
  --black: #111418;
  --success: #1f9a67;
  --warning: #b8871c;
  --danger: #c44848;
  --shadow-lg: 0 18px 44px rgba(22, 45, 76, 0.14);
  --shadow-md: 0 12px 30px rgba(22, 45, 76, 0.11);
  --shadow-sm: 0 8px 20px rgba(22, 45, 76, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  background:
    radial-gradient(1100px 420px at 8% -20%, rgba(74, 131, 239, 0.2), transparent 50%),
    radial-gradient(880px 300px at 95% -16%, rgba(46, 107, 230, 0.16), transparent 46%),
    linear-gradient(170deg, var(--bg) 0%, var(--bg-2) 56%, var(--bg-3) 100%);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
small,
strong,
label,
a,
th,
td,
li {
  color: #000000;
  opacity: 1 !important;
  text-shadow: none !important;
}

.app-container {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 14px 12px 108px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0 0 10px;
}

h1,
h2,
h3,
h4 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  letter-spacing: -0.015em;
}

a {
  color: inherit;
}

.card,
.auth-card {
  position: relative;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.card::before,
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), transparent 38%);
  pointer-events: none;
  z-index: 0;
}

.card > *,
.auth-card > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.topbar p {
  color: #000000;
}

.dashboard-hero {
  border: 1px solid var(--line-2);
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(74, 131, 239, 0.22) 0%, rgba(66, 103, 158, 0.18) 58%, rgba(255, 255, 255, 0.76) 100%),
    linear-gradient(140deg, #f7faff 0%, #e7effa 100%);
}

.dashboard-hero-content {
  padding: 16px;
}

.dashboard-logo {
  width: min(210px, 62%);
  max-height: 102px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(31, 45, 61, 0.24));
}

.dashboard-topbar {
  margin-top: 8px;
  margin-bottom: 0;
  align-items: center;
}

.dashboard-topbar h1,
.dashboard-topbar p {
  color: #142030;
}

.dashboard-footer-banner-wrap {
  padding: 0;
  overflow: hidden;
}

.dashboard-footer-banner {
  width: 100%;
  height: 148px;
  object-fit: cover;
  display: block;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.tile {
  border-radius: 14px;
  border: 1px solid #5f87d6;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  text-decoration: none;
  color: #101a28;
  font-weight: 800;
  text-align: center;
  padding: 14px 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 88, 190, 0.25);
}

.tile-warning {
  background: linear-gradient(135deg, #c6962c 0%, #a5781d 100%);
  border-color: #bd9440;
  color: #fff9e6;
}

.tile-adm-os {
  background: linear-gradient(135deg, #6fa9ff 0%, #3a78dd 100%);
  border-color: #5a91e9;
  color: #f4f8ff;
}

.tile-adm-new {
  background: linear-gradient(135deg, #f6b14a 0%, #d2871e 100%);
  border-color: #e09b36;
  color: #fff8ea;
}

.tile-adm-finance {
  background: linear-gradient(135deg, #63d5a3 0%, #239a67 100%);
  border-color: #4cbc8b;
  color: #effff7;
}

.tile-adm-analytics {
  background: linear-gradient(135deg, #6fd3e8 0%, #2f9fb8 100%);
  border-color: #57b9d0;
  color: #eefcff;
}

.tile-adm-settings {
  background: linear-gradient(135deg, #b7c3d4 0%, #8898ad 100%);
  border-color: #9aaac0;
  color: #f6f9fc;
}

.login-top-brand {
  text-align: center;
  margin-bottom: 10px;
}

.login-top-logo {
  width: min(430px, 96%);
  max-height: 280px;
  object-fit: contain;
}

.login-card {
  overflow: hidden;
  padding: 0;
}

.login-section {
  padding: 16px;
}

.login-intro-section {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(74, 131, 239, 0.18) 0%, rgba(255, 255, 255, 0.7) 100%);
}

.login-intro-section p {
  color: #000000;
}

label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 2px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.laudo-form {
  gap: 12px;
}

.laudo-form .form-section {
  border: 1px solid #b8cbe2;
  box-shadow: 0 8px 22px rgba(33, 76, 145, 0.12);
  background: linear-gradient(165deg, #ffffff 0%, #f5f9ff 100%);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.laudo-form .form-section:focus-within {
  border-color: #7ea4de;
  box-shadow: 0 12px 26px rgba(42, 104, 201, 0.2);
}

.form-section h3 {
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.card > h3 {
  text-align: center;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid #8da8ca;
  border-radius: 12px;
  background: linear-gradient(140deg, #f6faff 0%, #eaf2ff 100%);
  box-shadow: 0 8px 20px rgba(46, 107, 230, 0.12);
  color: #0f2338;
  font-weight: 800;
}

.is-hidden {
  display: none;
}

input,
select,
textarea,
button,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-success,
.btn-warning {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
}

input,
select,
textarea {
  color: var(--ink);
  background: #ffffff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #5f7186;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 4px rgba(74, 131, 239, 0.16);
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8093aa 50%),
    linear-gradient(135deg, #8093aa 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

button,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-success,
.btn-warning {
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.btn-primary {
  color: #0f1724;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-color: #557cc7;
  box-shadow: 0 8px 18px rgba(37, 88, 190, 0.26);
}

.btn-secondary {
  color: #111b2a;
  background: linear-gradient(140deg, #5e738b, #4d6278);
  border-color: #6b8199;
}

.btn-soft-client {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid #9dc4dc;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #21465f;
  background: linear-gradient(145deg, #e7f5ff, #d8ebf7);
  box-shadow: 0 6px 14px rgba(74, 131, 170, 0.15);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.btn-soft-client:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(74, 131, 170, 0.2);
}

.btn-ghost {
  color: #2b3f55;
  background: #eef4fb;
  border-color: #b8c8dc;
}

.btn-success {
  color: #0f1e18;
  background: linear-gradient(140deg, #31a675, #24845d);
  border-color: #58b994;
}

.btn-warning {
  color: #221a0a;
  background: linear-gradient(140deg, #c6962c, #a5771d);
  border-color: #c39d50;
}

.btn-danger {
  color: #2a1212;
  background: linear-gradient(140deg, #cc5555, #aa3f3f);
  border-color: #d67a7a;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.btn-success:hover,
.btn-warning:hover,
.btn-danger:hover {
  transform: translateY(-1px);
}

input[readonly] {
  color: #44576b;
  background: #f2f6fb;
}

.btn-submit {
  min-height: 52px;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.actions-inline {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.os-card {
  border-color: var(--line-2);
  transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.os-card:hover {
  transform: translateY(-1px);
}

.os-neon-aberta {
  border-color: #d7bf58;
  background: linear-gradient(160deg, rgba(255, 245, 188, 0.95) 0%, rgba(255, 236, 150, 0.88) 45%, rgba(255, 246, 209, 0.94) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 120, 0.45),
    0 0 0 1px rgba(215, 191, 88, 0.3),
    0 0 10px rgba(255, 217, 68, 0.35),
    0 0 22px rgba(255, 217, 68, 0.22);
}

.os-neon-finalizada {
  border-color: #5dce9f;
  background: linear-gradient(160deg, rgba(195, 255, 223, 0.95) 0%, rgba(154, 244, 196, 0.88) 45%, rgba(216, 255, 234, 0.94) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(120, 230, 181, 0.45),
    0 0 0 1px rgba(93, 206, 159, 0.3),
    0 0 10px rgba(39, 213, 133, 0.34),
    0 0 22px rgba(39, 213, 133, 0.2);
}

.os-neon-cancelada {
  border-color: #e08b8b;
  background: linear-gradient(160deg, rgba(255, 214, 214, 0.95) 0%, rgba(255, 181, 181, 0.88) 45%, rgba(255, 228, 228, 0.94) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(241, 152, 152, 0.45),
    0 0 0 1px rgba(224, 139, 139, 0.32),
    0 0 10px rgba(239, 89, 89, 0.35),
    0 0 22px rgba(239, 89, 89, 0.22);
}

.os-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.os-meta {
  color: #000000;
}

.os-note {
  border-radius: 10px;
  border: 1px solid #c7d3e3;
  background: #f2f6fb;
  color: #000000;
  padding: 8px 10px;
}

.os-service-highlight {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid #9fb4d1;
  background: linear-gradient(155deg, #f7fbff 0%, #eaf3ff 100%);
  box-shadow: 0 6px 14px rgba(58, 104, 176, 0.14);
  padding: 8px 10px;
}

.os-service-highlight p {
  margin: 0 0 4px;
}

.os-service-highlight p:last-child {
  margin-bottom: 0;
}

.os-actions form {
  margin: 0;
}

.os-actions form input[type='text'] {
  margin-bottom: 6px;
}

.status-badge {
  display: inline-flex;
  min-height: 29px;
  min-width: 94px;
  padding: 4px 12px;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.status-aberta {
  background: rgba(255, 220, 76, 0.2);
  color: #7d5e10;
  border-color: #d8bd5a;
  box-shadow: 0 0 8px rgba(255, 217, 68, 0.32);
}

.status-finalizada {
  background: rgba(39, 213, 133, 0.18);
  color: #0f6a43;
  border-color: #58c79a;
  box-shadow: 0 0 8px rgba(39, 213, 133, 0.3);
}

.status-cancelada {
  background: rgba(239, 89, 89, 0.18);
  color: #8f2727;
  border-color: #de8484;
  box-shadow: 0 0 8px rgba(239, 89, 89, 0.3);
}

.alert {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  font-size: 14px;
}

.alert.success {
  background: rgba(31, 154, 103, 0.12);
  color: #17784f;
  border-color: #8fd2b3;
}

.alert.error {
  background: rgba(196, 72, 72, 0.12);
  color: #9d3535;
  border-color: #e1aaaa;
}

.text-link {
  color: #2e6be6;
  text-decoration: none;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.empty {
  color: #000000;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.metric-card {
  border-color: var(--line-2);
}

.metric-card h3 {
  color: #000000;
  margin-bottom: 4px;
}

.metric-number {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 30px;
  color: #000000;
  margin-bottom: 4px;
}

.metric-card-highlight {
  border-color: #96b2dd;
  background: linear-gradient(165deg, #eef4fe 0%, #f8fbff 100%);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: 320px;
}

.analytics-top-actions {
  width: min(360px, 100%);
  display: grid;
  gap: 8px;
}

.analytics-details h3 {
  color: #000000;
  margin-bottom: 10px;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.analytics-kpis article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff 0%, #f4f8ff 100%);
  padding: 10px;
}

.analytics-kpis h4 {
  margin: 0 0 5px;
  color: #000000;
}

.analytics-kpis p,
.analytics-supplier-list p {
  margin-bottom: 5px;
  color: #000000;
}

.analytics-details strong,
.analytics-details .empty,
.analytics-details h4,
.chart-card h3,
.table-wrap h3,
.finance-table th,
.finance-table td {
  color: #000000;
}

.table-wrap h3 {
  margin-bottom: 10px;
}

.table-scroll {
  overflow-x: auto;
}

.finance-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.finance-table th,
.finance-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.finance-table th {
  color: var(--ink-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-user-card {
  background: linear-gradient(160deg, #ffffff, #f3f8ff);
}

.table-actions {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.table-actions form {
  margin: 0;
}

.table-plan-form {
  display: grid;
  gap: 6px;
}

.table-plan-form select,
.table-plan-form button,
.table-actions .btn-secondary,
.table-actions .btn-danger {
  width: 100%;
}

.company-operator-line + .company-operator-line {
  margin-top: 6px;
}

.os-table td {
  vertical-align: top;
}

.orders-filter-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.orders-filter-form label {
  margin-bottom: 4px;
}

.orders-filter-actions {
  display: grid;
  gap: 8px;
  align-self: end;
}

.os-table-actions {
  min-width: 250px;
}

.os-table-actions input[type='text'] {
  width: 100%;
  margin-bottom: 6px;
}

.orders-page .topbar {
  margin-bottom: 10px;
}

.orders-page .topbar p {
  font-size: 13px;
}

.orders-quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.orders-quick-actions .tile {
  padding: 10px 8px;
  border-radius: 11px;
  font-size: 13px;
}

.orders-page .metric-card {
  padding: 10px;
}

.orders-page .metric-card h3 {
  font-size: 13px;
}

.orders-page .metric-number {
  font-size: 22px;
}

.orders-table-wrap h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.orders-page .os-table td,
.orders-page .os-table th {
  font-size: 12px;
  padding: 8px 7px;
}

.orders-page .os-table small {
  font-size: 11px;
}

.orders-page .status-badge {
  min-height: 25px;
  min-width: 82px;
  padding: 3px 9px;
  font-size: 11px;
}

.orders-page .os-table-actions {
  min-width: 200px;
  gap: 6px;
}

.orders-page .btn-compact {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
  border-radius: 10px;
}

.orders-page .compact-input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
  border-radius: 10px;
}

.user-table-toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.user-table-toolbar input,
.user-table-toolbar select {
  width: 100%;
}

.user-table-count {
  margin: 0;
  color: var(--ink-dim);
  font-size: 13px;
}

.bottom-nav {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 60;
  border-radius: 18px;
  border: 1px solid #b5c5da;
  background: rgba(244, 248, 253, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.bottom-nav.admin-nav {
  grid-template-columns: repeat(5, 1fr);
}

.bottom-nav.master-nav {
  grid-template-columns: repeat(4, 1fr);
}

.bottom-nav a {
  text-decoration: none;
  text-align: center;
  color: #000000;
  padding: 13px 5px;
  font-size: 12px;
  font-weight: 800;
  border-right: 1px solid rgba(180, 197, 218, 0.9);
}

.bottom-nav a:last-child {
  border-right: 0;
}

.bottom-nav a.active {
  color: #000000;
  background: linear-gradient(150deg, rgba(74, 131, 239, 0.2), rgba(74, 131, 239, 0.1));
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.auth-card,
.topbar,
.quick-actions,
.metrics-grid,
.analytics-grid {
  animation: rise-in 280ms ease both;
}

@media (min-width: 740px) {
  .app-container {
    padding: 22px 18px 110px;
  }

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

  .user-table-toolbar {
    grid-template-columns: minmax(260px, 1fr) 180px auto;
    align-items: center;
  }

  .search-box {
    grid-template-columns: 1fr 170px;
  }

  .orders-filter-form {
    grid-template-columns: minmax(220px, 1.2fr) 180px 170px 170px 220px;
    align-items: end;
  }

  .orders-quick-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .actions-inline {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

  .analytics-top-actions {
    display: flex;
    justify-content: flex-end;
  }

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

  .laudo-form .form-section:last-of-type,
  .laudo-form .btn-submit {
    grid-column: 1 / -1;
  }
}

@media (max-width: 739px) {
  .orders-page .table-scroll {
    overflow: visible;
  }

  .orders-page .os-table {
    min-width: 0;
    width: 100%;
  }

  .orders-page .os-table thead {
    display: none;
  }

  .orders-page .os-table,
  .orders-page .os-table tbody,
  .orders-page .os-table tr,
  .orders-page .os-table td {
    display: block;
    width: 100%;
  }

  .orders-page .os-table tr {
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px;
  }

  .orders-page .os-table td {
    border-bottom: 1px solid rgba(38, 57, 83, 0.08);
    padding: 7px 6px;
  }

  .orders-page .os-table td:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
  }

  .orders-page .os-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #344960;
    margin-bottom: 3px;
  }
}

@media (min-width: 1024px) {
  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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