/* ============================================================
   NILLI — components.css
   Reusable component styles: cards, forms, badges, tables, etc.
   Requires main.css to be loaded first (design tokens must exist).
   ============================================================ */

/* ------------------------------------------------------------
   1. Cards
   ------------------------------------------------------------ */
.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  font-family: 'Bebas Neue', var(--sans);
  font-size: 1.25rem;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

/* ------------------------------------------------------------
   2. Stats Grid & Stat Cards
   ------------------------------------------------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-value {
  font-family: 'Bebas Neue', var(--sans);
  font-size: 2.5rem;
  letter-spacing: 2px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--gray4);
  font-family: var(--mono);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------
   3. Forms
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  background: #ffffff;
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--black);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230a0a0a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-error {
  font-size: 13px;
  color: #c0392b;
  margin-top: 4px;
}

/* ------------------------------------------------------------
   4. Badges
   ------------------------------------------------------------ */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-waiting      { background: #fff3cd; color: #856404; }
.badge-approved     { background: #d1ecf1; color: #0c5460; }
.badge-in-progress  { background: var(--lime); color: var(--black); }
.badge-completed    { background: #d4edda; color: #155724; }
.badge-not-arrived  { background: #f8d7da; color: #721c24; }

/* ------------------------------------------------------------
   5. Pills (superadmin / role / status indicators)
   ------------------------------------------------------------ */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pill-active        { background: #d4edda; color: #155724; }
.pill-inactive      { background: #f8d7da; color: #721c24; }
.pill-admin         { background: var(--black); color: var(--lime); }
.pill-receptionist  { background: #d1ecf1; color: #0c5460; }
.pill-doctor        { background: #e8d5f5; color: #6f42c1; }

/* ------------------------------------------------------------
   6. Tables
   ------------------------------------------------------------ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 15px;
}

.data-table thead tr {
  background: var(--black);
  color: var(--white);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray1);
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--white);
}

.empty-row td {
  text-align: center;
  padding: 48px 16px;
  color: var(--gray4);
}

/* ------------------------------------------------------------
   7. Section Headers
   ------------------------------------------------------------ */
.section-title {
  font-family: 'Bebas Neue', var(--sans);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--black);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* ------------------------------------------------------------
   8. Alerts / Notifications
   ------------------------------------------------------------ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fff0f0;
  border: 1px solid #f5c6c6;
  color: #c0392b;
}

.alert-success {
  background: #f0fff4;
  border: 1px solid #b2dfdb;
  color: #155724;
}

.alert-warning {
  background: #fffbf0;
  border: 1px solid #ffd700;
  color: #856404;
}


/* ------------------------------------------------------------
   9. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--transition);
  text-align: center;
}

.btn:hover {
  opacity: 0.88;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--black);
  color: var(--lime);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--black);
  color: var(--black);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* ------------------------------------------------------------
   10. Spacing Utilities
   ------------------------------------------------------------ */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ------------------------------------------------------------
   11. Card Title
   ------------------------------------------------------------ */
.card-title {
  font-family: 'Bebas Neue', var(--sans);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

/* ------------------------------------------------------------
   12. Form Status Messages
   ------------------------------------------------------------ */
.form-status {
  display: inline-block;
  margin-left: 12px;
  font-size: 14px;
}

/* ------------------------------------------------------------
   13. Settings Form
   ------------------------------------------------------------ */
.settings-form {
  max-width: 600px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}
