/* ============================================
   Zentra ERP - Custom Theme
   Brand Gradient: #667eea → #764ba2
   Built on AdminLTE 4 + Bootstrap 5.3
   ============================================ */

:root {
  --zentra-primary: #667eea;
  --zentra-secondary: #764ba2;
  --zentra-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --zentra-gradient-hover: linear-gradient(135deg, #5a6fd6 0%, #6a4294 100%);
  --zentra-light: #f0edf6;
  --zentra-dark: #2d1b4e;
  --zentra-text: #333333;
  --zentra-sidebar-bg: #2d1b4e;
  --zentra-sidebar-hover: rgba(102, 126, 234, 0.15);
  --zentra-sidebar-active: rgba(102, 126, 234, 0.25);
}

/* ===== LOGIN PAGE ===== */
.zentra-login-bg {
  min-height: 100vh;
  background: var(--zentra-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zentra-login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: none;
  overflow: hidden;
}

.zentra-login-header {
  background: var(--zentra-gradient);
  text-align: center;
  padding: 32px 24px 24px;
  color: #fff;
}

.zentra-login-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 2px;
}

.zentra-login-header p {
  font-size: 12px;
  opacity: 0.85;
  margin: 4px 0 0;
  letter-spacing: 1px;
}

.zentra-login-body {
  padding: 32px 28px;
}

.zentra-login-body .form-control {
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.zentra-login-body .form-control:focus {
  border-color: var(--zentra-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.zentra-login-body .input-group-text {
  border-radius: 0 8px 8px 0;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-left: none;
}

.btn-zentra {
  background: var(--zentra-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-zentra:hover {
  background: var(--zentra-gradient-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-zentra:active {
  transform: translateY(0);
}

/* ===== APP HEADER ===== */
.app-header.navbar {
  background: #fff !important;
  border-bottom: 2px solid var(--zentra-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.app-header .nav-link {
  color: #555;
}

.app-header .nav-link:hover {
  color: var(--zentra-primary);
}

.navbar-badge.badge {
  background: var(--zentra-secondary) !important;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
  background: var(--zentra-sidebar-bg) !important;
}

.app-sidebar[data-bs-theme="dark"] {
  background: var(--zentra-sidebar-bg) !important;
}

.sidebar-brand {
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-text {
  font-weight: 700;
  letter-spacing: 1.5px;
  font-size: 18px;
  background: var(--zentra-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand .brand-link {
  padding: 14px 16px;
}

.sidebar-menu .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
  border-radius: 6px;
  margin: 1px 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

.sidebar-menu .nav-link:hover {
  background: var(--zentra-sidebar-hover);
  color: #fff !important;
}

.sidebar-menu .nav-link.active {
  background: var(--zentra-sidebar-active);
  color: #fff !important;
  font-weight: 600;
}

.sidebar-menu .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--zentra-gradient);
  border-radius: 0 3px 3px 0;
}

.sidebar-menu .nav-header {
  color: rgba(255, 255, 255, 0.35) !important;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 20px 4px;
  font-weight: 600;
}

.sidebar-menu .nav-icon {
  color: rgba(255, 255, 255, 0.5);
  width: 22px;
}

.sidebar-menu .nav-link.active .nav-icon,
.sidebar-menu .nav-link:hover .nav-icon {
  color: var(--zentra-primary);
}

/* Treeview submenu */
.sidebar-menu .nav-treeview .nav-link {
  padding-left: 40px;
  font-size: 13px;
}

/* User panel in sidebar */
.sidebar-user-panel {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-panel .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--zentra-gradient);
  flex-shrink: 0;
}

.sidebar-user-panel .user-info {
  overflow: hidden;
}

.sidebar-user-panel .user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-panel .user-role {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== CONTENT AREA ===== */
.content-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--zentra-dark);
}

.breadcrumb-item a {
  color: var(--zentra-primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: #888;
}

/* ===== CARDS ===== */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  font-size: 15px;
}

/* ===== STAT WIDGETS ===== */
.small-box {
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.small-box:hover {
  transform: translateY(-2px);
}

.small-box.bg-zentra {
  background: var(--zentra-gradient) !important;
}

.small-box.bg-zentra-light {
  background: linear-gradient(135deg, #a8b8f0 0%, #b68bd4 100%) !important;
}

/* ===== TABLES ===== */
.table thead th {
  background: var(--zentra-light);
  color: var(--zentra-dark);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #ddd;
}

.table-hover tbody tr:hover {
  background: rgba(102, 126, 234, 0.04);
}

/* ===== BADGES ===== */
.badge.bg-zentra {
  background: var(--zentra-gradient) !important;
  color: #fff;
}

.badge-status-pending {
  background: #fff3cd;
  color: #856404;
}

.badge-status-approved {
  background: #d4edda;
  color: #155724;
}

.badge-status-rejected {
  background: #f8d7da;
  color: #721c24;
}

.badge-status-draft {
  background: #e2e3e5;
  color: #383d41;
}

/* ===== FOOTER ===== */
.app-footer {
  background: #fff;
  border-top: 1px solid #eee;
  font-size: 13px;
  color: #888;
}

.app-footer strong {
  color: var(--zentra-primary);
}

/* ===== UTILITIES ===== */
.text-zentra {
  color: var(--zentra-primary) !important;
}

.bg-zentra-gradient {
  background: var(--zentra-gradient) !important;
}

.border-zentra {
  border-color: var(--zentra-primary) !important;
}

/* Toast / Alert */
.alert-zentra {
  background: var(--zentra-light);
  border-left: 4px solid var(--zentra-primary);
  color: var(--zentra-dark);
}

/* Loading spinner */
.zentra-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--zentra-light);
  border-top: 3px solid var(--zentra-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .zentra-login-card {
    margin: 16px;
    max-width: 100%;
  }
}
