@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary-color: #007bff;
  --primary-dark: #0056b3;
  --text-color: #333;
  --bg-color: #f0f2f5;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
}

/* --- استایل‌های عمومی --- */
body {
  font-family: 'Vazirmatn', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  direction: rtl;
  text-align: right;
}

.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  background: var(--card-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

h1, h2 {
  color: #1a1a1a;
  font-weight: 700;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.5rem;
  margin-top: 30px;
  margin-bottom: 15px;
}

/* --- استایل جداول --- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  border-bottom: 1px solid var(--border-color);
  padding: 15px;
  text-align: right;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: #f9f9f9;
}

.credit-row {
  background-color: #e8f9e8;
}

.debit-row {
  background-color: #ffe6e6;
}

/* --- استایل دکمه‌ها --- */
.btn {
  display: inline-block;
  font-family: 'Vazirmatn';
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  margin-left: 10px;
}

.btn:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.8rem;
}

.btn-group {
  margin-bottom: 25px;
}

.btn-secondary {
  background-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #dc3545;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-success {
  background-color: #28a745;
}

.btn-success:hover {
  background-color: #218838;
}

/* --- استایل فرم‌ها --- */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%;
  font-family: 'Vazirmatn';
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group.has-icon {
  position: relative;
}

.form-group.has-icon input {
  padding-right: 40px;
}

.form-group .icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0a0a0;
  font-size: 1.2rem;
}

.error-message {
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 15px;
  text-align: center;
}

/* --- استایل کارت‌ها و خلاصه مالی --- */
.card-summary {
  background-color: #f7f9fc;
  border: 1px solid #e0e6ed;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  text-align: center;
}

.card-summary h3 {
  margin-top: 0;
  color: #333;
}

.card-summary p {
  font-size: 1.1rem;
  color: #555;
  margin: 5px 0;
}

.summary-value {
  font-weight: bold;
  color: #1e88e5;
}

.card-balance {
  background-color: #e6f3ff;
  border: 1px solid #cce0ff;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-balance h2 {
  margin: 0;
  color: #004085;
}

.card-balance p {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: #004085;
}

.negative-balance {
  color: #dc3545 !important;
  font-weight: bold;
}
.balance-cell {
    position: relative;
}

.tooltip {
    visibility: hidden;
    width: 150px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 150%;
    right: 0;
    margin-right: -75px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.balance-cell:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.date-toggle {
    cursor: pointer;
    font-weight: bold;
    text-decoration: underline;
    color: #1e88e5;
}
/* Styling for date display */
.date-container {
    position: relative;
    display: inline-block;
    cursor: help; /* Change cursor to a question mark */
    border-bottom: 1px dashed #999; /* Optional: adds a dashed underline */
}

.date-tooltip {
    visibility: hidden;
    width: auto;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* Position the tooltip above the text */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.date-container:hover .date-tooltip {
    visibility: visible;
    opacity: 1;
}

/* For better display on summary cards */
.card-summary p {
    position: relative;
}
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
    font-size: 16px;
    resize: vertical; /* Allows vertical resizing by user */
    min-height: 100px; /* Sets a minimum height */
    font-family: inherit; /* Inherits font from body for consistency */
}