* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f4f6fa; color: #222; font-size: 14px; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: #1e293b; color: #e2e8f0;
  display: flex; flex-direction: column; padding: 20px 0;
}
.brand { font-size: 18px; font-weight: bold; padding: 0 20px 20px; border-bottom: 1px solid #334155; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
  display: block; padding: 10px 20px; color: #cbd5e1; font-size: 14px;
}
.sidebar nav a:hover { background: #334155; text-decoration: none; }
.sidebar nav a.active { background: #2563eb; color: #fff; }
.user-box { padding: 14px 20px; border-top: 1px solid #334155; font-size: 12px; }
.btn-logout { display: inline-block; margin-top: 6px; color: #f87171; font-weight: bold; }

.content { flex: 1; padding: 26px 32px; }
h1.page-title { font-size: 22px; margin-bottom: 20px; color: #1e293b; }
h2 { font-size: 17px; margin: 20px 0 12px; }

.card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 16px; }
.stat { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat .label { color: #64748b; font-size: 12px; text-transform: uppercase; }
.stat .value { font-size: 20px; font-weight: bold; margin-top: 6px; color: #0f172a; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background: #f1f5f9; font-size: 12px; text-transform: uppercase; color: #475569; }
tr:hover td { background: #f8fafc; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: #dc2626; }

.btn {
  display: inline-block; padding: 8px 14px; border-radius: 6px; border: none;
  cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 13px; }
.form-control, select, input[type=text], input[type=date], input[type=number],
input[type=password], input[type=email], textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1;
  border-radius: 6px; font-size: 14px; font-family: inherit;
}
.form-control:focus { outline: none; border-color: #2563eb; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.alert { padding: 11px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-info    { background: #dbeafe; color: #1e40af; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { width: 360px; background: #fff; padding: 32px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.login-box h1 { text-align: center; margin-bottom: 22px; font-size: 20px; color: #1e293b; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-asset { background: #dbeafe; color: #1e40af; }
.badge-liability { background: #fef3c7; color: #92400e; }
.badge-equity { background: #e9d5ff; color: #6b21a8; }
.badge-revenue { background: #dcfce7; color: #166534; }
.badge-expense { background: #fee2e2; color: #991b1b; }
.badge-role-admin { background: #ede9fe; color: #6d28d9; }
.badge-role-accountant { background: #dbeafe; color: #1e40af; }
.badge-role-viewer { background: #e2e8f0; color: #475569; }

.tree-indent { display: inline-block; width: 18px; }
tr.parent-account td { font-weight: 600; }

.badge-aging { background: #fef3c7; color: #92400e; }
input[type=file] { width: 100%; padding: 6px 0; font-size: 13px; }
input[type=checkbox] { width: auto; }

.total-row td { font-weight: bold; background: #f8fafc; border-top: 2px solid #94a3b8; }
.report-table { width: 100%; }
.report-table td { padding: 6px 8px; }
.indent-1 { padding-left: 24px !important; }

.section-row { background: #e2e8f0; font-weight: 700; font-size: 12px; text-transform: uppercase; color: #334155; letter-spacing: .03em; }
.month-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.month-head h2 { margin: 0; }

.month-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.month-grid .card { margin-bottom: 0; min-width: 0; }
.month-grid .month-head { flex-wrap: wrap; }
.month-grid .month-head h2 { font-size: 15px; }
.month-grid .report-table td { padding: 5px 6px; font-size: 12.5px; }