/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: #1e40af;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

header h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: .02em; }

nav { display: flex; gap: 0.5rem; }

.tab-btn {
  background: transparent;
  border: 2px solid rgba(255,255,255,.5);
  color: #fff;
  padding: 0.4rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background .15s, border-color .15s;
}
.tab-btn:hover       { background: rgba(255,255,255,.15); }
.tab-btn.active      { background: #fff; color: #1e40af; border-color: #fff; font-weight: 600; }

/* ── Main ─────────────────────────────────────────────────────────────────── */
main { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tab-panel          { display: none; }
.tab-panel.active   { display: block; }

/* ── Panel header ─────────────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.panel-header h2 { font-size: 1.25rem; font-weight: 700; }

/* ── Poll indicator dot ───────────────────────────────────────────────────── */
.poll-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  font-size: 0.88rem;
}

thead tr { background: #1e40af; color: #fff; }
th, td   { padding: 0.65rem 0.9rem; text-align: left; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover           { background: #eff6ff; }

/* ── Priority badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-STAT     { background: #fee2e2; color: #b91c1c; }
.badge-URGENT   { background: #fef3c7; color: #92400e; }
.badge-ROUTINE  { background: #dcfce7; color: #166534; }

/* ── Status badges ────────────────────────────────────────────────────────── */
.status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-PENDING     { background: #dbeafe; color: #1d4ed8; }
.status-IN_PROGRESS { background: #fef9c3; color: #854d0e; }
.status-COMPLETED   { background: #dcfce7; color: #15803d; }
.status-CANCELLED   { background: #f1f5f9; color: #64748b; }

/* ── Action buttons ───────────────────────────────────────────────────────── */
.btn {
  padding: 0.35rem 0.8rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity .15s;
}
.btn:hover            { opacity: .85; }
.btn-primary          { background: #1e40af; color: #fff; padding: 0.5rem 1.4rem; font-size: 0.95rem; }
.btn-claim            { background: #0ea5e9; color: #fff; }
.btn-complete         { background: #16a34a; color: #fff; }
.btn-cancel           { background: #dc2626; color: #fff; }

/* ── Identity bar ─────────────────────────────────────────────────────────── */
.identity-bar {
  margin-top: 1.2rem;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.identity-bar input {
  margin-left: 0.5rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* ── Submit form ──────────────────────────────────────────────────────────── */
#tab-submit h2 { font-size: 1.25rem; margin-bottom: 1.2rem; }

#submit-form {
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  max-width: 560px;
}

.form-group         { margin-bottom: 1rem; }
.form-group label   { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 2px rgba(30,64,175,.2);
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.message {
  margin-top: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  font-size: 0.88rem;
}
.message.success { background: #dcfce7; color: #15803d; }
.message.error   { background: #fee2e2; color: #b91c1c; }
.hidden          { display: none !important; }

/* ── Audit trail ──────────────────────────────────────────────────────────── */
#tab-audit h2    { font-size: 1.25rem; margin-bottom: 1rem; }
#audit-container { max-height: 70vh; overflow-y: auto; }

.empty-msg {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  font-style: italic;
}
