/* Import Google Font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
:root {
  --primary: #2596ff;
  --secondary: #6C757D;
  --light: #F8F8F8;
  --dark: #333;
  --bgsecondary: #fff;
  --bgprimary: #eeeeee;
}

.body{
  display: flex;
  background: var(--bgprimary);
}

.sidebar{
  background: var(--bgsecondary);
  padding: 1rem;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar ul{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .4rem;
  height: 100%;
}

.top, .bottom{
display: grid;
gap: .5rem;
}

.sidebar ul li{
  padding: 1rem;
  display: grid;
  place-items: center; 
  border-radius: .25rem;
  height: 4rem;
  aspect-ratio: 1;
  cursor: pointer;
}

.sidebar ul .active{
  background: var(--primary);
  z-index: 1;
  color: var(--txtnegative);
}

.inactive {
background: var(--bgprimary);
transition: background 0.3s;
}

.inactive:hover {
background: #ccc;
}

img{
  width: 100%;
}

.goBack {
  position: absolute; /* Add this line */
  top: .85rem; /* Adjust the top distance as needed */
  left: 7rem; /* Adjust the left distance as needed */
  width: 3rem;
  text-decoration: none;
  background: none;
  border: none;
  border-radius: .15rem;
  margin: .8rem .7rem;
  cursor: pointer;
  transition: .3s;
  box-shadow: none;
}
.goBack:hover {
  width: 3rem;
  transition: .5s;
  margin: .8rem .3rem;
  padding-right: 1.5rem;
  background: none;
}

.goBack img {
  width: 2rem;
}

.main {
  width: 100%;
  padding: 4rem;
  background: var(--bgsecondary);
  margin: 1rem;
  border-radius: .5em;
}

h1 {
    text-align: center;
    background: var(--primary);
    padding: 1rem 5rem;
    border-radius: .5rem;
    color: #fff;
}

#addButton {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 8rem;
  padding: 1rem;
  border: none;
  border-radius: .4rem;
  background: var(--primary);
  cursor: pointer;
  color: #fff;
}

#addButton:hover {
  background: #2288e7;
}

#salaryList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
  background: #f1ecd8;
  border-radius: .5rem;
  padding: .8rem;
  box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.date{
  font-size: .6rem;
  color: #6C757D;
}

.buttons{
  display: flex;
  gap: .5rem;
}

.buttons button{
  width: 100%;
}

#popup {
  max-width: 18rem;
  width: 100%;
  border-radius: 12px;
  background: #fff;
  box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px;
  position: absolute;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  z-index: 2;
  display: none;
  padding: 1rem;
}

.popup-content{
  display: grid;
  gap: 1rem;
}

#popup h2 {
  text-align: center;
}

label {
    display: block;
}

input, textarea {
    width: 100%;
    padding: .8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    outline: none;

}

button {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 100%;
    padding: .4rem;
    cursor: pointer;
    border-radius: .25rem;
    margin-top: .5rem;
    box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;
}

button:hover {
  background: #2288e7;
}

#saveButton {
    background-color: var(--primary);
}

#saveButton:hover {
  background: #2288e7;
}

#cancelButton {
    background-color: #f03043;
}

#cancelButton:hover {
  background-color: #dd3747;
}

.calculator {
  max-width: 20rem;
  width: 100%;
  border-radius: 12px;
  padding: .5rem;
  background: #fff;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 50px 5px;
  position: absolute;
  transform: translate(-35%, -50%);
  top: 50%;
  left: 50%;
  z-index: 3;
  display: none;
}
.calculator #display {
  height: 80px;
  width: 100%;
  outline: none;
  border: none;
  text-align: right;
  margin-bottom: 10px;
  font-size: 25px;
  color: #000e1a;
}
.calculator .buttons {
  display: grid;
  grid-gap: .5rem;
  grid-template-columns: repeat(4, 1fr);
}
.calculator .buttons button {
  padding: .5rem;
  border-radius: 6px;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #000e1a;
  background-color: #fff;
  box-shadow: rgba(0, 0, 0, 0.178) 0px 0px 2px .5px;
}
.calculator .buttons button:active {
  transform: scale(0.99);
}
.calculator .operator {
  color: #2f9fff;
}
#equal {
  color: #fff;
  background-color: #0099ff;
}
#equal:hover {
  background: #4583e7;
}

#btnRed {
  background: #ff0000;
  color: #fff;
}

#btnOrange {
  background: #ffb30e;
  color: #fff;
}


#overlay {
  position: fixed; /* Sit on top of the page content */
  display: none; /* Hidden by default */
  width: 100%; /* Full width (cover the whole page) */
  height: 100%; /* Full height (cover the whole page) */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5); /* Black background with opacity */
  z-index: 2; /* Specify a stack order in case you're using a different order for other elements */
  cursor: pointer; /* Add a pointer on hover */
}

/* preloader */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}