

:root {
  
  --bg-canvas: #090a0e;
  --bg-surface: #10131a;
  --bg-surface-solid: #10131a;
  --bg-surface-elevated: #161a23;
  --bg-surface-hover: #1b202c;
  --bg-card: #11141c;
  --bg-card-hover: #161b26;
  --bg-input: #0b0d12;
  --bg-input-focus: #0f121a;

  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.2);
  --border-focus: #3b82f6;

  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-subtle: rgba(59, 130, 246, 0.1);
  --primary-border: rgba(59, 130, 246, 0.25);

  --accent-ai: #6366f1;
  --accent-ai-hover: #4f46e5;
  --accent-ai-subtle: rgba(99, 102, 241, 0.1);
  --accent-ai-border: rgba(99, 102, 241, 0.25);

  --accent-cyan: #06b6d4;
  --accent-cyan-subtle: rgba(6, 182, 212, 0.1);
  --accent-cyan-border: rgba(6, 182, 212, 0.25);

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.25);

  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.25);

  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.25);

  
  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #5b6577;
  --text-dim: #434c5a;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  
  --transition-fast: 0.12s ease-out;
  --transition-normal: 0.2s ease-out;
}


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  background-color: var(--bg-canvas);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}


.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}


.view {
  display: none;
  width: 100%;
}
.view.active {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}


#view-auth {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: transparent;
}
#view-auth.active {
  display: flex;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-card {
  width: 100%;
  padding: 2.25rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.logo-badge.sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  margin-bottom: 0;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 400;
}


.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.form-row-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 70px;
  gap: 0.5rem;
  width: 100%;
}

.field-ra, .field-digito, .field-uf {
  min-width: 0;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea,
.form-control {
  width: 100%;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.field-digito input,
.field-uf input {
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  padding-right: 2.5rem;
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.4rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}
.btn-toggle-pwd:hover {
  color: var(--text-main);
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
  user-select: none;
  font-family: inherit;
  line-height: 1.2;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.775rem;
}

.btn-icon-only {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: #ffc53d;
  border-color: #ffc53d;
  color: #100a05;
}
.btn-primary:hover:not(:disabled) {
  background: #ffb320;
  border-color: #ffb320;
}
.btn-primary:active:not(:disabled) {
  background: #f5a623;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--border-highlight);
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-ai {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
}
.btn-ai:hover:not(:disabled) {
  background: #4338ca;
  border-color: #818cf8;
}

.btn-danger {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.725rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--success);
  flex-shrink: 0;
}


#view-dashboard {
  min-height: 100vh;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 10, 14, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.775rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.user-meta {
  font-size: 0.675rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}


.dashboard-content {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-header-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-subtitle {
  font-size: 0.825rem;
  color: var(--text-secondary);
}


.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.tab-btn.active {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
}

.tab-badge {
  font-size: 0.675rem;
  padding: 0.08rem 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.tab-btn.active .tab-badge {
  background: var(--primary);
  color: #ffffff;
}

.search-box {
  position: relative;
  min-width: 250px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  padding-left: 2.1rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}


.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}


.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.task-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.task-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.task-badges-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge, .task-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.badge-indigo { background: var(--primary-subtle); color: #60a5fa; border: 1px solid var(--primary-border); }
.badge-violet, .badge-purple { background: var(--accent-ai-subtle); color: #a5b4fc; border: 1px solid var(--accent-ai-border); }
.badge-emerald, .badge-success { background: var(--success-subtle); color: #34d399; border: 1px solid var(--success-border); }
.badge-amber, .badge-warning { background: var(--warning-subtle); color: #fbbf24; border: 1px solid var(--warning-border); }
.badge-danger { background: var(--danger-subtle); color: #f87171; border: 1px solid var(--danger-border); }
.badge-cyan { background: var(--accent-cyan-subtle) !important; color: #22d3ee !important; border: 1px solid var(--accent-cyan-border) !important; }
.badge-neutral { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

.task-title, .task-card-title {
  font-size: 0.925rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-snippet {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.task-meta {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}


.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.75);
}

.modal-card.sm {
  max-width: 460px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}
.btn-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.task-info-banner {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}


.questions-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.question-card, .question-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-statement {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
}

.question-statement img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-xs);
  margin: 0.75rem 0;
  border: 1px solid var(--border-subtle);
}

.options-list, .options-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.option-item, .option-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-item:hover, .option-row:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
}

.option-item.selected {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 500;
}

.ai-answer-preview {
  margin-top: 0.5rem;
  padding: 0.75rem 0.85rem;
  background: var(--accent-ai-subtle);
  border-left: 2px solid var(--accent-ai);
  border-radius: var(--radius-xs);
  font-size: 0.825rem;
  color: #c7d2fe;
}


.essay-editor-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.label-with-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-counter {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.essay-textarea {
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
  font-size: 0.875rem;
}

.text-answer-input {
  width: 100%;
  min-height: 90px;
  margin-top: 0.5rem;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
  font-size: 0.875rem;
  box-sizing: border-box;
}


.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  flex-wrap: wrap;
}

.ai-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.775rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--success);
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.batch-status-card {
  padding: 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.card-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-section-desc {
  font-size: 0.775rem;
  color: var(--text-secondary);
  margin-top: -0.4rem;
}

.batch-header-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.batch-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.batch-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.775rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: var(--radius-xs);
  transition: width 0.25s ease-out;
}


.terminal-container {
  background: #06070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background: #0d0f14;
  padding: 0.4rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
  font-size: 0.675rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.terminal-body {
  padding: 0.65rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: #93c5fd;
  height: 170px;
  overflow-y: auto;
}

.log-line {
  margin-bottom: 0.2rem;
  word-break: break-word;
}
.log-line.text-muted {
  color: var(--text-muted);
}

.stat-label {
  font-size: 0.675rem;
  color: var(--text-muted);
}


.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem;
  gap: 1rem;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.85rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: var(--radius-full);
  animation: spin 0.55s linear infinite;
}
.spinner.lg {
  width: 32px;
  height: 32px;
  border-width: 2px;
  border-top-color: var(--primary);
}
.spinner.xs {
  width: 10px;
  height: 10px;
  border-width: 1.5px;
}
.task-batch-live-badge {
  gap: 0.3rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton-card {
  height: 160px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}
.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transform: translateX(-100%);
  animation: skeleton-sweep 1.6s infinite ease-out;
}

@keyframes skeleton-sweep {
  100% { transform: translateX(100%); }
}

.badge-loading {
  display: inline-block;
  min-width: 12px;
  text-align: center;
  opacity: 0.6;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
  color: var(--text-main);
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
.toast.warning { border-left: 3px solid var(--warning); }

@media (max-width: 640px) {
  .nav-container {
    padding: 0.65rem 1rem;
  }
  .dashboard-content {
    padding: 1rem 0.85rem;
  }
  .modal-overlay {
    padding: 0.5rem;
  }
  .modal-card {
    max-height: 94vh;
  }
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-actions {
    flex-direction: column;
    width: 100%;
  }
  .modal-actions .btn {
    width: 100%;
  }
}

.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.tasks-toolbar-left, .tasks-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tasks-select-all-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.task-card-header-left, .task-card-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.task-select-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.task-card.task-selected {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.tasks-batch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 197, 61, 0.08), rgba(255, 140, 59, 0.05));
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  box-shadow: 0 0 28px rgba(255, 197, 61, 0.07);
}

.batch-banner-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.batch-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.batch-banner-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.batch-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.batch-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffc53d, #ff8c3b);
  box-shadow: 0 0 10px rgba(255, 197, 61, 0.5);
  transition: width 0.3s ease;
}

.batch-banner-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.leiasp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.leiasp-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.stat-pill strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

.leiasp-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leiasp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.leiasp-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.leiasp-card:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.book-cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.leiasp-card:hover .book-cover-img {
  transform: scale(1.04);
}

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
}

.book-cover-overlay {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
}

.book-level-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #f1f5f9;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.quiz-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-xs);
}

.book-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.85rem 1rem 1rem;
}

.book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.book-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.3em;
}

.book-author {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: auto;
}
.book-meta strong {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.leiasp-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: banner-glow 3s infinite alternate ease-in-out;
}

@keyframes banner-glow {
  0% { border-color: rgba(16, 185, 129, 0.3); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
  100% { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15); }
}

.active-banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.active-banner-cover-wrapper {
  width: 48px;
  height: 64px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.active-banner-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.active-banner-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.active-banner-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 0.25rem;
}

.active-banner-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.active-banner-state {
  font-size: 0.75rem;
  font-weight: 600;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.active-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.active-banner-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.active-banner-progress-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.active-banner-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  transition: width 0.4s ease;
}

.active-banner-percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: #10b981;
  font-family: var(--font-mono);
  min-width: 36px;
}

.active-banner-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.active-banner-log-snippet {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.active-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.leiasp-card.reading-active {
  border-color: rgba(16, 185, 129, 0.7) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25) !important;
  position: relative;
}

.leiasp-card.reading-active::before {
  content: 'LENDO AGORA';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(16, 185, 129, 0.9);
  color: #022c22;
  font-weight: 800;
  font-size: 0.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  z-index: 5;
  animation: pulse-badge 2s infinite ease-in-out;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(0.96); }
}

@media (max-width: 768px) {
  .leiasp-active-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .active-banner-actions {
    justify-content: flex-end;
  }
}


html, body {
  overflow-x: clip;
}
body {
  -webkit-text-size-adjust: 100%;
}
body.modal-open {
  overflow: hidden;
}
#view-auth {
  min-height: 100vh;
  min-height: 100dvh;
}
img {
  max-width: 100%;
  height: auto;
}
button, .btn, .tab-btn, .option-row, .option-item,
label.checkbox-container, .tasks-select-all-label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.question-statement, .task-info-banner, .task-snippet, .book-info {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.question-statement table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.question-statement pre, .task-info-banner pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}
.question-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}
.info-banner {
  border-left: 2px solid var(--primary);
}
.option-row input[type="radio"], .option-row input[type="checkbox"],
.option-item input[type="radio"], .option-item input[type="checkbox"] {
  accent-color: var(--primary);
  flex-shrink: 0;
}
.option-row .option-text, .option-item .option-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.leiasp-progress-actions {
  margin-top: 15px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.leiasp-progress-actions .btn {
  flex: 1 1 140px;
  min-width: 0;
}
.leiasp-progress-actions .btn-minimize {
  flex: 0.8 1 110px;
}

@media (hover: none) {
  .leiasp-card:hover {
    transform: none;
  }
  .leiasp-card:hover .book-cover-img {
    transform: none;
  }
}


@media (max-width: 1024px) {
  .dashboard-content {
    padding: 1.5rem 1.25rem;
  }
  .tasks-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  .leiasp-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .active-banner-log-snippet {
    max-width: 220px;
  }
}


@media (max-width: 768px) {
  
  .nav-container {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  .brand-badge {
    display: none;
  }
  .brand-name {
    font-size: 0.85rem;
  }
  .user-card {
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
  }
  .user-name {
    max-width: 110px;
  }
  .user-meta {
    display: none;
  }
  
  .dashboard-header-block {
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-header-block .btn {
    width: 100%;
  }
  .section-title {
    font-size: 1.1rem;
  }
  
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .tabs-nav {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
  }
  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .search-box {
    min-width: 0;
    width: 100%;
  }
  
  .tasks-toolbar, .leiasp-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .tasks-toolbar-left, .tasks-toolbar-right, .leiasp-actions {
    width: 100%;
  }
  .tasks-toolbar-right .btn, .leiasp-actions .btn {
    flex: 1 1 140px;
    min-width: 0;
  }
  .tasks-batch-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .batch-banner-header {
    flex-wrap: wrap;
  }
  .batch-banner-meta {
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
  }
  
  .tasks-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
  }
  .task-card-header {
    flex-wrap: wrap;
  }
  .task-footer {
    flex-wrap: wrap;
  }
  .task-footer .btn {
    flex: 1 1 160px;
    min-width: 0;
  }
  
  .leiasp-stats {
    width: 100%;
  }
  .active-banner-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .active-banner-actions .btn {
    flex: 1 1 140px;
    min-width: 0;
  }
  .active-banner-meta {
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
  }
  .active-banner-log-snippet {
    max-width: 100%;
    white-space: normal;
  }
  
  .modal-overlay {
    padding: 0.75rem;
  }
  .modal-card {
    max-height: 94vh;
    max-height: 94dvh;
  }
  .modal-header {
    padding: 0.85rem 1rem;
    gap: 0.5rem;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-title {
    font-size: 0.95rem;
    white-space: normal;
  }
  
  .btn {
    min-height: 44px;
  }
  .tab-btn {
    min-height: 44px;
  }
  input[type="text"], input[type="password"], input[type="number"],
  select, textarea, .form-control {
    min-height: 44px;
    font-size: 16px;
  }
  .btn-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .task-select-checkbox {
    width: 22px;
    height: 22px;
  }
  .option-row, .option-item {
    min-height: 44px;
  }
  
  .toast-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}


@media (max-width: 480px) {
  #view-auth {
    padding: 1.25rem 0.85rem;
  }
  .auth-card {
    padding: 1.5rem 1.15rem;
  }
  .form-row-grid {
    grid-template-columns: 1fr 1fr;
  }
  .field-ra {
    grid-column: 1 / -1;
  }
  .auth-footer {
    flex-wrap: wrap;
  }
  .tasks-grid {
    grid-template-columns: 1fr;
  }
  .leiasp-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .book-cover-wrapper {
    aspect-ratio: 16 / 10;
    max-height: 220px;
  }
  .modal-overlay {
    padding: 0.5rem;
  }
  .modal-body {
    padding: 0.85rem;
  }
  .modal-footer {
    padding: 0.85rem 1rem;
  }
  .question-card, .question-block {
    padding: 0.9rem;
  }
  .option-row, .option-item {
    padding: 0.7rem 0.75rem;
    font-size: 0.85rem;
  }
  .batch-status-card {
    padding: 1rem;
  }
  .terminal-body {
    font-size: 0.7rem;
  }
  .section-subtitle {
    font-size: 0.775rem;
  }
}


@media (max-width: 380px) {
  .dashboard-content {
    padding: 0.85rem 0.65rem;
  }
  .user-name {
    max-width: 84px;
  }
  .stat-pill {
    font-size: 0.75rem;
  }
  .modal-title {
    font-size: 0.875rem;
  }
}


:root {
  --radius-card: 16px;
  --radius-pill: 9999px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.45);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #6366f1 60%, #06b6d4 100%);
  --gradient-ai: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

body {
  background:
    radial-gradient(900px 420px at 12% -80px, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(800px 380px at 88% -60px, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(700px 420px at 50% 110%, rgba(6, 182, 212, 0.08), transparent 60%),
    var(--bg-canvas);
  background-attachment: fixed;
}

.icon-inline {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -3px;
}
.icon-inline.lg { width: 20px; height: 20px; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 19, 26, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-container {
  min-height: 64px;
}
.logo-badge,
.logo-badge.sm {
  background: var(--gradient-primary);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
  border-radius: 12px;
}
.brand-badge {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}
.user-avatar,
.student-avatar-badge {
  background: var(--gradient-ai);
  color: #fff;
  border: none;
  font-weight: 800;
}

.glass-panel {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.auth-card.glass-panel {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)), var(--bg-surface);
  box-shadow: var(--shadow-pop);
}

.controls-bar,
.tasks-toolbar,
.leiasp-toolbar {
  border-radius: var(--radius-card);
  gap: 0.75rem;
}
.tabs-nav {
  gap: 0.4rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.tab-btn svg,
.btn svg {
  flex-shrink: 0;
}
.tab-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}
.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: transparent;
}
.tab-badge {
  border-radius: var(--radius-pill);
}

.btn {
  border-radius: 12px;
  font-weight: 700;
  gap: 0.5rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-normal), border-color var(--transition-fast);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45); }
.btn-ai {
  background: var(--gradient-ai);
  border: none;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.35);
}
.btn-icon-only {
  border-radius: 12px;
}
.search-box {
  border-radius: var(--radius-pill);
}
.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.tasks-grid,
.leiasp-grid {
  gap: 1rem;
}
.stat-pill,
.badge {
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.progress-bar-bg,
.active-banner-progress-bar-bg {
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar-fill,
.active-banner-progress-bar {
  background: var(--gradient-success);
  border-radius: var(--radius-pill);
}

.terminal-container { border-radius: 14px; overflow: hidden; }
.modal-card { border-radius: 18px; }
.btn-close { border-radius: 10px; }
.form-control, select.form-control, input.form-control, textarea.form-control {
  border-radius: 12px;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .dashboard-content { padding: 1rem 0.85rem 3rem; }
  .dashboard-header-block {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .dashboard-header-block .btn { width: 100%; justify-content: center; }
  .controls-bar {
    position: sticky;
    top: 58px;
    z-index: 30;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 640px) {
  .nav-container { min-height: 58px; gap: 0.5rem; }
  .brand-badge { display: none; }
  .user-card { gap: 0.5rem; }
  .modal-footer { flex-direction: column; align-items: stretch; }
  .modal-actions { display: grid; grid-template-columns: 1fr; gap: 0.5rem; width: 100%; }
  .modal-actions .btn { width: 100%; justify-content: center; }
  .auth-card.glass-panel { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


:root {
  --bg-canvas: #060504;
  --bg-surface: #0d0b09;
  --bg-surface-solid: #0d0b09;
  --bg-surface-elevated: #141110;
  --bg-surface-hover: #1c1815;
  --bg-card: #0d0b09;
  --bg-card-hover: #141110;
  --bg-input: #141110;
  --bg-input-focus: #1c1815;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: #ffc53d;
  --primary: #ffc53d;
  --primary-hover: #ffb320;
  --primary-subtle: rgba(255, 197, 61, 0.12);
  --primary-border: rgba(255, 197, 61, 0.35);
  --accent-ai: #ffc53d;
  --accent-ai-hover: #ffb320;
  --accent-ai-subtle: rgba(255, 197, 61, 0.12);
  --accent-ai-border: rgba(255, 197, 61, 0.35);
  --accent-cyan: #ffc53d;
  --accent-cyan-subtle: rgba(255, 197, 61, 0.12);
  --accent-cyan-border: rgba(255, 197, 61, 0.35);
  --text-main: #f5f2ee;
  --text-secondary: #c2b8ac;
  --text-muted: #857c72;
  --gradient-primary: linear-gradient(135deg, #ffc53d 0%, #ff8c3b 100%);
  --gradient-ai: linear-gradient(135deg, #ffc53d 0%, #ff8c3b 100%);
  --gradient-success: linear-gradient(90deg, #ffc53d, #ff8c3b);
  --accent-glow: rgba(255, 197, 61, 0.4);
}

body {
  background-color: #060504;
  background-image: radial-gradient(rgba(255, 197, 61, 0.09) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  background-attachment: fixed;
}

#view-auth .auth-card {
  border-radius: 22px;
  padding: 28px;
}
.auth-title em, .brand-name em { color: var(--primary); font-style: normal; }

.btn-primary {
  background: var(--primary);
  color: #100a05;
  box-shadow: none;
}
.btn-primary:hover {
  box-shadow: 0 8px 28px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-ai {
  background: var(--primary);
  color: #100a05;
  box-shadow: none;
}
.btn-ai:hover {
  box-shadow: 0 8px 28px var(--accent-glow);
  transform: translateY(-1px);
}
.tab-btn.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: transparent;
  box-shadow: none;
}
.tab-btn.active .tab-badge {
  background: var(--primary);
  color: #100a05;
}
.logo-badge,
.logo-badge.sm,
.user-avatar {
  background: var(--primary-subtle);
  color: var(--primary);
  box-shadow: none;
  border: 1px solid var(--primary-border);
}
.section-title { text-shadow: 0 0 60px rgba(255, 197, 61, 0.18); }

.site-footer {
  margin-top: auto;
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  background: #080706;
}
.site-footer strong { color: var(--primary); }
.footer-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}
.footer-donate {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.footer-donate:hover {
  text-decoration: underline;
}

.btn-donate {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: 12px;
  font-weight: 700;
}
.btn-donate svg {
  flex-shrink: 0;
}
.btn-donate:hover {
  background: var(--primary);
  color: #100a05;
  box-shadow: 0 8px 22px var(--accent-glow);
}
.donate-card .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.donate-card .modal-body strong { color: var(--text-main); }
.donate-actions {
  flex-direction: column;
  align-items: stretch;
}
.donate-actions .btn {
  width: 100%;
  justify-content: center;
}
.payment-price-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.1rem;
  border-radius: 14px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
}
.payment-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}
.payment-days {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.payment-qr {
  display: block;
  width: 210px;
  height: 210px;
  margin: 0.5rem auto;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.pix-copy-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.pix-copy-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.payment-support {
  font-size: 0.82rem;
  text-align: center;
}
.payment-support a {
  color: var(--primary);
  font-weight: 700;
}
.payment-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: var(--primary);
  font-weight: 700;
}

.beta-card .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.beta-card .modal-body strong { color: var(--text-main); }

.brand-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  color: var(--primary);
}
.section-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title-with-icon svg { color: var(--primary); flex-shrink: 0; }
.brand-logo-img {
  max-width: 230px;
  width: 80%;
  height: auto;
  object-fit: contain;
  margin-bottom: 0.25rem;
}
.brand-logo-img-nav {
  height: 36px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  flex-shrink: 0;
}
.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
@media (max-width: 640px) {
  .brand-logo { height: 28px; }
  .brand-logo-lg { height: 52px; }
}

html, body {
  background-color: #000;
}
body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='170'%3E%3Ctext x='24' y='108' font-family='Arial, sans-serif' font-size='36' font-weight='800' fill='rgba(255,197,61,0.06)' transform='rotate(-18 160 85)'%3Efofuritos%3C/text%3E%3C/svg%3E");
  background-size: 320px 170px;
  background-attachment: fixed;
}

#modal-leiasp-reader .form-row-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
#modal-leiasp-reader .form-group {
  min-width: 0;
}
#modal-leiasp-reader .form-group label {
  overflow-wrap: anywhere;
}
#leiasp-book-name-input {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
@media (max-width: 480px) {
  #modal-leiasp-reader .form-row-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.leiasp-progress-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--primary-border);
  background:
    linear-gradient(180deg, rgba(255, 197, 61, 0.06), transparent 40%),
    var(--bg-surface);
  box-shadow: 0 0 32px rgba(255, 197, 61, 0.08), var(--shadow-card);
}
.leiasp-progress-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
}
.leiasp-job-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  min-width: 0;
}
.leiasp-job-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-indicator-dot.pulse {
  animation: online-blink 1.6s ease-out infinite;
}
.leiasp-percent {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.leiasp-progress-track {
  background: rgba(255, 255, 255, 0.07);
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid var(--border-subtle);
}
.leiasp-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #ffc53d, #ff8c3b, #ffc53d);
  background-size: 200% 100%;
  animation: leiasp-shimmer 2.2s linear infinite;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(255, 197, 61, 0.55);
}
@keyframes leiasp-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.leiasp-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.leiasp-page-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.7rem;
}
.leiasp-page-pill strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}
.leiasp-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.7rem;
  font-weight: 700;
  font-size: 0.75rem;
}
.leiasp-terminal {
  border: 1px solid var(--border-medium);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}
.leiasp-terminal .terminal-body {
  color: #9ec5ff;
  font-size: 0.78rem;
  line-height: 1.65;
}
.leiasp-terminal .log-line.text-muted {
  color: var(--text-muted);
}
@keyframes online-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.navbar {
  position: relative;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid transparent;
}
.navbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-border), var(--primary), var(--primary-border), transparent);
}
.brand-logo-img-nav {
  filter: drop-shadow(0 0 10px rgba(255, 197, 61, 0.35));
  transition: filter var(--transition-fast), transform var(--transition-fast);
}
.nav-brand:hover .brand-logo-img-nav {
  filter: drop-shadow(0 0 16px rgba(255, 197, 61, 0.55));
  transform: scale(1.03);
}
.user-card {
  gap: 0.6rem;
  padding: 0.3rem 0.8rem 0.3rem 0.35rem;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    linear-gradient(135deg, var(--primary-border), transparent 50%, var(--primary-border)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  max-width: 280px;
}
.user-card:hover {
  box-shadow: 0 4px 22px rgba(255, 197, 61, 0.15);
  transform: translateY(-1px);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  color: #100a05;
  font-size: 0.85rem;
  box-shadow: 0 0 0 2px rgba(255, 197, 61, 0.25);
  flex-shrink: 0;
}
.user-info {
  min-width: 0;
}
.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.user-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.toast {
  padding: 0.8rem 1.1rem 0.8rem 0.8rem;
  border-radius: 14px;
  background: rgba(13, 11, 9, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  font-weight: 600;
  animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
}
.toast.success {
  border-left: none;
  border: 1px solid var(--primary-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 24px var(--accent-glow);
}
.toast.success svg {
  background: var(--primary-subtle);
  color: var(--primary);
}
.toast.error {
  border-left: none;
  border: 1px solid var(--primary-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 24px var(--accent-glow);
}
.toast.error svg {
  background: rgba(239, 68, 68, 0.15);
}
.toast.info {
  border-left: none;
  border: 1px solid var(--primary-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 24px var(--accent-glow);
}
.toast.info svg {
  background: var(--primary-subtle);
  color: var(--primary);
}
.toast.warning {
  border-left: none;
  border: 1px solid var(--primary-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 24px var(--accent-glow);
}
.toast.warning svg {
  background: rgba(245, 158, 11, 0.15);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 640px) {
  .leiasp-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .leiasp-card {
    flex-direction: row;
    align-items: stretch;
  }
  .leiasp-card .book-cover-wrapper {
    width: 104px;
    min-width: 104px;
    aspect-ratio: auto;
    max-height: none;
  }
  .leiasp-card .book-cover-overlay {
    top: 0.35rem;
    left: 0.35rem;
  }
  .leiasp-card .book-level-badge {
    font-size: 0.6rem;
  }
  .leiasp-card .book-info {
    padding: 0.7rem 0.8rem;
    min-width: 0;
  }
  .leiasp-card .book-title {
    font-size: 0.82rem;
    height: auto;
    max-height: 2.6em;
  }
  .leiasp-card .book-meta {
    font-size: 0.68rem;
  }
  .leiasp-card .btn-read-book {
    min-height: 44px;
    margin-top: 0.4rem;
  }
  .leiasp-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .leiasp-toolbar .leiasp-actions {
    display: flex;
    gap: 0.5rem;
  }
  .leiasp-toolbar .leiasp-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

.turnstile-box {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0 0.75rem;
  min-height: 65px;
}


