/*=============================================================
  Admin Panel Theme System — admin-themes.css
  Themes: adminlte | standard | gray | forest | midnight | rose | ocean
=============================================================*/

/* ─── CSS Variables Root ─── */
:root {
  --theme-primary:    #28a745;
  --theme-primary-dk: #1e7e34;
  --theme-primary-lt: #d4edda;
  --theme-accent:     #ffc107;
  --theme-sidebar-bg: #ffffff;
  --theme-sidebar-txt:#444444;
  --theme-sidebar-act:#28a745;
  --theme-sidebar-act-bg: #e8f5e9;
  --theme-sidebar-hover-bg: #f1f8f2;
  --theme-topbar-bg:  #28a745;
  --theme-topbar-txt: #ffffff;
  --theme-body-bg:    #f4f6f9;
  --theme-card-bg:    #ffffff;
  --theme-border:     #dee2e6;
}

/* ─── THEME: adminlte (Green – Default) ─── */
body.theme-adminlte { --theme-primary:#28a745; --theme-primary-dk:#1e7e34; --theme-primary-lt:#d4edda; --theme-accent:#ffc107; --theme-sidebar-bg:#ffffff; --theme-sidebar-txt:#444; --theme-sidebar-act:#28a745; --theme-sidebar-act-bg:#e8f5e9; --theme-sidebar-hover-bg:#f1f8f2; --theme-topbar-bg:#28a745; --theme-topbar-txt:#fff; --theme-body-bg:#f4f6f9; }

/* ─── THEME: standard (Blue) ─── */
body.theme-standard { --theme-primary:#2563eb; --theme-primary-dk:#1d4ed8; --theme-primary-lt:#dbeafe; --theme-accent:#f59e0b; --theme-sidebar-bg:#ffffff; --theme-sidebar-txt:#444; --theme-sidebar-act:#2563eb; --theme-sidebar-act-bg:#eff6ff; --theme-sidebar-hover-bg:#f0f5ff; --theme-topbar-bg:#2563eb; --theme-topbar-txt:#fff; --theme-body-bg:#f0f4fb; }

/* ─── THEME: gray (Slate) ─── */
body.theme-gray { --theme-primary:#4b5563; --theme-primary-dk:#374151; --theme-primary-lt:#f3f4f6; --theme-accent:#6366f1; --theme-sidebar-bg:#1f2937; --theme-sidebar-txt:#d1d5db; --theme-sidebar-act:#e5e7eb; --theme-sidebar-act-bg:#374151; --theme-sidebar-hover-bg:#374151; --theme-topbar-bg:#111827; --theme-topbar-txt:#f9fafb; --theme-body-bg:#f3f4f6; }

/* ─── THEME: forest (Dark Green) ─── */
body.theme-forest { --theme-primary:#065f46; --theme-primary-dk:#064e3b; --theme-primary-lt:#d1fae5; --theme-accent:#84cc16; --theme-sidebar-bg:#022c22; --theme-sidebar-txt:#a7f3d0; --theme-sidebar-act:#34d399; --theme-sidebar-act-bg:#064e3b; --theme-sidebar-hover-bg:#065f46; --theme-topbar-bg:#022c22; --theme-topbar-txt:#a7f3d0; --theme-body-bg:#f0fdf4; }

/* ─── THEME: midnight (Dark Navy) ─── */
body.theme-midnight { --theme-primary:#4f46e5; --theme-primary-dk:#3730a3; --theme-primary-lt:#e0e7ff; --theme-accent:#f472b6; --theme-sidebar-bg:#0f172a; --theme-sidebar-txt:#94a3b8; --theme-sidebar-act:#818cf8; --theme-sidebar-act-bg:#1e1b4b; --theme-sidebar-hover-bg:#1e293b; --theme-topbar-bg:#0f172a; --theme-topbar-txt:#e2e8f0; --theme-body-bg:#f1f5f9; }

/* ─── THEME: rose (Warm Pink) ─── */
body.theme-rose { --theme-primary:#e11d48; --theme-primary-dk:#be123c; --theme-primary-lt:#fce7f3; --theme-accent:#f97316; --theme-sidebar-bg:#fff1f2; --theme-sidebar-txt:#4c0519; --theme-sidebar-act:#e11d48; --theme-sidebar-act-bg:#ffe4e6; --theme-sidebar-hover-bg:#fff1f2; --theme-topbar-bg:#e11d48; --theme-topbar-txt:#fff; --theme-body-bg:#fff5f7; }

/* ─── THEME: ocean (Teal) ─── */
body.theme-ocean { --theme-primary:#0891b2; --theme-primary-dk:#0e7490; --theme-primary-lt:#cffafe; --theme-accent:#f59e0b; --theme-sidebar-bg:#083344; --theme-sidebar-txt:#a5f3fc; --theme-sidebar-act:#22d3ee; --theme-sidebar-act-bg:#0e7490; --theme-sidebar-hover-bg:#0e7490; --theme-topbar-bg:#083344; --theme-topbar-txt:#cffafe; --theme-body-bg:#f0fdfe; }

/*=== Apply variables to components ===*/

/* Body */
body { background-color: var(--theme-body-bg) !important; }

/* Topbar / Navbar */
.navbar.bg-success,
nav.navbar { 
  background-color: var(--theme-topbar-bg) !important; 
  color: var(--theme-topbar-txt) !important;
}
.navbar .text-white, .navbar .navbar-brand span { color: var(--theme-topbar-txt) !important; }

/* Sidebar */
nav#sidebar { background-color: var(--theme-sidebar-bg) !important; }
nav#sidebar .nav-item { 
  color: var(--theme-sidebar-txt) !important; 
  background-color: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
nav#sidebar .nav-item:hover { 
  background-color: var(--theme-sidebar-hover-bg) !important; 
  color: var(--theme-sidebar-act) !important;
  border: none !important;
}
nav#sidebar .nav-item.active { 
  background-color: var(--theme-sidebar-act-bg) !important;
  color: var(--theme-sidebar-act) !important;
  border: none !important;
  border-left: 4px solid var(--theme-sidebar-act) !important;
  border-radius: 0 8px 8px 0 !important;
}
nav#sidebar .icon-field { color: var(--theme-sidebar-act) !important; }
nav#sidebar .nav-item.active .icon-field { color: var(--theme-sidebar-act) !important; }

/* Buttons */
.btn-primary, .btn-success { 
 /* background-color: var(--theme-primary) !important; */
  border-color: var(--theme-primary-dk) !important; 
}
.btn-primary:hover, .btn-success:hover { 
  background-color: var(--theme-primary-dk) !important; 
}
.btn-outline-primary { 
  color: var(--theme-primary) !important; 
  border-color: var(--theme-primary) !important; 
}
.btn-outline-primary:hover { 
  background-color: var(--theme-primary) !important; 
  color: #fff !important; 
}

/* Badges */
.badge-primary, .badge.bg-primary { 
/*  background-color: var(--theme-primary) !important; */
}

/* Links */
a { color: var(--theme-primary) !important; }
a:hover { color: var(--theme-primary-dk) !important; }

/* Cards */
.card { background: var(--theme-card-bg) !important; }
.card-header.bg-success, .card-header.bg-primary { 
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dk)) !important; 
}

/* DataTable / Table */
table.dataTable thead { background: var(--theme-primary-lt) !important; }
table.dataTable thead th { color: var(--theme-primary-dk) !important; }

/* Form focus */
.form-control:focus, .form-select:focus { 
  border-color: var(--theme-primary) !important; 
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary), 0.15) !important;
}

/*=== Theme Picker Panel ===*/
#theme-picker-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99999;
  background: var(--theme-primary);
  color: #fff;
  border: none;
  border-radius: 8px 0 0 8px;
  padding: 12px 10px;
  cursor: pointer;
  box-shadow: -3px 0 15px rgba(0,0,0,0.15);
  writing-mode: vertical-rl;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
#theme-picker-btn:hover { padding-right: 14px; }
#theme-picker-btn i { writing-mode: initial; font-size: 16px; }

#theme-picker-panel {
  position: fixed;
  right: -320px;
  top: 0;
  width: 300px;
  height: 100vh;
  background: #fff;
  z-index: 99998;
  box-shadow: -5px 0 30px rgba(0,0,0,0.15);
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  padding-bottom: 20px;
}
#theme-picker-panel.open { right: 0; }

.theme-panel-header {
  background: var(--theme-primary);
  color: #fff;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.theme-panel-header .close-btn {
  cursor: pointer;
  font-size: 20px;
  opacity: 0.8;
  background: none;
  border: none;
  color: #fff;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}
.theme-option:hover { background: #f9fafb; }
.theme-option.active { background: #f0fdf4; }
.theme-swatch {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid transparent;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.theme-option.active .theme-swatch { border-color: #22c55e; box-shadow: 0 0 0 2px #bbf7d0; }
.swatch-top { grid-column: 1/-1; }
.theme-info .theme-name { font-weight: 700; font-size: 14px; color: #1f2937; }
.theme-info .theme-desc { font-size: 12px; color: #6b7280; }
.theme-check { margin-left: auto; color: #22c55e; font-size: 18px; display: none; }
.theme-option.active .theme-check { display: block; }

/*=== Sidebar Collapse Mode ===*/
@media (min-width: 769px) {
  body.sidebar-collapsed nav#sidebar { width: 70px !important; overflow-x: hidden; }
  body.sidebar-collapsed nav#sidebar .nav-item { 
    text-align: center !important; 
    padding: 18px 0 !important; 
    transition: padding 0.2s;
  }
  body.sidebar-collapsed nav#sidebar .nav-item .nav-text { 
    display: none !important; 
  }
  body.sidebar-collapsed nav#sidebar .nav-item .icon-field i { 
    font-size: 20px !important; 
  }
  body.sidebar-collapsed nav#sidebar .nav-item .icon-field {
    margin-right: 0 !important;
  }
  body.sidebar-collapsed main#view-panel { 
    margin-left: 70px !important; 
    width: calc(100% - 70px) !important; 
  }
}
