:root {
  --app-bg: #efe7da;
  --app-surface: #fffdf9;
  --app-ink: #24303a;
  --app-muted: #6f7b85;
  --app-accent: #305f72;
  --app-accent-strong: #21424f;
  --app-border: #d9d2c5;
}

body {
  background: linear-gradient(180deg, #f7f2e8 0%, var(--app-bg) 100%);
  color: var(--app-ink);
}

.sidebar {
  width: 280px;
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(10px);
}

.sidebar-account {
  background: rgba(255, 253, 249, 0.65);
  flex-shrink: 0;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
}

.sidebar-account-name {
  max-width: 100%;
}

.sidebar-account-icon {
  display: inline-block;
  height: 1.15rem;
  vertical-align: -0.2em;
  width: 1.15rem;
}

.brand {
  color: var(--app-ink);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-label {
  color: var(--app-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.menu-link {
  display: block;
  padding: 0.8rem 1rem;
  margin-bottom: 0.35rem;
  border-radius: 0.85rem;
  color: var(--app-ink);
  text-decoration: none;
}

.menu-link:hover,
.menu-link.active {
  background: var(--app-accent);
  color: #fff;
}

.menu-foldout {
  border-radius: 0.85rem;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.35rem;
}

.menu-foldout summary {
  list-style: none;
  cursor: pointer;
}

.menu-foldout summary::-webkit-details-marker {
  display: none;
}

.menu-submenu {
  margin-top: 0.35rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(36, 48, 58, 0.08);
}

.menu-link.menu-sublink {
  padding-left: 1.5rem;
  font-size: 0.95rem;
}

.action-bar {
  background: rgba(255, 253, 249, 0.7);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.action-bar-filter .form-control,
.action-bar-filter .form-select,
.action-bar-filter .btn {
  min-height: 2.5rem;
}

.action-bar .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 2.5rem;
}

.action-bar .btn-icon {
  height: 2.5rem;
  width: 2.5rem;
}

.login-card {
  max-width: 28rem;
  width: 100%;
}

.card,
.table {
  background: var(--app-surface);
}

.table thead th {
  color: var(--app-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-outline-secondary {
  border-color: var(--app-border);
}

.btn-icon {
  align-items: center;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  padding: 0;
  width: 2rem;
}

.btn-icon-svg {
  height: 1rem;
  width: 1rem;
}

.action-bar-submit {
  height: 2.5rem;
  width: 2.5rem;
}

.record-link {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.record-link:hover {
  color: var(--app-accent-strong);
  text-decoration: underline;
}

.record-row {
  cursor: pointer;
}

.record-row:focus-visible {
  outline: 2px solid var(--app-accent-strong);
  outline-offset: -2px;
}

.document-dropzone {
  border: 2px dashed var(--app-border);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.95), rgba(245, 239, 228, 0.95));
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.document-dropzone:hover,
.document-dropzone.is-dragover {
  border-color: var(--app-accent);
  background: linear-gradient(180deg, rgba(233, 243, 247, 0.95), rgba(242, 248, 250, 0.95));
  transform: translateY(-1px);
}

.record-picker {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 253, 249, 0.75);
}

.record-picker__option {
  cursor: pointer;
  background: rgba(255, 253, 249, 0.8);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.record-picker__option:hover {
  border-color: var(--app-accent);
  transform: translateY(-1px);
}

.record-picker__option.is-selected {
  border-color: var(--app-accent);
  background: rgba(233, 243, 247, 0.8);
}

.record-picker__options {
  max-height: 18rem;
  overflow-y: auto;
}

.required-indicator {
  font-weight: 600;
  cursor: help;
}

.status-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  display: inline-block;
  background: var(--app-border);
}

.status-dot[data-status="active"] {
  background: #198754;
}

.status-dot[data-status="draft"] {
  background: #ffc107;
}

.status-dot[data-status="closed"] {
  background: #6c757d;
}

.status-dot[data-status="all"],
.status-dot[data-status=""] {
  background: #b5b5b5;
}

@media (min-width: 992px) {
  .sidebar {
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
  }

  .sidebar nav {
    min-height: 0;
    overflow-y: auto;
  }

  .child-list-table {
    overflow: visible;
  }

  .imenik-table {
    overflow: visible;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    width: 100%;
  }
}
