/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

/* BODY BACKGROUND */
body {
  background: linear-gradient(135deg, #6a5af9, #a044ff);
  min-height: 100vh;
  padding: 20px;
}

/* HIDDEN */
.hidden {
  display: none;
}

/* LOGIN BOX */
.login-box {
  max-width: 350px;
  margin: 80px auto;
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.login-box h2 {
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.login-box button {
  width: 100%;
  padding: 10px;
  border: none;
  background: #6a5af9;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

/* MAIN APP */
.app-container {
  max-width: 1100px;
  margin: auto;
  background: #f5f6fa;
  border-radius: 16px;
  padding: 20px;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header h2 {
  font-size: 22px;
}

/* BUTTONS */
.btn-blue {
  background: #4a6cf7;
  color: white;
  border: none;
  padding: 8px 14px;
  margin-left: 5px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-red {
  background: #ff4d4f;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-green {
  background: #28c76f;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-orange {
  background: #ff9f43;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

/* DASHBOARD CARDS */
.card-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.card-box {
  flex: 1;
  background: linear-gradient(135deg, #6a5af9, #4a6cf7);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.card-box h2 {
  margin-top: 10px;
}

/* TABS */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.tab {
  flex: 1;
  padding: 10px;
  border-radius: 20px;
  border: none;
  background: #ddd;
  cursor: pointer;
}

.tab.active {
  background: #ff7a18;
  color: white;
}

/* TAB CONTENT */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* INPUTS */
input {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* PATIENT CARD */
#patientList {
  margin-top: 15px;
}

.card {
  background: white;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* UPLOAD */
.upload-buttons {
  margin: 10px 0;
}

/* PROGRESS BAR */
.progress-container {
  width: 100%;
  height: 25px;
  background: #ddd;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #28c76f;
  text-align: center;
  color: white;
  line-height: 25px;
  transition: 0.3s;
}

/* STATUS */
#statusText {
  margin-top: 10px;
  font-weight: bold;
}

/* ERROR LOG */
#errorLog {
  margin-top: 10px;
  color: red;
  font-size: 13px;
}

/* RESPONSIVE */
@media (max-width: 768px) {

  .card-row {
    flex-direction: column;
  }

  .tabs {
    flex-direction: column;
  }
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
}

/* HEADER */
.history-table th {
  background: linear-gradient(45deg, #4a6cf7, #6a5acd);
  color: white;
  padding: 12px;
  text-align: left;
  border: 1px solid #ddd;
}

/* CELLS */
.history-table td {
  padding: 10px;
  border: 1px solid #ddd;   /* 🔥 THIS CREATES FULL GRID */
  vertical-align: top;
}

/* ROW COLORS */
.history-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

/* HOVER */
.history-table tbody tr:hover {
  background: #eef2ff;
}

/* DATE COLUMN SMALL WIDTH */
.history-table td:first-child {
  width: 140px;
  font-weight: bold;
}

/* DIAGNOSIS COLUMN */
.history-table td:nth-child(2) {
  width: 30%;
}

/* MEDICINE COLUMN */
.history-table td:nth-child(3) {
  width: 40%;
}

/* NOTES CENTER */
.history-table td:last-child {
  text-align: center;
  font-weight: bold;
}

.history-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

#visitPage input,
#visitPage textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

#visitPage textarea {
  height: 70px;
}

.card-box{
  transition:0.2s;
}

.card-box:hover{
  transform:scale(1.03);
  opacity:0.95;
}

.dashboard-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:9999;
}

.dashboard-modal-box{
  width:90%;
  max-width:900px;
  max-height:85vh;
  overflow:auto;
  background:#fff;
  border-radius:14px;
  padding:20px;
}

.dashboard-modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:15px;
}

.dashboard-modal-header h2{
  margin:0;
}

.dashboard-modal-header button{
  border:none;
  background:red;
  color:#fff;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
}

.dashboard-modal-body table{
  width:100%;
  border-collapse:collapse;
}

.dashboard-modal-body th{
  background:#4f46e5;
  color:#fff;
  padding:10px;
  border:1px solid #ddd;
  text-align:left;
}

.dashboard-modal-body td{
  padding:10px;
  border:1px solid #ddd;
}

.patient-link{
  color:#1d4ed8;
  font-weight:bold;
  cursor:pointer;
}

.patient-link:hover{
  text-decoration:underline;
}