:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #14243d;
  --muted: #64748b;
  --border: #dbe3ea;
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --success: #166534;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 22px;
  color: var(--text);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
}

.container.narrow {
  max-width: 500px;
}

.card,
.topbar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hero-card {
  padding: 26px;
}

h1,
h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text);
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.subtitle {
  color: var(--muted);
  margin-top: -2px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.compact-subtitle,
.invoice-subtitle {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

input,
.select-box {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: white;
  color: var(--text);
}

input:focus,
.select-box:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

button,
.home-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
}

button:hover,
.home-btn:hover {
  background: var(--primary-hover);
}

.small-btn {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
}

.danger {
  background: var(--danger);
}

.danger:hover {
  background: #991b1b;
}

.success-btn {
  background: var(--success);
}

.success-btn:hover {
  background: #14532d;
}

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

.meta div {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 14px;
}

.meta strong {
  display: block;
  margin-bottom: 6px;
}

.meta span,
.meta div {
  line-height: 1.35;
}

.actions,
.page-actions,
.form-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.page-actions {
  margin-top: 0;
  margin-bottom: 10px;
}

.compact-actions {
  margin-bottom: 14px;
}

.primary-actions {
  margin-top: 18px;
}

.top-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.user-info {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: white;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: white;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

th {
  background: var(--primary);
  color: white;
}

tr:last-child td {
  border-bottom: none;
}

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.flash.success {
  background: var(--success-bg);
  color: var(--success);
}

.flash.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-open {
  color: var(--success);
  font-weight: bold;
}

.status-closed {
  color: var(--danger);
  font-weight: bold;
}

.status-open-bg {
  background: var(--success-bg);
}

.status-closed-bg {
  background: var(--danger-bg);
}

.status-chip,
.warranty-badge {
  display: inline;
  align-items: normal;
  border-radius: 0;
  padding: 0;
  font-weight: normal;
  line-height: inherit;
}

.invoice-header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.serial-box {
  font-size: 20px;
  min-height: 48px;
}

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

.menu-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  min-height: 150px;
}

.menu-card:hover {
  background: #f1f5f9;
}

.menu-card h2 {
  margin-bottom: 10px;
}

.menu-card p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.summary-card strong {
  display: block;
  margin-bottom: 8px;
  color: #334155;
}

.summary-card span {
  font-size: 22px;
  font-weight: bold;
  color: var(--text);
}

.serial-col {
  word-break: break-word;
}

.datetime-col {
  white-space: normal;
}

.muted-cell {
  color: var(--muted);
}

.empty-state-cell {
  text-align: center;
  color: var(--muted);
  padding: 22px;
}

.card-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

@media (max-width: 900px) {
  body {
    padding: 14px;
  }

  .container {
    max-width: 100%;
  }

  .meta,
  .summary-strip,
  .home-grid {
    grid-template-columns: 1fr 1fr;
  }

  .invoice-header-main {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .card,
  .topbar,
  .hero-card {
    padding: 16px;
    border-radius: 12px;
  }

  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 16px;
  }

  .top-header {
    justify-content: flex-start;
  }

  .user-info {
    width: 100%;
    justify-content: space-between;
  }

  .meta,
  .summary-strip,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .page-actions,
  .form-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .actions button,
  .actions .home-btn,
  .page-actions .home-btn,
  .form-actions-row button,
  .small-btn {
    width: 100%;
  }

  .top-header .home-btn {
    width: auto;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
  }

  .user-info {
    width: auto;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }

  .serial-box,
  input,
  .select-box {
    font-size: 16px;
  }

  table {
    min-width: 720px;
  }
}





/* v12 - Paleta Azevem ajustada + lixeira isolada */
:root {
  --azevem-green-dark: #024A3C;
  --azevem-green-mid: #3A8756;
  --azevem-green-light: #85C362;
  --azevem-green-soft: #E7F7DE;
  --text-strong: #0f172a;
}

body {
  background: #f3f4f6;
  color: var(--text-strong);
}

h1, h2, h3, .page-title, .section-title {
  color: var(--text-strong);
}

table thead th,
.table thead th {
  background: var(--azevem-green-dark) !important;
  color: #ffffff !important;
}

button,
.home-btn,
.primary-btn,
.btn-primary,
.actions a,
.actions button,
.page-actions a,
.page-actions button {
  background: var(--azevem-green-dark);
  border-color: var(--azevem-green-mid);
  color: #ffffff;
}

button:hover,
.home-btn:hover,
.primary-btn:hover,
.btn-primary:hover,
.actions a:hover,
.actions button:hover,
.page-actions a:hover,
.page-actions button:hover {
  background: var(--azevem-green-mid);
  border-color: var(--azevem-green-dark);
}

.card,
.panel,
.summary-card,
.info-card {
  background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--azevem-green-mid);
  box-shadow: 0 0 0 3px rgba(58, 135, 86, 0.18);
}

.status-open,
.status-aberta,
.badge-open {
  color: var(--azevem-green-dark) !important;
}

.compact-subtitle,
.subtitle {
  color: #475569;
}

/* lixeira isolada, sem caixa */
.delete-btn,
.btn-delete,
a.delete-btn,
button.delete-btn,
button.delete,
a.delete,
.actions .delete-btn,
.table .delete-btn,
td .delete-btn,
td form button {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #b91c1c !important;
  min-width: auto !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  font-size: 18px;
  line-height: 1;
}

.delete-btn:hover,
.btn-delete:hover,
a.delete-btn:hover,
button.delete-btn:hover,
button.delete:hover,
a.delete:hover,
.actions .delete-btn:hover,
.table .delete-btn:hover,
td form button:hover {
  background: transparent !important;
  border: none !important;
  color: #991b1b !important;
  transform: scale(1.06);
}

.trash-icon {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
