/* ══════════════════════════════════════════════════════════
   ProjetoAssets — Admin Design System v3.1
   Neon glow · flat color · sem outline preto
   ══════════════════════════════════════════════════════════ */

:root {
  --green:       #52a81b;
  --green-glow:  #6bd425;
  --green-light: #edf7e2;
  --yellow:      #ffd600;
  --purple:      #7c3aed;
  --dark:        #0d1117;
  --navy-mid:    #161d2b;
  --white:       #ffffff;
  --light:       #f0f8e8;
  --light-mid:   #e4f0d0;
  --border:      #c8dea8;
  --text:        #1a2332;
  --text-muted:  #526040;

  --glow:        0 0 0 1.5px rgba(82,168,27,.16), 0 6px 24px rgba(82,168,27,.08);
  --glow-hover:  0 0 0 2px rgba(107,212,37,.4), 0 10px 30px rgba(82,168,27,.18);

  --font-head:   'Fredoka', sans-serif;
  --font-pixel:  'Press Start 2P', monospace;
  --font-body:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --r-pill: 9999px;
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--light);
  font-size: 15px;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--green); }

/* ─── Layout ──────────────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

/* ─── Sidebar ─────────────────────────────────────────────── */
.admin-sidebar {
  width: 230px;
  background: var(--dark);
  border-right: 3px solid var(--green);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 2rem;
  padding: .5rem .75rem;
}

.sidebar-brand i { color: var(--green-glow); }

.brand-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--green-glow);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--green-glow), 0 0 18px rgba(107,212,37,.4);
  vertical-align: middle;
  animation: ledBlink 1.8s step-end infinite;
}

@keyframes ledBlink {
  0%, 100% { opacity: 1; }
  52%       { opacity: 0; }
}

.sidebar-section-label {
  font-family: var(--font-pixel);
  font-size: .48rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.42);
  padding: 0 .75rem;
  margin-bottom: .4rem;
  margin-top: 1.25rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.78);
  font-size: .875rem;
  font-weight: 500;
  transition: background .12s, color .12s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(107,212,37,.08);
  color: var(--green-glow);
}

.sidebar-nav a i { width: 16px; text-align: center; font-size: .9rem; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  padding: .5rem .75rem;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}

.sidebar-footer a:hover { background: rgba(220,38,38,.1); color: #f87171; }

/* ─── Main content ────────────────────────────────────────── */
.admin-main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-x: hidden;
  min-width: 0; /* impede que tabelas largas estourem o flex item */
}

/* ─── Topbar mobile + sidebar em gaveta ───────────────────── */
.admin-topbar { display: none; }

@media (max-width: 860px) {
  .admin-topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--dark);
    padding: .85rem 1.1rem;
    border-bottom: 3px solid var(--green);
    position: sticky;
    top: 0;
    z-index: 250;
  }

  .admin-menu-toggle {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: .2rem .4rem;
    flex-shrink: 0;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 300;
    box-shadow: 12px 0 32px rgba(0,0,0,.4);
  }

  .admin-sidebar.open { transform: translateX(0); }

  .admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 290;
  }

  .admin-sidebar-overlay.active { display: block; }

  .admin-main { padding: 1.25rem 1rem; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .dash-grid { grid-template-columns: 1fr; }
}

/* ─── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.page-title i { color: var(--green); }

/* ─── Stat cards ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--glow);
  border: 1.5px solid rgba(82,168,27,.12);
  position: relative;
  overflow: hidden;
  transition: box-shadow .18s;
}

.stat-card:hover { box-shadow: var(--glow-hover); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--green-glow));
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.green  { background: var(--green-light); color: var(--green); }
.stat-icon.purple { background: #ede9ff; color: var(--purple); }
.stat-icon.orange { background: #fff8e1; color: #e65100; }

.stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-body);
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: .25rem;
}

/* ─── Admin card ──────────────────────────────────────────── */
.admin-card {
  background: var(--white);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--glow);
  border: 1.5px solid rgba(82,168,27,.1);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.5rem;
  border-bottom: 1.5px solid rgba(82,168,27,.12);
  background: var(--dark);
}

.admin-card-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.admin-card-title i { color: var(--green-glow); }

/* ─── Smart table: toolbar, sort, paginação ──────────────── */
.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1.5rem;
  background: var(--white);
  border-bottom: 1.5px solid var(--light-mid);
  flex-wrap: wrap;
}

.st-search-wrap { position: relative; flex: 1; max-width: 340px; min-width: 180px; }
.st-search-wrap > i {
  position: absolute; left: .7rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: .9rem; pointer-events: none;
}
.st-search {
  width: 100%;
  padding: .5rem .75rem .5rem 2.1rem;
  font-family: var(--font-body); font-size: .85rem;
  color: var(--text); background: var(--white);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.st-search:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(82,168,27,.14);
}

.table-scroll { overflow-x: auto; }

th.st-sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .12s; }
th.st-sortable:hover { color: var(--green); }
th.st-sortable .st-arrow { font-size: .78em; opacity: .35; margin-left: .1rem; vertical-align: -1px; }
th.st-sortable.st-asc  .st-arrow,
th.st-sortable.st-desc .st-arrow { opacity: 1; color: var(--green); }

.st-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; flex-wrap: wrap;
  padding: .7rem 1.5rem;
  border-top: 1.5px solid var(--light-mid);
  background: var(--white);
}
.st-info { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.st-pager { display: flex; align-items: center; gap: .25rem; }
.st-page-btn {
  min-width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 .5rem;
  font-family: var(--font-body); font-size: .82rem; font-weight: 600;
  color: var(--text-muted); background: var(--white);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; transition: all .12s;
}
.st-page-btn:hover:not(:disabled):not(.active) { border-color: var(--green); color: var(--green); }
.st-page-btn.active { background: var(--green); border-color: var(--green); color: var(--dark); }
.st-page-btn:disabled { opacity: .4; cursor: default; }
.st-dots { padding: 0 .25rem; color: var(--text-muted); font-size: .82rem; }

/* ─── Grid de widgets (2 colunas → 1 no mobile) ──────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; } }

.mini-list { list-style: none; }
.mini-list li {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem;
  border-bottom: 1.5px dashed var(--light-mid);
  font-size: .85rem;
}
.mini-list li:last-child { border-bottom: none; }
.mini-list .mini-main { flex: 1; min-width: 0; }
.mini-list .mini-main strong { display: block; font-weight: 600; color: var(--dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .mini-sub { font-size: .73rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .mini-meta { flex-shrink: 0; text-align: right; font-size: .73rem; color: var(--text-muted); }

.card-link {
  display: block; text-align: center;
  padding: .7rem; font-size: .8rem; font-weight: 600;
  color: var(--green); background: var(--white);
  border-top: 1.5px solid var(--light-mid);
}
.card-link:hover { background: var(--green-light); color: var(--green); }

/* ─── Table ───────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: .75rem 1.5rem;
  text-align: left;
  background: var(--light);
  border-bottom: 1.5px solid var(--light-mid);
}

.data-table td {
  padding: .85rem 1.5rem;
  border-bottom: 1.5px dashed var(--light-mid);
  font-size: .875rem;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--green-light); }

.asset-row-thumb {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  object-fit: cover;
}

.asset-row-placeholder {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: var(--light-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
  font-size: 1.2rem;
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .25rem .6rem;
  border-radius: var(--r-pill);
}

.badge-green  { background: var(--green-light); color: var(--green); }
.badge-purple { background: #ede9ff; color: var(--purple); }
.badge-gray   { background: var(--light-mid); color: var(--text-muted); }
.badge-orange { background: #fff8e1; color: #e65100; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 600;
  padding: .5rem 1.1rem;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--green);
  color: var(--dark);
}
.btn-primary:hover {
  background: var(--green-glow);
  color: var(--dark);
  box-shadow: 0 0 18px rgba(107,212,37,.4);
}

.btn-secondary {
  background: var(--purple);
  color: var(--white);
}
.btn-secondary:hover {
  background: #6a2fd4;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(124,58,237,.3);
}

.btn-outline {
  background: var(--white);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--green);
  color: var(--green);
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #fecaca;
}
.btn-danger:hover { background: #fef2f2; }

.btn-sm  { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg  { padding: .75rem 1.6rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ─── Forms ───────────────────────────────────────────────── */
.form-section {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--glow);
  border: 1.5px solid rgba(82,168,27,.1);
}

.form-section-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px dashed var(--light-mid);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.form-section-title i { color: var(--green); }

.form-row   { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-group { margin-bottom: .85rem; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: .35rem;
}

.form-control {
  display: block; width: 100%;
  padding: .6rem .85rem;
  font-family: var(--font-body); font-size: .875rem;
  color: var(--text); background: var(--white);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(82,168,27,.14);
}

.form-text { font-size: .73rem; color: var(--text-muted); margin-top: .25rem; }

/* ─── Toggle ──────────────────────────────────────────────── */
.toggle-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: .6rem 0;
  border-bottom: 1.5px dashed var(--light-mid);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: .875rem; font-weight: 500; color: var(--dark); }
.toggle-desc  { font-size: .75rem; color: var(--text-muted); }

.toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute; inset: 0;
  background: var(--light-mid);
  border-radius: 99px;
  cursor: pointer;
  transition: background .2s;
  border: 1.5px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 2px; top: 2px;
  background: var(--white);
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.toggle input:checked + .toggle-slider { background: var(--green); border-color: var(--green); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ─── Current file ────────────────────────────────────────── */
.current-file {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .32rem .75rem;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.current-file i { color: var(--green); }

/* ─── Thumb preview ───────────────────────────────────────── */
.thumb-preview {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--r-sm);
  margin-bottom: .5rem;
}

/* ─── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    0deg, transparent 0px, transparent 3px,
    rgba(0,0,0,.14) 3px, rgba(0,0,0,.14) 4px
  );
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(82,168,27,.1) 0%, transparent 70%);
  pointer-events: none;
}

.login-box {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 0 0 1.5px rgba(107,212,37,.25), 0 32px 80px rgba(13,17,23,.8);
  position: relative;
  z-index: 1;
}

.login-logo {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--dark);
  text-align: center;
  margin-bottom: .25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.login-logo i { color: var(--green); }

.login-sub {
  font-family: var(--font-pixel);
  font-size: .38rem;
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 2rem;
}

.alert-admin {
  padding: .65rem .9rem;
  border-radius: var(--r-sm);
  font-size: .83rem;
  margin-bottom: 1rem;
  background: #fef2f2;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
}

/* ─── Empty row ───────────────────────────────────────────── */
.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  font-size: .875rem;
}

/* ─── Type selector ───────────────────────────────────────── */
.type-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.type-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  padding: .6rem 1rem;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  transition: all .15s;
  flex: 1;
  min-width: 160px;
}

.type-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
}

.type-option input { accent-color: var(--green); }
.type-option i { font-size: 1rem; }

/* ─── Snippet editor ──────────────────────────────────────── */
.snippet-row {
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .9rem;
  margin-bottom: .75rem;
}

.snippet-row-header {
  display: flex;
  gap: .5rem;
  margin-bottom: .5rem;
  align-items: center;
}

.snippet-row-header .form-control { flex: 1; }
.snippet-row-header select { max-width: 150px; flex-shrink: 0; }
.snippet-row-header .btn { flex-shrink: 0; }
