/* ========== GENERAL ========== */
:root {
  --purple: #2f00a4;
  --orange: #f05e39;
  --light-bg: #f5f7fa;
  --dark-bg: #181818;
  --classic-bg: #fefbf3;
  --text-dark: #222;
  --text-light: #fff;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--light-bg);
  color: var(--text-dark);
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(90deg, var(--purple), var(--orange));
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}
.logo {
  height: 45px;
  width: auto;
  object-fit: contain;
}
.title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  margin-left: 10px;
}
.logo-wrap {
  display: flex;
  align-items: center;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 70px;
  left: 0;
  width: 180px;
  background: white;
  height: calc(100% - 70px);
  box-shadow: 2px 0 6px rgba(0,0,0,0.1);
  padding-top: 15px;
}
.side-btn {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 10px;
  font-weight: 500;
  color: var(--text-dark);
  text-align: left;
  cursor: pointer;
}
.side-btn:hover, .side-btn.active {
  background: var(--orange);
  color: white;
}

/* ===== MAIN AREA ===== */
main {
  margin-left: 190px;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.btn {
  background: linear-gradient(90deg, var(--purple), var(--orange));
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.full { width: 100%; }
.btn:hover { opacity: 0.9; }

input[type="text"], input[type="number"], input[type="date"] {
  padding: 7px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
  margin-bottom: 10px;
}

/* ===== TABLE ===== */
#ledgerTable {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}
#ledgerTable th, #ledgerTable td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  text-align: center;
}
#ledgerTable th {
  background: var(--purple);
  color: white;
}
.total-row {
  background: var(--orange);
  color: white;
  font-weight: bold;
}

/* ===== MODAL ===== */
.modal { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); }
.modal-content {
  background:white; width:90%; max-width:400px; margin:80px auto; padding:20px;
  border-radius:12px; position:relative; animation:fadeIn 0.3s ease;
}
.close { position:absolute; top:10px; right:15px; cursor:pointer; font-size:22px; }
@keyframes fadeIn { from{opacity:0; transform:scale(0.9);} to{opacity:1; transform:scale(1);} }

/* ===== FOOTER ===== */
.footer {
  text-align:center; padding:10px; background:#fff; box-shadow:0 -2px 6px rgba(0,0,0,0.1);
}

/* ===== THEMES ===== */
body.dark {
  background: var(--dark-bg);
  color: var(--text-light);
}
body.dark table, body.dark .sidebar { background: #2a2a2a; color: white; }
body.classic { background: var(--classic-bg); }

/* ====== SMOOTH TRANSITIONS ====== */

/* Base fade for whole body during theme change */
body {
  transition: background-color 0.6s ease, color 0.6s ease;
}

/* Tab content fade animation */
.tab-content {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
  opacity: 1;
  transform: translateY(0);
}

/* Extra polish on cards and charts */
.card, canvas, table {
  transition: all 0.4s ease-in-out;
}
