/* CashLedgerPro - Clean accounting dashboard look */

:root {
  --primary: #004aad;
  --secondary: #006edc;
  --accent: #f1f3f6;
  --danger: #e53935;
  --text: #222;
  --muted: #777;
  --radius: 8px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  --font: "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* General layout */
body {
  font-family: var(--font);
  background: var(--accent);
  margin: 0;
  color: var(--text);
}

/* ============================= */
/* HEADER & NAVIGATION           */
/* ============================= */
header {
  background: var(--primary);
  color: white;
  padding: 14px 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header strong {
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}

/* Navigation bar */
.nav-bar {
  background: #003d99;
  box-shadow: var(--shadow);
  padding: 10px 0;
  position: sticky;
  top: 60px;
  z-index: 999;
}

.nav-bar .container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
}

.nav-bar a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-bar a:hover {
  background: var(--secondary);
  color: #ffeb3b;
}

/* ============================= */
/* CONTENT AREA                  */
/* ============================= */
.container {
  max-width: 960px;
  margin: 30px auto;
  padding: 20px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* Headings */
h2, h3 {
  color: var(--primary);
}

/* Buttons */
.btn {
  background: var(--secondary);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  transition: background 0.2s ease;
}
.btn:hover {
  background: var(--primary);
}

/* Forms */
label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  box-sizing: border-box;
  margin-top: 5px;
}

/* Flash messages */
.flash {
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 15px;
}
.flash.err { background: #ffe5e5; color: #a30000; border-left: 4px solid #e53935; }
.flash.ok  { background: #e8f5e9; color: #0a7a0a; border-left: 4px solid #4caf50; }

/* Footer */
footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 20px 0;
  border-top: 1px solid #ddd;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Responsive */
@media (max-width: 600px) {
  .nav-bar .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-bar a {
    display: block;
    width: 100%;
    padding: 10px;
    border-radius: 0;
  }

  .container {
    padding: 10px;
  }
}
/* ===== Dashboard KPI Cards ===== */
.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 24px;
}

.metric { padding: 18px; }
.metric-label {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .3px;
}
.metric-note {
  display: inline-block;
  margin-top: 10px;
  font-size: .8rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}
.metric-note.ok {
  background: #e7f8ee;
  color: #0a7a0a;
}
.metric-note.warn {
  background: #fff4e5;
  color: #a35a00;
}

/* Responsive: 2 columns on tablets, 1 on phones */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
}
