:root {
  --jmt-red: #b5121b;
  --jmt-red-dark: #8f0e15;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #e4e7eb;
  --success: #15803d;
  --danger: #b91c1c;
  --warning: #a16207;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .2px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--jmt-red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 14px;
}

nav a:hover {
  background: #f1f3f5;
}

main {
  max-width: 1440px;
  margin: 28px auto;
  padding: 0 22px 40px;
}

h1 {
  margin: 0 0 20px;
  font-size: 28px;
}

h2 {
  margin: 0 0 15px;
  font-size: 19px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.kpis {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.035);
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  margin-top: 7px;
  font-size: 30px;
  font-weight: 800;
}

.positive { color: var(--success); }
.negative { color: var(--danger); }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.btn {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 7px;
  border: 0;
  background: var(--jmt-red);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

.btn:hover { background: var(--jmt-red-dark); }

.btn.secondary { background: #4b5563; }
.btn.light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.danger { background: var(--danger); }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #fafafa;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.table-wrap {
  overflow-x: auto;
}

form.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #cfd5dc;
  border-radius: 7px;
  background: #fff;
  font: inherit;
}

textarea { min-height: 90px; }

.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e8ebef;
}

.badge.Paid { background: #dcfce7; color: #166534; }
.badge.Overdue { background: #fee2e2; color: #991b1b; }
.badge.Due-soon { background: #fef3c7; color: #92400e; }
.badge.Open { background: #dbeafe; color: #1e40af; }
.badge.Cancelled { background: #e5e7eb; color: #4b5563; }

.bar {
  margin-top: 6px;
  height: 15px;
  border-radius: 8px;
  background: #edf0f3;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--jmt-red);
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.login-shell {
  max-width: 430px;
  margin: 90px auto;
}

.login-shell .card {
  padding: 28px;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  margin-bottom: 15px;
}

.value-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.value-row:last-child { border-bottom: 0; }

@media (max-width: 900px) {
  .grid.two { grid-template-columns: 1fr; }
  form.grid-form { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  nav { display: none; }
}
.brand-logo{width:92px;height:44px;object-fit:contain;object-position:left center}.notice{padding:12px;border:1px solid #fecaca;background:#fff1f2;color:#991b1b;border-radius:8px;margin-bottom:14px}.value-row{display:flex;justify-content:space-between;gap:20px;padding:10px 0;border-bottom:1px solid var(--line)}.value-row span{text-align:right}.rate-preview{padding:10px;border:1px dashed #cfd5dc;border-radius:8px;background:#fafafa}@media(max-width:900px){.grid.two{grid-template-columns:1fr}.header-inner{align-items:flex-start;flex-direction:column;gap:12px}form.grid-form{grid-template-columns:1fr}.full{grid-column:auto}}
