/* ============================================================
   style.css - Design responsivo com temas claro e escuro
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; min-height: 100vh; transition: background 0.3s, color 0.3s; }

/* ── TEMA CLARO (default) ─────────────────────────────────── */
.tema-claro {
  --bg:          #f0f7f4;
  --bg-card:     #ffffff;
  --bg-header:   #1a8c5b;
  --bg-comprado: #e8f5e9;
  --primary:     #1a8c5b;
  --primary-h:   #15744a;
  --secondary:   #4a90d9;
  --secondary-h: #3a7abf;
  --danger:      #e53935;
  --danger-h:    #c62828;
  --success:     #43a047;
  --text:        #1a1a2e;
  --text-muted:  #555c6e;
  --text-inv:    #ffffff;
  --border:      #cde4d8;
  --shadow:      0 2px 8px rgba(26,140,91,.12);
  --categoria-bg:#e3f2fd;
  --categoria-txt:#1565c0;
  background: var(--bg);
  color: var(--text);
}

/* ── TEMA ESCURO ──────────────────────────────────────────── */
.tema-escuro {
	background-image: linear-gradient(rgba(15, 23, 42, 0.6);
	rgba(15, 23, 42, 0.6));
	background-image: url('uploads/fundo.jpg') !important; 
	background-size: contain !important; 
	background-size: cover !important; 
	background-position: center center !important; 
	background-attachment: fixed !important;
/*  --bg:          #121212; 
    --bg-card:     #1a2e1a;
    --bg-header:   #1e1e1e;
	--primary:     #4caf73;		*/
    
	
  --bg-card:   #101a2598;
  --bg-header:   #101a25;
  --bg-comprado: #1e1e1e;
  --primary:     #1b2533;
  --primary-h:   #66bb8a;
  --secondary:   #5c9bd6;
  --secondary-h: #79aee0;
  --danger:      #ef5350;
  --danger-h:    #e53935;
  --success:     #66bb6a;
  --text:        #e0e0e0;
  --text-muted:  #9e9e9e;
  --text-inv:    #121212;
  --border:      #333333;
  --shadow:      0 2px 8px rgba(255,255,255,.1);
  --categoria-bg:#263238;
  --categoria-txt:#80cbc4;
  --cat-verde:#CCFF66;
  background: var(--bg);
  color: var(--text);
}

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  background: var(--bg-header);
  color: var(--text-inv);
  padding: 0.75rem 1rem;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 3px 7px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.app-title { font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.header-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Container ────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 1rem; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: var(--shadow);
  margin-bottom: -1px;
}
h1 { color: var(--text);}
/* ── Seletor de lista ─────────────────────────────────────── */

.selector-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.form-inline { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 200px; }
.label-inline { white-space: nowrap; font-weight: 600; font-size: 1rem; }

/*-----Tabelas -*/
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  border: none;
  background-color: transparent;
}

th, td {
  border: none;
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
/* ── Inputs & Selects ─────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,140,91,.15);
}
.select { cursor: pointer; }
.textarea { resize: vertical; min-height: 80px; }

/* ── Botões ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.50rem 1.1rem;
  border: none; border-radius: 8px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 0.34rem 0.9rem; font-size: 0.82rem; border-radius: 6px; position: relative; right: 1rem !important;}
.btn-primary   { background: var(--primary);   color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-h); }
.btn-danger    { background: var(--danger);    color: #fff; }
.btn-danger:hover { background: var(--danger-h); }
.btn-success   { background: var(--success);  font-size: 2rem; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Lista header ─────────────────────────────────────────── */
.lista-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;

}
.lista-nome { font-size: 1rem; font-weight: 400; }

/* ── Seções ───────────────────────────────────────────────── */
.secao-titulo {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.comprados-titulo { margin-top: 1.5rem; }

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  background-color: #008080;
  color: #fff;
  border-radius: 99px;
  padding: 0.1rem 0.55rem;
  font-size: 1rem;
  font-weight: 700;
}
.badge-success { background: var(--success); }

/* ── Categoria grupo ──────────────────────────────────────── */
.categoria-grupo { margin-bottom: 0.7rem; }
.categoria-titulo {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--categoria-bg);
  color: var(--cat-verde);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 2px solid var(--border);
  margin-bottom: 0.5rem;
  display: inline-block;
}

/* ── Grid de produtos ─────────────────────────────────────── */
.produtos-grid { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Item card ────────────────────────────────────────────── */
.item-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.04rem 1rem;
  display: flex; align-items: center; gap: 0.52rem;
  box-shadow: var(--shadow);
  transition: background 0.2s, opacity 0.2s;
  margin: 2px;
}
.item-card:hover { border-color: var(--primary); }
.item-comprado {
  background: var(--bg-comprado);
  opacity: 0.75;
}
.item-comprado .item-nome {
  text-decoration: line-through;
  color: var(--text-muted);
}

.item-label {
  display: flex; align-items: center; gap: 0.65rem;
  cursor: pointer; flex: 1;
}
.item-check {
  width: 1.3rem; height: 1.3rem;

  cursor: pointer; 
  background-color: #FFFFFF;
  color: #FFFFFF;
  flex-shrink: 0;
  border-radius: 7px;
  border: 2px solid var(--border);
}
.item-foto {
  width: 46px; height: 46px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.item-info {
  display: flex; flex-direction: column; gap: 0.2rem;
}
.item-nome {
  font-weight: 600; font-size: 0.95rem;
  line-height: 1.25;
}
.item-qtd {
  font-size: 0.8rem; color: var(--text-muted);
}
.item-desc {
  font-size: 0.78rem; color: var(--text-muted);
}

.btn-remover {
  background: none; border: none;
  color: var(--danger);
  font-size: 1rem; cursor: pointer;
  padding: 0.3rem; border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-remover:hover { background: rgba(229,57,53,.1); }

/* ── Mensagem vazia ───────────────────────────────────────── */
.empty-msg {
  color: var(--text-muted); font-size: 0.9rem;
  text-align: center; padding: 1.5rem 0;
}

/* ── Seção comprados ──────────────────────────────────────── */
.secao-comprados { margin-top: 1.5rem; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 1rem;
}
.modal-box-lg { max-width: 600px; max-height: 80vh; overflow-y: auto; }
.modal-box h3 { font-size: 1.1rem; font-weight: 700; }
.modal-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap;
}
.modal-produtos-grid {
  display: flex; flex-direction: column; gap: 0.5rem;
  max-height: 50vh; overflow-y: auto;
}
.modal-produto-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.modal-produto-item .item-info { flex: 1; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  padding: 0.7rem 1.4rem;
  border-radius: 99px;
  font-size: 0.9rem; font-weight: 600;
  color: #fff;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  animation: fadeIn .25s ease;
  white-space: nowrap;
}
.toast.hidden { display: none; }
.toast-info    { background: #555; }
.toast-sucesso { background: var(--success); }
.toast-aviso   { background: #f59e0b; color: #1a1a1a; }
.toast-erro    { background: var(--danger); }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* ── Forms Admin ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }

/* ── Tabela admin ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.43rem 0.5rem;
  text-align: left;
}
th { font-weight: 700; background: var(--bg); color: var(--text-muted); }
tr:hover td { background: rgba(26,140,91,.04); }

/* ── Switch toggle ────────────────────────────────────────── */
.switch-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.switch-label { font-weight: 600; }
.switch {
  position: relative; display: inline-block;
  width: 48px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #ccc; border-radius: 99px;
  cursor: pointer; transition: background .3s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .3s;
}
input:checked + .slider { background: var(--primary); }
input:checked + .slider::before { transform: translateX(22px); }

/* ── Admin sidebar/nav ────────────────────────────────────── */
.admin-layout {
  display: flex; min-height: calc(100vh - 56px);
}
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
}
.sidebar .nav-title {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 0.75rem;
}
.sidebar a {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500; font-size: 0.9rem;
  transition: background .15s, color .15s;
  margin-bottom: 0.25rem;
}
.sidebar a:hover, .sidebar a.active {
  background: var(--primary);
  color: #fff;
}
.admin-content { flex: 1; padding: 1.5rem; overflow-y: auto; }

/* ── Alert ────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-erro    { background: #fdecea; color: #c62828; border: 1px solid #ef9a9a; }
.alert-sucesso { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.tema-escuro .alert-erro    { background: #3b1212; color: #ef9a9a; border-color: #7f1d1d; }
.tema-escuro .alert-sucesso { background: #0f2e13; color: #a5d6a7; border-color: #1b5e20; }

/* ── Login page ───────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow);
}
.login-box h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.3rem; }

/* ── Foto preview ─────────────────────────────────────────── */
.foto-preview-wrap { display: flex; align-items: center; gap: 0.75rem; }
.foto-preview {
  width: 72px; height: 72px;
  object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
  }
  .sidebar .nav-title { display: none; }
  .sidebar a { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
  .admin-content { padding: 1rem; }
  .form-row { flex-direction: column; }
  .selector-row { flex-direction: column; align-items: stretch; }
  .form-inline { flex-direction: column; align-items: stretch; }
  .lista-header { flex-direction: row; align-items: flex-start; }
  .modal-box { padding: 1rem; }
  .select {font-size: 1rem;}
}
