@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

:root{
  /* ===== Colors ===== */
  --body-color: #E4E9F7;
  --sidebar-color: #FFF;
  --primary-color: #695CFE;
  --primary-color-light: #F6F5FF;
  --toggle-color: #DDD;
  --text-color: #707070;

  /* ====== Transition ====== */
  --tran-03: all 0.2s ease;
  --tran-03: all 0.3s ease;
  --tran-04: all 0.3s ease;
  --tran-05: all 0.3s ease;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
}

body {
  display: flex;
  height: 100vh;
  background-color: #f5f7fa;
  transition: background 0.3s, color 0.3s;
}


::selection{
  background-color: var(--primary-color);
  color: #fff;
}

body.dark{
  --body-color: #18191a;
  --sidebar-color: #242526;
  --primary-color: #3a3b3c;
  --primary-color-light: #3a3b3c;
  --toggle-color: #fff;
  --text-color: #ccc;
}

.hidden {
  display: none !important;
}

/* Auth */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background: linear-gradient(135deg, #007bff, #0056b3);
}

.auth-box {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  width: 320px;
  text-align: center;
}

.auth-box input {
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.8rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.auth-box button {
  width: 100%;
  padding: 0.8rem;
  background: #007bff;
  color: white;
  border: none;
  margin-top: 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.auth-box button:hover {
  background: #0056b3;
}

.toggle {
  margin-top: 1rem;
}

.toggle a {
  color: #007bff;
  cursor: pointer;
  text-decoration: none;
}

.error {
  color: red;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Sidebar */
/* .sidebar {
  width: 240px;
  background: #0056b3;
  color: white;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.sidebar .sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: bold;
  font-size: 1.3rem;
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.nav {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
}

.dark-toggle {
  margin-top: 2rem;
} */

/* Main */
.main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}
.main-content {
  padding: 2rem;
}
.dashboard-header {
  margin-bottom: 1rem;
}

.expense-form {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-section {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-section input,
.filter-section button {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.filter-section button {
  background: #007bff;
  color: white;
  cursor: pointer;
  border: none;
}


.expense-form input {
  flex: 1 1 200px;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.expense-form button {
  padding: 0.7rem 1rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.expense-form button:hover {
  background: #0056b3;
}

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

.expense-table th,
.expense-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ccc;
}

.expense-table button {
  padding: 0.4rem 0.6rem;
  margin-right: 0.3rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.expense-table .edit {
  background: #ffc107;
  color: black;
}

.expense-table .delete {
  background: #dc3545;
  color: white;
}

body.dark .auth-box,
body.dark .expense-form input,
body.dark .expense-form,
body.dark .expense-table table {
  background: #1e1e1e;
  color: #fff;
  border-color: #444;
}

/* @media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: -250px;
    top: 0;
    bottom: 0;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .sidebar.active {
    left: 0;
  }

  .menu-toggle {
    display: inline;
  }

  .main {
    padding: 1rem;
  }
} */
/* Sidebar active tab styling */
.sidebar ul li.active {
  background-color: #007bff;
  color: white;
}

.analytics-container {
  display: flex;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 1rem;
}

.chart-card {
  background-color: #ffffff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 300px;
}

.chart-card h3 {
  margin-bottom: 0.5rem;
  color: #007bff;
}

/* ===== Sidebar ===== */
 
.sidebar{
    top: 0;
    left: 0;
    height: 100%;
    width: 200px;
    padding: 10px 14px;
    background: var(--sidebar-color);
    transition: var(--tran-05);
    z-index: 100;  
}

.sidebar.close{
    width: 88px;
}

/* ===== Reusable code - Here ===== */
.sidebar li{
    height: 50px;
    list-style: none;
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.sidebar header .image,
.sidebar .icon{
    min-width: 60px;
    border-radius: 6px;
}

.sidebar .icon{
    min-width: 60px;
    border-radius: 6px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar .text,
.sidebar .icon{
    color: var(--text-color);
    transition: var(--tran-03);
}

.sidebar .text{
    font-size: 17px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 1;
}
.sidebar.close .text{
    opacity: 0;
}
/* =========================== */

.sidebar header{
    position: relative;
}

.sidebar header .image-text{
    display: flex;
    align-items: center;
    margin-left: 10px;
    margin-top: 10pzx;
}
.sidebar header .logo-text{
    display: flex;
    flex-direction: column;
}
header .image-text .name {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 600;
}

header .image-text .profession{
    font-size: 16px;
    margin-top: -2px;
    display: block;
}

.sidebar header .image{
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar header .image img{
    width: 40px;
    border-radius: 6px;
}

.sidebar header .toggle{
    position: absolute;
    top: 50%;
    right: -25px;
    transform: translateY(-50%) rotate(180deg);
    height: 25px;
    width: 25px;
    background-color: var(--primary-color);
    color: var(--sidebar-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: var(--tran-05);
}

body.dark .sidebar header .toggle{
    color: var(--text-color);
}

.sidebar.close .toggle{
    transform: translateY(-50%) rotate(0deg);
}

.sidebar .menu{
    margin-top: 20px;
}

.sidebar li.search-box{
    border-radius: 6px;
    background-color: var(--primary-color-light);
    cursor: pointer;
    transition: var(--tran-05);
}

.sidebar li.search-box input{
    height: 100%;
    width: 100%;
    outline: none;
    border: none;
    background-color: var(--primary-color-light);
    color: var(--text-color);
    border-radius: 6px;
    font-size: 17px;
    font-weight: 500;
    transition: var(--tran-05);
}
.sidebar li a{
    list-style: none;
    height: 100%;
    background-color: transparent;
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
    border-radius: 6px;
    text-decoration: none;
    transition: var(--tran-03);
}

.sidebar li a:hover{
    background-color: var(--primary-color);
}
.sidebar li a:hover .icon,
.sidebar li a:hover .text{
    color: var(--sidebar-color);
}
body.dark .sidebar li a:hover .icon,
body.dark .sidebar li a:hover .text{
    color: var(--text-color);
}

.sidebar .menu-bar{
    height: calc(100% - 55px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: scroll;
}
.menu-bar::-webkit-scrollbar{
    display: none;
}
.sidebar .menu-bar .mode{
    border-radius: 6px;
    background-color: var(--primary-color-light);
    position: relative;
    transition: var(--tran-05);
}

.menu-bar .mode .sun-moon{
    height: 50px;
    width: 60px;
}

.mode .sun-moon i{
    position: absolute;
}
.mode .sun-moon i.sun{
    opacity: 0;
}
body.dark .mode .sun-moon i.sun{
    opacity: 1;
}
body.dark .mode .sun-moon i.moon{
    opacity: 0;
}

.menu-bar .bottom-content .toggle-switch{
    position: absolute;
    right: 0;
    height: 100%;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
}
.toggle-switch .switch{
    position: relative;
    height: 22px;
    width: 40px;
    border-radius: 25px;
    background-color: var(--toggle-color);
    transition: var(--tran-05);
}

.switch::before{
    content: '';
    position: absolute;
    height: 15px;
    width: 15px;
    border-radius: 50%;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    background-color: var(--sidebar-color);
    transition: var(--tran-04);
}

body.dark .switch::before{
    left: 20px;
}

.home{
    position: absolute;
    top: 0;
    top: 0;
    left: 250px;
    height: 100vh;
    width: calc(100% - 250px);
    background-color: var(--body-color);
    transition: var(--tran-05);
}
.home .text{
    font-size: 30px;
    font-weight: 500;
    color: var(--text-color);
    padding: 12px 60px;
}

.sidebar.close ~ .home{
    left: 78px;
    height: 100vh;
    width: calc(100% - 78px);
}
body.dark .home .text{
    color: var(--text-color);
}



#loader {
  display: none;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#result {
  text-align: center;
  margin-top: 20px;
}