:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --muted:#6c757d;
  --primary:#2c7be5;
  --melyfarma: #298544;
  --shadow: 0 6px 18px rgba(28,41,70,0.06);
}

*{box-sizing:border-box}

body{
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial; 
  background:var(--bg); 
  color:#0b1a2b; 
  margin:0;
}

/* ===== Sidebar ===== */
.light .sidebar{
  background:var(--card); 
  width:260px; 
  min-width: 260px;
  min-height:100vh; 
  display:flex; 
  flex-direction:column;
}
.sidebar .brand{
  border-bottom:1px solid rgba(15,23,42,0.04);
}
.logo{
  width:44px;
  height:44px; 
  color:white; 
  font-weight:700;
}
.sidebar .nav-link{
  color:#223; 
  padding:12px 14px; 
  border-radius:8px; 
  margin:6px 6px; 
  display:flex; 
  align-items:center; 
  gap:10px;
}
.sidebar .nav-link.active, 
.sidebar .nav-link:hover{
  background:rgba(44,123,229,0.08); 
  color:var(--primary);
}

/* ===== Topbar ===== */
.topbar{
  height: 75px; 
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* ===== Content ===== */
.content{
  min-height:100vh; 
  display:flex; 
  flex-direction:column;
}

/* ===== Cards / Stats ===== */
.stat-card,
.card{
  border-radius:12px; 
  box-shadow:var(--shadow);
}

.cards-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.stat-card .icon {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%; 
  font-size: 15px;
}


/* ===== Avatar ===== */
.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;      
  overflow: hidden;   
  flex-shrink: 0;        
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;                
}

.profile .dropdown-menu .dropdown-item:hover {
  background-color: #f1f3f6; 
  color: #0b1a2b;
}

.avatar{
  width:40px; 
  height:40px; 
  border-radius:8px; 
  background:linear-gradient(135deg,#e9eef9,#eef7ff); 
  display:inline-block;
}

.avatar-wrapper {
  position: relative;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.avatar-initials {
  text-transform: uppercase;
}


/* ===== Auth Page ===== */

.btn-melyfarma {
  background-color: #298544 !important;
  border-color: #298544 !important;
  color: #fff !important;
}

.btn-melyfarma:hover {
  background-color: #236d36;
  border-color: #236d36;
}

.auth-page{
  background:linear-gradient(180deg,#f4f7fb,#eef5ff); 
  height: 100vh;
  display:flex; 
  align-items:center; 
  justify-content:center;
}
.auth-container{
  width:100%; 
  max-width:960px; 
  padding:2rem;
}
.auth-page .card{
  border-radius:12px; 
  box-shadow:var(--shadow);
}

.authentication-inner .card {
  position: relative;
  z-index: 2;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.95);
  width: 400px;
  text-align: left;
  padding: 2rem;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  z-index: 1;
  animation: float 6s ease-in-out infinite alternate;
}

.shape1 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #7367f0, #9f8cff);
  top: -50px;
  left: -50px;
}
.shape2 {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #28c76f, #48e68c);
  bottom: -30px;
  right: -30px;
  animation-duration: 8s;
}
.shape3 {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #ff9f43, #ffca3a);
  top: 20%;
  right: -60px;
  animation-duration: 10s;
}

@keyframes float {
  0% { transform: translateY(0) translateX(0) rotate(0deg); }
  50% { transform: translateY(-20px) translateX(10px) rotate(15deg); }
  100% { transform: translateY(0) translateX(0) rotate(0deg); }
}

.card .form-control {
  border-radius: 12px;
  padding: 10px 12px;
}
.card .form-label {
  font-weight: 500;
}
.card .btn-primary {
  border-radius: 12px;
  padding: 10px;
  font-weight: 600;
  transition: all 0.3s;
}
.card .btn-primary:hover {
  background-color: #536df6;
  transform: translateY(-2px);
}

.card form .mb-3 {
  margin-bottom: 1.25rem;
}
.card form .form-label {
  display: block;
  margin-bottom: 0.25rem;
}


/* ===== Search Form ===== */
.search-form input{
  width:360px;
  max-width: 100%;
}

/* ===== Notifications ===== */
.notifications .badge { 
  position:absolute; 
  top:-6px; 
  right:-6px; 
}

.notif-dropdown {
  position: absolute;
  top: 36px;
  right: 0;
  width: 300px;
  background: #fff;
  border-radius: 12px;
  border-width: 2px;
  border-style: groove;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: none;
  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px);}
  to { opacity: 1; transform: translateY(0);}
}

.notif-header {
  border-bottom: 1px solid #eee;
  background: #f9f9f9;
}

.notif-body {
  max-height: 300px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  align-items: start;
  gap: 8px;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: rgba(44,123,229,0.08);
  border-radius: 8px;
}

.notif-item i {
  flex-shrink: 0;
}

#clearNotif {
  font-size: 0.8rem;
  text-decoration: none;
  padding: 0;
}

/* ===== Dark Theme ===== */
body.dark{
  background:#0b1220; 
  color:#dbe9ff;
}
body.dark .sidebar{
  background:#071028; 
  color:#b9d7ff;
}
body.dark .card{
  background:#071229; 
  box-shadow:none; 
  color:#cfe8ff;
}
body.dark .topbar{
  background:#071229;
}
body.dark .logo{
  background:linear-gradient(135deg,#8ab4ff,#3b82f6);
}

/* ===== Responsive ===== */
@media (max-width: 991px){
  .sidebar{
    position: fixed;
    left: -100%;
    top: 0;
    height: 100%;
    width: 260px;
    transition: left 0.3s ease;
    z-index: 1050;
  }
  .sidebar.show{
    left: 0;
  }
  .sidebar-overlay{
    content:"";
    position: fixed;
    inset:0;
    background: rgba(0,0,0,0.4);
    z-index: 1049;
    display: none;
  }
  .sidebar.show ~ .sidebar-overlay{
    display: block;
  }
  .content{
    padding-left: 0 !important;
  }
}

@media (max-width: 767px){
  .sidebar{
    position:fixed; 
    left:-100%; 
    transition:all .25s ease; 
    z-index:1050;
  }
  .sidebar.show{left:0;}
  .content{padding-left:0;}
}

@media (max-width: 575px){
  .search-form{
    flex: 1;
  }
  .search-form input{
    width: 100%;
  }
}
