.sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-dark);
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.sidebar-brand-sub {
  font-size: 12px;
  color: var(--text-on-dark-muted);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-on-dark);
}

.nav-item.active {
  background: var(--primary);
  color: var(--text-on-dark);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-dark);
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6.5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: var(--font-ui);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-on-dark);
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: var(--text-on-dark);
  font-weight: 600;
}

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-body);
}

.btn-danger-outline {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-sm {
  padding: 4.5px 9px;
  font-size: 11.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.badge-blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-green {
  background: var(--success-soft);
  color: var(--success);
}

.badge-amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}

.input, .select {
  width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--bg-surface);
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.data-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  line-height: 1.5;
}

.data-table tr:hover td {
  background: var(--primary-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 16px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.modal-body {
  padding: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--bg-body);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-item {
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  border-left: 4px solid var(--primary);
}

.toast-item.success { border-left-color: var(--success); }
.toast-item.error { border-left-color: var(--danger); }

@media (max-width: 640px) and (orientation: portrait) {
  .data-table thead {
    display: none;
  }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 8px;
  }
}

@media (max-width: 768px) {
  .modal-backdrop {
    align-items: center;
    padding: 8px;
  }
  .modal-box {
    border-radius: var(--radius-md);
    max-width: 100%;
    max-height: calc(100vh - 16px);
  }
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast-item {
    min-width: 0;
    width: 100%;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .modal-backdrop {
    padding: 6px;
  }
  .modal-box {
    max-height: calc(100vh - 12px);
  }
  .modal-header {
    padding: 8px 14px;
    font-size: 13px;
  }
  .modal-body {
    padding: 10px 14px;
    font-size: 12.5px;
  }
  .modal-footer {
    padding: 8px 14px;
  }
  .toast-container {
    left: auto;
    right: 10px;
    bottom: 42px;
    max-width: min(390px, 58vw);
    gap: 5px;
  }
  .toast-item {
    padding: 7px 11px;
    font-size: 11.5px;
    min-width: 0;
    width: auto;
  }
}
