/* ========================================
   PAINEL SAMLA RIOS — CSS
   ======================================== */

:root {
  --accent:        #c4835a;
  --accent-hover:  #b5724a;
  --accent-light:  rgba(196,131,90,.15);
  --bg:            #1a1917;
  --bg-card:       #242220;
  --bg-input:      #2e2c29;
  --border:        rgba(255,255,255,.08);
  --text:          #f0ebe4;
  --text-secondary:#a89a8c;
  --text-muted:    #6b5e55;
  --shadow:        0 4px 24px rgba(0,0,0,.4);
  --radius:        12px;
  --radius-sm:     8px;
}

[data-theme="light"] {
  --bg:            #f5f0eb;
  --bg-card:       #ffffff;
  --bg-input:      #f0ebe4;
  --border:        rgba(0,0,0,.08);
  --text:          #1a1917;
  --text-secondary:#6b5e55;
  --text-muted:    #a89a8c;
  --shadow:        0 4px 24px rgba(0,0,0,.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s;
}

/* ── TIPOGRAFIA ── */
h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text);
}

/* ── LAYOUT AUTH (login / setup / verify) ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.auth-sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

/* ── FORMULÁRIOS ── */
.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.field-group input[type="text"][name="codigo"] {
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
}

/* ── BOTÕES ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background .2s, opacity .2s, transform .1s;
  text-decoration: none;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-block { width: 100%; }

/* ── ALERTAS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(220,50,47,.12);
  border: 1px solid rgba(220,50,47,.3);
  color: #e57373;
}

.alert-success {
  background: rgba(76,175,80,.12);
  border: 1px solid rgba(76,175,80,.3);
  color: #81c784;
}

/* ── SETUP ── */
.step-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
}

.qr-wrap img {
  display: block;
  border-radius: 6px;
}

.secret-box {
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-align: center;
  color: var(--accent);
  margin-bottom: 16px;
  word-break: break-all;
}

/* ── LAYOUT PAINEL ── */
.painel-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-logo h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--accent);
}

.sidebar-logo p {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-section {
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  transition: background .2s, color .2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
  border-right: 2px solid var(--accent);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid var(--border);
}

.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 16px;
  }
  .topbar { padding-left: 16px; }
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
}

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

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 40px;
  height: 22px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  position: relative;
  transition: background .3s;
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform .3s;
}

[data-theme="light"] .theme-toggle::after {
  transform: translateX(18px);
}

/* ── CARDS / WIDGETS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}

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

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

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--accent);
  font-weight: 600;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── CONFIGURAÇÕES CORES ── */
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.color-row label {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}

.color-row input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
}

/* ── HAMBURGUER ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s;
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-coming {
  background: rgba(196,131,90,.15);
  color: var(--accent);
}

.badge-ok {
  background: rgba(76,175,80,.15);
  color: #81c784;
}

/* ── DIVIDER ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── PASSWORD TOGGLE ── */
.pass-wrap { position:relative; display:block; width:100%; }
.pass-wrap input { width:100%; padding-right:44px; }
.pass-eye {
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; padding:4px;
  color:var(--text-muted); line-height:0;
  display:flex; align-items:center; justify-content:center;
}
.pass-eye:hover { color:var(--accent); }
.pass-eye svg { width:18px; height:18px; display:block; flex-shrink:0; }

/* ── VOLTAR LINK ── */
.back-link {
  display:inline-block;
  font-size:13px !important;
  color:var(--text-muted) !important;
  text-decoration:none !important;
  padding:7px 16px;
  border-radius:20px;
  letter-spacing:.2px;
  transition:color .2s, background .2s, box-shadow .2s, transform .15s;
}
.back-link:hover {
  color:var(--accent) !important;
  background:var(--accent-light);
  box-shadow:0 3px 14px rgba(196,131,90,.22);
  transform:translateY(-1px);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
