/* ================================================
   POSCARE - ADMIN DIGITAL POSYANDU
   Global Styles (Login background ada di css/pages/login.css)
   ================================================ */

/* Reset & Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Roboto", "Lato", "Segoe UI", Tahoma, Geneva, Verdana,
    sans-serif;
  position: relative;
  background: linear-gradient(135deg, #e6f2ff 0%, #d0e6ff 100%);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  color: #1e293b;
}

/* ================================================
   DASHBOARD & MAIN APP STYLES
   ================================================ */

/* Main Container */
.main-container {
  display: flex;
  min-height: 100vh;
  background: transparent;
}

/* Dashboard Page Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  background: transparent;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.page-subtitle {
  font-size: 1rem;
  color: #6b7280;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #1e3a5f 0%, #2c5282 100%);
  color: #fff;
  padding: 2rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 0 2rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.sidebar-header p {
  font-size: 0.9rem;
  opacity: 0.8;
}

.sidebar-menu {
  padding: 2rem 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #79a8ea;
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: #79a8ea;
  font-weight: 600;
}

.menu-item i {
  width: 24px;
  margin-right: 1rem;
  font-size: 1.2rem;
}

/* Content Area */
.content {
  margin-left: 280px;
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
  background: transparent;
}

/* Grid Layout */
.grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 992px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Header */
.header {
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.8rem;
  color: #1e3a5f;
  font-weight: 700;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #246bce, #79a8ea);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  margin-bottom: 2rem;
}

.card-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 20px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.5;
}

.card-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table thead {
  background: #f8fafc;
}

table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #4a6fa3;
  border-bottom: 2px solid #e5e7eb;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #4a5568;
}

table tbody tr {
  transition: all 0.2s ease;
}

table tbody tr:hover {
  background: #f8fafc;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  font-size: 0.95rem;
}

.btn-primary {
  background: #246bce;
  color: #fff;
}

.btn-primary:hover {
  background: #1d58a8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(36, 107, 206, 0.3);
}

.btn-success {
  background: #10b981;
  color: #fff;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
  transform: translateY(-2px);
}

.btn-info {
  background: #3b82f6;
  color: #fff;
}

.btn-info:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #246bce;
  box-shadow: 0 0 0 3px rgba(36, 107, 206, 0.1);
}

.form-control:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: linear-gradient(135deg, #246bce, #79a8ea);
}

.stat-icon.green {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.stat-icon.yellow {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.stat-icon.red {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

.stat-icon.purple {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.stat-content {
  flex: 1;
}

.stat-content h3 {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-content p {
  font-size: 2rem;
  font-weight: 700;
  color: #1e3a5f;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-primary {
  background: #e0f2fe;
  color: #075985;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.alert-warning {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.alert-danger {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.alert-info {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 1.5rem;
  color: #1e3a5f;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: #ef4444;
  transform: rotate(90deg);
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(36, 107, 206, 0.3);
  border-top-color: #246bce;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination button:hover {
  background: #f3f4f6;
  border-color: #246bce;
}

.pagination button.active {
  background: #246bce;
  color: #fff;
  border-color: #246bce;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  table {
    font-size: 0.875rem;
  }

  table th,
  table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.d-flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.align-center {
  align-items: center;
}

.gap-1 {
  gap: 0.5rem;
}
.gap-2 {
  gap: 1rem;
}
.gap-3 {
  gap: 1.5rem;
}

.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;
}

.ml-1 {
  margin-left: 0.5rem;
}
.ml-2 {
  margin-left: 1rem;
}
.ml-auto {
  margin-left: auto;
}

.mr-1 {
  margin-right: 0.5rem;
}
.mr-2 {
  margin-right: 1rem;
}
.mr-auto {
  margin-right: auto;
}

.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}
.p-4 {
  padding: 2rem;
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}

.hidden {
  display: none;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}

/* ================================================
   NAVBAR STYLES (Glassmorphism with Animated Underline)
   ================================================ */

.navbar {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(30, 58, 95, 0.08);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: #246bce;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: default; /* Logo tidak bisa diklik */
}

.navbar-logo i {
  font-size: 1.5rem;
}

.navbar-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.navbar-menu li a {
  text-decoration: none;
  color: #64748b;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent !important;
  box-shadow: none !important;
}

/* Icon styling */
.navbar-menu li a i {
  font-size: 1rem;
  transition: all 0.3s ease;
}

/* Animated Underline Effect */
.navbar-menu li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, #246bce, #79a8ea);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-menu li a:hover {
  color: #246bce;
  background: transparent !important;
  transform: translateY(-2px);
  box-shadow: none !important;
}

/* Underline muncul saat hover */
.navbar-menu li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Icon bounce saat hover */
.navbar-menu li a:hover i {
  transform: scale(1.15) rotate(5deg);
  color: #246bce;
}

.navbar-menu li a.active {
  color: #246bce;
  background: transparent !important;
  box-shadow: none !important;
}

/* Active state - underline selalu terlihat */
.navbar-menu li a.active::after {
  transform: translateX(-50%) scaleX(1);
  background: #246bce;
}

/* Responsive Navbar */
@media (max-width: 1200px) {
  .navbar-menu {
    gap: 1.5rem;
  }

  .navbar-menu li a {
    padding: 0.5rem 0.75rem;
    font-size: 15px;
  }
}

@media (max-width: 992px) {
  .navbar-menu {
    gap: 1rem;
  }

  .navbar-menu li a span {
    display: none;
  }

  .navbar-menu li a {
    padding: 0.5rem;
  }

  .navbar-menu li a i {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .navbar-container {
    flex-wrap: wrap;
  }

  .navbar-menu {
    gap: 0.5rem;
  }

  .navbar-logo {
    font-size: 20px;
  }

  .navbar-logo i {
    font-size: 20px;
  }
}
