/* =========================================================
   GMB Form Pro — admin.css
   Admin dashboard com design Apple HIG (como o formulário)
   ========================================================= */

/* ── Body ───────────────────────────────────────────────── */
* { cursor: default !important; }
body {
  overflow: hidden;
  cursor: default;
  background: var(--bg);
}

button, a, [role="button"], input[type="submit"], input[type="button"], input[type="reset"], .filter-btn, .btn-preview-site, .btn-logout, .btn-login {
  cursor: pointer !important;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: var(--font);
  cursor: text !important;
}

/* ── Login Screen ───────────────────────────────────────── */
#loginScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

#loginScreen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(244,82,30,0.06) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(0,122,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--glass-shadow);
  position: relative;
  z-index: 1;
}

.login-card__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.login-card__logo svg {
  width: 32px;
  height: 32px;
}

.login-card__logo svg rect { fill: var(--accent); }

.login-card__title {
  font-size: var(--text-headline);
  font-weight: 600;
  color: var(--label-primary);
  text-align: center;
}

.login-card__subtitle {
  font-size: var(--text-footnote);
  color: var(--label-secondary);
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field label {
  font-size: var(--text-caption1);
  font-weight: 500;
  color: var(--label-secondary);
}

.field input {
  font-family: var(--font);
  font-size: var(--text-body);
  background: var(--bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  color: var(--label-primary);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s var(--ease-inout), background 0.2s var(--ease-inout);
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.field input::placeholder {
  color: var(--label-tertiary);
}

.btn-login {
  background: var(--accent);
  color: white;
  font-size: var(--text-body);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  width: 100%;
  transition: background 0.2s var(--ease-inout), box-shadow 0.2s var(--ease-inout);
  box-shadow: 0 2px 8px rgba(244,82,30,0.2);
}

.btn-login:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(244,82,30,0.3);
}

.btn-login:active {
  transform: scale(0.98);
}

.btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.login-error {
  font-size: var(--text-footnote);
  color: var(--error);
  text-align: center;
  min-height: 1.2em;
}

/* ── Dashboard ───────────────────────────────────────────── */
#dashboard {
  display: none;
  height: 100dvh;
  flex-direction: row;
}

#dashboard.visible { display: flex; }

/* Sidebar */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 1.5rem;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
}

.sidebar__brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar__brand-name {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.2;
}

.sidebar__brand-subtitle {
  font-size: var(--text-caption1);
  color: var(--label-secondary);
  font-weight: 500;
}

.sidebar__section-label {
  font-size: var(--text-caption2);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-tertiary);
  padding: 0 0.5rem;
}

.sidebar__search {
  position: relative;
}

.sidebar__search input {
  font-family: var(--font);
  font-size: var(--text-footnote);
  background: var(--bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  color: var(--label-primary);
  padding: 0.5rem 0.75rem 0.5rem 2.1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s var(--ease-inout);
}

.sidebar__search input:focus {
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.sidebar__search input::placeholder { color: var(--label-tertiary); }

.sidebar__search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--label-tertiary);
  pointer-events: none;
}

.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-btn {
  width: 100%;
  text-align: left;
  font-size: var(--text-subhead);
  font-weight: 500;
  color: var(--label-secondary);
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease-inout);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}

.filter-btn:hover {
  background: var(--label-quaternary);
  color: var(--label-primary);
}

.filter-btn.active {
  background: rgba(244,82,30,0.1);
  color: var(--accent);
  font-weight: 600;
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-dot--all     { background: var(--label-tertiary); }
.filter-dot--novo    { background: var(--accent); }
.filter-dot--revisado { background: var(--sys-blue); }
.filter-dot--concluido { background: var(--success); }

.sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-preview-site,
.btn-logout {
  width: 100%;
  text-align: left;
  font-size: var(--text-footnote);
  font-weight: 500;
  color: var(--label-secondary);
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.2s var(--ease-inout);
  cursor: pointer;
}

.btn-preview-site:hover {
  color: var(--accent);
  background: rgba(244,82,30,0.08);
}

.btn-logout:hover {
  color: var(--error);
  background: rgba(239,68,68,0.08);
}

/* Main */
.main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.main__header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--separator);
  flex-shrink: 0;
  background: var(--bg);
}

.main__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.main__title {
  font-size: var(--text-title2);
  font-weight: 700;
  color: var(--label-primary);
}

.main__meta {
  font-size: var(--text-footnote);
  color: var(--label-secondary);
  margin-top: 0.25rem;
}

.google-badge-admin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  font-size: var(--text-footnote);
  font-weight: 600;
  color: var(--label-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.google-badge-admin svg {
  width: 16px;
  height: 16px;
}

/* Submissions list */
#submissionsList {
  padding: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submission-item {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: all 0.2s var(--ease-inout);
  cursor: pointer;
}

.submission-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(244,82,30,0.1);
  background: var(--bg);
}

.submission-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.submission-item-name {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--label-primary);
}

.submission-item-date {
  font-size: var(--text-caption1);
  color: var(--label-secondary);
}

.submission-item-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: var(--text-caption1);
  font-weight: 600;
}

.submission-item-status--novo {
  background: rgba(244,82,30,0.1);
  color: var(--accent);
}

.submission-item-status--revisado {
  background: rgba(0,122,255,0.1);
  color: var(--sys-blue);
}

.submission-item-status--concluido {
  background: rgba(52,199,89,0.1);
  color: var(--success);
}

/* ── Detail overlay ────────────────────────────────────────── */
#detailOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 100;
}

#detailOverlay.visible { display: flex; }

.detail-panel {
  width: min(600px, 100vw);
  height: 100dvh;
  background: var(--bg);
  border-left: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
}

.detail-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--separator);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-shrink: 0;
}

.detail-header__info { flex: 1; min-width: 0; }

.detail-header__id {
  font-size: var(--text-caption1);
  color: var(--label-secondary);
  font-family: monospace;
  margin-bottom: 0.25rem;
}

.detail-header__name {
  font-size: var(--text-title3);
  font-weight: 700;
  color: var(--label-primary);
}

.detail-header__date {
  font-size: var(--text-footnote);
  color: var(--label-secondary);
  margin-top: 0.25rem;
}

.detail-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.status-select {
  font-family: var(--font);
  font-size: var(--text-footnote);
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  color: var(--label-primary);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s var(--ease-inout);
}

.status-select:focus { border-color: var(--accent); }

.btn-close-detail {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--label-secondary);
  transition: all 0.2s var(--ease-inout);
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  border: none;
}

.btn-close-detail:hover {
  background: var(--label-quaternary);
  color: var(--label-primary);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Collapsible section */
.collapse-section {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.collapse-trigger {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  color: var(--label-primary);
  font-size: var(--text-body);
  font-weight: 600;
  transition: background 0.2s var(--ease-inout);
  border: none;
  background: none;
  cursor: pointer;
}

.collapse-trigger:hover { background: var(--label-quaternary); }

.collapse-trigger svg {
  transition: transform 0.2s var(--ease-inout);
  flex-shrink: 0;
  color: var(--label-secondary);
}

.collapse-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.collapse-content {
  display: none;
  padding: 0 1rem 1rem;
}

.collapse-content.open { display: block; }

/* Form data table */
.form-table {
  width: 100%;
  border-collapse: collapse;
}

.form-table tr + tr td {
  border-top: 1px solid var(--separator);
}

.form-table td {
  padding: 0.5rem 0;
  vertical-align: top;
  font-size: var(--text-footnote);
}

.form-table td:first-child {
  color: var(--label-secondary);
  width: 38%;
  padding-right: 0.75rem;
  padding-top: 0.6rem;
  font-weight: 500;
}

.form-table td:last-child {
  color: var(--label-primary);
  word-break: break-word;
}

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.625rem;
}

.media-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  position: relative;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--label-secondary);
  font-size: var(--text-caption2);
  text-decoration: none;
  padding: 0.5rem;
  text-align: center;
  transition: all 0.2s var(--ease-inout);
}

.media-thumb a:hover {
  color: var(--accent);
  background: var(--label-quaternary);
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--label-quaternary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
