/* ============================================================
   IC Mileage Log Styles
   ============================================================ */

/* -- Summary stats -- */
.ml-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.ml-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
}
.ml-stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.2;
}
.ml-stat-deduction {
  font-size: 0.95rem;
  font-weight: 700;
  color: #059669;
  margin-top: 2px;
}
.ml-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-top: 4px;
}
.ml-irs-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: right;
  margin-top: -16px;
  margin-bottom: 24px;
}

/* -- Add trip form -- */
.ml-add-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ml-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ml-form-group--grow {
  flex: 1;
  min-width: 160px;
}
.ml-form-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.ml-form-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
}
.ml-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.ml-add-btn {
  padding: 9px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.ml-add-btn:hover { background: var(--accent-hover); }
.ml-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* -- Month filter pills -- */
.ml-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ml-pill {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
}
.ml-pill:hover { border-color: var(--accent); color: var(--accent); }
.ml-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* -- Trip table -- */
.ml-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
}
.ml-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.ml-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--steel);
}
.ml-table td {
  padding: 12px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.ml-table tr:last-child td {
  border-bottom: none;
}
.ml-table tr:hover td {
  background: var(--steel-dark);
}
.ml-table .ml-col-date { width: 120px; white-space: nowrap; }
.ml-table .ml-col-miles { width: 90px; text-align: right; font-weight: 700; }
.ml-table .ml-col-actions { width: 48px; text-align: center; }
.ml-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.ml-delete-btn:hover { color: #dc2626; background: #fef2f2; }

/* -- Empty state -- */
.ml-empty {
  text-align: center;
  padding: 48px 20px;
}
.ml-empty-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}
.ml-empty-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.ml-empty-sub {
  font-size: 0.85rem;
  color: var(--text-mid);
}

/* -- Loading -- */
.ml-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* -- Toast -- */
.ml-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #065f46;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
}
.ml-toast.visible { opacity: 1; transform: translateY(0); }

/* -- Print bar -- */
.ml-print-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ml-print-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-mid);
}
.ml-print-select {
  width: auto;
  min-width: 140px;
}
.ml-print-btn {
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ml-print-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* -- Error message -- */
.ml-error {
  color: #dc2626;
  font-size: 0.82rem;
  margin-top: 6px;
}

/* -- Responsive -- */
@media (max-width: 768px) {
  .ml-stats { grid-template-columns: 1fr; }
  .ml-add-form { flex-direction: column; align-items: stretch; }
  .ml-form-group--grow { min-width: auto; }
  .ml-add-btn { text-align: center; }
}

@media (max-width: 480px) {
  .ml-stat-card { padding: 12px 16px; }
  .ml-stat-value { font-size: 1.3rem; }
  .ml-table th, .ml-table td { padding: 10px 12px; }
}
