/* ----------------------------------------------------
   ROBOCOOP CONTROL PANEL - LIGHT MODE PREMIUM STYLES
   ---------------------------------------------------- */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-sidebar: #0f172a;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #eff6ff;
  
  --accent-emerald: #10b981;
  --accent-emerald-light: #ecfdf5;
  
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-red-light: #fef2f2;
  
  --accent-amber: #f59e0b;
  --accent-amber-light: #fffbeb;

  --accent-indigo: #6366f1;
  --accent-indigo-light: #eef2ff;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --font-main: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-logo: 'Outfit', system-ui, sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* ----------------------------------------------------
   UTILITIES
   ---------------------------------------------------- */
.hide {
  display: none !important;
}

.text-blue { color: var(--accent-blue) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-red { color: var(--accent-red) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-indigo { color: var(--accent-indigo) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.py-md { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-lg { padding-top: 32px !important; padding-bottom: 32px !important; }
.margin-top-sm { margin-top: 8px !important; }
.margin-top-md { margin-top: 16px !important; }
.margin-top-lg { margin-top: 24px !important; }
.margin-bottom-md { margin-bottom: 16px !important; }

/* Grid Layouts */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.grid-sidebar {
  grid-template-columns: 1.8fr 1.2fr;
}
@media (max-width: 1024px) {
  .grid-sidebar {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------
   LOCK SCREEN PIN BARRIER - SPLIT SCREEN LAYOUT
   ---------------------------------------------------- */
.pin-barrier {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f8fafc;
  z-index: 9999;
  overflow-y: auto;
}

/* Glowing background blobs */
.pin-barrier::before,
.pin-barrier::after {
  content: '';
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: var(--accent-emerald);
  filter: blur(140px);
  opacity: 0.08;
  z-index: 0;
  pointer-events: none !important;
  animation: floatBlobs 8s ease-in-out infinite alternate;
}

.pin-barrier::before {
  top: 15%;
  left: 60%;
}

.pin-barrier::after {
  bottom: 15%;
  right: 10%;
  background: var(--accent-blue);
  animation-delay: -4s;
}

@keyframes floatBlobs {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.1); }
}

/* Split Layout Container */
.login-split-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* Left Brand Panel */
.login-brand-panel {
  flex: 1.2;
  background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
  border-right: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
  filter: blur(60px);
}

.brand-panel-content {
  max-width: 440px;
  color: #0f172a;
}

.brand-panel-mascot-container {
  width: 260px;
  height: 260px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 24px rgba(16, 185, 129, 0.15));
}

.login-mascot {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: mascotFloat 4s ease-in-out infinite;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1.5deg); }
}

.login-brand-panel h1 {
  font-family: 'Poppins', var(--font-logo);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #065f46 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.brand-tagline {
  font-size: 16px;
  color: #475569;
  margin-bottom: 44px;
  line-height: 1.5;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.feature-item i,
.feature-item svg {
  width: 20px;
  height: 20px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-item span {
  font-size: 14.5px;
  color: #334155;
  line-height: 1.4;
}

/* Right Form Panel */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background-color: #f8fafc;
  position: relative;
}

.login-form-panel::before {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
  filter: blur(60px);
}

.pin-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 44px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.06);
  width: 100%;
  max-width: 400px;
  text-align: center;
  z-index: 1;
  animation: cardFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive Breakpoint for Login Layout */
@media (max-width: 968px) {
  .login-brand-panel {
    display: none !important;
  }
  .login-form-panel {
    flex: 1;
    width: 100%;
    padding: 24px;
    background-color: #f8fafc;
  }
  .login-form-panel .pin-card {
    max-width: 100%;
    padding: 32px 24px;
  }
}

.lock-icon-container {
  width: 68px;
  height: 68px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 24px auto;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.08);
}

.lock-icon {
  color: #10b981;
  width: 26px;
  height: 26px;
}

.pin-header h2 {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 26px;
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.pin-header p {
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Custom styles for inputs in login card */
.pin-form .input-with-icon {
  margin-bottom: 16px;
}

.pin-form .input-with-icon input {
  font-size: 14px !important;
  letter-spacing: normal !important;
  text-align: left !important;
  font-family: var(--font-main) !important;
  padding: 13px 16px 13px 48px !important;
  margin-bottom: 0 !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  border-radius: 10px !important;
  transition: all 0.25s ease !important;
}

.pin-form .input-with-icon input::placeholder {
  color: #94a3b8;
}

.pin-form .input-with-icon input:focus {
  outline: none !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Override browser autofill background */
.pin-form .input-with-icon input:-webkit-autofill,
.pin-form .input-with-icon input:-webkit-autofill:hover,
.pin-form .input-with-icon input:-webkit-autofill:focus,
.pin-form .input-with-icon input:-webkit-autofill:active {
  -webkit-text-fill-color: #0f172a !important;
  -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
  box-shadow: 0 0 0 30px #ffffff inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.pin-form .input-with-icon > i,
.pin-form .input-with-icon > svg {
  color: #94a3b8 !important;
}

.pin-form .input-with-icon input:focus ~ i,
.pin-form .input-with-icon input:focus ~ svg {
  color: #10b981 !important;
}

.pin-form .btn-toggle-password {
  color: #94a3b8 !important;
}

.pin-form .btn-toggle-password:hover {
  color: #475569 !important;
  background-color: #f1f5f9 !important;
}

.pin-form .btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  padding: 14px 20px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
  margin-top: 24px !important;
}

.pin-form .btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3) !important;
}

.pin-form .btn-primary:active {
  transform: translateY(0);
}

#login-2fa-container label {
  color: #475569 !important;
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Custom styles for login card and form elements */
.login-card {
  box-shadow: 0 20px 40px -15px rgba(0, 104, 93, 0.06), 0 0 0 1px rgba(0, 104, 93, 0.04) !important;
  background-color: #ffffff !important;
}

.login-card input {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-width: 1.5px !important;
  border-color: #e2e8f0 !important;
  background-color: #f8fafc !important;
  color: #191c1d !important;
  border-radius: 12px !important;
}

.login-card input::placeholder {
  color: #94a3b8 !important;
}

.login-card input:hover {
  border-color: #cbd5e1 !important;
}

.login-card input:focus {
  border-color: #008376 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(0, 131, 118, 0.12) !important;
  outline: none !important;
}

/* Custom autofill styles to prevent default blue/yellow background */
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus,
.login-card input:-webkit-autofill:active {
  -webkit-text-fill-color: #191c1d !important;
  -webkit-box-shadow: 0 0 0 30px #f8fafc inset !important;
  box-shadow: 0 0 0 30px #f8fafc inset !important;
  border-color: #e2e8f0 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.login-card input:focus:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
  box-shadow: 0 0 0 30px #ffffff inset !important;
  border-color: #008376 !important;
}

.error-msg {
  color: #f87171 !important;
  font-size: 13px;
  margin-top: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: shakeError 0.3s ease-in-out;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ----------------------------------------------------
   SIDEBAR
   ---------------------------------------------------- */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #072926 0%, #031412 100%);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.logo-circle {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 151, 136, 0.25);
  overflow: hidden;
  padding: 4px;
}

.logo-icon {
  color: var(--text-white);
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-family: var(--font-logo);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-text p {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item i,
.nav-item svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.nav-item:hover {
  background-color: rgba(0, 151, 136, 0.08);
  color: #00bfa5;
}

.nav-item:hover i,
.nav-item:hover svg {
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, #009788 0%, #00685d 100%);
  color: var(--text-white);
  box-shadow: 0 4px 14px rgba(0, 151, 136, 0.3);
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 8px 0;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}

/* ----------------------------------------------------
   MAIN CONTENT HEADER
   ---------------------------------------------------- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.header-title h2 {
  font-family: var(--font-logo);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-title p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ----------------------------------------------------
   CONTENT PANELS
   ---------------------------------------------------- */
.content-wrapper {
  padding: 32px;
  overflow-y: auto;
  flex-grow: 1;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

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

/* ----------------------------------------------------
   CARDS
   ---------------------------------------------------- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-header i,
.card-header svg {
  width: 20px;
  height: 20px;
}

.card-body {
  padding: 24px;
}

.desc-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Compact Card (for stats) */
.card-compact .card-body {
  padding: 20px;
}

/* ----------------------------------------------------
   SYSTEM STATS CARDS
   ---------------------------------------------------- */
.stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.stat-icon {
  width: 18px;
  height: 18px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: var(--font-logo);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.stat-bar-wrapper {
  width: 100%;
  height: 6px;
  background-color: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.stat-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-bar-blue { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.stat-bar-emerald { background: linear-gradient(90deg, #34d399, #10b981); }
.stat-bar-amber { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.stat-bar-red { background: linear-gradient(90deg, #f87171, #ef4444); }

.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ----------------------------------------------------
   BUTTONS
   ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: var(--text-white);
}

.btn-primary:hover {
  background-color: var(--accent-blue-hover);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.btn-outline {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background-color: var(--border-light);
  color: var(--text-primary);
}

.btn-outline-danger {
  background-color: transparent;
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.btn-outline-danger:hover {
  background-color: var(--accent-red-light);
  border-color: var(--accent-red);
}

.btn-danger-sm {
  background-color: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.1);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
}

.btn-danger-sm:hover {
  background-color: var(--accent-red);
  color: var(--text-white);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------
   BADGES
   ---------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  line-height: 1;
}

.badge-success {
  background-color: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

.badge-success i,
.badge-success svg {
  width: 14px;
  height: 14px;
}

/* ----------------------------------------------------
   STATUS CONTAINERS
   ---------------------------------------------------- */
.status-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
}

.status-circle::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.4;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.status-green {
  background-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.status-red {
  background-color: var(--accent-red);
  color: var(--accent-red);
}

.status-text {
  font-weight: 600;
  font-size: 15px;
}

.status-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-action-bar {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

/* ----------------------------------------------------
   FORM ELEMENTS
   ---------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.input-with-icon {
  position: relative;
  width: 100%;
}

.input-with-icon > i,
.input-with-icon > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  display: block;
  padding: 12px 16px 12px 48px;
  font-size: 14px;
  font-family: var(--font-main);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  transition: all 0.2s ease;
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.helper-text {
  font-size: 11px;
  color: #475569; /* Darker slate-600 for WCAG AA 4.5:1 contrast compliance */
  margin-top: 4px;
  font-weight: 500;
}

textarea {
  width: 100%;
  padding: 16px;
  font-size: 14px;
  font-family: 'JetBrains Mono', Courier, monospace;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  resize: vertical;
  transition: all 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 24px 0;
}

/* Bot Name Group */
.bot-name-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Toggle Switch Styles */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--accent-blue);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-blue);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ----------------------------------------------------
   DRAG AND DROP UPLOAD ZONE
   ---------------------------------------------------- */
.drag-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--border-light);
}

.drag-drop-zone:hover, .drag-drop-zone.active {
  border-color: var(--accent-blue);
  background-color: var(--accent-blue-light);
}

.upload-icon {
  width: 44px;
  height: 44px;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.drag-drop-zone p {
  font-size: 14px;
  color: var(--text-secondary);
}

.drag-drop-zone p span {
  color: var(--accent-blue);
  font-weight: 600;
}

/* Progress indicator */
.upload-progress-container {
  margin-top: 16px;
  padding: 12px;
  background-color: var(--border-light);
  border-radius: var(--radius-sm);
}

.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent-blue);
  transition: width 0.1s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ----------------------------------------------------
   TABLES
   ---------------------------------------------------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.table th, .table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  background-color: var(--border-light);
  font-weight: 600;
  color: var(--text-primary);
}

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

/* ----------------------------------------------------
   WHATSAPP QR CODE SECTION
   ---------------------------------------------------- */
.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--border-light);
  margin: 0 auto;
  max-width: 320px;
}

.qr-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.qr-text-ascii {
  font-family: monospace;
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: -1px;
  background-color: #ffffff;
  padding: 16px;
  border-radius: var(--radius-sm);
  color: #000000;
  user-select: none;
}

/* ----------------------------------------------------
   LOG VIEWER
   ---------------------------------------------------- */
.log-viewer {
  background-color: #0c1222;
  color: #d4d4d8;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  min-height: 500px;
  max-height: 600px;
  overflow-y: auto;
  overflow-x: auto;
  padding: 20px 24px;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-viewer::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.log-viewer::-webkit-scrollbar-track {
  background: #1e293b;
}

.log-viewer::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.log-viewer::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.log-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 12px;
  color: var(--text-muted);
}

.log-placeholder p {
  font-family: var(--font-main);
  font-size: 14px;
}

.log-select {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

/* ----------------------------------------------------
   TOAST NOTIFICATION MODAL
   ---------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-left: 4px solid var(--accent-blue);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 420px;
}

@keyframes slideIn {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast-notification.success {
  border-left-color: var(--accent-emerald);
  color: var(--text-primary);
}

.toast-notification.error {
  border-left-color: var(--accent-red);
  color: var(--accent-red);
}

.toast-notification.warning {
  border-left-color: var(--accent-amber);
  color: var(--accent-amber);
}

.toast-notification i,
.toast-notification svg {
  width: 18px;
  height: 18px;
}

/* ----------------------------------------------------
   EMBED CODE CONTAINER
   ---------------------------------------------------- */
.code-box-container {
  position: relative;
  background-color: var(--bg-sidebar);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin-top: 12px;
}

.code-box-container pre {
  font-family: 'JetBrains Mono', Courier, monospace;
  font-size: 12px;
  color: #a5f3fc; /* Cyan-200 */
  margin: 0;
  white-space: pre-wrap;
}

.btn-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border: none;
}

.btn-copy:hover {
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

/* ----------------------------------------------------
   PREMIUM SELECTS & CHECKBOX LISTS
   ---------------------------------------------------- */
.form-select-premium {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: var(--font-main);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.form-select-premium:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.fallback-checkbox-list {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 150px;
  overflow-y: auto;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fallback-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.fallback-checkbox-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* ----------------------------------------------------
   MODAL POPUP DIALOGS
   ---------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5); /* backdrop blur */
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeInModal 0.2s ease;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header h3 {
  font-family: var(--font-logo);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.btn-close-modal:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 16px 24px;
  background-color: var(--border-light);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUpModal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ----------------------------------------------------
   SUB-TAB NAVIGATION (inside panels)
   ---------------------------------------------------- */
.subtab-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.subtab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.subtab-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.subtab-btn.active {
  background: var(--accent-blue);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.subtab-btn.active:hover {
  background: var(--accent-blue-hover);
}

.subtab-panel {
  display: none;
  animation: fadeInSubtab 0.25s ease;
}

.subtab-panel.active {
  display: block;
}

@keyframes fadeInSubtab {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------
   ADDITIONAL ACCESSIBILITY, TOGGLE, AND LAYOUT STYLES
   ---------------------------------------------------- */
.btn-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}
.btn-sidebar-toggle i,
.btn-sidebar-toggle svg {
  width: 22px;
  height: 22px;
}
.btn-sidebar-toggle:hover {
  background-color: var(--border-light);
}

.btn-sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}
.btn-sidebar-close i,
.btn-sidebar-close svg {
  width: 20px;
  height: 20px;
}
.btn-sidebar-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 998;
  transition: opacity 0.25s ease;
}

.password-toggle-container {
  position: relative;
}
.password-toggle-container input {
  padding-right: 48px !important;
}
.btn-toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  z-index: 10;
}
.btn-toggle-password:hover {
  color: var(--text-secondary);
  background-color: var(--border-light);
}
.btn-toggle-password i,
.btn-toggle-password svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Keyboard accessibility focus styling */
:focus-visible {
  outline: 3px solid var(--accent-blue) !important;
  outline-offset: 2px !important;
}
.btn-toggle-password:focus-visible {
  outline-offset: 0px !important;
}

/* ----------------------------------------------------
   RESPONSIVE MEDIA QUERIES (MOBILE & TABLET)
   ---------------------------------------------------- */
@media (max-width: 768px) {
  .btn-sidebar-toggle {
    display: inline-flex;
  }
  
  .btn-sidebar-close {
    display: inline-flex;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 999;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .sidebar.sidebar-open {
    left: 0;
  }
  
  .main-header {
    padding: 16px 20px;
  }
  
  .content-wrapper {
    padding: 20px;
  }
  
  .grid {
    gap: 16px;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .main-content {
    width: 100vw;
  }
  
  .subtab-nav {
    flex-direction: column;
    gap: 4px;
  }
  
  .subtab-btn {
    width: 100%;
  }
  
  .bot-name-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .bot-name-row button {
    width: 100%;
  }
  
  /* Hide columns on mobile for better data density */
  .table th:nth-child(3), .table td:nth-child(3) {
    display: none;
  }
  
  .modal-card {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    padding: 12px 16px;
  }
}

/* Brand Inner Tabs */
.brand-tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
  padding-bottom: 0px;
}

.brand-tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.brand-tab-btn:hover {
  color: var(--accent-indigo);
}

.brand-tab-btn.active {
  color: var(--accent-indigo);
  border-bottom: 2px solid var(--accent-indigo);
}

.brand-tab-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.brand-tab-panel.active {
  display: block;
}

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

/* Colorized Log Lines */
.log-line {
  display: flex;
  align-items: flex-start;
  font-family: inherit;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.log-line:last-child {
  border-bottom: none;
}
.log-line-content {
  flex: 1;
  word-break: break-all;
  white-space: pre-wrap;
}
.log-line-error {
  color: #f87171 !important; /* red-400 */
}
.log-line-warn {
  color: #facc15 !important; /* yellow-400 */
}
.log-line-info {
  color: #38bdf8 !important; /* sky-400 */
}
.log-line-pm2 {
  color: #818cf8 !important; /* indigo-400 */
}
.log-line-timestamp {
  color: #71717a !important; /* slate-500 for slate timestamps */
  font-weight: 500;
  margin-right: 12px;
  width: 20ch;
  flex-shrink: 0;
  display: inline-block;
  user-select: none;
}

/* Markdown Body styling to override Tailwind resets */
.markdown-body {
  font-family: var(--font-main);
  color: var(--text-secondary);
}
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 8px;
  line-height: 1.25;
}
.markdown-body h1 { font-size: 1.4rem; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
.markdown-body h2 { font-size: 1.2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body h4 { font-size: 0.95rem; }

.markdown-body p {
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.6;
}
.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 10px;
}
.markdown-body ul {
  list-style-type: disc !important;
}
.markdown-body ol {
  list-style-type: decimal !important;
}
.markdown-body li {
  margin-top: 4px;
  line-height: 1.5;
}
.markdown-body hr {
  height: 1px;
  padding: 0;
  margin: 16px 0;
  background-color: var(--border-color);
  border: 0;
}
.markdown-body code {
  padding: 2px 6px;
  margin: 0;
  font-size: 85%;
  background-color: var(--border-light);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-indigo);
}
.markdown-body pre {
  padding: 12px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: var(--border-light);
  border-radius: 6px;
  margin-bottom: 10px;
}
.markdown-body pre code {
  background-color: transparent;
  padding: 0;
  font-size: 100%;
  border: 0;
  color: inherit;
}
.markdown-body blockquote {
  padding: 0 1em;
  color: var(--text-muted);
  border-left: 0.25em solid var(--border-color);
  margin: 0 0 10px 0;
}

.preview-scroll-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: var(--accent-indigo-light);
  color: var(--accent-indigo);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  font-family: var(--font-main);
  display: inline-flex;
  align-items: center;
}
.preview-scroll-btn:hover {
  background-color: var(--accent-indigo);
  color: var(--text-white);
  border-color: var(--accent-indigo);
  transform: translateY(-0.5px);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15);
}
.preview-scroll-btn:active {
  transform: translateY(0);
}

/* ----------------------------------------------------
   GLOBAL PAGE PRELOADER STYLE
   ---------------------------------------------------- */
.page-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0c0f17; /* Dark background for premium look */
  z-index: 100000; /* High z-index to cover the barrier and app */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
  opacity: 1;
  visibility: visible;
}

.page-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preloader-logo-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  z-index: 2;
  animation: preloaderMascotPulse 2s ease-in-out infinite;
}

.preloader-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid rgba(16, 185, 129, 0.08);
  border-top-color: #10b981; /* Teal accent */
  border-right-color: #3b82f6; /* Blue accent */
  z-index: 1;
  animation: preloaderSpin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

.preloader-title {
  font-family: 'Poppins', 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.preloader-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 16px;
  font-weight: 500;
}

.preloader-progress-bar {
  width: 140px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 2px;
  animation: preloaderFillProgress 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes preloaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes preloaderMascotPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.15)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.35)); }
}

@keyframes preloaderFillProgress {
  0% { width: 0%; }
  30% { width: 45%; }
  70% { width: 88%; }
  100% { width: 100%; }
}

/* ----------------------------------------------------
   COLLAPSIBLE RULES EDITOR STYLES
   ---------------------------------------------------- */
.rules-collapse-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.rules-collapse-card.collapsed {
  border-color: var(--border-light);
  box-shadow: none;
}

.rules-collapse-header {
  padding: 14px 18px;
  background-color: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.rules-collapse-card.collapsed .rules-collapse-header {
  border-bottom-color: transparent;
}

.rules-collapse-header:hover {
  background-color: var(--border-light);
}

.rules-collapse-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rules-collapse-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rules-collapse-card.collapsed .rules-collapse-chevron {
  transform: rotate(-90deg);
}

.rules-collapse-body {
  padding: 16px 18px;
  max-height: 1200px;
  opacity: 1;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s ease, 
              padding-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.rules-collapse-card.collapsed .rules-collapse-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

/* ----------------------------------------------------
   SIDEBAR COLLAPSED STYLES
   ---------------------------------------------------- */
.sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-sidebar-collapse {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s;
  margin-left: auto;
}

.btn-sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
}

.btn-sidebar-collapse i,
.btn-sidebar-collapse svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .btn-sidebar-collapse i,
.sidebar.collapsed .btn-sidebar-collapse svg {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .btn-sidebar-collapse {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .sidebar.collapsed {
    width: 80px;
    padding: 24px 12px;
    align-items: center;
  }
  
  .sidebar.collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
  }
  
  .sidebar.collapsed .brand-text {
    display: none !important;
  }
  
  .sidebar.collapsed .btn-sidebar-collapse {
    margin-left: 0;
    margin-top: 4px;
  }
  
  .sidebar.collapsed .sidebar-nav {
    align-items: center;
    width: 100%;
  }
  
  .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    width: 46px;
    height: 46px;
    gap: 0;
    margin-bottom: 6px;
  }
  
  .sidebar.collapsed .nav-item span {
    display: none !important;
  }
  
  .sidebar.collapsed .nav-divider {
    width: 28px;
    margin: 8px auto;
  }
  
  .sidebar.collapsed .sidebar-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 16px;
  }
  
  .sidebar.collapsed #btn-logout {
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }
  
  .sidebar.collapsed #btn-logout span {
    display: none !important;
  }
}




