/* ==========================================================================
   DENWCORE LEGAL - ENTERPRISE DESIGN SYSTEM & CSS UTILITIES
   Theme: Slate Dark Executive with Warm Gold & Cyan Accents
   Aesthetics: Premium Glassmorphism, Micro-Interactions, High Density Data Views
   ========================================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-header: rgba(15, 23, 42, 0.85);
  --bg-card: rgba(30, 41, 59, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #1e293b;
  --bg-modal: #0f172a;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(217, 119, 6, 0.3);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-heading: #ffffff;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --gold: #d97706;
  --gold-hover: #b45309;
  --gold-glow: rgba(217, 119, 6, 0.25);
  --cyan: #06b6d4;
  --green: #10b981;
  --purple: #8b5cf6;
  --red: #ef4444;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* GLOBAL RESETS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* APP HEADER */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 15px var(--gold-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: var(--text-heading);
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
}

.badge-enterprise {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* ROLE SELECTOR */
.role-selector-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 4px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.role-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.role-dropdown {
  background: transparent;
  border: none;
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.role-dropdown option {
  background: var(--bg-sidebar);
  color: var(--text-main);
}

/* HEADER RIGHT WIDGETS & USER PROFILE */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.5);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.user-avatar-icon { font-size: 1.1rem; }

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-heading);
}

.user-role-label {
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 600;
}

.timer-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.timer-display {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  width: 70px;
  text-align: center;
}

.zero-trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.zero-trust-badge:hover {
  background: rgba(6, 182, 212, 0.2);
}

.btn-ai-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-ai-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* APP LAYOUT & SIDEBAR */
.app-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin: 14px 10px 4px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease-in-out;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.ai-engine-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
}

.indicator-label {
  color: var(--text-muted);
}

.badge-engine {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.badge-engine.google-file-search {
  background: rgba(66, 133, 244, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(66, 133, 244, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-store-active {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: monospace;
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

/* CONTENT AREA */
.content-area {
  flex-grow: 1;
  padding: 24px 32px;
  background-color: var(--bg-main);
  overflow-y: auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PAGE TITLE BAR */
.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* BUTTONS */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-gold {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-gold:hover {
  background: var(--gold-hover);
}

.btn-approve-sm {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-reject-sm {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.btn-full-width {
  width: 100%;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* KPI GRID & CARDS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.kpi-trend {
  font-size: 0.75rem;
  font-weight: 600;
}

.kpi-trend.positive { color: var(--green); }
.kpi-trend.neutral { color: var(--gold); }

/* CONFLICT OF INTEREST (COI) CARD */
.coi-result-card {
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.coi-result-card.direct {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red);
  color: var(--text-main);
}

.coi-result-card.ethical {
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid var(--gold);
  color: var(--text-main);
}

.coi-result-card.clear {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--green);
  color: var(--text-main);
}

.coi-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

/* ROLE BANNER */
.role-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--gold-glow);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.role-banner-icon { font-size: 1.8rem; }
.role-banner-text h3 { font-size: 1rem; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.role-banner-text p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; }

.role-permissions-list { display: flex; flex-wrap: wrap; gap: 6px; }

.perm-tag { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.perm-tag.allow { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); }
.perm-tag.deny { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }

.role-access-warning {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.warning-icon { font-size: 1.8rem; }
.role-access-warning h4 { color: var(--red); font-size: 0.95rem; margin-bottom: 2px; }
.role-access-warning p { color: var(--text-muted); font-size: 0.8rem; }

/* PRACTICE SETTINGS UI */
.input-group-inline { display: flex; gap: 8px; }
.practice-areas-list-container { margin-top: 14px; }
.practice-chips-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.practice-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.btn-remove-chip {
  background: transparent;
  border: none;
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.btn-remove-chip:hover { color: #f87171; }

.field-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.margin-top-20 { margin-top: 20px; }
.margin-bottom-20 { margin-bottom: 20px; }
.text-center { text-align: center; }

/* LAYOUT GRIDS & GLASS CARDS */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h3 { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; }

/* DATA TABLES */
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: left; }
.data-table th { background: rgba(15, 23, 42, 0.6); color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; border-bottom: 1px solid var(--border-color); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-main); }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* BADGES & TAGS */
.badge-status { padding: 3px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; }
.badge-status.active { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-status.review { background: rgba(217, 119, 6, 0.2); color: #f59e0b; }
.badge-status.paid { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-status.unpaid { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.badge-privilege { font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(139, 92, 246, 0.2); color: #c084fc; }

/* AI WORKBENCH STYLING */
.grid-rag-workbench { display: grid; grid-template-columns: 360px 1fr; gap: 20px; }
.engine-toggle-group { display: flex; align-items: center; gap: 8px; }
.toggle-label { font-size: 0.8rem; color: var(--text-muted); }

.btn-engine { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border-color); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.btn-engine.active { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-color: var(--primary); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }

.input-text, .input-select, .input-textarea { width: 100%; background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main); padding: 8px 12px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.85rem; outline: none; }
.input-text:focus, .input-select:focus, .input-textarea:focus { border-color: var(--primary); }

.preset-queries { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.preset-title { font-size: 0.72rem; color: var(--text-muted); width: 100%; }

.btn-chip { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: var(--text-main); padding: 4px 8px; border-radius: 12px; font-size: 0.7rem; cursor: pointer; }
.btn-chip:hover { background: rgba(59, 130, 246, 0.2); border-color: var(--primary); }

.rag-output-box { background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 16px; min-height: 220px; font-size: 0.9rem; white-space: pre-line; margin-bottom: 16px; }

.citations-container { display: flex; flex-direction: column; gap: 8px; }
.citation-card { background: rgba(30, 41, 59, 0.4); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 4px; font-size: 0.8rem; }
.citation-header { display: flex; justify-content: space-between; font-weight: 600; color: var(--gold); margin-bottom: 4px; }
.citation-snippet { font-style: italic; color: var(--text-muted); }

/* CLIENT TIMELINE */
.timeline-container { display: flex; flex-direction: column; gap: 16px; padding: 10px 0; }
.timeline-step { display: flex; gap: 12px; position: relative; }
.step-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }

.timeline-step.done .step-icon { background: rgba(16, 185, 129, 0.2); color: var(--green); border: 1px solid var(--green); }
.timeline-step.current .step-icon { background: rgba(217, 119, 6, 0.2); color: var(--gold); border: 1px solid var(--gold); }

.step-info strong { font-size: 0.88rem; }
.step-date { font-size: 0.75rem; color: var(--text-muted); }

/* ZERO TRUST AUDIT STREAM LIST */
.audit-stream-list { display: flex; flex-direction: column; gap: 8px; }
.audit-stream-item { display: flex; align-items: center; justify-content: space-between; background: rgba(15, 23, 42, 0.5); padding: 8px 12px; border-radius: var(--radius-sm); border-left: 3px solid var(--cyan); font-size: 0.78rem; }
.audit-hash { font-family: monospace; font-size: 0.7rem; color: var(--cyan); background: rgba(6, 182, 212, 0.1); padding: 2px 6px; border-radius: 4px; }

/* AI FLOATING DRAWER */
.ai-drawer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); z-index: 200; display: none; }
.ai-drawer { position: fixed; top: 0; right: -420px; width: 400px; height: 100vh; background: var(--bg-sidebar); border-left: 1px solid var(--border-color); z-index: 201; display: flex; flex-direction: column; transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: -10px 0 30px rgba(0,0,0,0.6); }
.ai-drawer.open { right: 0; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.drawer-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; }
.drawer-body { flex-grow: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 10px; font-size: 0.85rem; }
.msg-content { background: var(--bg-card); padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.drawer-footer { padding: 12px 16px; border-top: 1px solid var(--border-color); display: flex; gap: 8px; }
.input-chat { flex-grow: 1; background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main); padding: 8px 12px; border-radius: var(--radius-sm); outline: none; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px); z-index: 300; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-card { width: 480px; max-width: 90%; background: var(--bg-modal); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8); }
.modal-card.modal-wide { width: 720px; max-width: 94%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-body { display: flex; flex-direction: column; gap: 4px; }
.enc-result-box { margin-top: 14px; padding: 12px; background: #000; border: 1px solid var(--cyan); border-radius: 4px; font-family: monospace; font-size: 0.78rem; color: var(--cyan); word-break: break-all; }
.placeholder-text { color: var(--text-muted); font-style: italic; font-size: 0.85rem; }

/* FORM LAYOUT */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.input-textarea { width: 100%; min-height: 90px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-main); padding: 10px 12px; font-family: var(--font-body); font-size: 0.88rem; outline: none; resize: vertical; box-sizing: border-box; }
.input-textarea-tall { min-height: 130px; }
.input-textarea:focus { border-color: var(--gold); }
.reminder-checks { display: flex; flex-direction: column; gap: 6px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; color: var(--text-main); }
.check-label input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; cursor: pointer; }
.label-inline { display: block; margin-bottom: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.security-note { background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.25); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.8rem; color: var(--cyan); margin: 8px 0; }
.conflict-alert { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.85rem; color: #fca5a5; }

/* CALENDAR VIEW */
.calendar-events-list { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 20px; }
.cal-event-card { display: flex; gap: 16px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border-color); transition: border-color 0.2s, transform 0.15s; }
.cal-event-card:hover { border-color: var(--gold); transform: translateX(3px); }
.cal-event-card.type-court { border-left: 3px solid #ef4444; }
.cal-event-card.type-deposition { border-left: 3px solid var(--gold); }
.cal-event-card.type-settlement { border-left: 3px solid var(--cyan); }
.cal-event-card.type-intake { border-left: 3px solid var(--green); }
.cal-event-card.type-default { border-left: 3px solid var(--purple); }
.cal-event-card.status-cancelled { opacity: 0.45; }
.cal-event-date-block { min-width: 52px; text-align: center; background: rgba(217, 119, 6, 0.1); border-radius: var(--radius-sm); padding: 6px 8px; }
.cal-event-day { font-size: 1.4rem; font-weight: 800; color: var(--gold); line-height: 1; }
.cal-event-month { font-size: 0.68rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.06em; }
.cal-event-info { flex: 1; }
.cal-event-title { font-weight: 700; font-size: 0.95rem; color: var(--text-heading); margin-bottom: 4px; }
.cal-event-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; color: var(--text-muted); }
.cal-event-meta span { display: flex; align-items: center; gap: 4px; }
.cal-event-actions { display: flex; gap: 6px; align-items: flex-start; }
.cal-nav { display: flex; align-items: center; gap: 12px; }
.calendar-grid-container { padding: 0 16px 16px; }
.calendar-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.calendar-grid-header span { text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding: 6px 0; }
.calendar-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { min-height: 64px; padding: 4px 6px; border-radius: 4px; background: var(--bg-card); border: 1px solid var(--border-color); font-size: 0.78rem; transition: background 0.15s; cursor: default; }
.cal-day:hover { background: var(--bg-card-hover); }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day.today { border-color: var(--gold); background: rgba(217, 119, 6, 0.08); }
.cal-day.has-event { border-color: var(--cyan); }
.cal-day-num { font-weight: 700; color: var(--text-main); }
.cal-day.today .cal-day-num { color: var(--gold); }
.cal-day-events { margin-top: 2px; display: flex; flex-direction: column; gap: 2px; }
.cal-day-dot { font-size: 0.62rem; background: rgba(6, 182, 212, 0.2); color: var(--cyan); border-radius: 2px; padding: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day-dot.court { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* MESSAGING HUB */
.msg-stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.msg-stat-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 16px 18px; text-align: center; transition: border-color 0.2s; }
.msg-stat-item:hover { border-color: var(--gold); }
.msg-stat-val { display: block; font-size: 1.8rem; font-weight: 800; color: var(--gold); font-family: var(--font-heading); }
.msg-stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.message-threads-list { display: flex; flex-direction: column; gap: 0; }
.msg-thread-card { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; gap: 14px; align-items: flex-start; transition: background 0.15s; }
.msg-thread-card:hover { background: var(--bg-card-hover); }
.msg-thread-card:last-child { border-bottom: none; }
.msg-channel-badge { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.msg-channel-badge.email { background: rgba(59, 130, 246, 0.15); }
.msg-channel-badge.sms { background: rgba(16, 185, 129, 0.15); }
.msg-thread-body { flex: 1; }
.msg-thread-subject { font-weight: 700; font-size: 0.92rem; color: var(--text-heading); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px; }
.msg-thread-preview { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px; }
.msg-thread-meta { display: flex; gap: 10px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.msg-thread-meta span { font-size: 0.72rem; color: var(--text-muted); }
.msg-thread-status { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge-delivered { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 4px; padding: 2px 8px; font-size: 0.7rem; font-weight: 700; }
.badge-unread { background: rgba(217, 119, 6, 0.15); color: var(--gold); border: 1px solid rgba(217, 119, 6, 0.3); border-radius: 4px; padding: 2px 8px; font-size: 0.7rem; font-weight: 700; }
.msg-filter-btn.active { border-color: var(--gold); color: var(--gold); }
.border-cyan { border-color: rgba(6, 182, 212, 0.3) !important; }

/* PREDEFINED LEGAL SERVICES CATALOG */
.services-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}
.service-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.service-card.selected {
  border-color: var(--gold);
  background: rgba(217, 119, 6, 0.08);
  box-shadow: 0 0 16px rgba(217, 119, 6, 0.2);
}
.service-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.service-category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.service-fee-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(217, 119, 6, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(217, 119, 6, 0.3);
}
.service-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  line-height: 1.3;
}
.service-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 12px;
}
.service-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}
.upload-dropzone {
  transition: all 0.2s ease;
}
.upload-dropzone:hover {
  background: rgba(217, 119, 6, 0.08) !important;
  border-color: var(--gold) !important;
}

