* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: #f4f9f9;
  color: #1e293b;
  line-height: 1.6;
}

.app-container {
  max-width: 1150px;
  margin: 15px auto;
  padding: 18px;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(15, 52, 96, 0.08);
  border: 1px solid #d1e8e4;
}

/* الشريط العلوي */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #2bbbad 0%, #0f3460 100%);
  border-radius: 16px;
  color: #ffffff;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-box img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: contain;
  border: 3px solid #ffffff;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.brand-box span {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 15px;
  border-radius: 12px;
  font-weight: 500;
  transition: 0.3s;
}

.nav-link:hover,
.nav-link.active {
  background: #ffffff;
  color: #0f3460;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-top: 10px;
  }
  .nav-menu.show-menu {
    display: flex;
  }
}

/* زر تثبيت التطبيق PWA */
.install-banner {
  display: none;
  background: #e0f7fa;
  border: 1px dashed #00838f;
  padding: 12px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.install-btn {
  background: #0f3460;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* الواجهة الرئيسية */
.hero-section {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 15px;
  flex-wrap: wrap;
}

.hero-image {
  flex: 1;
  min-width: 270px;
  text-align: center;
}

.hero-image img {
  width: 100%;
  max-width: 390px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(15, 52, 96, 0.12);
  border: 4px solid #e0f2f1;
}

.hero-text {
  flex: 1.2;
  min-width: 270px;
}

.hero-text h1 {
  font-size: 1.9rem;
  color: #0f3460;
  margin-bottom: 12px;
}

.hero-text p {
  font-size: 1.08rem;
  color: #475569;
  margin-bottom: 22px;
}

/* الأزرار */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #2bbbad 0%, #0f3460 100%);
  color: #ffffff;
  padding: 11px 22px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-outline {
  display: inline-block;
  background: #ffffff;
  color: #0f3460;
  padding: 10px 20px;
  border: 2px solid #2bbbad;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

/* شبكة المنتجات */
.section-header {
  text-align: center;
  margin-bottom: 25px;
}

.section-header h1 {
  color: #0f3460;
  margin-bottom: 6px;
}

.products-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}

.product-card {
  width: 265px;
  background: #ffffff;
  border: 1px solid #d1e8e4;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.product-body {
  padding: 16px;
  text-align: center;
}

.product-body h3 {
  color: #0f3460;
  margin-bottom: 8px;
}

.product-body p {
  color: #64748b;
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.price-badge {
  display: inline-block;
  background: #e0f2f1;
  color: #00695c;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* النوافذ المنبثقة والنماذج */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 52, 96, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 15px;
}

.modal-content {
  background: #ffffff;
  padding: 24px;
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 13px;
  text-align: right;
}

.form-group label {
  display: block;
  font-weight: 700;
  color: #0f3460;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
}

/* التذييل وحقوق الملكية */
.footer {
  margin-top: 35px;
  padding-top: 18px;
  border-top: 1px solid #d1e8e4;
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
}

.dev-credit {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #0f3460;
  font-weight: 700;
}
/* =========================================
   تنسيقات لوحة الإدارة والمحاسبة (موحدة)
   ========================================= */
.lock-screen {
  max-width: 400px;
  margin: 40px auto;
  background: #ffffff;
  padding: 32px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid #d1e8e4;
  box-shadow: 0 8px 25px rgba(15, 52, 96, 0.08);
}

.lock-screen h2 {
  color: #0f3460;
}

.dashboard-content {
  display: none;
}

.admin-layout {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0f3460 0%, #1a4b84 100%);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(15, 52, 96, 0.18);
}

.side-btn {
  text-align: right;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px 15px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s;
}

.side-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.side-btn.active-side {
  background: #ffffff;
  color: #0f3460;
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-main-area {
  flex: 1;
  min-width: 280px;
}

.tab-section {
  display: none;
}

.tab-section.active-tab {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #d1e8e4;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.stat-card h4 {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.stat-card .amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f3460;
}

.stat-card.profit .amount { color: #059669; }
.stat-card.loss .amount { color: #dc2626; }
.stat-card.savings { background: #e0f2f1; border-color: #2bbbad; }
.stat-card.debts { background: #fffbeb; border-color: #fcd34d; }

.periods-bar {
  display: flex;
  justify-content: space-around;
  background: #e0f7fa;
  border: 1px solid #b2ebf2;
  color: #0f3460;
  padding: 13px;
  border-radius: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.box-panel {
  background: #ffffff;
  border: 1px solid #d1e8e4;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
}

.box-panel h3 {
  color: #0f3460;
  margin-bottom: 16px;
  border-bottom: 2px solid #e0f2f1;
  padding-bottom: 8px;
}

.table-wrapper { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 10px; border-bottom: 1px solid #e2e8f0; text-align: right; }
th { background: #f1f5f9; color: #0f3460; }

.del-row {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.pay-btn {
  background: #d1fae5;
  color: #065f46;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  margin-left: 4px;
}

.badge-paid {
  background: #d1fae5;
  color: #065f46;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.82rem;
}

.badge-unpaid {
  background: #fef3c7;
  color: #92400e;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.82rem;
}

.discount-box {
  background: #e0f2f1;
  border: 1px dashed #2bbbad;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: #0f3460;
}

.discount-box input {
  width: 80px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
  }
  .side-btn {
    white-space: nowrap;
    text-align: center;
  }
}
