/* ==========================================================================
   CASE DIRECTORY & DETAIL VIEW STYLES (OVERFLOW-SAFE, PRODUCTION READY)
   ========================================================================== */

/* 1. Case Directory Top Search & Filter Bar */
.case-search-bar {
  margin-bottom: 0.65rem;
}

.case-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.case-item-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 0.8rem;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
}

.case-item-card:hover, .case-item-card:active {
  border-color: var(--accent-gold-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.case-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  gap: 0.4rem;
}

.case-cnr-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.case-parties-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.25rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.case-vs-span {
  color: var(--accent-gold-700);
  font-size: 0.8rem;
  font-weight: 800;
  margin: 0 0.15rem;
}

.case-details-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.case-next-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.45rem;
  background: var(--accent-gold-50);
  color: var(--accent-gold-900);
  border: 1px solid rgba(228, 156, 12, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 0.4rem;
  white-space: nowrap;
}

/* 2. Comprehensive Case Detail View */
.case-detail-header-card {
  background: linear-gradient(145deg, var(--primary-900), var(--primary-800));
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 0.95rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.detail-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  gap: 0.5rem;
}

.detail-case-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 0.35rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.detail-metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.74rem;
}

.metadata-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metadata-cell-label {
  font-size: 0.64rem;
  color: var(--accent-gold-400);
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metadata-cell-val {
  color: #f1f5f9;
  font-weight: 600;
  margin-top: 0.1rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 3. Client Quick Action Card */
.case-client-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  gap: 0.5rem;
}

.client-info-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.client-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-100);
  color: var(--primary-900);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-text-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-text-phone {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-action-buttons {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-whatsapp-action {
  background: #16a34a;
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
}

/* 4. Chronological Hearing History Timeline */
.hearing-timeline-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-xs);
}

.timeline-list {
  position: relative;
  padding-left: 1.15rem;
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-strong);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -1.15rem;
  top: 3px;
  width: 10px;
  height: 10px;
  background: var(--accent-gold-500);
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 2px var(--primary-900);
}

.timeline-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  gap: 0.4rem;
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-900);
}

.timeline-stage-pill {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--bg-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-summary {
  font-size: 0.76rem;
  color: var(--text-main);
  line-height: 1.4;
  background: var(--bg-app);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-md);
  margin-top: 0.3rem;
  border-left: 3px solid var(--accent-gold-500);
  word-break: break-word;
  overflow-wrap: break-word;
}

.timeline-order-download {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-700);
  margin-top: 0.3rem;
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}

/* 5. Document Vault Grid */
.document-vault-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.doc-vault-item {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.doc-vault-item:hover {
  border-color: var(--accent-gold-500);
  box-shadow: var(--shadow-sm);
}

.doc-icon-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-file-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-file-meta {
  font-size: 0.64rem;
  color: var(--text-muted);
}
