/* Digikala Accounting — custom styles (RTL) */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --dk-red: #ef394e;
  --dk-dark: #232933;
  --dk-sidebar: #1e2430;
  --dk-border: #e6e8eb;
  --dk-muted: #6b7280;
}

body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background: #f4f5f7;
  color: #232933;
}

/* Sidebar layout */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px;
  min-height: 100vh;
  background: var(--dk-sidebar);
  color: #cfd4dc;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease;
}
.sidebar .brand {
  padding: 1.1rem 1.25rem;
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sidebar .brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--dk-red);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.sidebar nav { padding: .75rem; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: .65rem;
  color: #cfd4dc;
  text-decoration: none;
  padding: .6rem .85rem;
  border-radius: .5rem;
  margin-bottom: .15rem;
  font-size: .92rem;
  transition: background .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--dk-red); color: #fff; }
.sidebar .sidebar-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .78rem;
  color: #8a93a1;
}

.main-content {
  flex: 1;
  margin-right: 250px;
  padding: 1.5rem 1.75rem 3rem;
}
@media (max-width: 991px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-right: 0; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.topbar h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.topbar .breadcrumb { margin: 0; }

/* Cards */
.card { border: 1px solid var(--dk-border); border-radius: .85rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card .card-header {
  background: transparent; border-bottom: 1px solid var(--dk-border);
  font-weight: 700; padding: .9rem 1.1rem;
}

.kpi-card { border-right: 4px solid var(--dk-red); }
.kpi-card .kpi-title { font-size: .82rem; color: var(--dk-muted); }
.kpi-card .kpi-value { font-size: 1.3rem; font-weight: 700; margin-top: .25rem; }
.kpi-card .kpi-sub { font-size: .78rem; color: var(--dk-muted); }

/* Tables */
.table thead th {
  font-size: .8rem; color: var(--dk-muted);
  border-bottom-width: 1px; white-space: nowrap;
}
.table td { font-size: .88rem; vertical-align: middle; }

.badge { font-weight: 500; }

/* Amounts */
.amount { direction: ltr; unicode-bidi: embed; display: inline-block; }
.amount.neg { color: #dc2626; }
.amount.pos { color: #16a34a; }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #232933 0%, #3a4c5f 100%);
}
.login-box { width: 380px; }

/* Chart containers */
.chart-box { position: relative; height: 280px; }

/* Messages */
.messages-container { position: fixed; top: 1rem; left: 1rem; z-index: 2000; max-width: 380px; }

/* Expense form number input */
input[type=number] { direction: ltr; text-align: left; }

/* Print-friendly tables on detail pages */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-right: 0; }
}
