/* ===== ADMIN PANEL STYLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0B0B0B;
  --black-2: #111111;
  --black-3: #161616;
  --black-4: #1C1C1C;
  --orange: #D65A1F;
  --orange-dark: #b84c18;
  --white: #FFFFFF;
  --grey: #888888;
  --grey-light: #CCCCCC;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --sidebar-w: 240px;
}

html, body { height: 100%; }

body {
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { border: none; cursor: pointer; background: none; font-family: inherit; color: inherit; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn--primary { background: var(--orange); color: var(--white); }
.btn--primary:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn--primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--outline { background: transparent; color: var(--white); border: 1.5px solid var(--border); }
.btn--outline:hover { border-color: var(--orange); color: var(--orange); }
.btn--ghost { background: transparent; color: var(--grey); }
.btn--ghost:hover { color: var(--white); }
.btn--sm { padding: 8px 16px; font-size: 0.8rem; }
.btn--danger { background: rgba(220,38,38,0.15); color: #f87171; border: 1px solid rgba(220,38,38,0.25); }
.btn--danger:hover { background: rgba(220,38,38,0.25); }

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--black);
  background-image: radial-gradient(circle at 20% 50%, rgba(214,90,31,0.06) 0%, transparent 60%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
}

.login-logo { margin-bottom: 28px; }
.login-logo img { height: 48px; margin: 0 auto; }

.login-box h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.login-box > p {
  color: var(--grey);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

#login-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--grey-light); letter-spacing: 0.04em; }
.field input {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.field input:focus { border-color: var(--orange); }
.field input::placeholder { color: rgba(255,255,255,0.2); }

.error-msg {
  font-size: 0.82rem;
  color: #f87171;
  min-height: 18px;
  text-align: center;
}

#login-form .btn { width: 100%; justify-content: center; padding: 14px; font-size: 0.95rem; }

.back-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--grey);
  transition: color var(--transition);
}
.back-link:hover { color: var(--orange); }

/* ===== ADMIN LAYOUT ===== */
.admin-panel {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--black-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 8px;
  overflow-y: auto;
}

.sidebar__logo {
  padding: 8px 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar__logo img { height: 36px; }

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

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--grey);
  transition: var(--transition);
  cursor: pointer;
}
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__link:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.sidebar__link.active { background: rgba(214,90,31,0.12); color: var(--orange); }

.sidebar__bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar__bottom .btn { width: 100%; justify-content: center; }

/* ---- Main ---- */
.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--black);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.admin-topbar h2 { font-size: 1.4rem; font-weight: 800; }
.admin-topbar p { color: var(--grey); font-size: 0.88rem; margin-top: 4px; }

/* ---- Cards ---- */
.card {
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card h3 { font-size: 1rem; font-weight: 700; }
.card > p { color: var(--grey); font-size: 0.88rem; }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.card-header h3 { font-size: 1rem; font-weight: 700; }
.card-header p { color: var(--grey); font-size: 0.85rem; margin-top: 4px; }

/* ---- Tab Content ---- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Preview Box ---- */
.preview-box {
  width: 100%;
  aspect-ratio: 16/7;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--black-2);
  position: relative;
}
.preview-box img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.preview-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey);
  font-size: 0.88rem;
}

/* ---- Upload Area ---- */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--orange);
  background: rgba(214,90,31,0.05);
}
.upload-area svg { width: 36px; height: 36px; color: var(--grey); }
.upload-area p { font-size: 0.9rem; color: var(--grey-light); }
.upload-area small { font-size: 0.78rem; color: var(--grey); }
.link-text { color: var(--orange); cursor: pointer; }

/* ---- Projects Admin Grid ---- */
.projects-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.project-slot {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
}

.project-slot__img {
  width: 100%; height: 70%;
  object-fit: cover;
  display: block;
}

.project-slot__placeholder {
  width: 100%; height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black-4);
  cursor: pointer;
  transition: background var(--transition);
}
.project-slot__placeholder:hover { background: rgba(214,90,31,0.07); }
.project-slot__placeholder svg { width: 32px; height: 32px; color: var(--grey); opacity: 0.35; }

.project-slot__info {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-slot__label {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--white);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 2px 4px;
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}
.project-slot__label::placeholder { color: var(--grey); }
.project-slot__label:focus { border-bottom-color: var(--orange); }

.project-slot__actions {
  display: flex;
  gap: 4px;
}
.slot-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  color: var(--grey);
}
.slot-btn:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.slot-btn.delete:hover { background: rgba(220,38,38,0.15); color: #f87171; }
.slot-btn svg { width: 14px; height: 14px; }

.add-slot {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--grey);
  font-size: 0.82rem;
}
.add-slot:hover { border-color: var(--orange); color: var(--orange); background: rgba(214,90,31,0.04); }
.add-slot svg { width: 28px; height: 28px; }

/* ---- Action Row ---- */
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Status Message ---- */
.status-msg {
  font-size: 0.83rem;
  min-height: 20px;
  transition: var(--transition);
}
.status-msg.success { color: #4ade80; }
.status-msg.error { color: #f87171; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .admin-panel { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: unset;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar__logo { display: none; }
  .sidebar__nav { flex-direction: row; gap: 4px; flex: unset; }
  .sidebar__bottom { flex-direction: row; border-top: none; padding-top: 0; margin-left: auto; }
  .admin-main { padding: 20px 16px; }
}

/* ===== NEW ADMIN ADDITIONS ===== */

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card__icon svg { width: 22px; height: 22px; }
.stat-card__icon.orange { background: rgba(214,90,31,0.15); color: var(--orange); }
.stat-card__icon.green  { background: rgba(37,211,102,0.12); color: #25D366; }
.stat-card__icon.blue   { background: rgba(59,130,246,0.12); color: #60a5fa; }
.stat-card__icon.purple { background: rgba(168,85,247,0.12); color: #c084fc; }
.stat-card p { font-size: 0.78rem; color: var(--grey); margin-bottom: 4px; }
.stat-card h3 { font-size: 1.8rem; font-weight: 800; line-height: 1; }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--grey-light);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: inherit;
}
.quick-btn:hover { border-color: var(--orange); color: var(--orange); background: rgba(214,90,31,0.05); }

/* Chart */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  margin-top: 16px;
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar-val { font-size: 0.7rem; color: var(--grey); }
.chart-bar {
  width: 100%;
  background: var(--orange);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
  opacity: 0.85;
}
.chart-bar-label { font-size: 0.65rem; color: var(--grey); white-space: nowrap; }

/* Section bars */
.section-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.section-bar-row:last-child { border-bottom: none; }
.section-bar-label { width: 80px; font-size: 0.82rem; color: var(--grey-light); flex-shrink: 0; }
.section-bar-track { flex: 1; background: var(--black-2); border-radius: 4px; height: 8px; overflow: hidden; }
.section-bar-fill { height: 100%; background: var(--orange); border-radius: 4px; transition: width 0.5s ease; }
.section-bar-val { width: 32px; text-align: right; font-size: 0.78rem; color: var(--grey); }

/* Text Fields */
.text-group { margin-bottom: 28px; }
.text-group__header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.text-field-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.text-field-row:last-child { border-bottom: none; }
.text-field-label { font-size: 0.82rem; font-weight: 600; color: var(--grey-light); padding-top: 4px; }
.text-field-inputs { display: flex; flex-direction: column; gap: 8px; }
.text-field-lang { display: flex; align-items: flex-start; gap: 8px; }
.lang-badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  background: rgba(255,255,255,0.08); border-radius: 4px;
  padding: 3px 6px; color: var(--grey); margin-top: 4px; flex-shrink: 0;
}
.lang-badge.pt { background: rgba(214,90,31,0.15); color: var(--orange); }
.text-field-input {
  flex: 1;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: inherit; font-size: 0.88rem;
  padding: 8px 12px; outline: none; width: 100%;
  transition: border-color var(--transition);
}
.text-field-input:focus { border-color: var(--orange); }
textarea.text-field-input { resize: vertical; min-height: 72px; }

/* Instagram Admin */
.ig-admin-list { display: flex; flex-direction: column; gap: 12px; }
.ig-admin-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.ig-admin-thumb {
  width: 72px; height: 72px;
  min-width: 72px;
  border-radius: var(--radius-sm);
  background: var(--black-4);
  border: 1px dashed var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition);
}
.ig-admin-thumb:hover { border-color: var(--orange); }
.ig-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ig-admin-fields { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ig-admin-fields .field label { font-size: 0.72rem; font-weight: 600; color: var(--grey); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 4px; }
.ig-admin-fields input {
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: inherit; font-size: 0.82rem;
  padding: 7px 10px; outline: none; width: 100%;
  transition: border-color var(--transition);
}
.ig-admin-fields input:focus { border-color: var(--orange); }
.ig-del-btn {
  margin-top: 4px;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Help list */
.help-list {
  padding-left: 20px;
  color: var(--grey);
  font-size: 0.88rem;
  line-height: 1.8;
}
.help-list li { margin-bottom: 4px; }

/* Responsive text fields */
@media (max-width: 700px) {
  .text-field-row { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .chart-bars { height: 80px; }
}
