:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --brand-color: #0099cc; /* Medical Blue */
  --sidebar-width: 260px;
}
body {
  font-family: "Sarabun", sans-serif;
  background-color: #f4f7f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sidebar Layout */
.wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
  min-height: 100vh;
}
#sidebar {
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background: #ffffff;
  color: #333;
  transition: all 0.3s;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}
#sidebar .sidebar-header {
  padding: 20px;
  background: white;
  border-bottom: 1px solid #eee;
}
#sidebar ul.components {
  padding: 20px 0;
}
#sidebar ul p {
  color: #aaa;
  padding: 10px 20px 5px;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0;
}
#sidebar ul li a {
  padding: 10px 25px;
  font-size: 0.95rem;
  display: block;
  color: #555;
  text-decoration: none;
  transition: 0.3s;
  border-left: 4px solid transparent;
}
#sidebar ul li a:hover {
  background: #f8f9fa;
  color: var(--brand-color);
}
#sidebar ul li.active > a,
a[aria-expanded="true"] {
  color: var(--brand-color);
  background: #eef7fb;
  border-left-color: var(--brand-color);
  font-weight: 500;
}
ul ul a {
  font-size: 0.9em !important;
  padding-left: 45px !important;
  background: #fff;
}

#content {
  width: 100%;
  padding: 20px;
  min-height: 100vh;
  transition: all 0.3s;
  background-color: #f4f7f6;
}

/* Admin Cards */
.admin-card {
  border: none;
  border-radius: 12px;
  transition: transform 0.2s;
  height: 100%;
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  border: 1px solid #eee;
}
.admin-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-color);
}
.icon-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Custom Table */
.table-custom th {
  font-weight: 600;
  background-color: #eef7fb;
  color: #006699;
  border-bottom: 2px solid #bce0ef;
}
.table-custom td {
  vertical-align: middle;
}
.img-thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
}

/* Forms */
.form-label {
  font-weight: 500;
  color: #555;
}
.card-custom {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

/* Gallery */
.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
}
.gallery-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.gallery-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  padding: 5px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.gallery-actions:hover {
  background: white;
  color: red;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
  #sidebar {
    margin-left: calc(var(--sidebar-width) * -1);
  }
  #sidebar.active {
    margin-left: 0;
  }
}

/* Login Styles */
.login-container {
  max-width: 400px;
  margin: auto;
  padding: 2rem;
}
.card-login {
  border: none;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background: white;
  overflow: hidden;
}
.login-header {
  background: linear-gradient(135deg, var(--brand-color) 0%, #006699 100%);
  padding: 2rem;
  text-align: center;
  color: white;
}
.login-logo {
  width: 80px;
  height: 80px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  padding: 5px;
}
.login-logo img {
  width: 90%;
  height: auto;
}
.btn-brand {
  background-color: var(--brand-color);
  color: white;
  border: none;
}
.btn-brand:hover {
  background-color: #0077a3;
  color: white;
}

/* Preloader Styles moved to includes/preloader.php for robustness */



