/* =============================================================
   Z3US.AI — Design System
   Fonte: Quicksand (Google Fonts)
   Paleta: Laranja #F99D28 | Cinza #828282 | Preto #000 | Branco #FFF
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');

/* ---- Custom Properties ---- */
:root {
  --z-orange: #F99D28;
  --z-orange-dark: #d6820d;
  --z-orange-glow: rgba(249, 157, 40, 0.18);
  --z-orange-glow2: rgba(249, 157, 40, 0.08);
  --z-gray: #828282;
  --z-gray-light: #A0A0A0;
  --z-gray-dark: #444444;

  --z-black: #000000;
  --z-bg: #0B0B0B;
  --z-surface: #141414;
  --z-surface2: #1C1C1C;
  --z-border: rgba(255, 255, 255, 0.07);
  --z-border-hover: rgba(249, 157, 40, 0.35);

  --z-white: #FFFFFF;
  --z-text: #E8E8E8;
  --z-text-muted: #828282;

  --z-sidebar-w: 260px;
  --z-sidebar-bg: #0E0E0E;
  --z-header-h: 64px;

  --z-radius: 10px;
  --z-radius-lg: 16px;
  --z-radius-sm: 6px;

  --z-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --z-shadow-orange: 0 0 20px rgba(249, 157, 40, 0.15);

  --z-transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', Arial, sans-serif;
  background-color: var(--z-bg);
  color: var(--z-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--z-orange);
  text-decoration: none;
  transition: var(--z-transition);
}

a:hover {
  color: var(--z-orange-dark);
}

img {
  max-width: 100%;
  display: block;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--z-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--z-gray-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--z-orange);
}

/* ================================================================
   LAYOUT
   ================================================================ */

.z-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.z-sidebar {
  width: var(--z-sidebar-w);
  min-height: 100vh;
  background: var(--z-sidebar-bg);
  border-right: 1px solid var(--z-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.z-sidebar__brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--z-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.z-sidebar__logo {
  width: 36px;
  height: 36px;
  background: var(--z-orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #000;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(249, 157, 40, 0.4);
}

.z-sidebar__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--z-white);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.z-sidebar__subtitle {
  font-size: 10px;
  color: var(--z-orange);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}

.z-sidebar__nav {
  padding: 16px 0;
  flex: 1;
  overflow-y: auto;
}

.z-sidebar__section {
  padding: 8px 20px 4px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--z-text-muted);
  font-weight: 600;
}

.z-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--z-text-muted);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--z-transition);
  cursor: pointer;
  text-decoration: none;
}

.z-nav-item:hover {
  color: var(--z-white);
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--z-gray-dark);
}

.z-nav-item.active {
  color: var(--z-orange);
  background: var(--z-orange-glow2);
  border-left-color: var(--z-orange);
  font-weight: 600;
}

.z-nav-item svg,
.z-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  flex-shrink: 0;
}

.z-sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--z-border);
}

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

.z-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--z-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #000;
  flex-shrink: 0;
}

.z-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--z-white);
}

.z-user-role {
  font-size: 10.5px;
  color: var(--z-text-muted);
}

/* ---- Main Area ---- */
.z-main {
  margin-left: var(--z-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Sidebar collapsed (desktop toggle) ---- */
.z-layout.sidebar-collapsed .z-sidebar {
  transform: translateX(-100%);
}

.z-layout.sidebar-collapsed .z-main {
  margin-left: 0;
}

/* ---- Header ---- */
.z-header {
  height: var(--z-header-h);
  background: var(--z-surface);
  border-bottom: 1px solid var(--z-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(10px);
}

.z-header__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--z-white);
}

.z-header__breadcrumb {
  font-size: 12px;
  color: var(--z-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.z-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Content ---- */
.z-content {
  padding: 28px;
  flex: 1;
}

/* ================================================================
   CARDS / KPI
   ================================================================ */

.z-card {
  background: var(--z-surface);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  padding: 24px;
  transition: var(--z-transition);
}

.z-card:hover {
  border-color: var(--z-border-hover);
  box-shadow: var(--z-shadow-orange);
  transform: translateY(-2px);
}

.z-card__title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--z-text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.z-card__value {
  font-size: 38px;
  font-weight: 700;
  color: var(--z-white);
  line-height: 1;
  margin-bottom: 6px;
}

.z-card__value span {
  font-size: 14px;
  color: var(--z-text-muted);
  font-weight: 400;
}

.z-card__icon {
  width: 44px;
  height: 44px;
  background: var(--z-orange-glow);
  border-radius: var(--z-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--z-orange);
}

.z-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* ================================================================
   TABELAS
   ================================================================ */

.z-table-wrap {
  background: var(--z-surface);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  overflow: hidden;
}

.z-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.z-table thead th {
  background: var(--z-surface2);
  color: var(--z-text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--z-border);
}

.z-table tbody tr {
  border-bottom: 1px solid var(--z-border);
  transition: var(--z-transition);
}

.z-table tbody tr:last-child {
  border-bottom: none;
}

.z-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.z-table tbody td {
  padding: 13px 16px;
  color: var(--z-text);
  vertical-align: middle;
}

.z-table tbody td:first-child {
  font-weight: 600;
}

/* ================================================================
   BOTÕES
   ================================================================ */

.z-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--z-radius-sm);
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--z-transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.z-btn-primary {
  background: var(--z-orange);
  color: #000;
}

.z-btn-primary:hover {
  background: var(--z-orange-dark);
  color: #000;
  box-shadow: 0 0 18px rgba(249, 157, 40, 0.4);
  transform: translateY(-1px);
}

.z-btn-secondary {
  background: rgba(130, 130, 130, 0.15);
  color: var(--z-gray-light);
  border: 1px solid var(--z-border);
}

.z-btn-secondary:hover {
  background: rgba(130, 130, 130, 0.25);
  color: var(--z-white);
}

.z-btn-danger {
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b7a;
  border: 1px solid rgba(220, 53, 69, 0.25);
}

.z-btn-danger:hover {
  background: rgba(220, 53, 69, 0.28);
  color: #ff8a95;
}

.z-btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.z-btn-icon {
  padding: 7px;
  background: transparent;
  border: 1px solid var(--z-border);
  color: var(--z-text-muted);
  border-radius: var(--z-radius-sm);
}

.z-btn-icon:hover {
  border-color: var(--z-orange);
  color: var(--z-orange);
}

/* ================================================================
   BADGES
   ================================================================ */

.z-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.z-badge-success {
  background: rgba(40, 199, 111, 0.15);
  color: #56e295;
  border: 1px solid rgba(40, 199, 111, 0.25);
}

.z-badge-warning {
  background: rgba(249, 157, 40, 0.15);
  color: var(--z-orange);
  border: 1px solid rgba(249, 157, 40, 0.25);
}

.z-badge-danger {
  background: rgba(234, 84, 85, 0.15);
  color: #ff6b7a;
  border: 1px solid rgba(234, 84, 85, 0.25);
}

.z-badge-info {
  background: rgba(0, 166, 255, 0.12);
  color: #4cc8ff;
  border: 1px solid rgba(0, 166, 255, 0.2);
}

.z-badge-gray {
  background: rgba(130, 130, 130, 0.15);
  color: var(--z-gray-light);
  border: 1px solid var(--z-border);
}

.z-badge-create {
  background: rgba(40, 199, 111, 0.15);
  color: #56e295;
  border: 1px solid rgba(40, 199, 111, 0.25);
}

.z-badge-update {
  background: rgba(0, 166, 255, 0.12);
  color: #4cc8ff;
  border: 1px solid rgba(0, 166, 255, 0.2);
}

.z-badge-reject {
  background: rgba(234, 84, 85, 0.15);
  color: #ff6b7a;
  border: 1px solid rgba(234, 84, 85, 0.25);
}

/* ================================================================
   FORMULÁRIOS
   ================================================================ */

.z-form-group {
  margin-bottom: 18px;
}

.z-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--z-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.z-input,
.z-select,
.z-textarea {
  width: 100%;
  background: var(--z-surface2);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-sm);
  padding: 10px 14px;
  color: var(--z-text);
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 13.5px;
  transition: var(--z-transition);
  outline: none;
}

.z-input:focus,
.z-select:focus,
.z-textarea:focus {
  border-color: var(--z-orange);
  box-shadow: 0 0 0 3px var(--z-orange-glow);
  background: var(--z-surface);
}

.z-input::placeholder,
.z-textarea::placeholder {
  color: var(--z-gray-dark);
}

.z-select option {
  background: var(--z-surface2);
  color: var(--z-text);
}

.z-textarea {
  resize: vertical;
  min-height: 90px;
}

/* ================================================================
   ABAS
   ================================================================ */

.z-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--z-border);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 0;
}

.z-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--z-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--z-transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Quicksand', Arial, sans-serif;
  text-decoration: none;
}

.z-tab:hover {
  color: var(--z-white);
}

.z-tab.active {
  color: var(--z-orange);
  border-bottom-color: var(--z-orange);
}

.z-tab-count {
  background: var(--z-orange-glow);
  color: var(--z-orange);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
}

.z-tab-panel {
  display: none;
}

.z-tab-panel.active {
  display: block;
}

/* ================================================================
   FILTROS / BUSCA
   ================================================================ */

.z-filters {
  background: var(--z-surface);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.z-filters .z-form-group {
  margin-bottom: 0;
  min-width: 160px;
  flex: 1;
}

/* ================================================================
   STEP WIZARD
   ================================================================ */

.z-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: var(--z-radius);
  border: 1px solid var(--z-border);
}

.z-step {
  flex: 1;
  padding: 12px 10px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--z-text-muted);
  background: var(--z-surface2);
  border-right: 1px solid var(--z-border);
  transition: var(--z-transition);
  cursor: default;
}

.z-step:last-child {
  border-right: none;
}

.z-step.active {
  background: var(--z-orange);
  color: #000;
}

.z-step.done {
  background: rgba(40, 199, 111, 0.1);
  color: #56e295;
}

.z-step-num {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 3px;
}

/* ================================================================
   IMPORTAÇÃO JSON
   ================================================================ */

.z-import-box {
  background: var(--z-surface);
  border: 2px dashed var(--z-border);
  border-radius: var(--z-radius-lg);
  padding: 28px;
  transition: var(--z-transition);
}

.z-import-box:hover,
.z-import-box:focus-within {
  border-color: var(--z-orange);
  box-shadow: var(--z-shadow-orange);
}

.z-import-textarea {
  width: 100%;
  min-height: 320px;
  background: var(--z-surface2);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius);
  padding: 16px;
  color: #a8ff78;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: var(--z-transition);
}

.z-import-textarea:focus {
  border-color: var(--z-orange);
  box-shadow: 0 0 0 3px var(--z-orange-glow);
}

.z-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.z-counter-chip {
  background: var(--z-surface2);
  border: 1px solid var(--z-border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--z-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.z-counter-chip strong {
  color: var(--z-orange);
}

/* Preview sections */
.z-preview-section {
  background: var(--z-surface2);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.z-preview-header {
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--z-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.z-preview-body {
  padding: 16px;
}

/* ================================================================
   ALERTS / FLASH
   ================================================================ */

.z-alert {
  border-radius: var(--z-radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.z-alert-success {
  background: rgba(40, 199, 111, 0.12);
  border-color: rgba(40, 199, 111, 0.3);
  color: #56e295;
}

.z-alert-error {
  background: rgba(234, 84, 85, 0.12);
  border-color: rgba(234, 84, 85, 0.3);
  color: #ff6b7a;
}

.z-alert-warning {
  background: rgba(249, 157, 40, 0.12);
  border-color: rgba(249, 157, 40, 0.3);
  color: var(--z-orange);
}

.z-alert-info {
  background: rgba(0, 166, 255, 0.1);
  border-color: rgba(0, 166, 255, 0.25);
  color: #4cc8ff;
}

/* ================================================================
   LOGIN
   ================================================================ */

.z-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--z-bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(249, 157, 40, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(249, 157, 40, 0.04) 0%, transparent 70%);
  padding: 20px;
}

.z-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--z-surface);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  padding: 40px 36px;
  box-shadow: var(--z-shadow);
  animation: fadeInUp 0.4s ease;
}

.z-login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.z-login-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--z-orange);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #000;
  margin: 0 auto 12px;
  box-shadow: 0 0 32px rgba(249, 157, 40, 0.35);
}

.z-login-brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--z-white);
  letter-spacing: 0.04em;
}

.z-login-brand span {
  color: var(--z-orange);
}

.z-login-subtitle {
  font-size: 12.5px;
  color: var(--z-text-muted);
  margin-top: 4px;
}

/* ================================================================
   MODAL
   ================================================================ */

.z-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.z-modal {
  background: var(--z-surface);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--z-shadow);
  animation: slideUp 0.25s ease;
}

.z-modal__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--z-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.z-modal__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--z-white);
}

.z-modal__body {
  padding: 24px;
}

.z-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--z-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ================================================================
   UTILITY
   ================================================================ */

.z-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.z-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.z-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
}

.z-chart-card {
  background: var(--z-surface);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  padding: 20px 20px 16px;
}

.z-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--z-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.text-muted {
  color: var(--z-text-muted) !important;
}

.text-orange {
  color: var(--z-orange) !important;
}

.text-white {
  color: var(--z-white) !important;
}

.text-sm {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

.fw-700 {
  font-weight: 700;
}

.fw-600 {
  font-weight: 600;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.gap-8 {
  gap: 8px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.d-hidden {
  display: none;
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-orange {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(249, 157, 40, 0.35);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(249, 157, 40, 0);
  }
}

.animate-fadein {
  animation: fadeInUp 0.35s ease;
}

/* Loading spinner */
.z-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--z-border);
  border-top-color: var(--z-orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
  .z-grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .z-kpi-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (max-width: 768px) {

  /* No mobile a sidebar começa escondida independente do estado desktop */
  .z-sidebar {
    transform: translateX(-100%);
  }

  .z-sidebar.open {
    transform: translateX(0) !important;
  }

  /* No mobile nunca há margem: a sidebar fica por cima do conteúdo */
  .z-main,
  .z-layout.sidebar-collapsed .z-main {
    margin-left: 0;
  }

  .z-grid-2,
  .z-grid-3,
  .z-grid-4 {
    grid-template-columns: 1fr;
  }

  .z-content {
    padding: 16px;
  }

  .z-header {
    padding: 0 16px;
  }
}

/* Sidebar backdrop for mobile */
.z-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.z-sidebar-backdrop.show {
  display: block;
}

/* Hamburger — sempre visível */
.z-hamburger {
  display: flex;
  background: none;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-sm);
  padding: 7px 9px;
  cursor: pointer;
  color: var(--z-text-muted);
  flex-direction: column;
  gap: 4px;
  transition: var(--z-transition);
  flex-shrink: 0;
}

.z-hamburger:hover {
  border-color: var(--z-orange);
  color: var(--z-orange);
}

.z-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--z-transition);
}

/* X quando sidebar está ABERTA (desktop) — indica "fechar" */
@media (min-width: 769px) {
  .z-hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .z-hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .z-hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* ☰ quando sidebar está FECHADA — indica "abrir" */
  .z-layout.sidebar-collapsed .z-hamburger span:nth-child(1),
  .z-layout.sidebar-collapsed .z-hamburger span:nth-child(3) {
    transform: none;
  }

  .z-layout.sidebar-collapsed .z-hamburger span:nth-child(2) {
    opacity: 1;
    transform: none;
  }
}

/* ================================================================
   PAGE-SPECIFIC TWEAKS
   ================================================================ */

/* Detail row in system show */
.z-detail-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--z-border);
  gap: 16px;
}

.z-detail-row:last-child {
  border-bottom: none;
}

.z-detail-label {
  width: 200px;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--z-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
}

.z-detail-value {
  flex: 1;
  font-size: 13.5px;
  color: var(--z-text);
  word-break: break-word;
}

/* ================================================================
   ROW POPUP — campos do modal de preview de linha
   ================================================================ */

.mp-field {
  display: flex;
  align-items: flex-start;
  padding: 11px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 0;
}
.mp-field:last-child { border-bottom: none; }
.mp-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  padding-top: 2px;
  line-height: 1.5;
}
.mp-value {
  flex: 1;
  font-size: 13px;
  color: #e5e7eb;
  word-break: break-word;
  line-height: 1.6;
  white-space: pre-wrap;
}
.mp-value.mp-empty { color: #374151; font-style: italic; }

/* Empty state */
.z-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--z-text-muted);
}

.z-empty-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.z-empty p {
  font-size: 13px;
}

/* ================================================================
   SISTEMAS — Badge extras (ambiente, status expandido)
   ================================================================ */

.z-badge-env-prod {
  background: rgba(34, 197, 94, 0.13);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.z-badge-env-homol {
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.z-badge-env-dev {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.z-badge-env-qa {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ================================================================
   IMPORTAÇÃO V2 — Stepper, layout, cards
   ================================================================ */

/* Stepper */
.z-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
}

.z-step2 {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: #151515;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  transition: background 0.2s, color 0.2s;
  cursor: default;
}

.z-step2+.z-step2 {
  border-left: 1px solid #2a2a2a;
}

.z-step2.active {
  background: rgba(255, 159, 28, 0.07);
  color: #ff9f1c;
}

.z-step2.done {
  background: rgba(34, 197, 94, 0.06);
  color: #22c55e;
}

.z-step2__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #2a2a2a;
  color: #4b5563;
  flex-shrink: 0;
}

.z-step2.active .z-step2__num {
  background: #ff9f1c;
  color: #000;
}

.z-step2.done .z-step2__num {
  background: #22c55e;
  color: #000;
}

/* Two-column import layout */
.z-import-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

/* Editor card */
.z-import-editor {
  background: #151515;
  border: 1px dashed rgba(255, 159, 28, 0.25);
  border-radius: 10px;
  padding: 18px 20px 20px;
  transition: border-color 0.2s;
}

.z-import-editor:focus-within {
  border-color: rgba(255, 159, 28, 0.5);
}

.z-import-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.z-import-editor__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #9ca3af;
}

.z-import-editor__title .z-icon-orange {
  color: #ff9f1c;
}

.z-import-editor__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.z-import-editor__hint {
  font-size: 12px;
  color: #374151;
}

/* Info card (right sidebar) */
.z-import-info-card {
  background: #151515;
  border: 1px solid #232323;
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}

.z-import-info-card__head {
  padding: 12px 16px;
  border-bottom: 1px solid #1f1f1f;
  font-size: 12px;
  font-weight: 700;
  color: #d1d5db;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.z-import-info-card__body {
  padding: 4px 0;
}

/* Detail row */
.z-irow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid #1a1a1a;
  font-size: 13px;
  transition: background 0.15s;
}

.z-irow:last-child {
  border-bottom: none;
}

.z-irow__left {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #9ca3af;
}

.z-irow__icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.z-irow__icon--o {
  background: rgba(255, 159, 28, 0.12);
  color: #ff9f1c;
}

.z-irow__icon--b {
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
}

.z-irow__icon--g {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.z-irow__icon--r {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.z-irow__icon--p {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.z-irow__val {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.z-irow__val--pending {
  color: #374151;
}

/* Summary row */
.z-srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid #1a1a1a;
}

.z-srow:last-child {
  border-bottom: none;
}

.z-srow__left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #d1d5db;
}

.z-srow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.z-srow__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.z-srow__count {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.z-srow__action {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.z-srow__action--g {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.z-srow__action--b {
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
}

.z-srow__action--r {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* Preview wrapper */
.z-import-preview-wrap {
  background: #151515;
  border: 1px solid #232323;
  border-radius: 10px;
  overflow: hidden;
}

.z-import-preview-wrap__head {
  padding: 13px 20px;
  border-bottom: 1px solid #1f1f1f;
  font-size: 12px;
  font-weight: 700;
  color: #d1d5db;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.z-import-preview-wrap__body {
  padding: 16px 20px;
}

/* Empty preview state */
.z-import-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 14px;
  text-align: center;
}

.z-import-empty__icon {
  font-size: 40px;
  opacity: 0.18;
  display: block;
}

.z-import-empty__title {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}

.z-import-empty__sub {
  font-size: 12px;
  color: #374151;
  line-height: 1.6;
  max-width: 340px;
}

/* Textarea override for import */
.z-import-textarea-v2 {
  width: 100%;
  min-height: 280px;
  background: #0f0f10;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 14px 16px;
  color: #86efac;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.7;
}

.z-import-textarea-v2::placeholder {
  color: #2a2a2a;
}

.z-import-textarea-v2:focus {
  border-color: rgba(255, 159, 28, 0.5);
}

/* Responsive */
@media (max-width: 960px) {
  .z-import-layout {
    grid-template-columns: 1fr;
  }

  .z-import-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .z-import-info-card {
    margin-bottom: 0;
  }
}

@media (max-width: 600px) {
  .z-stepper {
    flex-direction: column;
  }

  .z-step2+.z-step2 {
    border-left: none;
    border-top: 1px solid #2a2a2a;
  }

  .z-import-right {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   DASHBOARD V2 — KPI Cards & Charts
   ================================================================ */

/* ---- KPI row ---- */
.z-dash-kpis {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.z-kpi2 {
  background: #171717;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 18px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.z-kpi2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--kpi-c, #ff9f1c);
}

.z-kpi2--link {
  cursor: pointer;
}

.z-kpi2--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-color: var(--kpi-c, #ff9f1c);
}

.z-kpi2__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.z-kpi2__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  line-height: 1.3;
}

.z-kpi2__icon {
  width: 24px;
  height: 24px;
  color: var(--kpi-c, #ff9f1c);
  opacity: 0.8;
  flex-shrink: 0;
}

.z-kpi2__icon svg {
  width: 100%;
  height: 100%;
}

.z-kpi2__val {
  font-size: 34px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.z-kpi2__val--danger {
  color: #ff4d4f !important;
}

/* KPI color variants */
.z-kpi2--orange {
  --kpi-c: #ff9f1c;
}

.z-kpi2--cyan {
  --kpi-c: #22d3ee;
}

.z-kpi2--blue {
  --kpi-c: #60a5fa;
}

.z-kpi2--purple {
  --kpi-c: #a855f7;
}

.z-kpi2--red {
  --kpi-c: #ff4d4f;
}

.z-kpi2--yellow {
  --kpi-c: #facc15;
}

.z-kpi2--green {
  --kpi-c: #22c55e;
}

/* ---- Dashboard chart grids ---- */
.z-dash-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.z-dash-3col {
  grid-template-columns: repeat(3, 1fr);
}

.z-dash-2col {
  grid-template-columns: 1fr 1fr;
}

.z-dash-2col-wide {
  grid-template-columns: 2fr 1fr;
}

/* ---- Chart card v2 ---- */
.z-chart2 {
  background: #171717;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 18px 20px 16px;
}

.z-chart2--alert {
  border-color: rgba(255, 77, 79, 0.35);
  border-left: 3px solid #ff4d4f;
}

.z-chart2__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #232323;
  margin-bottom: 14px;
}

.z-chart2__title {
  font-size: 12.5px;
  font-weight: 600;
  color: #d1d5db;
  letter-spacing: 0.03em;
}

.z-chart2__badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.z-chart2__badge--danger {
  background: rgba(255, 77, 79, 0.12);
  color: #ff4d4f;
  border: 1px solid rgba(255, 77, 79, 0.25);
}

.z-chart2__body {
  position: relative;
  height: 210px;
}

.z-chart2__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  color: #374151;
  font-size: 12.5px;
  font-weight: 500;
}

.z-chart2__empty span:first-child {
  font-size: 24px;
  opacity: 0.35;
  display: block;
  margin-bottom: 2px;
}

.z-chart2__empty--warn {
  color: #78350f;
}

.z-chart2__empty--warn span:first-child {
  opacity: 0.55;
}

/* ---- Responsive — Dashboard V2 ---- */
@media (max-width: 1400px) {
  .z-dash-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1100px) {
  .z-dash-kpis {
    grid-template-columns: repeat(4, 1fr);
  }

  .z-dash-2col-wide {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .z-dash-kpis {
    grid-template-columns: repeat(3, 1fr);
  }

  .z-dash-3col {
    grid-template-columns: 1fr 1fr;
  }

  .z-dash-2col-wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .z-dash-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .z-dash-3col,
  .z-dash-2col {
    grid-template-columns: 1fr;
  }
}

.z-table-count {
  display: none !important;
}