/* Accounting SaaS — panel theme compatibility (legacy view classes) */
:root {
  --acc-ink: #0f172a;
  --acc-muted: #64748b;
  --acc-line: #e2e8f0;
  --acc-ok: #059669;
  --acc-danger: #dc2626;
  --acc-warn: #d97706;
  --acc-accent: #6366f1;
}

.dark {
  --acc-ink: #e2e8f0;
  --acc-muted: #94a3b8;
  --acc-line: #334155;
}

/* Long sidebar dropdowns (سایر امکانات) */
#nav-more.sidebar-dropdown-panel.open {
  max-height: 28rem;
}

.content .card,
.page-body .card {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.08);
}

.dark .content .card,
.dark .page-body .card {
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: none;
}

.navbar-vertical .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.navbar-vertical .nav-link {
  font-size: 0.875rem;
}

.navbar-vertical .nav-link.active {
  font-weight: 600;
}

.page-wrapper {
  background: #f1f5f9;
}

.page-header {
  border-bottom: 1px solid var(--acc-line);
  background: #fff;
}

/* Legacy content headings */

.content h1,
.page-body h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.content h3,
.page-body h3 {
  font-size: 1.05rem;
  font-weight: 650;
}

.flash-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  margin-bottom: 1rem;
}

.flash-err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  margin-bottom: 1rem;
}

.content table,
.page-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.content th,
.content td,
.page-body th,
.page-body td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--acc-line);
  text-align: right;
  vertical-align: middle;
}

.content th,
.page-body th {
  background: #f8fafc;
  color: var(--acc-muted);
  font-weight: 600;
  white-space: nowrap;
}

.dark .content th,
.dark .page-body th {
  background: #0f172a;
}

.dark .content tbody tr:hover,
.dark .page-body tbody tr:hover {
  background: #334155;
}

.content tbody tr:hover,
.page-body tbody tr:hover {
  background: #f8fafc;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  border: 0;
  background: linear-gradient(to left, #6366f1, #4f46e5);
  color: #fff !important;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
  font-family: inherit;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.45);
}

.btn:hover {
  filter: brightness(0.95);
  color: #fff !important;
}

.btn.gray { background: #475569; }
.btn.green { background: var(--acc-ok); }
.btn.red { background: var(--acc-danger); }
.btn.outline {
  background: #fff;
  color: var(--acc-ink) !important;
  border: 1px solid var(--acc-line);
  box-shadow: none;
}

.btn.outline:hover {
  background: #f8fafc;
  color: var(--acc-ink) !important;
}

.dark .btn.outline {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0 !important;
}

.dark .btn.outline:hover {
  background: #334155;
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

label {
  display: block;
  margin: 0.7rem 0 0.3rem;
  font-size: 0.85rem;
  color: var(--acc-muted);
  font-weight: 500;
}

.content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.global-search input),
.content select,
.content textarea,
.auth-card input,
.auth-card select,
.auth-card textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--acc-line);
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--acc-ink);
}

.content input:focus,
.content select:focus,
.content textarea:focus,
.auth-card input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.dark .content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.dark .content select,
.dark .content textarea {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e2e8f0;
  font-weight: 600;
}

.pill.draft { background: #e2e8f0; }
.pill.pending { background: #fef3c7; color: #92400e; }
.pill.approved { background: #dbeafe; color: #1e40af; }
.pill.finalized { background: #d1fae5; color: #065f46; }
.pill.cancelled { background: #fee2e2; color: #991b1b; }
.pill.received,
.pill.issued { background: #dbeafe; color: #1e40af; }
.pill.deposited { background: #fef3c7; color: #92400e; }
.pill.cleared { background: #d1fae5; color: #065f46; }
.pill.returned { background: #fee2e2; color: #991b1b; }

.muted { color: var(--acc-muted); font-size: 0.85rem; }
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  direction: ltr;
  text-align: left;
  font-family: "Vazirmatn", ui-monospace, monospace;
}

.indent-1 { padding-right: 1.2rem !important; }
.indent-2 { padding-right: 2.2rem !important; }
.indent-3 { padding-right: 3.2rem !important; }

.row-actions a,
.row-actions button {
  margin-left: 0.35rem;
}

/* Login */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.22), transparent 42%),
    radial-gradient(circle at 85% 10%, rgba(139, 92, 246, 0.18), transparent 38%),
    linear-gradient(160deg, #020617, #0f172a 55%, #1e1b4b);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  color: var(--acc-ink);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 10px 24px -8px rgba(99, 102, 241, 0.55);
}

@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Sidebar scroll for long accounting menu */
.navbar-vertical .navbar-collapse {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.navbar-vertical .nav-link-icon {
  width: 1.5rem;
  opacity: 0.9;
}

.navbar-dark .navbar-brand a {
  color: #fff;
  text-decoration: none;
}

.page-pretitle {
  color: var(--acc-muted);
  font-size: 0.8rem;
}

.page-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

code {
  font-family: "Vazirmatn", ui-monospace, monospace;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

@media print {
  .navbar-vertical,
  .page-header,
  .noprint {
    display: none !important;
  }
  .page-wrapper,
  .page-body {
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* —— UX سپیدارگونه —— */
.nav-section {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #94a3b8 !important;
  text-transform: none;
}

.nav-more > summary {
  list-style: none;
  cursor: pointer;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more-list { padding-right: 0.5rem; }
.nav-hint {
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.75rem;
  line-height: 1.7;
}
.nav-hint kbd {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-family: inherit;
}

.topbar-acc { position: sticky; top: 0; z-index: 30; }
.global-search {
  position: relative;
}
.global-search input {
  margin: 0;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid var(--acc-line);
  border-radius: 0.85rem;
  box-shadow: 0 12px 32px rgba(15,23,42,.12);
  max-height: 360px;
  overflow: auto;
  z-index: 50;
}
.dark .search-suggest {
  background: #1e293b;
  border-color: #475569;
}
.search-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.15rem 0.75rem;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f1f5f9;
}
.search-item:hover { background: #f8fafc; }
.search-item strong { grid-column: 2; }
.search-item small { grid-column: 2; color: var(--acc-muted); }
.search-type {
  grid-row: span 2;
  align-self: center;
  font-size: 0.72rem;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  text-align: center;
}

.quick-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.quick-actions .btn { display: inline-flex; align-items: center; gap: 0.3rem; }

.workbench-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(120deg, #fff, #eef2ff);
}
.dark .workbench-hero {
  background: linear-gradient(120deg, #1e293b, #312e81);
}
.flow-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px dashed var(--acc-line);
  border-radius: 0.75rem;
}
.flow-strip a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--acc-ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.flow-strip span {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #206bc4;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}
.flow-strip i { color: #94a3b8; }

.alert-stack { display: flex; flex-direction: column; gap: 0.4rem; }
.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  border-radius: 0.55rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid;
  color: inherit;
}
.alert-item.danger { background: #fef2f2; border-color: #fecaca; }
.alert-item.warn { background: #fffbeb; border-color: #fde68a; }
.alert-item.info { background: #f0f9ff; border-color: #bae6fd; }

.card.kpi strong.num { font-size: 1.45rem; display: block; margin: 0.2rem 0; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.chip {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--acc-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}
.chip.active {
  background: #206bc4;
  color: #fff;
}

.table-dense th,
.table-dense td {
  padding: 0.45rem 0.55rem !important;
  font-size: 0.85rem;
}
.table-dense thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.empty-box {
  text-align: center;
  padding: 2rem 1rem;
}
.empty-box-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #206bc4;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.empty-box .btn { margin-top: 0.75rem; }

.content .card { padding: 1rem; }

.entry-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(120deg, #eff6ff, #fff);
  border-color: #bfdbfe;
}
.entry-total {
  text-align: left;
  direction: ltr;
}
.entry-total strong {
  display: block;
  font-size: 1.5rem;
  color: #1d4ed8;
}
.entry-grid select,
.entry-grid input {
  margin: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.85rem;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--acc-line);
  border-radius: 0.5rem;
}
.jalali-wrap .jdp-display,
.jdp-display {
  direction: ltr;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
kbd {
  background: #e2e8f0;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.78em;
  font-family: inherit;
}
.entry-banner kbd {
  background: #dbeafe;
}

