/* === PatentPro - AI-driven Patent Application System === */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #e2e0ea;
  --border-light: #f0eef5;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #aeaeb2;
  --primary: #7c6fb5;
  --primary-light: rgba(124,111,181,0.08);
  --primary-dark: #6a5ea3;
  --secondary: #86c7b2;
  --tertiary: #f0b896;
  --success: #34c759;
  --success-bg: rgba(52,199,89,0.08);
  --warning: #ff9f0a;
  --warning-bg: rgba(255,159,10,0.08);
  --danger: #ff3b30;
  --danger-bg: rgba(255,59,48,0.08);
  --info: #5ac8fa;
  --info-bg: rgba(90,200,250,0.08);
  --ai: #6366f1;
  --ai-light: rgba(99,102,241,0.08);
  --ai-glow: rgba(99,102,241,0.25);
  --ai-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif; font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; height: 100vh; }

/* Layout */
#app { display: flex; height: 100vh; }

/* Sidebar */
#sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: transform var(--transition);
  z-index: 100;
}
#sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); min-width: 0; width: 0; }
.sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--border-light); }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.logo-title { font-weight: 700; font-size: 18px; display: block; letter-spacing: -0.3px; }
.logo-sub { font-size: 11px; color: var(--text-muted); display: block; text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  text-decoration: none; font-weight: 500; transition: all var(--transition);
  margin-bottom: 2px; font-size: 13.5px;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-light); }
.sidebar-stats { display: flex; gap: 20px; }
.stat-mini-value { font-size: 20px; font-weight: 700; display: block; color: var(--primary); }
.stat-mini-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

/* Main Content */
#main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.top-bar {
  height: var(--header-height); min-height: var(--header-height);
  padding: 0 28px; display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-bar-left h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }
.btn-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); border: none;
  background: transparent; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: var(--text-secondary); transition: all var(--transition);
}
.btn-icon:hover { background: var(--primary-light); color: var(--primary); }
.btn-icon.btn-xs { width: 28px; height: 28px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 14px; width: 280px; transition: all var(--transition);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input { border: none; background: none; outline: none; font-size: 13px; width: 100%; color: var(--text); }

#content-area { flex: 1; overflow-y: auto; padding: 28px; }

/* Views */
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stat-card-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-card-value { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-card-change { font-size: 12px; margin-top: 8px; font-weight: 500; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-header h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; display: flex; align-items: center; gap: 8px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  padding: 10px 20px; font-size: 13.5px; font-weight: 600; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,111,181,0.3); }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }

/* AI Buttons & Badges */
.btn-ai {
  background: var(--ai-gradient); color: white;
  padding: 8px 16px; font-size: 12.5px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.btn-ai::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%); transition: transform 0.6s;
}
.btn-ai:hover::before { transform: translateX(100%); }
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--ai-glow); }

.btn-ai-glow {
  background: var(--ai-gradient); color: white; border: none;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 0 12px var(--ai-glow);
  animation: aiPulse 3s ease-in-out infinite;
}
@keyframes aiPulse {
  0%, 100% { box-shadow: 0 0 8px var(--ai-glow); }
  50% { box-shadow: 0 0 20px var(--ai-glow); }
}

.btn-ai-inline {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 6px; border: none;
  background: var(--ai-light); color: var(--ai); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); opacity: 0.7;
}
.btn-ai-inline:hover { opacity: 1; background: var(--ai-gradient); color: white; box-shadow: 0 2px 8px var(--ai-glow); }

.ai-badge-sm {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  border-radius: 4px; background: var(--ai-gradient); color: white;
  text-transform: uppercase;
}

.ai-insight-card { border-color: rgba(99,102,241,0.2); }
.ai-insight-card:hover { box-shadow: 0 4px 16px var(--ai-glow); }

/* Input with AI button */
.input-with-ai { position: relative; }
.input-with-ai input { padding-right: 44px; }

/* Textarea with AI actions */
.textarea-with-ai { position: relative; }
.ai-textarea-actions {
  display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}
.btn-ai-action {
  padding: 4px 12px; font-size: 11px; font-weight: 600;
  border: 1px solid rgba(99,102,241,0.25); border-radius: 6px;
  background: var(--ai-light); color: var(--ai); cursor: pointer;
  transition: all var(--transition);
}
.btn-ai-action:hover { background: var(--ai-gradient); color: white; border-color: transparent; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.required { color: var(--danger); }
.form-hint { font-size: 11.5px; color: var(--text-muted); }
.form-divider { grid-column: 1 / -1; height: 1px; background: var(--border-light); margin: 8px 0; }
.char-count { font-size: 11px; color: var(--text-muted); text-align: right; }
.text-muted { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

input, select, textarea {
  padding: 10px 14px; font-size: 13.5px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 100%; background: var(--surface);
  color: var(--text); transition: all var(--transition); font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea { resize: vertical; min-height: 80px; }

/* Wizard */
.wizard-layout { display: flex; gap: 24px; }
.wizard-main { flex: 1; min-width: 0; }
.form-wizard { max-width: 900px; }
.wizard-steps {
  display: flex; gap: 4px; margin-bottom: 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; overflow-x: auto;
}
.wizard-step {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  color: var(--text-muted); white-space: nowrap; transition: all var(--transition); flex: 1; justify-content: center;
}
.wizard-step.active { background: var(--primary-light); color: var(--primary); }
.wizard-step.completed { color: var(--success); }
.step-number {
  width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--border-light); color: var(--text-muted); transition: all var(--transition);
}
.wizard-step.active .step-number { background: var(--primary); color: white; }
.wizard-step.completed .step-number { background: var(--success); color: white; }
.wizard-content { display: none; }
.wizard-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-light);
}
.wizard-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.progress-bar { width: 200px; height: 4px; background: var(--border-light); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 2px; transition: width 0.4s ease; }
#wizard-progress-text { font-size: 11px; color: var(--text-muted); }

/* Wizard AI Sidebar */
.wizard-ai-sidebar {
  width: 340px; min-width: 340px;
  background: var(--surface); border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius); display: flex; flex-direction: column;
  max-height: calc(100vh - 180px); position: sticky; top: 0;
  box-shadow: 0 4px 20px var(--ai-glow);
}
.wizard-ai-sidebar.collapsed { display: none; }
.ai-sidebar-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04));
}
.ai-sidebar-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.ai-sidebar-content { flex: 1; overflow-y: auto; padding: 16px 20px; }
.ai-sidebar-input { padding: 12px 16px; border-top: 1px solid var(--border-light); }

.ai-context-tips { font-size: 13px; line-height: 1.7; }
.ai-context-tips h4 { font-size: 13px; font-weight: 700; color: var(--ai); margin-bottom: 8px; }
.ai-context-tips ul { padding-left: 16px; margin-bottom: 12px; }
.ai-context-tips li { margin-bottom: 4px; color: var(--text-secondary); }
.ai-context-tips p { margin-bottom: 8px; color: var(--text-secondary); }

.ai-msg { margin-bottom: 16px; animation: fadeIn 0.3s ease; }
.ai-msg-user { text-align: right; }
.ai-msg-user .ai-msg-bubble { background: var(--primary); color: white; display: inline-block; text-align: left; }
.ai-msg-ai .ai-msg-bubble { background: var(--ai-light); border: 1px solid rgba(99,102,241,0.15); }
.ai-msg-bubble { padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6; max-width: 90%; display: inline-block; }
.ai-msg-bubble p { margin-bottom: 6px; }
.ai-msg-bubble p:last-child { margin-bottom: 0; }
.ai-msg-bubble strong { font-weight: 700; }
.ai-msg-bubble ul, .ai-msg-bubble ol { padding-left: 18px; margin: 6px 0; }
.ai-msg-bubble li { margin-bottom: 3px; }
.ai-msg-bubble code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.ai-msg-label { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.ai-input-row { display: flex; gap: 8px; }
.ai-input-row input { flex: 1; }

/* AI Typing Indicator */
.ai-typing { display: flex; gap: 4px; padding: 12px 16px; }
.ai-typing span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ai);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Floating AI Panel */
.ai-float-panel {
  position: fixed; bottom: 20px; right: 20px; width: 400px; max-height: 560px;
  background: var(--surface); border: 1px solid rgba(99,102,241,0.2);
  border-radius: 16px; box-shadow: 0 8px 32px rgba(99,102,241,0.15);
  display: none; flex-direction: column; z-index: 500;
  animation: slideUp 0.3s ease;
}
.ai-float-panel.active { display: flex; }
.ai-float-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04));
  border-radius: 16px 16px 0 0;
}
.ai-float-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.ai-float-messages { flex: 1; overflow-y: auto; padding: 16px; max-height: 380px; min-height: 200px; }
.ai-float-input { padding: 12px 16px; border-top: 1px solid var(--border-light); }

/* AI Center */
.ai-center-layout { display: flex; gap: 24px; }
.ai-center-main { flex: 1; min-width: 0; }
.ai-center-sidebar { width: 320px; min-width: 320px; }
.ai-chat-card { display: flex; flex-direction: column; min-height: calc(100vh - 200px); }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px 0; min-height: 300px; max-height: calc(100vh - 380px); }
.ai-chat-input-area { border-top: 1px solid var(--border-light); padding-top: 16px; }
.ai-quick-prompts { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.ai-quick-btn {
  padding: 6px 14px; font-size: 11.5px; font-weight: 500;
  border: 1px solid rgba(99,102,241,0.2); border-radius: 20px;
  background: var(--ai-light); color: var(--ai); cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.ai-quick-btn:hover { background: var(--ai-gradient); color: white; border-color: transparent; }

.ai-tool-list { display: flex; flex-direction: column; gap: 8px; }
.ai-tool-btn {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: all var(--transition); width: 100%;
}
.ai-tool-btn:hover { border-color: var(--ai); background: var(--ai-light); transform: translateY(-1px); }
.ai-tool-icon { font-size: 22px; flex-shrink: 0; }
.ai-tool-btn strong { display: block; font-size: 13px; margin-bottom: 2px; }
.ai-tool-btn small { font-size: 11px; color: var(--text-muted); }

/* AI Review Result */
.ai-review-box {
  margin-top: 20px; padding: 20px; border-radius: var(--radius);
  border: 1px solid rgba(99,102,241,0.2); background: var(--ai-light);
}
.ai-review-box h4 { color: var(--ai); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.ai-review-box .ai-review-content { font-size: 13.5px; line-height: 1.8; }
.ai-review-box .ai-review-content p { margin-bottom: 8px; }
.ai-review-box .ai-review-content ul { padding-left: 18px; margin-bottom: 8px; }
.ai-review-box .ai-review-content li { margin-bottom: 4px; }
.ai-review-box .ai-review-content strong { color: var(--text); }

/* AI Dashboard Insights */
.ai-insight-item {
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
  font-size: 13px; line-height: 1.6;
}
.ai-insight-item:last-child { border-bottom: none; }
.ai-insight-item .insight-type {
  display: inline-block; padding: 2px 8px; font-size: 10px; font-weight: 700;
  border-radius: 4px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px;
}
.insight-type.tip { background: var(--ai-light); color: var(--ai); }
.insight-type.warning { background: var(--warning-bg); color: #cc7a00; }
.insight-type.action { background: var(--success-bg); color: #1b8a36; }

/* View Toolbar */
.view-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.filter-group { display: flex; gap: 10px; }
.filter-group select { width: auto; min-width: 180px; }

/* Patent List Items */
.patent-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 12px; cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 20px;
}
.patent-item:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.patent-item-main { flex: 1; min-width: 0; }
.patent-item-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.2px; }
.patent-item-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.patent-item-meta span { display: flex; align-items: center; gap: 4px; }
.patent-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px;
  font-size: 11.5px; font-weight: 600; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-draft { background: var(--border-light); color: var(--text-secondary); }
.badge-under_review { background: var(--warning-bg); color: #cc7a00; }
.badge-approved { background: var(--success-bg); color: #1b8a36; }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-filed { background: var(--info-bg); color: #0077b6; }

/* Completeness Bar */
.completeness-bar { width: 120px; height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.completeness-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.completeness-text { font-size: 11px; color: var(--text-muted); text-align: right; }

/* Timeline */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -32px; top: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.timeline-dot.completed { border-color: var(--success); background: var(--success); }
.timeline-dot.completed::after { content: '\2713'; color: white; font-size: 11px; font-weight: 700; }
.timeline-dot.pending { border-color: var(--warning); }
.timeline-date { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.timeline-title { font-size: 14px; font-weight: 600; }
.timeline-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* Claims */
.claim-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 10px;
}
.claim-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.claim-number {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.claim-type { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.claim-type.independent { color: var(--primary); }
.claim-type.dependent { color: var(--text-muted); }
.claim-text { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.claim-depends { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Documents */
.doc-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px;
  background: var(--surface); transition: all var(--transition);
}
.doc-item:hover { border-color: var(--primary); }
.doc-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.doc-icon.specification { background: var(--primary-light); }
.doc-icon.drawings { background: var(--info-bg); }
.doc-icon.priority { background: var(--warning-bg); }
.doc-icon.search_report { background: var(--success-bg); }
.doc-info { flex: 1; }
.doc-name { font-weight: 600; font-size: 14px; }
.doc-meta { font-size: 12px; color: var(--text-muted); }

/* Info Box */
.info-box {
  background: var(--primary-light); border: 1px solid rgba(124,111,181,0.15);
  border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 20px;
}
.info-box strong { color: var(--primary); font-size: 13px; display: block; margin-bottom: 8px; }
.info-box ul { padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
.info-box li { margin-bottom: 4px; }

/* Inventor Row */
.inventor-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px; align-items: end; padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.inventor-row:last-child { border-bottom: none; }

/* Claim Editor Row */
.claim-editor-row {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 10px; background: var(--surface);
}
.claim-editor-header { display: flex; gap: 12px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.claim-editor-header select { width: auto; min-width: 150px; }
.claim-editor-header input { width: 80px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px); z-index: 1000;
  display: none; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 90%; max-width: 600px; max-height: 80vh;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; overflow-y: auto; max-height: 50vh; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Detail View */
.detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 20px;
}
.detail-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.detail-meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
}
.detail-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.detail-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; overflow-x: auto; }
.detail-tab {
  padding: 10px 20px; font-size: 13.5px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition); white-space: nowrap;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-section { margin-bottom: 24px; }
.detail-section h4 { font-size: 14px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.detail-section p { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }
.detail-section .empty-text { color: var(--text-muted); font-style: italic; }

/* Completeness Chart */
.completeness-chart-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.completeness-chart-item:last-child { border-bottom: none; }
.completeness-chart-label { width: 140px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.completeness-chart-bar { flex: 1; height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.completeness-chart-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.completeness-chart-value { width: 40px; font-size: 13px; font-weight: 700; text-align: right; }

/* Status Chart */
.status-chart-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.status-chart-item:last-child { border-bottom: none; }
.status-chart-left { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-chart-count { font-size: 20px; font-weight: 800; }

/* Export */
.export-actions { margin-top: 20px; }

/* Review */
.review-section { margin-bottom: 20px; padding: 16px; background: var(--bg); border-radius: var(--radius-sm); }
.review-section h4 { font-size: 13px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.review-field { display: flex; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.review-label { font-weight: 600; min-width: 140px; color: var(--text-secondary); }
.review-value { color: var(--text); }
.review-check { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.review-check-icon { font-size: 16px; }
.review-check-ok { color: var(--success); }
.review-check-missing { color: var(--danger); }

/* Responsive */
@media (max-width: 1100px) {
  .wizard-ai-sidebar { display: none; }
  .ai-center-sidebar { display: none; }
  .ai-center-layout { flex-direction: column; }
}
@media (max-width: 768px) {
  #sidebar { position: fixed; height: 100vh; transform: translateX(calc(-1 * var(--sidebar-width))); }
  #sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .form-grid { grid-template-columns: 1fr; }
  .inventor-row { grid-template-columns: 1fr; }
  .wizard-steps { overflow-x: auto; }
  .wizard-step span { display: none; }
  .patent-item { flex-direction: column; align-items: flex-start; }
  .patent-item-right { flex-direction: row; align-items: center; }
  .search-box { width: 200px; }
  .detail-header { flex-direction: column; }
  .ai-float-panel { width: calc(100% - 40px); }
}

/* Print */
@media print {
  #sidebar, .top-bar, .wizard-actions, .view-toolbar, .btn, .ai-float-panel, .wizard-ai-sidebar { display: none !important; }
  #main-content { margin: 0; }
  #content-area { padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 15px; font-weight: 500; }
.empty-state-sub { font-size: 13px; margin-top: 6px; }
