* { box-sizing: border-box; }
body {
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: linear-gradient(180deg, #ffe6ff, #e6d9ff, #d9e6ff);
  color: #333;
}

/* Header */
header {
  text-align: center;
  background: linear-gradient(90deg, #c084fc, #a78bfa, #fbc8d4);
  padding: 1.2rem;
  color: white;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}
h1 { margin: 0 0 .2rem 0; font-size: 2rem; }
h2 { margin: 0 0 .6rem 0; font-weight: 500; }
.auth-actions { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: .5rem; }
.notice-row { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.reminder-summary { font-weight: 600; }

button {
  cursor: pointer;
  background-color: #c084fc;
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: .55rem .9rem;
  transition: .2s;
}
button:hover { background-color: #a855f7; }
button.secondary { background: #6b7280; }
button.secondary:hover { background: #4b5563; }

.admin-badge {
  background: #fbc8d4;
  color: #3b1e54;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: bold;
}
.hidden { display: none !important; }

/* Pills */
.pillbar {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin: 14px auto 0;
  flex-wrap: wrap;
}
.pill {
  background: #e9d5ff; color: #4c1d95; border: 1px solid #c4b5fd;
  padding: .4rem .8rem; border-radius: 999px;
}
.pill.active { background: #c084fc; color: white; border-color: #a855f7; }

/* Filters/search */
.filters, .add-company {
  margin: 1rem auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
select, input {
  padding: 0.6rem;
  border-radius: 6px;
  border: none;
  min-width: 160px;
}
#searchInput { min-width: 240px; }

/* Table */
.table-container {
  margin: 1rem auto;
  width: 92%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,.1);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th {
  background: #c084fc;
  color: white;
  padding: .8rem;
  text-align: left;
}
td { padding: .8rem; border-bottom: 1px solid #eee; }
.toggle-btn { background: #ede9fe; color: #4c1d95; padding: .25rem .5rem; }
.actions-cell button { margin-right: 6px; }

.overdue { background: #fff5f5; }
.track-count {
  font-weight: 600;
  color: #6b21a8;
  text-align: center;
}

/* Chart */
.chart-container {
  width: 70%;
  margin: 2rem auto;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,.1);
}

/* Modals */
.modal {
  display: none; position: fixed; z-index: 1000; inset: 0;
  background: rgba(0,0,0,.35);
}
.modal-content {
  background: white; margin: 5% auto; padding: 18px; width: 52%;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.modal-content.small { width: 420px; max-width: calc(100% - 24px); }
.close { float: right; font-size: 22px; cursor: pointer; }
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center;
}
.form-grid input { width: 100%; }
.save-btn { margin-top: 10px; }

/* Details dropdown inside table */
.details-row .details-content {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px;
}
.details-notes {
  max-height: 260px; overflow: auto; border: 1px solid #eee;
  border-radius: 8px; padding: 10px; background: #fafafa;
}
.note-item { padding: 6px 0; border-bottom: 1px dashed #eee; }
.note-item:last-child { border-bottom: none; }
.details-form textarea { width: 100%; }
.hint { color: #6b7280; font-size: .9rem; }
