/* V8 ADMIN — Universal | Layout */

body {
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: inherit; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

/* ---------------------------------------------------------------- */
/* App shell                                                        */
/* ---------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(79, 107, 255, 0.55));
}

.sidebar-brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.sidebar-footer {
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main {
  padding: 28px 32px 60px;
  max-width: 1100px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}

.page-header h1 {
  font-size: 21px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------------------------------------------------------------- */
/* Botões                                                            */
/* ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

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

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-ghost:hover { background: var(--bg-elevated); }

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
}
.icon-btn:hover { background: var(--bg-elevated); color: var(--text-main); }

/* ---------------------------------------------------------------- */
/* Cards / Stats                                                     */
/* ---------------------------------------------------------------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.stat-card .label {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 4px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text-main);
}

/* ---------------------------------------------------------------- */
/* Tabelas                                                           */
/* ---------------------------------------------------------------- */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}

tr:last-child td { border-bottom: none; }

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state strong { display: block; color: var(--text-main); margin-bottom: 4px; }

/* ---------------------------------------------------------------- */
/* Badges                                                            */
/* ---------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-muted { background: var(--bg-elevated); color: var(--text-muted); }

/* ---------------------------------------------------------------- */
/* Formulários                                                       */
/* ---------------------------------------------------------------- */

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 13.5px;
  font-family: var(--font-body);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

.field {
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-section {
  margin-bottom: 26px;
}

.form-section h3 {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--text-main);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.checkbox-row input { width: auto; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 12px;
}

/* ---------------------------------------------------------------- */
/* Tabs (dentro da tela de Projetos)                                 */
/* ---------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------------------------------------------------------------- */
/* Modal                                                             */
/* ---------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h2 { font-size: 17px; }

/* ---------------------------------------------------------------- */
/* Toast                                                             */
/* ---------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.2s ease;
}

.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- */
/* Client link / snippet box                                         */
/* ---------------------------------------------------------------- */

.snippet-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  gap: 10px;
}
.link-row:last-child { border-bottom: none; }
.link-row .meta { font-size: 12px; color: var(--text-muted); }

/* ---------------------------------------------------------------- */
/* Auth pages (login.html / editar.html)                             */
/* ---------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, rgba(79, 107, 255, 0.12), transparent 55%), var(--bg-page);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(79, 107, 255, 0.5));
}

.auth-card h1 {
  text-align: center;
  font-size: 18px;
  margin-bottom: 4px;
}

.auth-card p.sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 22px;
}

.auth-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 16px;
}

.client-edit-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.client-edit-page .brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.client-edit-page .brand-row img {
  width: 32px; height: 32px; object-fit: contain;
}

/* ---------------------------------------------------------------- */
/* Preview ao vivo (contato/redes no rodapé simulado)                 */
/* ---------------------------------------------------------------- */

.live-preview {
  background: #05070c;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 8px;
}

.live-preview .preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.preview-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 12px;
  border: 1px solid var(--border);
}

/* ---------------------------------------------------------------- */
/* Responsivo                                                        */
/* ---------------------------------------------------------------- */

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .sidebar-brand { border-bottom: none; padding-bottom: 8px; margin-bottom: 0; }
  .nav { flex-direction: row; }
  .sidebar-footer { display: none; }
  .main { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
}
/* ---------------------------------------------------------------- */
/* Login (variante com classes .login-*)                             */
/* Cole isto no final do css/style.css                               */
/* ---------------------------------------------------------------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, rgba(79, 107, 255, 0.12), transparent 55%), var(--bg-page);
  padding: 20px;
}

.login-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(79, 107, 255, 0.5));
}

.login-brand h1 {
  font-size: 16px;
  margin: 0 0 2px;
}

.login-brand p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.login-header {
  margin-bottom: 22px;
}

.login-header h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 12.5px;
}

.login-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--text-faint);
}
