* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f4f8;
  color: #333;
  min-height: 100vh;
}

/* Nav */
nav {
  background: #007bff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

nav .brand {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-right: 32px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0 14px;
  line-height: 56px;
  font-size: 0.95rem;
  transition: color 0.2s, border-bottom 0.2s;
}

nav a:hover, nav a.active {
  color: #fff;
  border-bottom: 3px solid #fff;
}

nav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

nav .user-info {
  color: rgba(255,255,255,0.9);
  font-size: 0.88rem;
}

/* Buttons */
button, .btn {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  background: #007bff;
  color: #fff;
}
.btn-primary:hover { background: #0056b3; }

.btn-danger {
  background: #dc3545;
  color: #fff;
}
.btn-danger:hover { background: #a71d2a; }

.btn-secondary {
  background: #6c757d;
  color: #fff;
}
.btn-secondary:hover { background: #495057; }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.82rem;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.1rem;
  color: #007bff;
  margin-bottom: 16px;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 10px;
}

/* Stats row */
.stats-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  min-width: 160px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px 24px;
  text-align: center;
  border-top: 4px solid #007bff;
}

.stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: #007bff;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 4px;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
}

/* Two-column */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; }
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
}

/* Patient list items */
.patient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.patient-item:last-child { border-bottom: none; }

.patient-item:hover .patient-name { color: #007bff; text-decoration: underline; }

.patient-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.patient-meta {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-active {
  background: #d4edda;
  color: #155724;
}

.badge-discharged {
  background: #f8d7da;
  color: #721c24;
}

/* Vitals history */
.vitals-item {
  border-left: 3px solid #007bff;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #f8f9fa;
  border-radius: 0 4px 4px 0;
}

.vitals-item .vitals-date {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 4px;
}

.vitals-item .vitals-values {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
}

.vitals-item .vitals-notes {
  font-size: 0.85rem;
  color: #555;
  margin-top: 6px;
  font-style: italic;
}

/* Login page */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.login-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
}

.login-card .logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-card .logo h1 {
  font-size: 2rem;
  color: #007bff;
  font-weight: 800;
  letter-spacing: 2px;
}

.login-card .logo p {
  color: #888;
  font-size: 0.85rem;
  margin-top: 4px;
}

.login-logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
}

.alert {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Patient info header */
.patient-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.patient-avatar {
  width: 56px;
  height: 56px;
  background: #007bff;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.patient-header-info h2 {
  font-size: 1.25rem;
  color: #222;
  border: none;
  padding: 0;
  margin: 0;
}

.patient-header-info p {
  color: #888;
  font-size: 0.88rem;
  margin-top: 2px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  color: #aaa;
  padding: 28px 0;
  font-size: 0.9rem;
}
