/* ══════════════════════════════════════════════════════════════════
   Service Invoice Submission Monitor — Module Styles  v3
   ══════════════════════════════════════════════════════════════════ */

/* ── Page Header ─────────────────────────────────────────── */
.inv-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.inv-page-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #e8f5f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.inv-page-header h1 {
  font-size: 22px;
  margin: 0;
  color: var(--text);
}
.inv-page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* ── Error Banner ─────────────────────────────────────────── */
.inv-banner {
  display: none;
}
.inv-banner.visible {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #dc2626;
}
.inv-banner-icon { font-size: 16px; }

/* ── Filters ──────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filters-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.filters-label-icon { font-size: 14px; }
.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 8px;
}
.filter-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  min-width: 150px;
}
.filter-input-month {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

/* ── Summary Stats ────────────────────────────────────────── */
.inv-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.inv-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  text-align: center;
}
.inv-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.inv-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.inv-stat-submitted .inv-stat-value { color: var(--success); }
.inv-stat-pending .inv-stat-value { color: var(--danger); }
.inv-stat-progress .inv-stat-value { color: var(--primary); }

.inv-progress-bar {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}
.inv-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width .4s ease;
  width: 0%;
}

/* ── Loading ──────────────────────────────────────────────── */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  display: none;
}
.loading-state.visible { display: block; }

/* ── Section Cards ────────────────────────────────────────── */
.section-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
  overflow: hidden;
}
.section-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-card-header h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.section-card-icon { font-size: 18px; }
.section-card-body { padding: 0; }

/* ── Column Filters Row ──────────────────────────────────── */
.inv-col-filters {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr 1fr;
  gap: 0;
  padding: 10px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.col-filter-input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  width: calc(100% - 12px);
}
.col-filter-input::placeholder {
  color: #94a3b8;
}
.col-filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.1);
}

/* ── Invoice Table ───────────────────────────────────────── */
.inv-table-wrap {
  overflow-x: auto;
}
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.inv-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.inv-table thead th.sortable {
  cursor: pointer;
  transition: color .15s;
}
.inv-table thead th.sortable:hover {
  color: var(--primary);
}
.inv-table thead th.sorted {
  color: var(--primary);
}
.sort-icon {
  font-size: 11px;
  margin-left: 4px;
  opacity: .5;
}
.inv-table thead th.sorted .sort-icon {
  opacity: 1;
}

.inv-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.inv-table tbody tr:last-child { border-bottom: none; }
.inv-table tbody tr:hover { background: #fafbfc; }

.inv-table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  color: var(--text);
}

.inv-empty-row {
  text-align: center;
  padding: 40px 16px !important;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

/* ── Cell Styles ─────────────────────────────────────────── */
.cell-name {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.cell-position {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: .2px;
}
.cell-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.cell-actions {
  white-space: nowrap;
}

/* ── Status Badges ────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  flex-shrink: 0;
}
.status-submitted {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.status-pending {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.status-nosi {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

/* ── Department Tag ────────────────────────────────────────── */
.dept-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
}
.dept-OT { background: #dbeafe; color: #1d4ed8; }
.dept-PT { background: #dcfce7; color: #15803d; }
.dept-SLP { background: #f3e8ff; color: #7e22ce; }
.dept-SPED { background: #fef3c7; color: #92400e; }
.dept-MD { background: #fce7f3; color: #be185d; }
.dept-PSYCHOLOGY { background: #e0e7ff; color: #3730a3; }
.dept-ORTHOSIS { background: #ccfbf1; color: #0f766e; }
.dept-FRONT_DESK { background: #f1f5f9; color: #475569; }

.branch-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}

/* ── View Proof Link ─────────────────────────────────────── */
.view-proof-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  margin-top: 4px;
}
.view-proof-link:hover { text-decoration: underline; }

/* ── Action Buttons ───────────────────────────────────────── */
.consultant-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.btn-action {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.btn-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0fdfa;
}
.btn-action.btn-upload {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-action.btn-upload:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.btn-action.btn-email {
  color: var(--info);
  border-color: #bfdbfe;
}
.btn-action.btn-email:hover {
  background: #eff6ff;
  border-color: var(--info);
}
.btn-action.btn-sms {
  color: var(--warning);
  border-color: #fde68a;
}
.btn-action.btn-sms:hover {
  background: #fffbeb;
  border-color: var(--warning);
}
.btn-action.btn-sent {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #86efac;
  font-weight: 600;
}
.btn-action.btn-sent:hover {
  background: #dcfce7;
  border-color: #4ade80;
}
.btn-action.btn-nosi {
  color: #6b7280;
  border-color: #d1d5db;
}
.btn-action.btn-nosi:hover {
  background: #f3f4f6;
  border-color: #6b7280;
  color: #374151;
}
.btn-action.btn-delete {
  color: var(--danger);
  border-color: #fecaca;
}
.btn-action.btn-delete:hover {
  background: #fef2f2;
  border-color: var(--danger);
}
.btn-action:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 8px; font-size: 16px; }
.empty-state p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ── Toast Notification ──────────────────────────────────── */
.inv-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s ease;
  pointer-events: none;
}
.inv-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.inv-toast.success { background: #16a34a; }
.inv-toast.error { background: #dc2626; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .inv-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .inv-col-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 16px;
  }
}
@media (max-width: 768px) {
  .inv-summary-row {
    grid-template-columns: 1fr;
  }
  .inv-col-filters {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .inv-table thead th {
    padding: 10px 12px;
    font-size: 10px;
  }
  .inv-table tbody td {
    padding: 10px 12px;
    font-size: 12px;
  }
  .section-card-header {
    padding-left: 16px;
    padding-right: 16px;
  }
  .filters-bar {
    gap: 8px;
  }
  /* Hide Actions column header text on mobile but keep column */
  .inv-table thead th:last-child {
    font-size: 0;
  }
}
