:root {
  color-scheme: light dark;

  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --accent: #38bdf8;

  --bg-screen-light: #ffffff;
  --bg-surface-light: #f1f5f9;
  --bg-subtle-light: #f1f2f3;
  --bg-hover-light: var(--accent);
  --border-light: #e2e8f0;
  --text-hi-light: #0f172a;
  --text-lo-light: #64748b;

  --bg-screen-dark: #101219;
  --bg-surface-dark: #101219;
  --bg-subtle-dark: #212429;
  --bg-hover-dark: var(--accent);
  --border-dark: #2f323f;
  --text-hi-dark: #f8fafc;
  --text-lo-dark: #94a3b8;

  --bg-screen: light-dark(var(--bg-screen-light), var(--bg-screen-dark));
  --bg-surface: light-dark(var(--bg-surface-light), var(--bg-surface-dark));
  --bg-subtle: light-dark(var(--bg-subtle-light), var(--bg-subtle-dark));
  --bg-hover: light-dark(var(--bg-hover-light), var(--bg-hover-dark));
  --border: light-dark(var(--border-light), var(--border-dark));
  --text-hi: light-dark(var(--text-hi-light), var(--text-hi-dark));
  --text-lo: light-dark(var(--text-lo-light), var(--text-lo-dark));
}

:root.light {
  color-scheme: light;
}

:root.dark {
  color-scheme: dark;
}

body {
  font-family: system-ui, sans-serif;
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  color: var(--text-hi);
  background-color: var(--bg-screen);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

main {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-lg);
  box-sizing: border-box;
  padding: var(--spacing-lg);
  width: 100%;
  height: 100%;
  overflow: hidden;
  flex-grow: 1;
}

nav {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  width: 100%;

  flex-shrink: 0;
  flex-grow: 0;

  position: sticky;
  top: 0;
  z-index: 100;

  background: color-mix(in srgb, var(--bg-color) 80%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.nav-left {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.nav-title {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.nav-version {
  font-size: 0.75rem;
  color: light-dark(#64748b, #94a3b8); /* Muted Text */
  font-family: monospace;
  background: light-dark(#f1f5f9, #1e293b);
  padding: 2px 6px;
  border-radius: 4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-color);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.nav-link:hover {
  opacity: 1;
}

.nav-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-color);
}

.nav-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.nav-icon-btn:hover {
  background: light-dark(#f1f5f9, #1e293b);
}

.icon-sun { display: none; }
.icon-moon { display: block; }
:root.dark .icon-sun { display: block; }
:root.dark .icon-moon { display: none; }

input[type='text'],
input[type='number'],
input[type='search'],
input[type='date'],
input:not([type]),
select {
  background-color: var(--bg-subtle);
  line-height: 1;
  border: none;
  border-radius: var(--radius-sm);
  font-size: large;
  padding: var(--spacing-sm);
}

select option {
  padding: 0 var(--spacing-sm);
}

select option:hover {
  background-color: var(--bg-hover);
}

.sidebar {
  padding: 0;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: var(--spacing-md);
  overflow-y: auto;
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6 {
  margin: 5px;
}

.card h1 {
  font-weight: bold;
  font-size: x-large;
}

.card h2 {
  font-size: large;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

/* Need this to limit virtual scroll */
.table-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.toolbar {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.toolbar-buttons {
  display: flex;
  flex-direction: row;
}

.button {
  box-sizing: border-box;
  height: 100%;
  cursor: pointer;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: large;
  font-weight: 500;
  color: var(--text-hi);
  /* Helps center the icons */
  display: flex;
  align-items: center;
}

.button:not([disabled]):hover,
details[open] .button {
  background: var(--bg-hover);
}

.button:disabled,
.button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
  pointer-events: none; 
}

.button-group {
  display: inline-flex;
  flex-direction: row;
  gap: 0;
}

.button-group>.button:not(:last-child),
.button-group> :not(:last-child)>.button {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.button-group>.button:not(:first-child),
.button-group> :not(:first-child)>.button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.button-group>.button:not(:first-child),
.button-group> :not(:first-child) {
  margin-left: -1px;
}

.button-group .button:hover,
.button-group details[open] .button {
  position: relative;
  z-index: 1;
  border-color: var(--border);
}

.dropdown {
  position: relative;
}

.dropdown summary {
  box-sizing: border-box;
  /* Hides the dropdown arrow*/
  list-style: none;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  padding: var(--spacing-md);
  z-index: 50;

  display: flex;
  flex-direction: column;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  color: var(--text-hi);
  padding: var(--spacing-sm);
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: var(--bg-hover);
  border-radius: var(--radius-sm);
}