/* ===========================
   تنظیمات کلی
   =========================== */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* ❌ جلوگیری از اسکرول افقی کل صفحه */
  font-family: sans-serif;
  direction: rtl;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* ===========================
   🟡 استایل صفحه لاگین
   =========================== */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #007bff, #00c6ff);
  padding: 15px;
}

.login-page .login-box {
  background: white;
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 350px;
  text-align: center;
}

.login-page .login-box img {
  width: 80px;
  margin-bottom: 15px;
}

.login-page h2 {
  margin: 10px 0 20px;
  font-size: 1.4rem;
}

.login-page input[type="text"],
.login-page input[type="password"] {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.login-page button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #007bff;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}

.login-page button:hover {
  background: #0056b3;
}

.login-page .remember-me {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 10px 0;
  font-size: 14px;
}

.login-page .remember-me input {
  margin-left: 5px;
}

.login-page .error {
  color: red;
  font-size: 14px;
  margin-top: 10px;
  min-height: 18px;
}

/* 📱 لاگین - تبلت */
@media (max-width: 768px) {
  .login-page .login-box {
    padding: 30px 20px;
    max-width: 300px;
  }
  .login-page h2 {
    font-size: 1.2rem;
  }
  .login-page button {
    font-size: 15px;
  }
}

/* 📱 لاگین - موبایل */
@media (max-width: 480px) {
  .login-page .login-box {
    padding: 25px 15px;
    max-width: 90%;
  }
  .login-page .login-box img {
    width: 60px;
  }
  .login-page h2 {
    font-size: 1.1rem;
  }
  .login-page input[type="text"],
  .login-page input[type="password"] {
    font-size: 13px;
    padding: 10px;
  }
  .login-page button {
    font-size: 14px;
    padding: 10px;
  }
}


/* ===========================
   🟢 استایل صفحه ERP
   =========================== */
.erp-page {
  background: #f0f2f5;
  padding: 20px;
}

.erp-page h2 {
  text-align: center;
  color: #007bff;
  margin-bottom: 20px;
}

.erp-page .form-box {
  background: white;
  padding: 15px;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.erp-page input,
.erp-page select,
.erp-page button {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.erp-page button {
  cursor: pointer;
  transition: 0.3s;
}

.erp-page button:hover {
  background: #007bff;
  color: white;
}

.erp-page #search,
.erp-page #filterCategory {
  width: 200px;
}

/* 📊 جدول ERP */
.erp-page .table-wrapper {
  width: 100%;
  overflow-x: auto;              /* ✅ فقط جدول اسکرول افقی می‌خوره */
  -webkit-overflow-scrolling: touch;
}

.erp-page table {
  width: 100%;
  min-width: 600px;              /* حداقل عرض جدول */
  border-collapse: collapse;
  margin-top: 15px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.erp-page th,
.erp-page td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
}

.erp-page th {
  background: #007bff;
  color: white;
}

.erp-page td button {
  margin: 0 3px;
}

.erp-page #totalPrice {
  font-weight: bold;
  margin-top: 10px;
  text-align: right;
}

/* 📊 داشبورد */
.erp-page #dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 20px;
  justify-content: center;
}

.erp-page #chartContainer {
  width: 400px;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.erp-page #stats {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

/* 📱 ERP - تبلت */
@media (max-width: 900px) {
  .erp-page #dashboard {
    flex-direction: column;
    align-items: center;
  }
  .erp-page #chartContainer,
  .erp-page #stats {
    width: 90%;
  }
}

/* 📱 ERP - موبایل */
@media (max-width: 600px) {
  .erp-page .form-box {
    flex-direction: column;
    align-items: stretch;
  }

  .erp-page .form-box input,
  .erp-page .form-box select,
  .erp-page .form-box button {
    width: 100%;
  }

  .erp-page #search,
  .erp-page #filterCategory {
    width: 100%;
  }

  .erp-page th,
  .erp-page td {
    font-size: 13px;
    padding: 8px;
  }

  .erp-page table {
    min-width: 500px; /* جدول از این عرض کوچیک‌تر نشه */
  }

  .erp-page #chartContainer {
    width: 100%;
    max-width: 100%;
  }

  .erp-page #stats {
    width: 100%;
  }
}
