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

:root {
  --font-ui: "Inter", sans-serif;
  --bg-page: #f4f1ea;
  --bg-panel: rgba(255, 255, 255, 0.86);
  --bg-panel-strong: #ffffff;
  --bg-ink: #132238;
  --bg-sidebar: #142235;
  --bg-sidebar-soft: #1d314b;
  --accent: #c96d42;
  --accent-strong: #ae5630;
  --accent-soft: rgba(201, 109, 66, 0.14);
  --border-soft: rgba(19, 34, 56, 0.12);
  --text-main: #19283b;
  --text-muted: #627188;
  --success-bg: #e8f6ee;
  --success-text: #1f6d46;
  --danger-bg: #fde9e7;
  --danger-text: #8f322f;
  --shadow-soft: 0 18px 45px rgba(20, 34, 53, 0.12);
  --shadow-strong: 0 30px 80px rgba(20, 34, 53, 0.16);
  --radius-lg: 28px;
  --radius-md: 18px;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--text-main);
  background: var(--bg-page);
}

body.modal-open {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
}

body.sidebar-drawer-open {
  overflow: hidden;
}

body.sidebar-drawer-open .mobile-sidebar {
  transform: translateX(0);
}

body.sidebar-drawer-open .mobile-sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.mobile-sidebar-overlay[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

#modal-success-message {
  color: #28a745;
  font-size: 14px;
}

.ui-scrollbar-md {
  scrollbar-width: thin;
  scrollbar-color: rgba(109, 90, 67, 0.35) transparent;
}

.ui-scrollbar-md::-webkit-scrollbar {
  width: 10px;
}

.ui-scrollbar-md::-webkit-scrollbar-track {
  background: transparent;
}

.ui-scrollbar-md::-webkit-scrollbar-thumb {
  background: rgba(109, 90, 67, 0.24);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.ui-scrollbar-md::-webkit-scrollbar-thumb:hover {
  background: rgba(109, 90, 67, 0.38);
  background-clip: padding-box;
}

.ui-scrollbar-sm {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.ui-scrollbar-sm::-webkit-scrollbar {
  width: 6px;
}

.ui-scrollbar-sm::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.ui-scrollbar-sm::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.ui-scrollbar-sm::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.ui-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.ui-sort-button.is-active {
  color: #1f5fbf;
}

.ui-filter-toggle:hover,
.ui-filter-toggle[aria-expanded="true"] {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.ui-filter-toggle {
  position: relative;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.ui-filter-toggle.is-filtered {
  background: #dfeaff;
  color: #1f5fbf;
}

.ui-filter-toggle.is-filtered::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #c96d42;
}

.ui-filter-option.is-active {
  border-color: #b7cbf3;
  background: #e7f0ff;
  color: #1f5fbf;
  font-weight: 600;
}

.archive-tool-button:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

.loader-container {
  position: fixed;
  height: 100vh;
  width: 100vw;
  font-family: var(--font-ui);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  background: rgba(20, 34, 53, 0.42);
  backdrop-filter: blur(8px);
}

.loader {
  height: var(--loader-dot-size);
  width: var(--loader-width);
  position: relative;
}

.loader--dot {
  animation: loader 3s ease-in-out infinite;
  height: var(--loader-dot-size);
  width: var(--loader-dot-size);
  border-radius: 100%;
  background-color: black;
  position: absolute;
  border: 2px solid white;
}

.loader--dot:nth-child(1) {
  background-color: #8cc759;
  animation-delay: 0.5s;
}

.loader--dot:nth-child(2) {
  background-color: #8c6daf;
  animation-delay: 0.4s;
}

.loader--dot:nth-child(3) {
  background-color: #ef5d74;
  animation-delay: 0.3s;
}

.loader--dot:nth-child(4) {
  background-color: #f9a74b;
  animation-delay: 0.2s;
}

.loader--dot:nth-child(5) {
  background-color: #60beeb;
  animation-delay: 0.1s;
}

.loader--dot:nth-child(6) {
  background-color: #fbef5a;
  animation-delay: 0s;
}

.loader--text {
  position: absolute;
  top: 200%;
  left: 0;
  right: 0;
  width: 4rem;
  margin: auto;
  font-weight: bold;
  animation: loading-text 3s infinite;
  color: white;
}

@keyframes loader {
  15% {
    transform: translateX(0);
  }

  45% {
    transform: translateX(calc(var(--loader-width) - var(--loader-dot-size)));
  }

  65% {
    transform: translateX(calc(var(--loader-width) - var(--loader-dot-size)));
  }

  95% {
    transform: translateX(0);
  }
}

@keyframes loading-text {
  0% {
    content: "Loading";
  }

  25% {
    content: "Loading.";
  }

  50% {
    content: "Loading..";
  }

  75% {
    content: "Loading...";
  }
}
