
/* Payment Tracker - Minimal Clean Styles */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #6c757d;
  --primary: #2d6cdf;
  --primary-hov: #1b4fbf;
  --danger: #dc3545;
  --danger-hov: #b02a37;
  --warning: #f0ad4e;
  --success: #28a745;
  --border: #dee2e6;
  --shadow: 0 2px 6px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Navbar */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand { font-weight: 700; font-size: 1.1rem; }

.nav-links a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--primary);
  font-size: 0.9rem;
}

.nav-links a:hover { text-decoration: underline; }

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

/* Login box */
.login-box {
  max-width: 360px;
  margin: 4rem auto;
  background: var(--card);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-box h2 { margin-top: 0; text-align: center; }

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.95rem;
  background: var(--card);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(45,108,223,0.15);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: #f1f3f5; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover { background: var(--primary-hov); }

.btn-secondary { background: #e9ecef; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover { background: var(--danger-hov); }

.btn-warning {
  background: var(--warning);
  color: #212529;
  border-color: var(--warning);
}

.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.table th,
.table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.table tr:last-child td { border-bottom: none; }

.table td.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0;
}

.filters input,
.filters select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.9rem;
  min-width: 140px;
}

/* Stats */
.stats {
  margin: 1rem 0;
  font-size: 1.1rem;
}

/* Alerts */
.flash-messages { margin-bottom: 1rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 5px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Actions cell */
.actions form { display: inline; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge-scheduled { background: #e9ecef; color: #495057; }
.badge-development { background: #cfe2ff; color: #084298; }
.badge-testing { background: #fff3cd; color: #856404; }
.badge-handover { background: #d1ecf1; color: #0c5460; }
.badge-for-payment { background: #f8d7da; color: #721c24; }
.badge-paid { background: #d4edda; color: #155724; }

/* Kanban */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-column { min-width: 260px; background: #f8f9fa; border-radius: 8px; padding: 0.75rem; }
.kanban-column h3 { margin: 0 0 0.75rem; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); }
.kanban-card { background: var(--card); border-radius: 6px; padding: 0.75rem; margin-bottom: 0.5rem; box-shadow: var(--shadow); }
.kanban-card .card-title { font-weight: 600; margin-bottom: 0.25rem; }
.kanban-card .card-meta { font-size: 0.8rem; color: var(--muted); }
.kanban-card .card-action { font-size: 0.8rem; margin-top: 0.5rem; padding: 0.35rem; background: #e7f1ff; border-radius: 4px; }
.kanban-card .overdue { color: var(--danger); font-weight: 600; }

/* Status stepper */
.status-stepper {
  display: flex;
  align-items: center;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  padding: 0.5rem 0 0.75rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  flex-shrink: 0;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.step-done .step-dot  { background: var(--success); border-color: var(--success); color: #fff; }
.step-active .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }

.step-label {
  font-size: 0.72rem;
  text-align: center;
  color: var(--muted);
  white-space: nowrap;
}

.step-done .step-label  { color: var(--success); font-weight: 600; }
.step-active .step-label { color: var(--primary); font-weight: 700; }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 20px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.step-line-done { background: var(--success); }

/* Role callout */
.role-callout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #e8f0fe;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.role-callout-label { font-size: 0.85rem; color: var(--muted); }

.role-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Info card (task details) */
.info-card {
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.info-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 130px;
  flex-shrink: 0;
}

.info-value { font-size: 0.95rem; }

.info-pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9rem;
  background: #f8f9fa;
  border-radius: 5px;
  padding: 0.65rem 0.85rem;
  margin: 0;
  width: 100%;
}

/* Team slots */
.team-slot {
  background: var(--card);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  box-shadow: var(--shadow);
}

.team-slot-me {
  border: 2px solid var(--primary);
  background: #f0f5ff;
}

.team-slot-role {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.team-slot-name { font-size: 0.95rem; font-weight: 500; }

.you-badge {
  font-size: 0.7rem;
  background: var(--primary);
  color: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.35rem;
  vertical-align: middle;
  font-weight: 700;
}

/* Payee payment cards */
.payment-card {
  background: var(--card);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-left: 3px solid var(--success);
}

.payment-card-left { flex: 1; min-width: 0; }
.payment-card-right { flex-shrink: 0; text-align: right; }

.payment-type-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--success);
  margin-bottom: 0.15rem;
}

.payment-date { font-size: 0.85rem; color: var(--muted); }

.payment-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.payment-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 0.35rem;
}

.no-receipt { font-size: 0.8rem; color: var(--muted); }

/* Timeline (status log) */
.timeline { position: relative; padding-left: 1.5rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-content {
  background: var(--card);
  border-radius: 7px;
  padding: 0.65rem 0.9rem;
  box-shadow: var(--shadow);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.timeline-who { font-weight: 600; font-size: 0.88rem; }
.timeline-when { font-size: 0.8rem; color: var(--muted); }
.timeline-notes { font-size: 0.9rem; margin-top: 0.35rem; color: var(--text); }

/* Empty state */
.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

/* Comment thread */
.comment-compose {
  background: var(--card);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.comment-list { display: flex; flex-direction: column; gap: 0.75rem; }

.comment-item {
  background: var(--card);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--border);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-time {
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
}

.comment-actions { display: flex; gap: 0.4rem; margin-left: auto; }

.comment-body {
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Task cards on payee dashboard */
.task-card {
  background: var(--card);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: box-shadow 0.15s;
  border-left: 3px solid var(--primary);
}

.task-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.task-card-left { flex: 1; min-width: 0; }

.task-card-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.task-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card-meta { font-size: 0.8rem; color: var(--muted); }

.task-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.comment-count {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

/* PM Dashboard */
.pm-section {
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--border);
}
.pm-section-alert { border-left-color: var(--danger); }
.pm-section-delay { border-left-color: var(--warning); }

.pm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.pm-section-title { font-weight: 700; font-size: 0.95rem; }

.pm-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}
.pm-badge-neutral { background: var(--muted); }
.pm-badge-done { background: var(--success); }

.pm-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.pm-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: background 0.15s;
}
.pm-task-row:hover { background: #eef2ff; }
.pm-task-name { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.15rem; }
.pm-task-meta { font-size: 0.82rem; color: var(--muted); }
.pm-meta-sep { margin: 0 0.3em; }
.pm-meta-warn { color: var(--danger); font-weight: 600; }
.pm-meta-overdue { color: var(--danger); font-weight: 600; }
.pm-meta-delay { color: var(--warning); font-weight: 600; }
.pm-meta-ok { color: var(--success); font-weight: 600; }
.pm-task-right { flex-shrink: 0; }

.pm-done-summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}
.pm-done-summary::-webkit-details-marker { display: none; }

/* PM action boxes (delay flag, acceptance) in task_detail */
.pm-action-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.pm-action-box-delay { border-color: var(--warning); background: #fffbf0; }

.acceptance-recorded {
  background: #f0faf4;
  border: 1px solid #b3dfc1;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
}

/* Delay badge in status log / task info */
.badge-delay { background: var(--warning); color: #6b4a00; }

/* Responsive */
@media (max-width: 768px) {
  .navbar { flex-direction: column; align-items: flex-start; }
  .nav-links { margin-top: 0.5rem; }
  .nav-links a { margin-left: 0; margin-right: 1rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .table th, .table td { padding: 0.5rem; font-size: 0.85rem; }
}

/* Channel badges */
.badge-gcash { background: #0070ba; color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.badge-bank_transfer { background: #1a73e8; color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.badge-maya { background: #7c3aed; color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.badge-paypal { background: #003087; color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.badge-cash { background: #059669; color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.badge-other { background: #6b7280; color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }

/* Bulk payment table */
#bulk-table input, #bulk-table select { font-size: 0.9rem; padding: 0.35rem 0.5rem; }

/* Team rows in task form */
.team-row select, .team-row input { width: 100%; box-sizing: border-box; }
