/* ══════════════════════════════════════════════════════════════════
   Government Submissions Module — Styles
   ══════════════════════════════════════════════════════════════════ */

/* ── Month Navigation ───────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0 0 20px;
}
.month-label {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 200px;
  text-align: center;
}

/* ── View Tabs ──────────────────────────────────────────────── */
.view-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 4px;
  width: fit-content;
}
.view-tab {
  padding: 8px 20px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.view-tab:hover { color: var(--text-primary); }
.view-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── Calendar View ──────────────────────────────────────────── */
.calendar-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--primary-darker);
}
.cal-header {
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}
.cal-day {
  background: #fff;
  min-height: 100px;
  padding: 6px 8px;
  position: relative;
  cursor: default;
}
.cal-day.other-month {
  background: #f8fafc;
}
.cal-day.other-month .cal-day-num {
  color: var(--text-muted);
  opacity: .4;
}
.cal-day.today {
  background: #e8f4f6;
}
.cal-day.today .cal-day-num {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cal-event {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  line-height: 1.4;
  transition: opacity .15s;
}
.cal-event:hover { opacity: .85; }
.cal-event.cat-withholding {
  background: #dbeafe;
  color: #1e40af;
  border-left: 3px solid #3b82f6;
}
.cal-event.cat-expanded {
  background: #fef3c7;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}
.cal-event.cat-otherTax {
  background: #ede9fe;
  color: #5b21b6;
  border-left: 3px solid #8b5cf6;
}
.cal-event.cat-statutory {
  background: #d1fae5;
  color: #065f46;
  border-left: 3px solid #10b981;
}
.cal-event.complied {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-left-color: #16a34a !important;
  text-decoration: line-through;
  opacity: .65;
}
.cal-event.not-applicable {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-left-color: #94a3b8 !important;
  text-decoration: line-through;
  opacity: .5;
}

/* ── Category List View ─────────────────────────────────────── */
.category-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.category-header:hover { background: #e8ecef; }
.category-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-icon { font-size: 18px; }
.cat-toggle {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform .2s;
}
.cat-toggle.collapsed { transform: rotate(-90deg); }
.category-body { padding: 0; }
.category-body.collapsed { display: none; }

/* ── Deadline Row ───────────────────────────────────────────── */
.deadline-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.deadline-row:last-child { border-bottom: none; }
.deadline-row:hover { background: #fafbfc; }
.deadline-row.is-overdue { background: #fef2f2; }
.deadline-row.is-overdue:hover { background: #fee2e2; }

.deadline-date {
  min-width: 80px;
  text-align: center;
}
.deadline-date-day {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.deadline-date-month {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .5px;
}

.deadline-info {
  flex: 1;
  min-width: 0;
}
.deadline-form {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.deadline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}
.deadline-freq {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  margin-top: 4px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
}
.freq-monthly { background: #dbeafe; color: #1e40af; }
.freq-quarterly { background: #fef3c7; color: #92400e; }
.freq-annual { background: #ede9fe; color: #5b21b6; }

.deadline-urgency {
  min-width: 90px;
  text-align: center;
}
.urgency-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.urgency-safe { background: #dcfce7; color: #166534; }
.urgency-5day { background: #fef3c7; color: #92400e; }
.urgency-3day { background: #fed7aa; color: #9a3412; }
.urgency-1day { background: #fecaca; color: #991b1b; }
.urgency-overdue { background: #991b1b; color: #fff; }
.urgency-complied { background: #16a34a; color: #fff; }
.urgency-na { background: #94a3b8; color: #fff; }

.deadline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ── Complied Button ────────────────────────────────────────── */
.btn-comply {
  padding: 6px 14px;
  border: 2px solid var(--primary);
  background: none;
  color: var(--primary);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-comply:hover {
  background: var(--primary);
  color: #fff;
}
.btn-comply.complied {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
  cursor: default;
  pointer-events: none;
}
.btn-comply.complied::before {
  content: '✓ ';
}
.btn-add-task {
  padding: 6px 14px;
  border: 2px solid #d97706;
  background: none;
  color: #d97706;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-add-task:hover {
  background: #d97706;
  color: #fff;
}
.btn-add-task.added {
  background: #6b7280;
  border-color: #6b7280;
  color: #fff;
  cursor: default;
  pointer-events: none;
}

/* ── N/A Button ────────────────────────────────────────────── */
.btn-na {
  padding: 6px 14px;
  border: 2px solid #94a3b8;
  background: none;
  color: #64748b;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-na:hover {
  background: #94a3b8;
  color: #fff;
}
.btn-na.active {
  background: #64748b;
  border-color: #64748b;
  color: #fff;
  cursor: default;
  pointer-events: none;
}
.btn-na.active::before {
  content: '— ';
}

/* ── Disabled buttons ──────────────────────────────────────── */
.btn-comply[disabled],
.btn-na[disabled],
.btn-add-task[disabled] {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── N/A deadline row ──────────────────────────────────────── */
.deadline-row.is-na {
  opacity: .55;
  background: #f8fafc;
}
.deadline-row.is-na:hover { background: #f1f5f9; }

/* ── Stat N/A ──────────────────────────────────────────────── */
.stat-na { color: #64748b !important; }

/* ── Compliance Log Snippet ────────────────────────────────── */
.compliance-log-snippet {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.compliance-log-snippet .log-icon {
  font-size: 12px;
  flex-shrink: 0;
}
.compliance-log-snippet .log-text {
  color: #64748b;
}
.compliance-log-snippet .log-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.log-more-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.log-more-btn:hover { background: var(--primary-xlight); }

/* ── Compliance Log Modal Rows ─────────────────────────────── */
.log-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.log-row:last-child { border-bottom: none; }
.log-row .log-action {
  font-size: 13px;
  font-weight: 700;
  min-width: 150px;
}
.log-row .log-user {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
}
.log-row .log-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.log-row.log-complied .log-action { color: #16a34a; }
.log-row.log-na .log-action { color: #64748b; }
.log-row.log-reopened .log-action { color: #d97706; }

/* ── Alert Banners ──────────────────────────────────────────── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  animation: slideDown .3s ease;
  position: relative;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.alert-banner .alert-icon { font-size: 20px; flex-shrink: 0; }
.alert-banner .alert-text { flex: 1; }
.alert-banner .alert-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: .6;
  padding: 0 4px;
  color: inherit;
}
.alert-banner .alert-close:hover { opacity: 1; }

.alert-5day {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}
.alert-3day {
  background: #fed7aa;
  border: 1px solid #f97316;
  color: #9a3412;
}
.alert-1day {
  background: #fecaca;
  border: 1px solid #ef4444;
  color: #991b1b;
}

/* ── Stats overrides ────────────────────────────────────────── */
.stat-pending { color: #d97706 !important; }
.stat-done { color: #16a34a !important; }
.stat-overdue { color: #dc2626 !important; }

/* ── Calendar tooltip ───────────────────────────────────────── */
.cal-event-tooltip {
  position: fixed;
  background: #1e293b;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  max-width: 280px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  line-height: 1.5;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .deadline-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .deadline-date { min-width: 60px; }
  .deadline-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .cal-day { min-height: 70px; }
  .cal-event { font-size: 9px; }
  .month-nav { gap: 10px; }
  .month-label { font-size: 16px; min-width: 160px; }
}
