:root {
  --color-bg: #f4f6f8;
  --color-text: #333;

  --color-primary: #2563eb;
  --color-primary-hover: #1e40af;

  --color-sidebar-bg: #1e293b;
  --color-sidebar-text: #fff;

  --color-card-bg: #fff;
  --color-input-border: #ccc;
  --color-input-focus: #2563eb;

  --color-footer-bg: #1f2937;
  --color-footer-text: #e5e7eb;

  --color-error: #ff3333;
}

input,
select {
  font-size: 16px;
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  padding: 0.5em;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-input-border);
  border-radius: 8px;
  color: var(--color-text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

select option[value=""] {
  color: #888;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--color-sidebar-bg);
  color: var(--color-text);
  height: 100svh;
  overflow-x: hidden;
}

.layout {
  display: flex;
  height: 100svh;
  position: relative;
}

.sidebar {
  width: 240px;
  background: var(--color-sidebar-bg);
  color: var(--color-sidebar-text);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 0px;
}

.sidebar.collapsed .sidebar-menu {
  display: none;
}

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

.sidebar-header img {
  max-width: 150px;
  transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-header img {
  opacity: 0;
  width: 0;
}

.sidebar-toggle {
  background: var(--color-sidebar-bg);
  color: white;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  position: absolute;
  top: 15px;
  right: -50px;
  z-index: 1200;
  transition: right 0.3s ease;
  display: none;
}

.sidebar-menu {
  display: block;
  list-style: none;
  margin-top: 1rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-menu li {
  margin: 0.3rem 0;
}

.sidebar-menu a,
.sidebar-menu button {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  color: white;
  background: transparent;
  text-decoration: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 0.95rem;
}

.sidebar-menu a:hover,
.sidebar-menu button:hover {
  background: var(--color-primary);
}

.sidebar .selected {
  background-color: var(--color-primary);
}

.content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  justify-content: space-between;
  /* padding-top: 4em; */
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.grid-cards-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 15px;
}

.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  text-align: center;
  padding: 1rem;
  margin-top: auto;
  border-radius: 8px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--color-card-bg);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  cursor: default;
  min-width: 250px;
}

.card:hover {
  transform: translateY(-3px);
}

.card h3 {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.card h4 {
  text-align: center;
  background-color: var(--color-footer-bg);
  color: var(--color-sidebar-text);
  padding: 4px;
  border-radius: 8px;
}

form label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: bold;
}

form select,
form input[type="text"],
form input[type="number"],
form input[type="password"] {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid var(--color-input-border);
  border-radius: 6px;
  transition: border-color 0.3s;
}

form input[aria-invalid="true"] {
  border: 1px solid red;
}

form input:focus {
  border-color: var(--color-input-focus);
  outline: none;
}

form button {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  width: 100%;
}

form button:hover {
  background: var(--color-primary-hover);
}

.errorlist {
  color: var(--color-error);
  font-weight: bold;
  padding: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  color: var(--color-primary);
  background: white;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background: var(--color-primary);
  color: white;
}

.pagination .active {
  background: var(--color-primary);
  color: white;
}

.select2 {
  width: 100% !important;
}

.search-bar {
  display: flex;
  justify-content: end;
  background-color: var(--color-sidebar-bg);
  padding: 5px;
  border-radius: 10px;
  gap: 20px;
  justify-content: center;
}

.search-bar form {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.search-bar form select {
  margin-bottom: 0;
  width: max-content;
}

.search-bar form input {
  margin-bottom: 0;
}

.report-container-wrapper {
  padding: 10px;
}

.report-container {
  display: flex;
  justify-content: space-around;
  padding: 10px;
  background-color: var(--color-sidebar-bg);
  border-radius: 10px;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 280px;
}

.report-card-content-item-title {
  font-weight: bold;
}

.report-container .card {
  flex: 1;
  border: 3px solid var(--color-primary);
  height: auto;
}

.report-container .card h4 {
  background-color: var(--color-primary);
  text-align: center;
  padding: 2px;
  border-radius: 10px;
  color: var(--color-card-bg);
  font-weight: bold;
}

.report-card-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}

.report-card-content-item {
  display: flex;
  justify-content: space-between;
}

.report-card-content-item {
  padding: 2px;
}

.report-card-content-item:nth-child(1n + 2) {
  border-top: 1px solid black;
}

.current-store {
  display: block;
  padding: 10px;
  background-color: var(--color-primary);
}

.collapsed .current-store {
  display: none;
}

.empty-list-container {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: center;
  padding: 5px;
}

.empty-list-wrapper {
  max-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-list-wrapper img {
  width: 100%;
  border-radius: 30px;
}

.empty-list-wrapper span {
  display: block;
  width: 100%;
  text-align: center;
  padding: 5px;
  background-color: var(--color-sidebar-bg);
  color: var(--color-sidebar-text);
  border-radius: 10px;
}

.messages {
  position: fixed;
  top: 0;
  right: 0;
  overflow: hidden;
  animation: slideRight 5s forwards;
  pointer-events: none;
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 3px solid var(--color-primary-hover);
  border-radius: 0px 0px 0px 17px;
}

.messages li {
  background-color: var(--color-input-focus);
  height: 100%;
  list-style: none;
  padding: 10px;
}

.messages li.error {
  background-color: var(--color-error);
}

.select2-search__field {
  font-size: 16px !important;
}

.search-bar {
  gap: 20px;
  min-width: 300px;
}

*::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

*::-webkit-scrollbar-track {
  border-radius: 5px;
  background-color: #26334a;
  border: 3px solid #f4f6f8;
}

*::-webkit-scrollbar-track:hover {
  background-color: #5a7cb3;
}

*::-webkit-scrollbar-track:active {
  background-color: #6990cf;
}

*::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: #2563eb;
  border: 1px solid #f4f6f8;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #1a46a7;
}

*::-webkit-scrollbar-thumb:active {
  background-color: #14347c;
}

@keyframes slideRight {
  0% {
    transform: translateX(100%);
  }

  10% {
    transform: translateX(0);
  }

  80% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 700px) {
  .search-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-bar .search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-bar form.monthly {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
  }

  .search-bar form.monthly select {
    width: 100%;
  }

  .search-bar form.monthly button {
    grid-column: 1 / -1;
  }

  .search-form select[name="month"] {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 1000px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    height: 100%;
    z-index: 1000;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
    top: 7px;
    left: 250px;
    right: auto;
    font-size: 1rem;
  }

  .content {
    padding: 1rem;
    padding-top: 16%;
  }
}
