/* ── Argoplan Brand theme ── */
:root {
  --bg:        #1a1a2e;
  --surface:   #16213e;
  --surface2:  #0f3460;
  --accent:    #e94560;
  --accent2:   #f97316;
  --ok:        #22c55e;
  --fail:      #ef4444;
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --faint:     #475569;
  --border:    #0f3460;
  --radius:    6px;
  --font:      system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: .9rem;
}
.navbar-brand::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
.navbar-right { display: flex; gap: 1.5rem; align-items: center; }
.navbar-user { color: var(--muted); font-size: .8rem; }
.btn-link {
  background: none; border: none; color: var(--muted);
  font-size: .8rem; cursor: pointer; padding: 0;
}
.btn-link:hover { color: var(--text); }

/* ── Container ── */
.container { max-width: 800px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ── Progress bar ── */
.progress-section {
  background: var(--surface);
  padding: .85rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .4rem; font-size: .78rem;
}
.progress-label { color: var(--muted); }
.progress-deadline { color: var(--accent); font-weight: 600; }
.progress-deadline.late { color: var(--fail); }
.progress-bar-bg {
  background: var(--surface2); border-radius: 4px; height: 8px; overflow: hidden;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  height: 100%; border-radius: 4px; transition: width .3s;
}
.progress-count { color: var(--faint); font-size: .7rem; margin-top: .25rem; }

/* ── Category label ── */
.category-label {
  color: var(--accent); font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  margin: 1rem 0 .5rem;
}

/* ── Checklist item ── */
.checklist-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  border-left: 3px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: .45rem;
  transition: border-color .15s;
}
.checklist-item.status-ok   { border-left-color: var(--ok); }
.checklist-item.status-falhou { border-left-color: var(--fail); }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: .82rem; font-weight: 500; }
.item-desc { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.item-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.item-readonly-badge {
  font-size: .72rem; padding: 3px 10px; border-radius: 9999px; font-weight: 600;
}
.item-readonly-badge.ok   { background: #22c55e22; color: var(--ok); }
.item-readonly-badge.falhou { background: #ef444422; color: var(--fail); }

/* ── Buttons ── */
.btn {
  border: none; border-radius: var(--radius);
  padding: .4rem .85rem; font-size: .75rem; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-ok     { background: var(--ok); color: #fff; }
.btn-fail   { background: var(--fail); color: #fff; }
.btn-ghost  { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost.active { color: var(--text); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; width: 100%; padding: .7rem; font-size: .88rem; margin-top: .75rem;
}
.btn-danger { background: var(--fail); color: #fff; }
.btn-sm { padding: .25rem .6rem; font-size: .7rem; }

/* ── Submit hint ── */
.submit-hint { color: var(--faint); font-size: .68rem; text-align: center; margin-top: .35rem; }

/* ── Login page ── */
.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.login-card {
  background: var(--surface); border-radius: 10px;
  padding: 2rem; width: 100%; max-width: 380px;
  border: 1px solid var(--border);
}
.login-logo {
  text-align: center; margin-bottom: 1.5rem;
}
.login-logo h1 { font-size: 1.3rem; font-weight: 700; }
.login-logo .dot { color: var(--accent); }
.login-logo p { color: var(--muted); font-size: .8rem; margin-top: .25rem; }

/* ── Form ── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .35rem; }
input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .55rem .75rem;
  color: var(--text); font-size: .85rem; font-family: var(--font);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-error { color: var(--fail); font-size: .75rem; margin-top: .5rem; }

/* ── Tabs ── */
.tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: .6rem 1.1rem; background: none; border: none; color: var(--muted);
  font-size: .78rem; cursor: pointer; border-bottom: 2px solid transparent;
  font-family: var(--font);
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Metric cards ── */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .65rem; margin-bottom: 1rem; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem;
}
.metric-card.danger { border-color: var(--fail); }
.metric-label { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.metric-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-top: .15rem; }
.metric-value.ok   { color: var(--ok); }
.metric-value.warn { color: var(--accent2); }
.metric-value.fail { color: var(--fail); }
.metric-sub { color: var(--faint); font-size: .65rem; }

/* ── Table ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: .85rem;
}
.card-header {
  padding: .55rem .9rem; border-bottom: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.card-header.danger { color: var(--fail); border-bottom-color: #ef444433; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th {
  background: var(--surface2); color: var(--muted); padding: .45rem .9rem;
  text-align: left; font-weight: 500;
}
td { padding: .55rem .9rem; border-top: 1px solid var(--border); }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 9999px;
  font-size: .68rem; font-weight: 600;
}
.badge-ok     { background: #22c55e22; color: var(--ok); }
.badge-warn   { background: #f9731622; color: var(--accent2); }
.badge-fail   { background: #ef444422; color: var(--fail); }
.badge-muted  { background: var(--surface2); color: var(--muted); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 100;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 10px;
  padding: 1.5rem; width: 100%; max-width: 420px;
  border: 1px solid var(--border);
}
.modal h3 { font-size: 1rem; margin-bottom: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* ── Action bar ── */
.action-bar {
  display: flex; justify-content: flex-end; margin-bottom: .75rem;
}

/* ── Submitted state ── */
.submitted-banner {
  background: #22c55e18; border: 1px solid #22c55e44;
  border-radius: var(--radius); padding: .75rem 1rem;
  color: var(--ok); font-size: .82rem; font-weight: 600;
  text-align: center; margin-bottom: 1rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .checklist-item { flex-direction: column; align-items: flex-start; }
  .item-actions { width: 100%; }
  .item-actions .btn { flex: 1; text-align: center; }
  .tabs { overflow-x: auto; }
}
