@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800;900&family=Cairo:wght@400;600;700;800;900&family=Noto+Sans+Arabic:wght@400;600;700;800&family=Readex+Pro:wght@400;500;600;700&family=Tajawal:wght@400;500;700;800;900&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  direction: rtl;
  min-height: 100vh;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* =========================================================
   5 THEME ENGINES
   ========================================================= */

/* --- 1. Royal Blue --- */
html[data-theme="blue"], html[data-theme="blue"] * {
  font-family: 'Alexandria', 'Inter', system-ui, sans-serif !important;
}
html[data-theme="blue"] body {
  background: radial-gradient(circle at 50% 0%, #1e3a8a 0%, #0d1e4c 45%, #050b1d 100%) fixed !important;
  color: #f8fafc !important;
}
html[data-theme="blue"] .hz-header {
  background: rgba(13, 30, 76, 0.92) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #1d4ed8 !important;
}
html[data-theme="blue"] .hz-card,
html[data-theme="blue"] .hz-modal-box {
  background: rgba(15, 34, 88, 0.95) !important;
  border: 1px solid #1d4ed8 !important;
  color: #f8fafc !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55) !important;
}
html[data-theme="blue"] .hz-tab-btn {
  background-color: rgba(15, 34, 88, 0.9) !important;
  border: 1px solid #1d4ed8 !important;
  color: #bfdbfe !important;
}
html[data-theme="blue"] .hz-tab-btn.active {
  background-color: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.6) !important;
}

/* --- 2. Midnight Dark --- */
html[data-theme="dark"], html[data-theme="dark"] * {
  font-family: 'Cairo', system-ui, sans-serif !important;
}
html[data-theme="dark"] body {
  background: radial-gradient(circle at 50% 0%, #172554 0%, #090d16 50%, #030712 100%) fixed !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .hz-header {
  background: rgba(12, 18, 34, 0.92) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #1e293b !important;
}
html[data-theme="dark"] .hz-card,
html[data-theme="dark"] .hz-modal-box {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid #1e293b !important;
  color: #f8fafc !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55) !important;
}
html[data-theme="dark"] .hz-tab-btn {
  background-color: rgba(22, 32, 54, 0.9) !important;
  border: 1px solid #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .hz-tab-btn.active {
  background-color: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(2, 132, 199, 0.5) !important;
}

/* --- 3. Girly Pink (بناتي) --- */
html[data-theme="pink"], html[data-theme="pink"] * {
  font-family: 'Tajawal', system-ui, sans-serif !important;
}
html[data-theme="pink"] body {
  background: linear-gradient(135deg, #fda4af 0%, #fb7185 35%, #f43f5e 70%, #ec4899 100%) fixed !important;
  color: #831843 !important;
}
html[data-theme="pink"] .hz-header {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(14px);
  border-bottom: 2px solid #f472b6 !important;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.2) !important;
}
html[data-theme="pink"] .hz-card,
html[data-theme="pink"] .hz-modal-box {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 2px solid #fbcfe8 !important;
  color: #831843 !important;
  box-shadow: 0 12px 35px rgba(225, 29, 72, 0.2) !important;
  border-radius: 16px !important;
}
html[data-theme="pink"] .hz-tab-btn {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 1.5px solid #fbcfe8 !important;
  color: #be185d !important;
}
html[data-theme="pink"] .hz-tab-btn.active {
  background: linear-gradient(135deg, #f43f5e, #ec4899) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.5) !important;
}
html[data-theme="pink"] strong,
html[data-theme="pink"] h1,
html[data-theme="pink"] h2,
html[data-theme="pink"] h3 {
  color: #831843 !important;
}

/* --- 4. Vibrant Energy --- */
html[data-theme="energy"], html[data-theme="energy"] * {
  font-family: 'Readex Pro', system-ui, sans-serif !important;
}
html[data-theme="energy"] body {
  background: radial-gradient(circle at 50% 0%, #451a03 0%, #210c01 45%, #0d0500 100%) fixed !important;
  color: #fff7ed !important;
}
html[data-theme="energy"] .hz-header {
  background: rgba(38, 14, 2, 0.92) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #7c2d12 !important;
}
html[data-theme="energy"] .hz-card,
html[data-theme="energy"] .hz-modal-box {
  background: rgba(46, 16, 3, 0.95) !important;
  border: 1px solid #7c2d12 !important;
  color: #fff7ed !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6) !important;
}
html[data-theme="energy"] .hz-tab-btn {
  background-color: rgba(46, 16, 3, 0.9) !important;
  border: 1px solid #7c2d12 !important;
  color: #fed7aa !important;
}
html[data-theme="energy"] .hz-tab-btn.active {
  background-color: #ea580c !important;
  border-color: #fb923c !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.6) !important;
}

/* --- 5. Emerald Forest --- */
html[data-theme="green"], html[data-theme="green"] * {
  font-family: 'Noto Sans Arabic', system-ui, sans-serif !important;
}
html[data-theme="green"] body {
  background: radial-gradient(circle at 50% 0%, #022c22 0%, #011711 45%, #000c09 100%) fixed !important;
  color: #f0fdf4 !important;
}
html[data-theme="green"] .hz-header {
  background: rgba(2, 36, 28, 0.92) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #065f46 !important;
}
html[data-theme="green"] .hz-card,
html[data-theme="green"] .hz-modal-box {
  background: rgba(2, 44, 34, 0.95) !important;
  border: 1px solid #065f46 !important;
  color: #f0fdf4 !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6) !important;
}
html[data-theme="green"] .hz-tab-btn {
  background-color: rgba(2, 44, 34, 0.9) !important;
  border: 1px solid #065f46 !important;
  color: #a7f3d0 !important;
}
html[data-theme="green"] .hz-tab-btn.active {
  background-color: #059669 !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(5, 150, 105, 0.6) !important;
}

/* =========================================================
   CORE UI LAYOUT & COMPONENTS
   ========================================================= */

.hz-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hz-brand-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hz-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.hz-brand-text h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.hz-brand-text span {
  font-size: 11px;
  opacity: 0.8;
  display: block;
}

.hz-header-actions-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.hz-btn-primary {
  background: #2563eb;
  color: #ffffff;
}
.hz-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.hz-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hz-tabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 28px;
  flex-wrap: wrap;
}

.hz-tab-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.hz-main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px 24px;
}

.hz-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.hz-stat-card {
  padding: 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hz-stat-num {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.hz-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.hz-task-row:hover {
  transform: translateX(-3px);
  border-color: rgba(255, 255, 255, 0.25);
}

.hz-bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid #38bdf8;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  border-radius: 16px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 1000;
  color: white;
}

/* Modals & Backdrop */
.hz-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.hz-modal-box {
  width: 90%;
  max-width: 560px;
  border-radius: 20px;
  padding: 30px;
}

/* Form Controls */
.hz-form-group {
  margin-bottom: 16px;
}
.hz-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.hz-input, .hz-select, .hz-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
  font-size: 14px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .hz-stats-grid {
    grid-template-columns: 1fr;
  }
  .hz-header {
    padding: 0 14px;
  }
  .hz-task-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
