/* Kadrato — Premium Design System */

/* ── CSS Custom Properties ── */
:root {
  color-scheme: light dark;
  --color-page: #f8f6f1;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-border: #e6e2da;
  --color-border-hover: #d4cfc5;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #6b6560;
  --color-text-muted: #9c9690;
  --color-primary: #0d7c66;
  --color-primary-hover: #0a6654;
  --color-primary-light: #e8f5f0;
  --color-accent: #d4883a;
  --color-success: #1a8a5c;
  --color-warning: #c2860e;
  --color-error: #c43d3d;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  --shadow-elevated: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-dropdown: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-badge: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark {
  --color-page: #141414;
  --color-surface: #1e1e1e;
  --color-surface-elevated: #252525;
  --color-border: #2e2e2e;
  --color-border-hover: #3a3a3a;
  --color-text-primary: #ebebeb;
  --color-text-secondary: #8a8a8a;
  --color-text-muted: #5c5c5c;
  --color-primary-light: rgba(13,124,102,0.15);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
  --shadow-elevated: 0 4px 12px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.12);
  --shadow-dropdown: 0 8px 24px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.15);
}

/* ── Base transitions ── */
html body,
html aside,
html header,
html main {
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

/* ── Interactive element transitions ── */
button, a, input, select, textarea, .btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Focus-visible accessibility ring ── */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
}

/* ── Inputs ── */
input, select, textarea {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-primary);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.12);
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.25);
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: var(--radius-btn);
  padding: 0.5rem 1rem;
  cursor: pointer;
  gap: 0.5rem;
  border: none;
  position: relative;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn-secondary:hover {
  background-color: var(--color-surface-elevated);
  border-color: var(--color-border-hover);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

html.dark .btn-secondary {
  background-color: var(--color-surface-elevated);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

html.dark .btn-secondary:hover {
  border-color: var(--color-border-hover);
  background-color: #2c2c2c;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  border: none;
}

.btn-ghost:hover {
  background-color: rgba(0,0,0,0.04);
  color: var(--color-text-primary);
}

html.dark .btn-ghost:hover {
  background-color: rgba(255,255,255,0.06);
}

.btn-danger {
  background-color: var(--color-error);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b33535;
}

/* ── Shadow utilities ── */
.shadow-card {
  box-shadow: var(--shadow-card);
}

.shadow-elevated {
  box-shadow: var(--shadow-elevated);
}

.shadow-dropdown {
  box-shadow: var(--shadow-dropdown);
}

/* ── Cards ── */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

html.dark .card {
  border-color: var(--color-border);
}

.card-interactive {
  transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.card-interactive:hover {
  box-shadow: var(--shadow-elevated);
  transform: translateY(-1px);
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

/* Remove default padding - let Tailwind classes control spacing */
thead th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  white-space: nowrap;
}

tbody td {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  text-align: left;
}

/* Right-align last column (actions) but not colspan cells */
tbody td:last-child:not([colspan]) {
  text-align: right;
}

/* Ensure text-center class wins on empty states */
tbody td.text-center {
  text-align: center !important;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: rgba(0,0,0,0.015);
}

html.dark tbody tr:hover {
  background-color: rgba(255,255,255,0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ── Flash messages (toast) ── */
.flash-message {
  animation: flash-in 0.4s var(--ease-spring);
}

@keyframes flash-in {
  0% { opacity: 0; transform: translateY(-12px) scale(0.96); }
  60% { transform: translateY(2px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.flash-message.fade-out {
  animation: flash-out 0.3s var(--ease-out) forwards;
}

@keyframes flash-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ── Modal ── */
.modal-backdrop {
  animation: backdrop-in 0.25s var(--ease-out);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(0, 0, 0, 0.4);
}

html.dark .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-dialog {
  animation: dialog-in 0.3s var(--ease-spring);
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Toast notifications ── */
.toast-item {
  animation: toast-in 0.5s var(--ease-spring);
}

@keyframes toast-in {
  0% { opacity: 0; transform: translateX(40px) scale(0.94); }
  50% { transform: translateX(-4px) scale(1.01); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Dropdown animation ── */
.dropdown-menu {
  animation: dropdown-in 0.2s var(--ease-out);
}

@keyframes dropdown-in {
  from { opacity: 0; transform: scale(0.96) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Sidebar ── */
.sidebar-overlay {
  display: none;
}

@media (max-width: 767px) {
  .sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
  }
  .sidebar-drawer.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d4cfc5;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9c9690;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #3a3a3a;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #d4cfc5 transparent;
}

html.dark * {
  scrollbar-color: #3a3a3a transparent;
}

/* ── Selection color ── */
::selection {
  background-color: rgba(13, 124, 102, 0.18);
}

html.dark ::selection {
  background-color: rgba(13, 124, 102, 0.3);
}

/* ── Loading skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, transparent 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.8s ease-in-out infinite;
  border-radius: var(--radius-btn);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Transition utilities ── */
.transition-dropdown-enter {
  opacity: 0;
  transform: scale(0.96) translateY(-4px);
}

.transition-dropdown-active {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: all 0.2s var(--ease-out);
}

.transition-dropdown-leave {
  opacity: 0;
  transform: scale(0.96) translateY(-4px);
  transition: all 0.15s ease-in;
}

/* ── Progress Rings ── */
.progress-ring {
  transform: rotate(-90deg);
  transform-origin: center;
}

.progress-ring__track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 4;
}

.progress-ring__fill {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 163; /* 2π × 26 ≈ 163 */
  stroke-dashoffset: 163;
  transition: stroke-dashoffset 1s var(--ease-out);
}

.progress-ring__fill--warn {
  stroke: #c2860e;
}

.progress-ring__fill--danger {
  stroke: var(--color-error);
}

/* Full circle (100%) gets a subtle glow */
.progress-ring__fill[style*="dashoffset: 0"],
.progress-ring__fill[style*="dashoffset:0"] {
  filter: drop-shadow(0 0 4px var(--color-primary));
}

.progress-ring__label {
  font-size: 11px;
  font-weight: 600;
  fill: var(--color-text-primary);
  dominant-baseline: middle;
  text-anchor: middle;
}

.progress-ring__sublabel {
  font-size: 8.5px;
  fill: var(--color-text-muted);
  dominant-baseline: middle;
  text-anchor: middle;
}

/* ── Live pulse dot ── */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  position: relative;
  flex-shrink: 0;
}

.pulse-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background-color: #22c55e;
  opacity: 0.4;
  animation: pulse-ring 1.8s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.5; }
  70%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(0.6); opacity: 0; }
}

/* ── Sparkline ── */
.sparkline {
  overflow: visible;
}

.sparkline__line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.7;
}

.sparkline__area {
  fill: var(--color-primary);
  opacity: 0.08;
}

.sparkline__dot--last {
  fill: var(--color-primary);
}

/* ── Skeleton shimmer — data-loading state ── */
[data-loading="true"] .skeleton-item {
  background: linear-gradient(90deg,
    var(--color-border) 25%,
    var(--color-surface-elevated) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.8s ease-in-out infinite;
  border-radius: var(--radius-btn);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

[data-loading="true"] .skeleton-item * {
  visibility: hidden;
}

/* ── Nav group label ── */
.nav-group-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0.5rem 0.75rem;
  margin-top: 1rem;
}

/* ── Landing page — scroll fade-in ── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up.delay-1 { transition-delay: 0.08s; }
.fade-up.delay-2 { transition-delay: 0.16s; }
.fade-up.delay-3 { transition-delay: 0.24s; }
.fade-up.delay-4 { transition-delay: 0.32s; }

/* ── Landing page — floating screenshot ── */
@keyframes float-y {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50%       { transform: translateY(-12px) rotate(-1deg); }
}

.screenshot-float {
  animation: float-y 5s ease-in-out infinite;
  transform-origin: center bottom;
  will-change: transform;
}

/* ── Landing page — mock dashboard chrome ── */
.mock-chrome {
  background: var(--color-surface);
  border-radius: 14px 14px 12px 12px;
  border: 1px solid var(--color-border);
  box-shadow: 0 32px 80px rgba(0,0,0,0.15), 0 8px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
}

html.dark .mock-chrome {
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
}

.mock-titlebar {
  background: var(--color-page);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mock-urlbar {
  flex: 1;
  height: 22px;
  background: var(--color-surface);
  border-radius: 6px;
  border: 1px solid var(--color-border);
  max-width: 320px;
  margin: 0 auto;
}

/* ── Landing page — avatar stack ── */
.avatar-stack {
  display: flex;
  flex-direction: row-reverse;
}

.avatar-stack .av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-left: -10px;
  flex-shrink: 0;
}

.avatar-stack .av:last-child { margin-left: 0; }

.nav-group-label:first-child {
  margin-top: 0;
}

/* ── Command Palette ── */
.cp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(80px, 14vh, 160px);
  pointer-events: none;
  opacity: 0;
}

.cp-overlay--open {
  pointer-events: auto;
  opacity: 1;
}

.cp-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
}

html.dark .cp-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

.cp-overlay--open .cp-backdrop {
  opacity: 1;
}

.cp-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.03);
  overflow: hidden;
  transform: scale(0.95) translateY(-8px);
  opacity: 0;
  transition: transform 0.25s var(--ease-spring), opacity 0.2s var(--ease-out);
}

html.dark .cp-modal {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.04);
}

.cp-overlay--open .cp-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Search row */
.cp-search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.cp-search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.cp-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  line-height: 1.5;
}

.cp-input::placeholder {
  color: var(--color-text-muted);
}

.cp-input:focus {
  box-shadow: none;
  border-color: transparent;
}

.cp-esc-hint {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 7px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

/* Results list */
.cp-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.375rem 0;
}

.cp-group + .cp-group {
  border-top: 1px solid var(--color-border);
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.cp-group-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  padding: 0.5rem 1rem 0.25rem;
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 10px;
  margin: 0 0.375rem;
  transition: background-color 0.1s ease, color 0.1s ease;
  color: var(--color-text-primary);
}

.cp-item:hover,
.cp-item--active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

html.dark .cp-item:hover,
html.dark .cp-item--active {
  background-color: rgba(13, 124, 102, 0.15);
  color: #5ec4a8;
}

.cp-item--danger {
  color: var(--color-error);
}

.cp-item--danger:hover,
.cp-item--active.cp-item--danger {
  background-color: rgba(196, 61, 61, 0.08);
  color: var(--color-error);
}

html.dark .cp-item--danger {
  color: #e06060;
}

html.dark .cp-item--danger:hover,
html.dark .cp-item--active.cp-item--danger {
  background-color: rgba(196, 61, 61, 0.12);
  color: #e06060;
}

.cp-item-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.7;
}

.cp-item--active .cp-item-icon,
.cp-item:hover .cp-item-icon {
  opacity: 1;
}

.cp-item-label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 450;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 1px 6px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.cp-item--active .cp-kbd,
.cp-item:hover .cp-kbd {
  background-color: rgba(13, 124, 102, 0.08);
  border-color: rgba(13, 124, 102, 0.2);
  color: var(--color-primary);
}

html.dark .cp-item--active .cp-kbd,
html.dark .cp-item:hover .cp-kbd {
  background-color: rgba(13, 124, 102, 0.15);
  border-color: rgba(13, 124, 102, 0.3);
  color: #5ec4a8;
}

.cp-kbd--sm {
  font-size: 10px;
  padding: 1px 5px;
}

/* Empty state */
.cp-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Item text block (label + subtitle) */
.cp-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.cp-item-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cp-item:hover .cp-item-subtitle,
.cp-item--active .cp-item-subtitle {
  color: var(--color-primary);
  opacity: 0.75;
}

html.dark .cp-item:hover .cp-item-subtitle,
html.dark .cp-item--active .cp-item-subtitle {
  color: #5ec4a8;
  opacity: 0.7;
}

/* Recent search hint badge */
.cp-item-recent-hint {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--color-text-muted);
  background-color: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 1.7;
}

.cp-item--active .cp-item-recent-hint,
.cp-item:hover .cp-item-recent-hint {
  background-color: rgba(13, 124, 102, 0.08);
  border-color: rgba(13, 124, 102, 0.2);
  color: var(--color-primary);
}

html.dark .cp-item--active .cp-item-recent-hint,
html.dark .cp-item:hover .cp-item-recent-hint {
  background-color: rgba(13, 124, 102, 0.15);
  border-color: rgba(13, 124, 102, 0.3);
  color: #5ec4a8;
}

/* Loading indicator */
.cp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.cp-loading svg {
  width: 18px;
  height: 18px;
  animation: cp-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes cp-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Footer hints */
.cp-footer {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-page);
}

html.dark .cp-footer {
  background-color: rgba(255,255,255,0.02);
}

.cp-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 11.5px;
  color: var(--color-text-muted);
}

/* Trigger button in topbar */
.cp-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cp-trigger:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-secondary);
  background-color: var(--color-surface-elevated);
}

html.dark .cp-trigger {
  background-color: var(--color-surface-elevated);
  border-color: var(--color-border);
}

html.dark .cp-trigger:hover {
  border-color: var(--color-border-hover);
  background-color: #2c2c2c;
}

.cp-trigger-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.cp-trigger-shortcut {
  font-family: inherit;
  font-size: 11px;
  background-color: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

html.dark .cp-trigger-shortcut {
  background-color: rgba(255,255,255,0.04);
}

/* ── Empty State Component ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  gap: 1.25rem;
}

/* Table cell variant — less vertical padding */
td > .empty-state,
.empty-state--compact {
  padding: 2.5rem 1.5rem;
}

.empty-state__illustration {
  width: 72px;
  height: 72px;
  color: var(--color-primary);
  flex-shrink: 0;
  opacity: 0.9;
}

.empty-state__illustration svg {
  width: 100%;
  height: 100%;
}

.empty-state__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  width: 100%;
  padding: 0 0.5rem;
}

.empty-state__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.35;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.empty-state__description {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.empty-state__action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1.125rem;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-btn);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.empty-state__action:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 2px 6px rgba(13,124,102,0.25);
}

.empty-state__action:active {
  transform: scale(0.97);
}


/* ═══════════════════════════════════════════════
   MICROINTERACTIONS & VISUAL POLISH
   ═══════════════════════════════════════════════ */

/* ── Card hover glow ──────────────────────────
 *
 * .card-glow         — base class (teal glow by default)
 * .card-glow-amber   — amber accent glow
 * .card-glow-emerald — emerald accent glow
 * .card-glow-blue    — blue accent glow
 *
 * Usage: add alongside .card on any card element.
 */
.card-glow {
  transition:
    box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}

.card-glow:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 124, 102, 0.35);
  box-shadow:
    0 0 0 1px rgba(13, 124, 102, 0.12),
    0 4px 16px rgba(13, 124, 102, 0.1),
    var(--shadow-elevated);
}

html.dark .card-glow:hover {
  border-color: rgba(13, 124, 102, 0.4);
  box-shadow:
    0 0 0 1px rgba(13, 124, 102, 0.2),
    0 4px 16px rgba(13, 124, 102, 0.15),
    var(--shadow-elevated);
}

.card-glow-amber:hover {
  border-color: rgba(212, 136, 58, 0.35);
  box-shadow:
    0 0 0 1px rgba(212, 136, 58, 0.12),
    0 4px 16px rgba(212, 136, 58, 0.1),
    var(--shadow-elevated);
}

html.dark .card-glow-amber:hover {
  border-color: rgba(212, 136, 58, 0.4);
  box-shadow:
    0 0 0 1px rgba(212, 136, 58, 0.2),
    0 4px 16px rgba(212, 136, 58, 0.15),
    var(--shadow-elevated);
}

.card-glow-emerald:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.12),
    0 4px 16px rgba(16, 185, 129, 0.1),
    var(--shadow-elevated);
}

html.dark .card-glow-emerald:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.2),
    0 4px 16px rgba(16, 185, 129, 0.15),
    var(--shadow-elevated);
}

.card-glow-blue:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.12),
    0 4px 16px rgba(59, 130, 246, 0.1),
    var(--shadow-elevated);
}

html.dark .card-glow-blue:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.2),
    0 4px 16px rgba(59, 130, 246, 0.15),
    var(--shadow-elevated);
}

/* existing .card-interactive also gains tinted border on hover */
.card-interactive {
  transition:
    box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}

.card-interactive:hover {
  border-color: rgba(13, 124, 102, 0.25);
}

html.dark .card-interactive:hover {
  border-color: rgba(13, 124, 102, 0.3);
}

/* ── Button ripple effect ────────────────────
 *
 * A .btn-ripple <span> is injected by JS on mousedown.
 * The .btn base class gets overflow:hidden to clip it.
 */
.btn {
  overflow: hidden;
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  pointer-events: none;
  animation: ripple-expand 0.55s var(--ease-out) forwards;
  background-color: rgba(255, 255, 255, 0.28);
}

.btn-secondary .btn-ripple,
.btn-ghost .btn-ripple {
  background-color: rgba(13, 124, 102, 0.1);
}

html.dark .btn-secondary .btn-ripple,
html.dark .btn-ghost .btn-ripple {
  background-color: rgba(13, 124, 102, 0.18);
}

@keyframes ripple-expand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ── Button icon micro-animation ─────────────
 *
 * Wrap any SVG inside a button with .btn-icon.
 */
.btn .btn-icon {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s var(--ease-spring);
  will-change: transform;
}

.btn:hover .btn-icon {
  transform: scale(1.18);
}

/* Variant: icon slides right on hover (for arrow / chevron icons) */
.btn-icon-slide:hover .btn-icon {
  transform: translateX(3px);
}

/* ── Button loading state ────────────────────
 *
 * Add .btn-loading to show inline spinner and block interaction.
 * Wrap original label text in .btn-label to hide it cleanly.
 */
.btn-loading {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.72;
}

.btn-loading .btn-label {
  visibility: hidden;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1em;
  height: 1em;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner-rotate 0.65s linear infinite;
}

/* ── Standalone spinner component ───────────
 *
 * <div class="spinner"></div>
 * Sizes: .spinner-sm  .spinner-lg
 * Colors: default (primary), .spinner-white, .spinner-muted
 */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid transparent;
  border-top-color: var(--color-primary);
  border-right-color: var(--color-primary);
  border-radius: 50%;
  animation: spinner-rotate 0.65s linear infinite;
  flex-shrink: 0;
}

.spinner-sm {
  width: 0.875rem;
  height: 0.875rem;
  border-width: 1.5px;
}

.spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

.spinner-white {
  border-top-color: #ffffff;
  border-right-color: #ffffff;
}

.spinner-muted {
  border-top-color: var(--color-text-muted);
  border-right-color: var(--color-text-muted);
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* Full-area loading overlay — place inside a .relative container */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.65);
  border-radius: inherit;
  z-index: 10;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

html.dark .loading-overlay {
  background-color: rgba(30, 30, 30, 0.65);
}

/* ── Table row hover accent ───────────
 *
 * Subtle left border accent on hover using box-shadow (avoids position issues).
 */
tbody tr:hover {
  background-color: rgba(13, 124, 102, 0.025);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

html.dark tbody tr:hover {
  background-color: rgba(13, 124, 102, 0.055);
}

/* Clickable rows */
tbody tr[data-href],
tbody tr.row-clickable {
  cursor: pointer;
}

tbody tr[data-href]:hover,
tbody tr.row-clickable:hover {
  background-color: rgba(13, 124, 102, 0.04);
}

html.dark tbody tr[data-href]:hover,
html.dark tbody tr.row-clickable:hover {
  background-color: rgba(13, 124, 102, 0.08);
}

/* ── Input smooth transitions ────────────────
 *
 * Extends the base input rules; ensures colour/shadow changes
 * never flash.
 */
input,
select,
textarea {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

/* ── Form input success / error states ──────*/
input.input-success,
select.input-success,
textarea.input-success {
  border-color: var(--color-success) !important;
  box-shadow: 0 0 0 3px rgba(26, 138, 92, 0.1) !important;
}

html.dark input.input-success,
html.dark select.input-success,
html.dark textarea.input-success {
  box-shadow: 0 0 0 3px rgba(26, 138, 92, 0.2) !important;
}

input.input-error,
select.input-error,
textarea.input-error {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px rgba(196, 61, 61, 0.1) !important;
}

html.dark input.input-error,
html.dark select.input-error,
html.dark textarea.input-error {
  box-shadow: 0 0 0 3px rgba(196, 61, 61, 0.2) !important;
}

/* Field-level hint / validation message */
.field-hint {
  font-size: 0.75rem;
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s ease;
}

.field-hint-success { color: var(--color-success); }
.field-hint-error   { color: var(--color-error); }
.field-hint-muted   { color: var(--color-text-muted); }

/* ── Animated focus ring (bloom effect) ─────
 *
 * Overrides the base :focus rules so the ring visibly
 * expands outward instead of appearing instantaneously.
 */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.12);
  animation: focus-ring-bloom 0.2s var(--ease-out) forwards;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.25);
  animation: focus-ring-bloom-dark 0.2s var(--ease-out) forwards;
}

@keyframes focus-ring-bloom {
  from {
    box-shadow: 0 0 0 0 rgba(13, 124, 102, 0.25);
    border-color: var(--color-border);
  }
  to {
    box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.12);
    border-color: var(--color-primary);
  }
}

@keyframes focus-ring-bloom-dark {
  from {
    box-shadow: 0 0 0 0 rgba(13, 124, 102, 0.35);
    border-color: var(--color-border);
  }
  to {
    box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.25);
    border-color: var(--color-primary);
  }
}

/* Checkboxes / radios skip the bloom animation */
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  animation: none;
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.18);
  outline: none;
}

html.dark input[type="checkbox"]:focus,
html.dark input[type="radio"]:focus {
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.3);
}

/* ── Page fade-in transition ─────────────────
 *
 * JS applies .page-fade-in to <main> on DOMContentLoaded.
 */
.page-fade-in {
  animation: page-fade 0.28s var(--ease-out) both;
}

@keyframes page-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── KPI number entrance animation ──────────
 *
 * JS adds .animate-count-in to large stat numbers after
 * data has loaded.
 */
.animate-count-in {
  animation: count-pop 0.4s var(--ease-spring) both;
}

@keyframes count-pop {
  0%   { opacity: 0; transform: scale(0.88) translateY(4px); }
  60%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── CSS-only tooltip ────────────────────────
 *
 * <span class="tooltip" data-tip="Hint text">…</span>
 * Variant: .tooltip-bottom
 */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background-color: var(--color-text-primary);
  color: var(--color-surface);
  font-size: 0.6875rem;
  line-height: 1.4;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s var(--ease-out);
  z-index: 50;
  font-weight: 500;
}

html.dark .tooltip::after {
  background-color: var(--color-surface-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-dropdown);
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip-bottom::after {
  bottom: auto;
  top: calc(100% + 7px);
  transform: translateX(-50%) translateY(-3px);
}

.tooltip-bottom:hover::after {
  transform: translateX(-50%) translateY(0);
}

/* ── Stagger list animation ──────────────────
 *
 * JS sets --i CSS custom property on each .stagger-item
 * child so each row animates in with a cascading delay.
 */
.stagger-item {
  opacity: 0;
  transform: translateY(10px);
  animation: stagger-in 0.3s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes stagger-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Icon container pop ──────────────────────
 *
 * Apply .icon-pop to coloured icon wrapper divs.
 * Parent must have class="group" for group-hover to work.
 */
.icon-pop {
  transition: transform 0.2s var(--ease-spring), background-color 0.2s ease;
}

.group:hover .icon-pop {
  transform: scale(1.1);
}

/* ── Badge ring-pulse ────────────────────────
 *
 * Add .badge-pulse to any badge to indicate "new" content.
 */
.badge-pulse {
  position: relative;
}

.badge-pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid var(--color-primary);
  opacity: 0;
  animation: badge-ring-pulse 2.2s ease-out infinite;
}

@keyframes badge-ring-pulse {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.9); }
}

/* ── Divider with centred label ──────────────*/
.divider-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

/* ── SVG icon smooth transitions ─────────────*/
svg {
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* ══════════════════════════════════════════════════════════
   COLLAPSIBLE SIDEBAR
   ══════════════════════════════════════════════════════════ */

/* Default (expanded) sidebar width */
.sidebar-drawer {
  width: 260px;
  transition: width 0.28s var(--ease-out);
}

/* Collapsed state — icon-only at 56px */
.sidebar-drawer.sidebar-collapsed {
  width: 56px;
}

/* Hide text labels & shortcut hints when collapsed */
.sidebar-drawer.sidebar-collapsed .sidebar-label,
.sidebar-drawer.sidebar-collapsed .nav-shortcut-hint {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: nowrap;
}

/* Hide group labels completely (no dead vertical space) when collapsed */
.sidebar-drawer.sidebar-collapsed .nav-group-label {
  height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

.sidebar-drawer:not(.sidebar-collapsed) .sidebar-label {
  opacity: 1;
  width: auto;
}

/* Swap collapse icon arrows */
.sidebar-drawer.sidebar-collapsed #collapse-icon-expand {
  display: none;
}

.sidebar-drawer.sidebar-collapsed #collapse-icon-collapse {
  display: block;
}

/* Center nav items when collapsed */
.sidebar-drawer.sidebar-collapsed .sidebar-nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* Tooltip for collapsed sidebar nav items */
.sidebar-drawer.sidebar-collapsed .sidebar-nav-item {
  position: relative;
}

.sidebar-drawer.sidebar-collapsed .sidebar-nav-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--color-surface-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-dropdown);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.375rem 0.625rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: opacity 0.15s ease;
}

.sidebar-drawer.sidebar-collapsed .sidebar-nav-item[data-tooltip]:hover::after {
  opacity: 1;
}

/* Keyboard shortcut hints — visible on nav item hover (desktop) */
.nav-shortcut-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, monospace;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 5px;
  background-color: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
  overflow: visible;
  width: auto;
}

.sidebar-nav-item:hover .nav-shortcut-hint {
  opacity: 1;
}

/* Hide shortcut hints on mobile always */
@media (max-width: 767px) {
  .nav-shortcut-hint {
    display: none !important;
  }
  /* On mobile sidebar is slide-in drawer, not collapsible */
  .sidebar-drawer {
    width: 260px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR (mobile only)
   ══════════════════════════════════════════════════════════ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: stretch;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: transform 0.3s var(--ease-out),
              background-color 0.2s var(--ease-out),
              border-color 0.2s var(--ease-out);
}

html.dark .bottom-nav {
  background-color: rgba(20, 20, 20, 0.94);
}

.bottom-nav.bottom-nav-hidden {
  transform: translateY(100%);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 12px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.15s ease, background-color 0.15s ease;
  min-width: 0;
}

.bottom-nav-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bottom-nav-item:active {
  background-color: rgba(0, 0, 0, 0.04);
  transform: scale(0.94);
  transition: transform 0.08s ease;
}

html.dark .bottom-nav-item:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.bottom-nav-item.bottom-nav-active {
  color: var(--color-primary);
}

html.dark .bottom-nav-item.bottom-nav-active {
  color: #5ec4a8;
}

/* ══════════════════════════════════════════════════════════
   "WIĘCEJ" BOTTOM SHEET
   ══════════════════════════════════════════════════════════ */

.more-sheet-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 70;
}

html.dark .more-sheet-backdrop {
  background-color: rgba(0, 0, 0, 0.55);
}

.more-sheet-backdrop.hidden {
  display: none;
}

.more-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.32s var(--ease-out);
  padding-bottom: env(safe-area-inset-bottom, 8px);
  max-height: 85vh;
  overflow-y: auto;
}

html.dark .more-sheet {
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
}

.more-sheet.more-sheet-open {
  transform: translateY(0);
}

.more-sheet-handle {
  width: 36px;
  height: 4px;
  background-color: var(--color-border);
  border-radius: 999px;
  margin: 12px auto 0;
}

.more-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--color-border);
}

.more-sheet-body {
  padding: 8px 12px 12px;
}

.more-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.more-sheet-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

html.dark .more-sheet-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.more-sheet-item:active {
  background-color: rgba(0, 0, 0, 0.05);
}

html.dark .more-sheet-item:active {
  background-color: rgba(255, 255, 255, 0.06);
}

.more-sheet-item-active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

html.dark .more-sheet-item-active {
  color: #5ec4a8;
}

.more-sheet-item-active:hover {
  background-color: var(--color-primary-light);
}

.more-sheet-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background-color: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

html.dark .more-sheet-item-icon {
  background-color: var(--color-surface-elevated);
}

.more-sheet-item-active .more-sheet-item-icon {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

html.dark .more-sheet-item-active .more-sheet-item-icon {
  color: #5ec4a8;
}

.more-sheet-item-label {
  flex: 1;
}

.more-sheet-item-danger {
  color: var(--color-error);
}

.more-sheet-item-icon-danger {
  background-color: rgba(196, 61, 61, 0.08);
  color: var(--color-error);
}

html.dark .more-sheet-item-icon-danger {
  background-color: rgba(196, 61, 61, 0.12);
}

.more-sheet-separator {
  height: 1px;
  background-color: var(--color-border);
  margin: 6px 0;
}
