/* Painel admin - hub Degust */

.admin-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.admin-header .wordmark { margin: 0; }
.admin-header .wordmark img { height: 32px; }
.admin-header .title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}
.admin-header .title-block .subtitle {
  font-size: 13px;
  color: var(--text-muted);
}
.admin-header .actions { display: flex; gap: 8px; }

.admin-main {
  flex: 1;
  padding: 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-main { grid-template-columns: 1fr; }
}

.sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  position: sticky;
  top: 24px;
}
.sidebar h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 4px 4px 12px;
  font-weight: 600;
}

.form-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.form-item {
  position: relative;
  padding: 10px 12px 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.form-item:hover { background: var(--bg-card); }
.form-item.active {
  background: var(--bg-card);
  border-color: var(--line);
}
.form-item.active::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--grad);
  border-radius: 3px;
}
.form-item .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.form-item .meta {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.empty-list {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

.content {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  min-height: 400px;
  box-shadow: var(--shadow-card);
}
@media (min-width: 640px) { .content { padding: 32px; } }

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.content-title h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.content-title p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}
.content-header .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.public-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-card);
  border-radius: 8px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.responses-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
}
.responses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.responses-table th,
.responses-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.responses-table tbody tr { transition: background 0.1s; }
.responses-table th {
  background: var(--bg-card);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.responses-table tr:hover td { background: var(--bg-color); }
.responses-table td.cell-id { color: var(--text-light); font-family: monospace; }
.responses-table td.cell-date { white-space: nowrap; color: var(--text-muted); }
.cell-truncate {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state h3 { margin: 0 0 8px; font-size: 18px; color: var(--text-main); }
.empty-state p { margin: 0; font-size: 14px; }

/* Dashboard de forms ativos */
.dashboard-header {
  margin-bottom: 24px;
}
.dashboard-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.dashboard-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.form-card {
  position: relative;
  background: var(--bg-color);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.15s;
}
.form-card:hover {
  border-color: var(--text-main);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.06);
}
.form-card:hover::before { opacity: 1; }

.form-card .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.form-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.form-card .badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.form-card .badge.has-data {
  background: var(--grad);
  color: #fff;
}
.form-card .description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.form-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-light);
}
.form-card .slug-tag {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
}
.form-card .updated {
  font-size: 11px;
}

/* Login */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-card);
}
.login-card .wordmark { margin-bottom: 24px; }
.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}
.login-card .lead { font-size: 14px; margin-bottom: 24px; }
.login-card label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.login-card input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  background: var(--bg-color);
  margin-bottom: 16px;
}
.login-card input:focus {
  outline: none;
  border-color: var(--text-main);
  background: white;
}
.login-card .btn-primary {
  width: 100%;
}

.detail-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.detail-modal {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 32px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}
.detail-modal h3 {
  margin: 0 0 24px;
  padding-bottom: 16px;
  font-size: 20px;
  border-bottom: 2px solid;
  border-image: var(--grad) 1;
}
.detail-modal dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .detail-modal dl {
    grid-template-columns: 180px 1fr;
    align-items: baseline;
    gap: 12px 24px;
  }
  .detail-modal dt { margin-bottom: 0; }
}
.detail-modal dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.detail-modal dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}
.detail-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
