/* Reset & Fonts */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* Background for login/register */
body.auth {
  background: linear-gradient(to right, #2c3e50, #3498db);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Login/Register Container */
.container {
  background: #fff;
  width: 350px;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  text-align: center;
}

h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  background: #3498db;
  color: #fff;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

button:hover {
  background: #2980b9;
}

.switch {
  margin-top: 15px;
  font-size: 14px;
}

.switch a {
  color: #3498db;
  text-decoration: none;
  font-weight: bold;
}

.switch a:hover {
  text-decoration: underline;
}

/* -------------------------------------- */
/* Dashboard Layout for Tanod/Kagawad/Admin */
/* -------------------------------------- */

body.dashboard {
  background: #f4f4f9;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #2c3e50;
  color: #fff;
  padding: 20px;
}

.sidebar h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
}

.sidebar a {
  display: block;
  color: #fff;
  padding: 10px;
  margin: 5px 0;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s;
}

.sidebar a:hover {
  background: #3498db;
}

/* Main Content */
.content {
  flex: 1;
  padding: 30px;
}

.content h1 {
  margin-bottom: 15px;
  color: #2c3e50;
}

.content p {
  line-height: 2.0;
  margin-left: 5px;
  color: #333;
}

/* -------------------------------------- */
/* Custom Styling for Each Page            */
/* -------------------------------------- */

/* Alerts Page */
.alert-card {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 15px;
  margin: 12px 0;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.alert-info {
  margin-left: 15px;
  flex: 1;
}

.alert-info h3 {
  margin: 0;
  color: #2c3e50;
}

.alert-info p {
  margin: 6px 0;
  color: #555;
}

.alert-time {
  font-size: 13px;
  color: #888;
}

.alert-btn:hover {
  background: #2980b9;
}

/* Buttons inside alert cards */
.alert-btn {
  background: #3498db;
  color: #fff;
}

/* Report Page */
.form-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 600px;
}

label {
  font-weight: bold;
  display: block;
  margin: 12px 0 5px;
}

textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  resize: none;
}

/* Dispatch Table */
.dispatch-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.dispatch-table th, 
.dispatch-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.dispatch-table th {
  background: #2c3e50;
  color: #fff;
  text-transform: uppercase;
  font-size: 14px;
}

.dispatch-table tr:hover {
  background: #f9f9f9;
}

/* Respond button */
.respond-btn {
  background: #27ae60;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}

.respond-btn:hover {
  background: #1e8449;
}

/* Profile Page */
.profile-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 600px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Modal Background */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

/* Modal Content Box */
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
  margin: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Responder Table */
.responder-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

.responder-table th,
.responder-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
}

.responder-table th {
  background: #007bff;
  color: white;
}

/* Modal Buttons */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button {
  min-width: 100px;
  height: 36px;
  font-size: 14px;
}

.modal-actions button:hover {
  background: #0056b3;
}

.modal-actions button:last-child {
  background: #6c757d;
}

.modal-actions button:last-child:hover {
  background: #5a6268;
}

.tabs {
  display: flex;
  margin-bottom: 15px;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  cursor: pointer;
  border: none;
  background: #2c3e50;
  color: #fff;
  font-weight: bold;
  transition: background 0.3s;
}

.tab-btn:hover {
  background: #3498db;
}

.tab-btn.active {
  background: #2980b9;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Table styling improvements */
.dispatch-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dispatch-table th {
  background-color: #34495e;
  color: white;
  padding: 12px;
  text-align: left;
  font-size: 14px;
}

.dispatch-table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid #eee;
  font-size: 16px;
}

.dispatch-table tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Availability badges */
.status-available {
  color: #2ecc71;
  font-weight: bold;
}

.status-unavailable {
  color: #e74c3c;
  font-weight: bold;
}

/* Assigned indicator */
.assigned.yes {
  color: #2ecc71;
  font-weight: bold;
}

.assigned.no {
  color: #e74c3c;
  font-weight: bold;
}

/* Assignment box styling */
.assignment-box {
  background: #f4f6f8;
  border-left: 4px solid #3498db;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 5px 0;
  line-height: 1.3;
  font-size: 13px;
}

.assignment-box .status-tag {
  display: inline-block;
  background: #3498db;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 0;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #ff3b3b;
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: fadeIn 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 350px;
}

.toast-message {
  flex-grow: 1;
}

.toast-close {
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  margin-left: 10px;
  user-select: none;
}

.toast-close:hover {
  color: #ffcccc;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Checkbox group container */
.responders {
  margin: 10px 0 15px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 10px;
  border: 1px solid #ddd;
}

/* Each checkbox line */
.responders label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 6px;
}

/* Hide default checkbox */
.responders input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #666;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
}

/* When checked */
.responders input[type="checkbox"]:checked {
  background: #007bff;
  border-color: #007bff;
}

/* Checkmark */
.responders input[type="checkbox"]:checked::after {
  content: "✔";
  position: absolute;
  top: -2px;
  left: 2px;
  font-size: 15px;
  color: white;
}

.recommended {
  background-color: #f0fff4;
}

.badge {
  background: #22c55e;
  color: white;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.action-btn {
  min-width: 110px;
  height: 38px;
  padding: 0 14px;

  font-size: 14px;
  font-weight: 600;
  line-height: 1;

  border-radius: 6px;
  border: none;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: background 0.2s ease, transform 0.1s ease;
}

.action-btn:active {
  transform: scale(0.97);
}

.alert-btn {
  background: #3498db;
  color: #fff;
}

.alert-btn:hover {
  background: #2980b9;
}

.edit-btn {
  background: #3498db;
  color: #fff;
}

.edit-btn:hover {
  background: #3498db;
}

.review-btn {
  background: #3498db;
  color: #fff;
}

.review-btn:hover {
  background: #3498db;
}

.heatmap-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 10px;
}

.heatmap-controls select,
.heatmap-controls button {
  padding: 6px 10px;
}

.dashboard-main-column {
    display: flex;
    flex-direction: row; /* Keep row to have cards on left, chart on right */
    gap: 15px;
    align-items: flex-start;
    margin-top: 20px;
    width: 100%;
}

.analytics-cards {
    flex: 0.8; /* Adjusted to be slightly narrower for a single column */
    display: grid;
    grid-template-columns: 1fr; 
    gap: 2px;
}

.chart-wrapper {
    flex: 1; /* Takes up the remaining space */
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%; 
}
.chart-container {
    position: relative;
    height: 350px; 
    width: 300px; 
    margin: 0 auto;
}

.alert-card {
    display: block; 
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
}

.alert-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.alert-card p {
    font-size: 18px;
    font-weight: bold;
    margin: 0 !important; /* Reset margin for cleaner look */
}