/* =====================================================
   ROMELUX SISTEMA — Design System
   Paleta: Preto #0D0D0D + Dourado #C9A84C + Branco
   Inspirado no layout Olist
   ===================================================== */



:root {
  /* Cores principais */
  --black:     #0D0D0D;
  --black-2:   #1A1A1A;
  --black-3:   #252525;
  --gold:      #C9A84C;
  --gold-l:    #E8CC7A;
  --gold-d:    #9A7A2E;
  --gold-bg:   #FBF6EC;
  --white:     #FFFFFF;
  --off-white: #F8F7F4;

  /* UI */
  --bg:        #F5F4F1;
  --bg-card:   #FFFFFF;
  --border:    #E8E4DC;
  --border-d:  #D4CFC4;
  --text:      #1A1814;
  --text-s:    #6B6560;
  --text-xs:   #9C9690;

  /* Status */
  --teal:      #2D7D6F;
  --teal-d:    #1F5C52;
  --teal-l:    #E8F5F2;
  --amber:     #C4870A;
  --amber-l:   #FEF3DC;
  --red:       #C0392B;
  --red-d:     #922B21;
  --red-l:     #FDEDEB;
  --blue:      #2471A3;
  --blue-d:    #1A5276;
  --blue-l:    #EAF2FA;
  --gray:      #7F8C8D;
  --gray-l:    #F2F3F4;

  /* Sidebar */
  --sidebar-w:     240px;
  --sidebar-bg:    #0D0D0D;
  --sidebar-text:  rgba(255,255,255,0.7);
  --sidebar-hover: rgba(201,168,76,0.12);
  --sidebar-active-bg: rgba(201,168,76,0.18);
  --sidebar-active: #C9A84C;

  /* Tipografia */
  --font-display: Arial, sans-serif;
  --font-body:    Arial, sans-serif;

  /* Espaçamento */
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow:    0 1px 4px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.5; }
input, select, textarea, button { font-family: var(--font-body); font-size: 13px; }
a { color: var(--gold); text-decoration: none; }

/* ---- LAYOUT PRINCIPAL ---- */
.app-wrap { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .25s ease;
  border-right: 1px solid rgba(201,168,76,0.15);
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  margin-bottom: 8px;
}

.sidebar-logo img {
  width: 140px;
  height: auto;
  display: block;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 6px;
  font-weight: 500;
}

/* Nav grupos */
.nav-group { margin-bottom: 2px; }

.nav-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: color .2s, background .2s;
  border-radius: var(--radius);
  margin: 0 8px;
}

.nav-group-btn:hover { color: var(--gold); background: var(--sidebar-hover); }
.nav-group-btn.active { color: var(--gold); }

.nav-group-btn .nav-group-icon { font-size: 15px; margin-right: 8px; }
.nav-group-btn .nav-chevron { font-size: 10px; transition: transform .2s; opacity: .5; }
.nav-group-btn.open .nav-chevron { transform: rotate(90deg); }

/* Nav itens filhos */
.nav-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}
.nav-items.open { max-height: 400px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 1px 8px;
  padding: 8px 12px 8px 32px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}

.nav-item:hover { color: #fff; background: var(--sidebar-hover); }
.nav-item.active {
  color: var(--gold);
  background: var(--sidebar-active-bg);
  font-weight: 500;
}
.nav-item .nav-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-item.active .nav-dot { opacity: 1; }

/* Separador simples (compatibilidade) */
.nav-sep {
  padding: 12px 24px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(201,168,76,0.5);
}

/* Nav item direto (sem grupo) */
.nav-direct {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 1px 8px;
  padding: 9px 12px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.nav-direct:hover { color: #fff; background: var(--sidebar-hover); }
.nav-direct.active { color: var(--gold); background: var(--sidebar-active-bg); font-weight: 500; }

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid rgba(201,168,76,0.15);
}
.sidebar-footer-user {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-footer-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold-d);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- MAIN ---- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,244,241,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 52px;
}

.btn-menu {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-xs);
  margin-left: auto;
}

/* ---- CONTEÚDO ---- */
.content {
  padding: 24px;
  flex: 1;
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: .01em;
}

/* ---- MÉTRICAS ---- */
.metric {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
}
.metric-label { font-size: 11px; color: var(--text-xs); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.metric-value { font-size: 26px; font-weight: 700; color: var(--text); margin: 4px 0 2px; line-height: 1.1; }
.metric-sub   { font-size: 11px; color: var(--text-s); }

/* ---- GRIDS ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }

/* ---- FORMULÁRIO ---- */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-s);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
  margin-top: 12px;
}
label:first-child { margin-top: 0; }

input[type=text], input[type=email], input[type=number], input[type=date],
input[type=password], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-d);
  border-radius: var(--radius);
  background: var(--off-white);
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
  background: #fff;
}
select { cursor: pointer; }

.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---- BOTÕES ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-d);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  line-height: 1;
}
.btn:hover { background: var(--off-white); border-color: var(--border-d); }

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
  font-weight: 600;
}
.btn-primary:hover { background: var(--gold-d); border-color: var(--gold-d); color: #fff; }

.btn-danger { background: var(--red-l); border-color: #f0b9b5; color: var(--red-d); }
.btn-danger:hover { background: var(--red-d); color: #fff; border-color: var(--red-d); }

.btn-full { width: 100%; justify-content: center; margin-top: 8px; padding: 10px 16px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---- TABELA ---- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-xs);
  padding: 8px 12px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--off-white); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-teal  { background: var(--teal-l); color: var(--teal-d); }
.badge-amber { background: var(--amber-l); color: var(--amber); }
.badge-red   { background: var(--red-l); color: var(--red-d); }
.badge-blue  { background: var(--blue-l); color: var(--blue-d); }
.badge-gray  { background: var(--gray-l); color: var(--gray); }
.badge-gold  { background: #FBF0D9; color: var(--gold-d); }

/* ---- ALERTAS ---- */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
  border-left: 3px solid transparent;
}
.alert-success { background: var(--teal-l); color: var(--teal-d); border-color: var(--teal); }
.alert-danger  { background: var(--red-l); color: var(--red-d); border-color: var(--red); }
.alert-warning { background: var(--amber-l); color: var(--amber); border-color: var(--amber); }
.alert-info    { background: var(--blue-l); color: var(--blue-d); border-color: var(--blue); }

/* ---- TABS ---- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 8px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-s);
  transition: color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold-d); border-bottom-color: var(--gold); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- TIMELINE ---- */
.timeline { display: flex; gap: 0; margin: 12px 0; }
.tl-step  { flex: 1; text-align: center; position: relative; }
.tl-step::before {
  content: ''; position: absolute;
  top: 14px; left: 50%; right: -50%;
  height: 2px; background: var(--border);
}
.tl-step:last-child::before { display: none; }
.tl-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-d);
  background: var(--bg-card);
  color: var(--text-xs);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
  position: relative; z-index: 1;
  transition: all .2s;
}
.tl-dot.done    { background: var(--teal); border-color: var(--teal); color: #fff; }
.tl-dot.current { background: var(--gold); border-color: var(--gold); color: var(--black); }
.tl-label { font-size: 11px; color: var(--text-s); }

/* ---- PROGRESS BAR ---- */
.prog-bar  { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 3px; transition: width .3s; background: var(--gold); }

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(13,13,13,.6);
  backdrop-filter: blur(2px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  border: 1px solid var(--border);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

/* ---- OVERLAY MOBILE ---- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}

/* ---- EMPTY STATE ---- */
.msg-vazio {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-xs);
  font-size: 13px;
}

/* ---- TELA DE LOGIN ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.12) 0%, transparent 70%);
  top: -100px; right: -100px;
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.08) 0%, transparent 70%);
  bottom: -50px; left: -50px;
}
.login-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  position: relative; z-index: 1;
}
.login-logo {
  display: block;
  width: 180px;
  margin: 0 auto 28px;
}
.login-card label { color: rgba(255,255,255,.5); }
.login-card input {
  background: rgba(255,255,255,.06);
  border-color: rgba(201,168,76,.25);
  color: #fff;
}
.login-card input:focus {
  background: rgba(255,255,255,.09);
  border-color: var(--gold);
}
.login-card input::placeholder { color: rgba(255,255,255,.25); }
.login-btn {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background: var(--gold);
  color: var(--black);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background .2s;
  font-family: var(--font-body);
}
.login-btn:hover { background: var(--gold-l); }
.login-error { color: #f0a090; font-size: 12px; margin-top: 10px; text-align: center; }

/* ---- RESPONSIVO ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .btn-menu { display: flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .form-row, .form-row3 { grid-template-columns: 1fr; }
}

/* Logo na sidebar */
.sidebar-logo-img {
  width: 130px;
  height: auto;
  display: block;
  filter: brightness(1.1);
}
