/*
Theme Name: Gondola ERP Dashboard
Theme URI: https://ezequielribeiro.adv.br
Author: INOVAERAA
Author URI: https://ezequielribeiro.adv.br
Description: Tema visual de painel interno (ERP) para Pinotti Gondolas, com navegacao lateral, KPIs, catalogo, orcamentos, estoque, pedidos, obras, financeiro e relatorios. Acesso restrito a usuarios logados. Dados de exemplo estaticos, sem persistencia real em banco.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gondola-erp
*/

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: oklch(0.98 0.003 250);
  color: oklch(0.22 0.02 260);
}

a { color: oklch(0.5 0.18 255); text-decoration: none; }
a:hover { color: oklch(0.42 0.19 255); }

input, select {
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

label { min-width: 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: oklch(0.85 0.01 260); border-radius: 8px; }

.gondola-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.gondola-nav {
  width: 248px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid oklch(0.92 0.005 260);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.gondola-nav .brand {
  margin: 0 -16px 24px;
  padding: 22px 20px;
  background: oklch(0.5 0.18 255);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gondola-nav .brand-logo {
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.gondola-nav .nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: oklch(0.6 0.01 260);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 8px 6px;
}

.gondola-nav .nav-section-title.second { padding-top: 18px; }

.gondola-nav .nav-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  background: transparent;
  color: oklch(0.4 0.02 260);
}

.gondola-nav .nav-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(0.85 0.01 260);
  flex-shrink: 0;
}

.gondola-nav .nav-item.active {
  background: oklch(0.95 0.03 255);
  color: oklch(0.5 0.18 255);
}

.gondola-nav .nav-item.active .dot { background: oklch(0.5 0.18 255); }

.gondola-nav .profile-card {
  cursor: pointer;
  margin-top: auto;
  padding: 14px 10px;
  border-radius: 10px;
  background: oklch(0.97 0.01 60);
  display: flex;
  align-items: center;
  gap: 10px;
}

.gondola-nav .profile-card.active { background: oklch(0.95 0.03 255); }

.gondola-nav .profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: oklch(0.72 0.18 55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.gondola-nav .profile-meta { line-height: 1.3; }
.gondola-nav .profile-meta .name { font-size: 13px; font-weight: 700; }
.gondola-nav .profile-meta .link { font-size: 11px; color: oklch(0.55 0.02 260); }

/* Main */
.gondola-main { flex: 1; padding: 28px 36px 48px; min-width: 0; }

.gondola-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.gondola-topbar h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.gondola-topbar .subtitle { font-size: 13.5px; color: oklch(0.5 0.02 260); margin-top: 3px; }

.gondola-topbar .topbar-right { display: flex; align-items: center; gap: 12px; }

.daterange { position: relative; }
.daterange-toggle {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid oklch(0.9 0.005 260);
  color: oklch(0.4 0.02 260);
  display: flex;
  align-items: center;
  gap: 6px;
}
.daterange-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid oklch(0.9 0.005 260);
  border-radius: 10px;
  box-shadow: 0 8px 24px oklch(0 0 0 / 0.08);
  padding: 6px;
  z-index: 10;
  min-width: 150px;
}
.daterange-menu.open { display: block; }
.daterange-menu .opt {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 7px;
  color: oklch(0.35 0.02 260);
}
.daterange-menu .opt:hover { background: oklch(0.97 0.005 260); }

.avatar-btn {
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: oklch(0.5 0.18 255);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* Cards / grids reused across views */
.card {
  background: #fff;
  border: 1px solid oklch(0.92 0.005 260);
  border-radius: 14px;
  padding: 22px;
}

.card-title { font-size: 15px; font-weight: 700; }
.card-subtitle { font-size: 12.5px; color: oklch(0.52 0.02 260); margin-top: 2px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }

.kpi-card { background: #fff; border: 1px solid oklch(0.92 0.005 260); border-radius: 14px; padding: 18px 20px; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: oklch(0.52 0.02 260); }
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; }
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; }
.kpi-trend { font-size: 12.5px; font-weight: 600; }

.table-head {
  display: grid;
  padding: 0 0 10px;
  border-bottom: 1px solid oklch(0.92 0.005 260);
}
.table-head > div {
  font-size: 11.5px;
  font-weight: 700;
  color: oklch(0.55 0.02 260);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table-row {
  display: grid;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid oklch(0.95 0.005 260);
}

.badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

.btn-primary {
  cursor: pointer;
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 9px;
  background: oklch(0.5 0.18 255);
  color: #fff;
  border: none;
}
.btn-secondary {
  cursor: pointer;
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 9px;
  background: oklch(0.95 0.03 255);
  color: oklch(0.5 0.18 255);
  border: none;
}
.btn-orange {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  background: oklch(0.68 0.16 55);
  color: #fff;
  border: none;
}

.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: oklch(0.45 0.02 260); }
.form-field input, .form-field select {
  padding: 10px 12px;
  border: 1px solid oklch(0.88 0.005 260);
  border-radius: 8px;
  font-size: 13.5px;
}

.photo-slot {
  width: 100%;
  height: 88px;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, oklch(0.95 0.005 260), oklch(0.95 0.005 260) 8px, oklch(0.97 0.003 260) 8px, oklch(0.97 0.003 260) 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: oklch(0.55 0.01 260);
  text-align: center;
  padding: 6px;
}

.photo-slot.tall { height: 130px; border-radius: 14px 14px 0 0; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.4);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 14px; }

.progress-track { height: 5px; border-radius: 4px; background: oklch(0.93 0.005 260); overflow: hidden; }
.progress-fill { height: 100%; background: oklch(0.5 0.18 255); }

.barcode-block {
  width: 100%;
  background: repeating-linear-gradient(45deg, oklch(0.94 0.005 260), oklch(0.94 0.005 260) 8px, oklch(0.97 0.003 260) 8px, oklch(0.97 0.003 260) 16px);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 11px;
  color: oklch(0.55 0.01 260);
}

.stage-circle {
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  border: 2px solid oklch(0.85 0.01 260);
  background: #fff;
  color: oklch(0.6 0.02 260);
}
.stage-circle.done { background: oklch(0.5 0.18 255); color: #fff; border-color: oklch(0.5 0.18 255); }
.stage-line { height: 2px; flex: 1; background: oklch(0.9 0.005 260); margin: 0 -8px 22px; }
.stage-line.done { background: oklch(0.5 0.18 255); }

.gondola-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gondola-login-card {
  background: #fff;
  border: 1px solid oklch(0.92 0.005 260);
  border-radius: 14px;
  padding: 40px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.gondola-login-card .login-brand {
  margin: -40px -40px 24px;
  padding: 24px 20px;
  background: oklch(0.5 0.18 255);
  border-radius: 13px 13px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gondola-login-card .login-logo {
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 960px) {
  .gondola-nav { display: none; }
  .gondola-main { padding: 20px; }
  .grid-kpi, .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
