/* ===== COLOR SYSTEM ===== */
:root {
  /* Primary Colors */
  --primary: #0F2847;
  --secondary: #2E5F8F;
  --background: #F7F9FB;
  --accent: #2CA58D;
  
  /* Text Colors */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  /* Status Colors */
  --success: #2CA58D;
  --warning: #F59E0B;
  --error: #EF4444;
  
  /* UI Neutrals */
  --card-background: #FFFFFF;
  --border: #E2E8F0;
  --hover: #EEF4F8;
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-y: auto;
}

html {
  scroll-behavior: smooth;
  overflow: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary);
}

/* ===== LAYOUT ===== */
.container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.left {
  width: 40%;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}

.left h1, .left h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.left p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

.login-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.logo-symbol {
  width: 180px;
  height: 180px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.left h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

.right {
  width: 60%;
  display: flex;
  justify-content: center;
  align-items: start;
  padding: 2rem;
  overflow-y: auto;
}

/* ===== CARDS ===== */
.card {
  background: var(--card-background);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.3s ease;
  border: 1px solid var(--border);
  min-width: 350px;
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

/* ===== FORM INPUT ERRORS ===== */
input.field-error,
textarea.field-error,
select.field-error {
  border-color: var(--error) !important;
  background-color: rgba(239, 68, 68, 0.05);
}

input.field-error:focus,
textarea.field-error:focus,
select.field-error:focus {
  outline: none;
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-message {
  margin-bottom: 1rem;
  
  border-radius: 6px;
  font-size: 0.9rem;
}

.form-message.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border-left: 3px solid var(--error);
}

.form-message.alert-success {
  background-color: rgba(44, 165, 141, 0.1);
  color: var(--success);
  border-left: 3px solid var(--success);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--card-background);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
  margin: 0.5rem 0;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== FORMS ===== */
input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(79, 143, 191, 0.1);
  background: var(--hover);
}

label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.form-group {
  margin-bottom: 2rem;
}

/* ===== BUTTONS ===== */
button, .button {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

button:hover, .button:hover {
  background: #16324F;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

button:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-secondary:hover {
  background: #3d7aad;
}

.btn-accent {
  background: var(--accent);
}

.btn-accent:hover {
  background: #239876;
}

.btn-danger {
  background: var(--error);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-warning {
  background: var(--warning);
}

.btn-warning:hover {
  background: #d97706;
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 2rem;
}

.tab {
  padding: 1rem 0;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ===== NAVIGATION ===== */
.navbar {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
}

.navbar-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.navbar-menu a {
  color: white;
  transition: color 0.3s ease;
}

.navbar-menu a:hover {
  color: var(--accent);
}

.sidebar {
  width: 250px;
  background: var(--primary);
  color: white;
  height: 100vh;
  padding: 2rem 1rem;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-menu {
  list-style: none;
  margin-top: 2rem;
}

.sidebar-item {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active {
  
  font-weight: 600;
}

.sidebar-item a {
  color: white;
}

/* ===== MAIN CONTENT ===== */
.main {
  margin-left: 250px;
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
}

.dashboard {
  margin-top: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  margin: 0;
}

/* ===== TABLES ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.table thead {
  background: var(--hover);
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
  background: var(--hover);
  transition: background 0.3s ease;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.status-active {
  color: var(--success);
  font-weight: 600;
}

.status-discharged {
  color: var(--error);
  font-weight: 600;
}

/* ===== ALERTS & MESSAGES ===== */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(44, 165, 141, 0.1);
  border-left-color: var(--success);
  color: #166534;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: var(--error);
  color: #7f1d1d;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: var(--warning);
  color: #78350f;
}

.alert-info {
  background: rgba(79, 143, 191, 0.1);
  border-left-color: var(--secondary);
  color: #1e3a8a;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: rgba(30, 58, 95, 0.2);
  color: var(--primary);
}

.badge-success {
  background: rgba(44, 165, 141, 0.2);
  color: var(--success);
}

.badge-error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  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.active {
  display: flex;
}

.modal-content {
  background: var(--card-background);
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

/* ===== CHARTS/GRAPHS CONTAINER ===== */
.chart-container {
  background: var(--card-background);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
    padding: 1.5rem 0.5rem;
  }

  .main {
    margin-left: 200px;
    padding: 1.5rem;
  }

  .card {
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
  }

  .left {
    width: 100%;
    height: 200px;
    padding: 1.5rem;
  }

  .right {
    width: 100%;
    padding: 1.5rem;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1rem;
  }

  .sidebar-menu {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-top: 0;
  }

  .sidebar-item {
    white-space: nowrap;
  }

  .main {
    margin-left: 0;
    padding: 1rem;
  }

  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  .navbar-menu {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .tabs {
    gap: 1rem;
  }

  .table {
    font-size: 0.9rem;
  }

  .table th, .table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 1.5rem;
    min-width: 100%;
  }

  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  button, .button {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  .stat-number {
    font-size: 2rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ===== REPORTS PAGE STYLES ===== */
.reports-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--hover);
  border-bottom-color: var(--secondary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

.report-section {
  display: none;
}

.report-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--background);
  border-radius: 8px;
}

.report-btn {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #4F8FBF 0%, #2CA58D 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.15);
}

.report-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
  background: linear-gradient(135deg, #2CA58D 0%, #4F8FBF 100%);
}

.report-btn:active {
  transform: translateY(-1px);
}

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hidden {
  display: none;
}

.opacity-50 {
  opacity: 0.5;
}

.cursor-pointer {
  cursor: pointer;
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

.text-warning {
  color: var(--warning);
}

.bg-light {
  background: var(--hover);
  padding: 1rem;
  border-radius: 8px;
}

.welcome-section {
    margin-bottom: 14px;
}

.welcome-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #111827;
}

.welcome-text {
    margin-top: 4px;
    font-size: 0.95rem;
    color: #6B7280;
}