:root {
  --orange: #fd802e;
  --orange-dark: #e56a1a;
  --black: #1e1e1e;
  --bg: #f4f0ec;
  --white: #ffffff;
  --muted: #8a8580;
  --border: #e6e0d8;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

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

.app[hidden] {
  display: none;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  padding: 0 4px 28px;
}

.logo-img {
  display: block;
  width: 100%;
  max-width: 110px;
  height: auto;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}

.nav-item.active {
  background: var(--orange);
  color: var(--black);
  font-weight: 700;
}

.nav-icon {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.6;
  width: 20px;
}

.nav-item.active .nav-icon {
  opacity: 0.7;
}

.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}

.sidebar-contact {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}

/* MAIN */
.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 44px 20px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
}

.topbar-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.topbar-badge {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--orange-dark);
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 100px;
}

.content {
  padding: 4px 44px 60px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-head {
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.panel-head-sub {
  margin-top: 32px;
}

.panel-head-sub h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

/* FORM */
.form-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--black);
}

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="date"], textarea {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 400;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--black);
  resize: vertical;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="password"]:focus, input[type="date"]:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--white);
}

.btn-primary {
  align-self: flex-start;
  background: var(--orange);
  color: var(--black);
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

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

/* GRID / CARDS */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 720px;
}

.media-card, .tutorial-card, .light-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.light-card h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.photo-placeholder {
  aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 12px;
  margin-bottom: 4px;
}

.light-card-fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.light-card-fotos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.photo-placeholder-wide {
  aspect-ratio: 16 / 6;
  margin-bottom: 0;
}

.tag {
  align-self: flex-start;
  background: rgba(253,128,46,0.12);
  color: var(--orange-dark);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 4px;
}

.tag-alt {
  background: rgba(30,30,30,0.06);
  color: var(--black);
}

.media-card h3, .tutorial-card h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.btn-outline {
  margin-top: 10px;
  align-self: flex-start;
  border: 1.5px solid var(--black);
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-outline:hover {
  background: var(--black);
  color: var(--white);
}

.btn-sm {
  margin-top: 0;
  padding: 7px 12px;
  font-size: 12.5px;
}

.link-arrow {
  margin-top: 6px;
  color: var(--orange-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
}

.link-arrow:hover {
  text-decoration: underline;
}

/* LISTS: compras / checklist */
.shop-list, .task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.shop-list li, .task-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
}

.shop-list li:last-child, .task-list li:last-child {
  border-bottom: none;
}

.shop-info, .task-info {
  flex: 1;
  min-width: 0;
}

.shop-name, .task-name {
  margin: 0;
  font-weight: 600;
  font-size: 14.5px;
}

.checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.checkbox span {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  transition: background 0.15s, border-color 0.15s;
}

.checkbox input:checked + span {
  background: var(--orange);
  border-color: var(--orange);
}

.checkbox input:checked + span::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--black);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

.pill-essential { background: rgba(253,128,46,0.14); color: var(--orange-dark); }
.pill-recommended { background: rgba(30,30,30,0.07); color: var(--black); }
.pill-done { background: rgba(46,164,79,0.12); color: #2ea44f; }
.pill-progress { background: rgba(253,128,46,0.14); color: var(--orange-dark); }
.pill-pending { background: rgba(30,30,30,0.06); color: var(--muted); }

/* CONFIGURAÇÃO DA WEBCAM */
.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.settings-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}

.settings-list li:last-child {
  border-bottom: none;
}

.settings-label {
  font-weight: 600;
  font-size: 14.5px;
}

.settings-value {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
}

/* RESPONSIVE */
@media (max-width: 860px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 18px 16px;
    flex-direction: column;
  }

  .logo {
    padding-bottom: 14px;
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }

  .nav-item {
    flex-shrink: 0;
  }

  .sidebar-bottom {
    display: none;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 24px 20px 12px;
  }

  .content {
    padding: 4px 20px 44px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .shop-list li, .task-list li {
    flex-wrap: wrap;
  }
}
