/* DojoCheck (c) 2026 GADPM0. Todos os direitos reservados. Uso sujeito a licenca proprietaria. */
* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --label: #cbd5e1;
  --border: #334155;
  --border-soft: #1e293b;
  --input-bg: #0f172a;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --danger: #dc2626;
  --warning: #fbbf24;
  --overlay: rgba(2, 6, 23, 0.82);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --label: #334155;
    --border: #cbd5e1;
    --border-soft: #e2e8f0;
    --input-bg: #ffffff;
    --warning: #b45309;
    --overlay: rgba(15, 23, 42, 0.45);
  }
}

body.dc-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  accent-color: var(--accent);
}

.hidden {
  display: none !important;
}

.dc-screen {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 96px;
}

.dc-header-logo {
  display: block;
  max-width: 64px;
  max-height: 64px;
  border-radius: 12px;
  margin-bottom: 0;
  object-fit: contain;
  flex-shrink: 0;
}

.dc-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dc-topbar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dc-btn-spaced {
  margin-top: 12px;
}

.dc-label-spaced {
  display: block;
  margin-top: 14px;
}

.dc-student-photo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
  flex: 0 0 auto;
  background: var(--surface-2);
}

.dc-photo-preview img,
#studentFacePreview,
#academyLogoPreview {
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
}

.dc-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.dc-card h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.dc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.dc-card-header h2 {
  margin: 0;
}

.dc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.dc-brand h1 {
  margin: 0;
  font-size: 22px;
}

.dc-logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dc-muted {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0 0;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--label);
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
}

.dc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.dc-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.dc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin: 0;
}

.dc-btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.dc-btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.dc-btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.dc-btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.dc-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--warning);
  min-height: 18px;
}

.dc-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dc-topbar h1 {
  margin: 0;
  font-size: 20px;
}

.dc-date-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-date-box label {
  margin: 0;
}

.dc-date-box input[type="date"] {
  width: auto;
  padding: 6px 8px;
}

.dc-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.dc-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.dc-tab {
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.dc-tab.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.dc-panel {
  display: none;
}

.dc-panel.active {
  display: block;
}

.dc-photo-preview {
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.dc-photo-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: var(--input-bg);
}

#studentFacePreview {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

.dc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}

.dc-student-item {
  flex-direction: column;
  align-items: stretch;
}

.dc-student-info {
  flex: 1 1 auto;
  min-width: 0;
}

.dc-student-details {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dc-student-name {
  display: block;
}

.dc-student-cpf,
.dc-student-phone {
  display: block;
}

.dc-student-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}

.dc-plan-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 14px;
}

.dc-plan-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-height: 92px;
}

.dc-plan-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.dc-plan-option span {
  color: var(--muted);
  font-size: 12px;
}

.dc-plan-option em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
  margin-top: auto;
}

@media (max-width: 480px) {
  .dc-plan-options {
    grid-template-columns: 1fr;
  }
  .dc-plan-options-compact {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dc-plan-options-compact {
  grid-template-columns: repeat(2, 1fr);
}

.dc-plan-option-small {
  min-height: 58px;
  padding: 8px;
}

.dc-plan-option-small strong {
  font-size: 14px;
}

.dc-btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.dc-history-item {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.dc-history-info {
  min-width: 140px;
  flex: 1 1 160px;
}

.dc-history-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  align-items: flex-start;
}

.dc-history-seq {
  background: #1e3a8a;
  color: #dbeafe;
  border: 1px solid #2563eb;
}

@media (prefers-color-scheme: light) {
  .dc-history-seq {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #93c5fd;
  }

  .dc-card {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  }

  .dc-item {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }

  .dc-topbar {
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 8px;
  }
}

.dc-history-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: stretch;
  align-items: stretch;
  width: 100%;
  margin-top: 4px;
}

.dc-history-actions .dc-btn {
  min-height: 42px;
  flex: 0 0 auto;
  width: 100%;
}

@media (max-width: 480px) {
  .dc-history-actions {
    justify-content: stretch;
  }
  .dc-history-actions .dc-btn {
    width: 100%;
  }
}

.dc-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.dc-modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.dc-modal-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.dc-modal-card p {
  margin: 0 0 14px 0;
  font-size: 14px;
  color: var(--muted);
}

.dc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.dc-pix-card { max-width: 420px; }
.dc-pix-qr { display:flex; justify-content:center; margin:12px 0; }
.dc-pix-qr img { max-width:240px; border-radius:8px; }
#pixCodeText { width:100%; box-sizing:border-box; }

#pixModalOverlay { z-index: 9998; }

.dc-whatsapp-fab {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  right: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 24px;
  background: #25d366;
  color: #052e16;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0.92;
}

.dc-whatsapp-fab:active { opacity: 1; }

#msgTemplateInput {
  min-height: 96px;
  resize: vertical;
}

.dc-msg-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dc-msg-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dc-msg-name {
  font-weight: 700;
  min-width: 0;
}

.dc-msg-meta {
  display: block;
}

.dc-msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.dc-msg-checked {
  border-color: #16a34a;
  color: #15803d;
}

@media (prefers-color-scheme: dark) {
  .dc-msg-checked {
    color: #86efac;
  }
}
