/* =============== عمومی =============== */
body {
  font-family: "Vazirmatn", sans-serif;
  direction: rtl;
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom right, #0c0032, #1a002d);
  color: #e0d7ff;
}

/* =============== دکمه‌ها =============== */
button {
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-add-category-Inv,
.btn-add-item-Inv {
  margin: 16px 0;
  padding: 10px 20px;
  background: linear-gradient(135deg, #7e57c2, #5e35b1);
  color: #eee;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 15px #8e6fe3cc;
}

.btn-add-category-Inv:hover,
.btn-add-item-Inv:hover {
  background: linear-gradient(135deg, #9a7aff, #7e57c2);
  box-shadow: 0 0 25px #b3a5ffcc;
}

/* =============== آکاردئون =============== */
.category-accordion-Inv {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  box-shadow: 0 4px 30px rgba(58, 0, 130, 0.4);
  overflow: hidden;
}

.accordion-header-Inv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-weight: bold;
  background: rgb(40, 0, 54);
  color: #e0d7ff;
  cursor: pointer;
  transition: background 0.3s ease;
}

.accordion-header-Inv:hover {
  background: rgb(106, 1, 145);
}

.accordion-actions-Inv {
  display: flex;
  gap: 10px;
}

.accordion-actions-Inv button {
  font-size: 1.2rem;
  background: none;
  border: none;
  color: #c9a3ff;
}

/* =============== بدنه آکاردئون =============== */
.accordion-body-Inv {
  padding: 1rem;
  background: rgba(40, 0, 54, 0.752);
  overflow-x: auto;
}

/* دکمه اضافه در بدنه */
.accordion-body-Inv .btn-add-item-Inv {
  background: linear-gradient(to right, #00c9a7, #007e6b);
  border-radius: 10px;
  box-shadow: 0 0 10px #00c9a799;
}

.accordion-body-Inv .btn-add-item-Inv:hover {
  background: linear-gradient(to right, #007e6b, #00c9a7);
  box-shadow: 0 0 15px #00e6b399;
}

/* =============== مودال =============== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: rgba(26, 0, 45, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  width: 90%;
  max-width: 420px;
  color: #f0f0f0;
  box-shadow: 0 8px 30px rgba(138, 43, 226, 0.4);
  backdrop-filter: blur(12px);
}

.modal-content h2,
.modal-content h3 {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 1rem;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

/* دکمه‌های مودال */
.modal-buttons,
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-buttons .btn-cancel,
.modal-actions .btn-cancel {
  background-color: #5e5e5e;
  color: #eee;
  border-radius: 10px;
}

.modal-buttons .btn-confirm,
.modal-actions .btn-confirm {
  background: linear-gradient(to right, #27ae60, #1e8449);
  color: white;
  border-radius: 10px;
  
}

.modal-buttons .btn-cancel:hover,
.modal-actions .btn-cancel:hover {
  background-color: #777;
}

.modal-buttons .btn-confirm:hover,
.modal-actions .btn-confirm:hover {
  background: linear-gradient(to right, #1e8449, #27ae60);
}

.modal-buttons .btn-cancel,
.modal-actions .btn-cancel,
.modal-buttons .btn-confirm,
.modal-actions .btn-confirm {
  padding: 12px 20px;
  min-width: 100px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 12px;
}

/* =============== جدول داخل آکاردئون =============== */
.accordion-body-Inv table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0 10px;
  background: transparent;
  color: #eee;
}

.accordion-body-Inv thead tr {
  background: linear-gradient(135deg, #321e68, #3b0a66);
  box-shadow: 0 4px 10px #4b2ca9aa;
  border-radius: 15px;
}

.accordion-body-Inv th,
.accordion-body-Inv td {
  padding: 1rem;
  text-align: center;
  font-size: 1.1rem;
  vertical-align: middle;
  font-weight: 500;
}

.accordion-body-Inv th {
  font-weight: 700;
  color: #d3c7ff;
}

.accordion-body-Inv tbody tr {
  background: rgba(58, 0, 130, 0.3);
  box-shadow: 0 4px 12px rgba(58, 0, 130, 0.4);
  border-radius: 15px;
  transition: background 0.3s ease;
}

.accordion-body-Inv tbody tr:hover {
  background: rgba(90, 35, 180, 0.5);
  box-shadow: 0 8px 24px #9a7affbb;
}

.accordion-body-Inv td button {
  margin: 0 0.3rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f5f3ff;
  box-shadow: 0 0 10px transparent;
}

.accordion-body-Inv td button:hover {
  transform: scale(1.08);
  opacity: 0.95;
  box-shadow: 0 0 15px #a387ff;
}

/* دکمه‌های عملیات خاص */
.accordion-body-Inv button[onclick*="consume"] {
  background: linear-gradient(135deg, #1e88e5, #0d47a1);
}
.accordion-body-Inv button[onclick*="waste"] {
  background: linear-gradient(135deg, #fb8c00, #ef6c00);
}
.accordion-body-Inv button[onclick*="deplete"] {
  background: linear-gradient(135deg, #e53935, #b71c1c);
}

/* دکمه‌های غیرفعال */
.accordion-body-Inv button:disabled {
  background-color: #3c045f !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* رنگ‌بندی وضعیت‌ها */
.accordion-body-Inv td[style*="color:gray"] {
  color: #ccc !important;
}
.accordion-body-Inv td[style*="color:red"] {
  color: #ff4d4d !important;
}
.accordion-body-Inv td[style*="color:green"] {
  color: #00e676 !important;
}

/* =============== واکنش‌گرایی =============== */
@media (max-width: 500px) {
  .modal-content {
    width: 95%;
    padding: 16px;
  }

  .accordion-header-Inv {
    flex-direction: column;
    align-items: flex-start;
  }

  .accordion-actions-Inv {
    margin-top: 8px;
    justify-content: flex-end;
  }

  .accordion-body-Inv table {
    min-width: 100%;
  }
}



/* تغییر تم */

/* =============== تم روشن (Light Theme) =============== */
body[data-theme="light"] {
  background: linear-gradient(to bottom right, #f0f0ff, #ffffff);
  color: #222;
}

body[data-theme="light"] .btn-add-category-Inv,
body[data-theme="light"] .btn-add-item-Inv {
  background: linear-gradient(135deg, #d1c4e9, #b39ddb);
  color: #222;
  box-shadow: 0 0 10px #cbbdefaa;
}

body[data-theme="light"] .btn-add-category-Inv:hover,
body[data-theme="light"] .btn-add-item-Inv:hover {
  background: linear-gradient(135deg, #b39ddb, #9575cd);
  box-shadow: 0 0 15px #b39ddbcc;
}

body[data-theme="light"] .category-accordion-Inv {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(100, 100, 255, 0.1);
}

body[data-theme="light"] .accordion-header-Inv {
  background: #e8eaf6;
  color: #333;
}

body[data-theme="light"] .accordion-header-Inv:hover {
  background: #d1c4e9;
}

body[data-theme="light"] .accordion-actions-Inv button {
  color: #5e35b1;
}

body[data-theme="light"] .accordion-body-Inv {
  background: rgba(245, 245, 255, 0.9);
}

body[data-theme="light"] .accordion-body-Inv .btn-add-item-Inv {
  background: linear-gradient(to right, #a5f2e9, #69d4c4);
  color: #222;
  box-shadow: 0 0 10px #b2f5ea;
}

body[data-theme="light"] .accordion-body-Inv .btn-add-item-Inv:hover {
  background: linear-gradient(to right, #69d4c4, #a5f2e9);
  box-shadow: 0 0 15px #92e7da;
}

/* مودال */
body[data-theme="light"] .modal-content {
  background: #ffffffee;
  color: #111;
  box-shadow: 0 8px 30px rgba(100, 100, 255, 0.15);
}

body[data-theme="light"] .modal-content input,
body[data-theme="light"] .modal-content select {
  background: rgba(240, 240, 255, 0.6);
  color: #111;
}

/* دکمه‌های مودال */
body[data-theme="light"] .modal-buttons .btn-cancel,
body[data-theme="light"] .modal-actions .btn-cancel {
  background-color: #ccc;
  color: #333;
}

body[data-theme="light"] .modal-buttons .btn-cancel:hover,
body[data-theme="light"] .modal-actions .btn-cancel:hover {
  background-color: #bbb;
}

body[data-theme="light"] .modal-buttons .btn-confirm,
body[data-theme="light"] .modal-actions .btn-confirm {
  background: linear-gradient(to right, #81c784, #43a047);
}

body[data-theme="light"] .modal-buttons .btn-confirm:hover,
body[data-theme="light"] .modal-actions .btn-confirm:hover {
  background: linear-gradient(to right, #43a047, #81c784);
}

/* جدول */
body[data-theme="light"] .accordion-body-Inv table {
  background: transparent;
  color: #222;
}

body[data-theme="light"] .accordion-body-Inv thead tr {
  background: linear-gradient(135deg, #c5cae9, #e8eaf6);
  box-shadow: 0 4px 10px #ddd;
}

body[data-theme="light"] .accordion-body-Inv th {
  color: #4a148c;
}

body[data-theme="light"] .accordion-body-Inv tbody tr {
  background: #f5f5ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .accordion-body-Inv tbody tr:hover {
  background: #ede7f6;
  box-shadow: 0 8px 24px #d1c4e9;
}

body[data-theme="light"] .accordion-body-Inv td button {
  color: #222;
  box-shadow: 0 0 10px transparent;
}

body[data-theme="light"] .accordion-body-Inv td button:hover {
  box-shadow: 0 0 12px #b39ddb;
}

/* دکمه‌های عملیات خاص */
body[data-theme="light"] .accordion-body-Inv button[onclick*="consume"] {
  background: linear-gradient(135deg, #90caf9, #1e88e5);
}
body[data-theme="light"] .accordion-body-Inv button[onclick*="waste"] {
  background: linear-gradient(135deg, #ffcc80, #fb8c00);
}
body[data-theme="light"] .accordion-body-Inv button[onclick*="deplete"] {
  background: linear-gradient(135deg, #ef9a9a, #e53935);
}

body[data-theme="light"] .accordion-body-Inv button:disabled {
  background-color: #ccc !important;
  color: #888;
}

/* رنگ‌بندی وضعیت‌ها */
body[data-theme="light"] .accordion-body-Inv td[style*="color:gray"] {
  color: #888 !important;
}
body[data-theme="light"] .accordion-body-Inv td[style*="color:red"] {
  color: #d50000 !important;
}
body[data-theme="light"] .accordion-body-Inv td[style*="color:green"] {
  color: #2e7d32 !important;
}


/* styles.css */

/* استایل برای Modal جدید آیتم */
.modal-add-invoice-item .modal-content {
    width: 400px;
}

/* استایل برای نمایش آیتم‌های فاکتور در Modal اصلی */
.invoice-item-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 5px;
}
.invoice-item-display span {
    flex-grow: 1;
    margin-right: 10px;
}
.invoice-item-display .btn-remove-item {
    background-color: transparent;
    border: none;
    color: #ff5252;
    cursor: pointer;
    font-size: 16px;
}
.invoice-item-display .btn-remove-item:hover {
    color: #cc0000;
}