@font-face { font-family: "Cairo"; src: url("../fonts/Cairo-400.ttf"); font-weight: 400; }
@font-face { font-family: "Cairo"; src: url("../fonts/Cairo-700.ttf"); font-weight: 700; }

:root { --accent: #F5A800; --dark: #2B2B2B; --side: 240px; }
body { font-family: "Cairo", Tahoma, sans-serif; background: #f5f6f8; font-size: 14px; }
.sidebar { position: fixed; top: 0; right: 0; bottom: 0; width: var(--side); background: var(--dark); color: #ddd; overflow-y: auto; z-index: 1030; }
.sidebar .brand { padding: 18px 16px; border-bottom: 1px solid #3c3c3c; display: flex; align-items: center; gap: 10px; }
.sidebar .brand img { height: 38px; background: #fff; border-radius: 8px; padding: 3px; }
.sidebar .brand b { color: #fff; font-size: 15px; line-height: 1.2; }
.sidebar .nav-link { color: #cfcfcf; padding: 9px 18px; border-right: 3px solid transparent; display: flex; gap: 10px; align-items: center; }
.sidebar .nav-link:hover { color: #fff; background: #353535; }
.sidebar .nav-link.active { color: #fff; background: #3a3a3a; border-right-color: var(--accent); }
.sidebar .nav-head { font-size: 11px; color: #888; padding: 14px 18px 4px; }
.main { margin-right: var(--side); padding: 22px 26px; min-height: 100vh; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(100%); transition: .2s; }
  .sidebar.open { transform: none; }
  .main { margin-right: 0; padding: 14px; }
}
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title h1 { font-size: 22px; font-weight: 700; margin: 0; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-radius: 12px; }
.card-header { background: #fff; font-weight: 700; border-bottom: 1px solid #eee; }
.stat { padding: 16px; }
.stat .lbl { color: #777; font-size: 12px; }
.stat .val { font-size: 21px; font-weight: 700; }
.stat .ic { font-size: 26px; color: var(--accent); }
.btn-accent { background: var(--accent); color: #222; border-color: var(--accent); font-weight: 700; }
.btn-accent:hover { background: #dc9700; color: #111; }
.table thead th { background: #fafafa; font-size: 12.5px; color: #555; white-space: nowrap; }
.table td { vertical-align: middle; }
.num { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profit-pos { color: #198754; font-weight: 700; }
.profit-neg { color: #dc3545; font-weight: 700; }
.lines-table input, .lines-table select { font-size: 13px; padding: 4px 6px; min-width: 0; }
.lines-table td { padding: 3px; }
.lines-table .c-desc { min-width: 230px; }
.lines-table .c-num { width: 105px; }
.lines-table .c-sm { width: 80px; }
.lines-table .ro { background: #f6f6f6; }
.lines-table tr.sec-row td { background: #fff7e0; }
.internal { background: #eef7ff !important; }
.totals-box td { padding: 4px 8px; }
.form-label { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.doc-preview { width: 100%; height: 80vh; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.badge { font-weight: 600; }
.empty { color: #999; text-align: center; padding: 30px; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.chart-bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bars .bar { width: 100%; display: flex; gap: 2px; align-items: flex-end; height: 100%; }
.chart-bars .bar span { flex: 1; border-radius: 3px 3px 0 0; }
.chart-bars .bar .s { background: #d6d6d6; }
.chart-bars .bar .p { background: var(--accent); }
.chart-bars small { font-size: 10px; color: #888; margin-top: 3px; direction: ltr; }
