/* Dashboard App Styles
   High-contrast, accessible design with resizable sidebar
   Copyright (c) 2026 Evident Technologies LLC
*/

/* ── App Shell ─────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - var(--header-height, 72px));
  background: #f5f5f4;
}

.app-shell--resizing {
  cursor: col-resize;
  user-select: none;
}

.app-shell--resizing * {
  cursor: col-resize !important;
}

/* ── Sidebar (Case Bar) ───────────────────────────────────────── */
.app-sidebar {
  background: #fff;
  border-inline-end: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 240px;
  max-width: 480px;
  position: relative;
}

.app-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-block-end: 1px solid #e5e7eb;
  background: #f9fafb;
}

.app-sidebar__title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.app-sidebar__add {
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #4b5563;
  font-size: 1.25rem;
  font-weight: 300;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.app-sidebar__add:hover {
  background: #f3f4f6;
  border-color: #3b82f6;
  color: #2563eb;
}

.sidebar-form {
  padding: 1rem 1.25rem;
  border-block-end: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f9fafb;
}

.sidebar-form .auth-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #fff;
  color: #1f2937;
}

.sidebar-form .auth-input::placeholder {
  color: #9ca3af;
}

.sidebar-form .auth-btn--sm {
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
}

.case-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
  background: #fff;
}

.case-list__item {
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  margin-block-end: 0.375rem;
  transition:
    background 150ms ease,
    border-color 150ms ease;
  border: 1px solid transparent;
}

.case-list__item:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.case-list__item[aria-current="true"] {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.case-list__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.case-list__meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin-block-start: 0.25rem;
}

.case-list__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

/* ── Resize Handle ────────────────────────────────────────────── */
.app-sidebar__resize {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.15s ease;
}

.app-sidebar__resize:hover,
.app-sidebar__resize--active {
  background: rgb(59 130 246 / 20%);
}

/* ── Main Panel ────────────────────────────────────────────────── */
.app-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f5f5f4;
}

.app-empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 2rem;
  max-width: 800px;
  margin-inline: auto;
}

.app-empty__icon {
  color: #2563eb;
  margin-block-end: 1.5rem;
}

.app-empty__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.75rem;
}

.app-empty__desc {
  font-size: 1rem;
  color: #4b5563;
  margin: 0 0 2rem;
  max-width: 60ch;
}

.app-empty__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  text-align: left;
  max-width: 500px;
  margin-inline: auto;
}

.app-empty__step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-block-end: 1rem;
}

.app-empty__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.app-empty__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ── Tier Gating Banner ───────────────────────────────────────── */
.app-tier-gate {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
  padding: 1.5rem 2rem;
  border-block-end: 3px solid #f59e0b;
  display: none;
}

.app-tier-gate--visible {
  display: block;
}

.app-tier-gate__inner {
  max-width: 900px;
  margin-inline: auto;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.app-tier-gate__icon {
  color: #fbbf24;
  flex-shrink: 0;
}

.app-tier-gate__content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
}

.app-tier-gate__content p {
  font-size: 0.9375rem;
  color: #e2e8f0;
  margin: 0 0 1rem;
}

.app-tier-gate__btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: #f59e0b;
  color: #1e293b;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (width <= 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .app-sidebar--mobile-visible {
    display: flex;
    position: fixed;
    inset: var(--header-height, 72px) 0 0 0;
    z-index: 100;
    max-width: 100%;
  }

  .app-sidebar__resize {
    display: none;
  }
}

/* ── Accessibility ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .app-sidebar__add,
  .case-list__item {
    transition: none;
  }
}

@media (prefers-contrast: high) {
  .app-sidebar {
    border-inline-end-width: 2px;
  }

  .case-list__item {
    border-width: 1px;
  }

  .app-sidebar__add {
    border-width: 2px;
  }
}
