:root {
  --primary-color: #10a37f;
  --primary-hover: #0d8f6f;
  --text-primary: #202123;
  --text-secondary: #6e6e80;
  --border-color: #d9d9e3;
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f8;
  --bg-hover: #f0f0f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica", "Arial", sans-serif;
  background: var(--bg-secondary);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Header */
.header {
  display: none;
}

/* Main Content */
.main-content {
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

/* Layout Grid - 3 Columns with Shadow */
.layout-grid {
  display: grid;
  grid-template-columns: 380px 1fr 380px;
  gap: 0;
  height: 100vh;
}

.left-column {
  background: var(--bg-primary);
  padding: 20px;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
}

.center-content {
  min-width: 0;
  background: var(--bg-secondary);
  padding: 20px;
  overflow-y: auto;
}

.right-sidebar {
  background: var(--bg-primary);
  padding: 20px;
  overflow-y: auto;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.06);
}

/* Remove old right-column styles */
.right-column {
  display: none;
}

.right-column-grid {
  display: none;
}

.right-sidebar .chat-card {
  margin: 0;
}

.right-sidebar .chat-header h3 {
  font-size: 0.95rem;
}

.right-sidebar .chat-messages {
  height: calc(100vh - 280px);
  min-height: 400px;
}

/* Placeholder Area */
.placeholder-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px);
  padding: 40px 20px;
}

.placeholder-content {
  text-align: center;
  max-width: 400px;
}

.placeholder-icon {
  font-size: 4rem;
  color: var(--border-color);
  margin-bottom: 20px;
}

.placeholder-content h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 600;
}

.placeholder-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.placeholder-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.placeholder-list li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.placeholder-list i {
  color: var(--primary-color);
  margin-right: 8px;
}

/* Card */
.card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.card h2,
.card h3 {
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Upload Section */
.upload-section-card {
  margin-bottom: 16px;
}

.upload-section-card h2 {
  font-size: 1rem;
  margin-bottom: 16px;
}

/* Tab Switcher */
.data-source-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-primary);
  color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.tab-btn i {
  font-size: 0.9rem;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--bg-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary-color);
  background: var(--bg-primary);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.1);
  transform: translateY(-2px);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-content p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

.upload-icon {
  font-size: 2rem;
  color: var(--text-secondary);
}

/* Google Sheets Input */
.sheets-input-area {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.sheets-input-area label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.sheets-input-area label i {
  color: #0f9d58;
  margin-right: 6px;
}

.sheets-url-input {
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.sheets-help {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  border-left: 3px solid #0f9d58;
}

.sheets-help p {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.sheets-help ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.sheets-help li {
  margin-bottom: 4px;
}

/* Import History */
.history-container {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  max-height: 500px;
  overflow-y: auto;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.history-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.history-header h3 i {
  color: var(--primary-color);
}

.btn-clear-history {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-clear-history:hover {
  background: #fee;
  border-color: #f44;
  color: #f44;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary-color);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

.history-empty i {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.history-empty p {
  margin: 0;
  font-size: 0.9rem;
}

.history-item {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.history-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.history-item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.history-item-header > i {
  font-size: 1.2rem;
  margin-top: 2px;
}

.history-item-info {
  flex: 1;
}

.history-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.history-item-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-delete-history {
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-delete-history:hover {
  background: #fee;
  color: #f44;
}

.history-item-source {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 10px;
  word-break: break-all;
  font-family: monospace;
  transition: background 0.2s ease;
}

.history-item-source[style*="cursor: pointer"]:hover {
  background: var(--bg-tertiary);
  color: var(--primary-color);
}

.history-item-actions {
  display: flex;
  gap: 8px;
}

.btn-load-history {
  flex: 1;
  padding: 8px 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-load-history:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 163, 127, 0.3);
}

/* History Selection Controls */
.history-selection-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.select-all-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.btn-analyze-selected {
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-analyze-selected:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 163, 127, 0.3);
}

.btn-analyze-selected:disabled {
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.history-checkbox {
  display: flex;
  align-items: center;
  margin-right: 8px;
  cursor: pointer;
}

.history-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}

.history-item.selected {
  background: #f0fdf4;
  border: 1px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.15);
}

.file-item i {
  color: var(--primary-color);
}

/* Analysis Form */
.analysis-form-card {
  margin-bottom: 16px;
}

.analysis-form-card h2 {
  font-size: 1rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group label i {
  color: var(--primary-color);
  margin-right: 4px;
}

.label-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  background: var(--bg-primary);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Phone Input Wrapper */
.phone-input-wrapper {
  position: relative;
  display: flex;
  gap: 8px;
}

.phone-input-wrapper .form-control {
  flex: 1;
}

.btn-show-list {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-show-list:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-show-list:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Phone List Dropdown */
.phone-list-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 400px;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.phone-list-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.phone-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.2s ease;
}

.phone-search-input:focus {
  border-color: var(--primary-color);
}

.phone-count {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.phone-list-container {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.phone-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 2px 0;
}

.phone-list-item:hover {
  background: var(--bg-secondary);
  transform: translateX(4px);
}

.phone-number {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.phone-number i {
  color: var(--primary-color);
  font-size: 0.8rem;
}

.phone-record-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 3px 8px;
  border-radius: 12px;
}

.phone-list-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 0;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Quick Stats Card */
.quick-stats-card {
  margin-bottom: 16px;
}

.quick-stats-card h3 {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.quick-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.quick-stat-item:last-child {
  border-bottom: none;
}

.quick-stat-item span {
  color: var(--text-secondary);
}

.quick-stat-item strong {
  color: var(--text-primary);
}

/* Analysis Results */
.analysis-results {
  margin-bottom: 20px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#analysisContent {
  font-size: 0.9rem;
  line-height: 1.7;
}

#analysisContent h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-top: 20px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 6px;
}

#analysisContent h4 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-top: 16px;
  margin-bottom: 8px;
}

#analysisContent .warning {
  background: linear-gradient(to right, #fef3c7 0%, #fffbeb 100%);
  padding: 16px;
  margin: 16px 0;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.15),
    0 1px 3px rgba(245, 158, 11, 0.1);
}

#analysisContent .info {
  background: linear-gradient(to right, #dbeafe 0%, #eff6ff 100%);
  padding: 16px;
  margin: 16px 0;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.15),
    0 1px 3px rgba(59, 130, 246, 0.1);
}

#analysisContent .danger {
  background: linear-gradient(to right, #fee2e2 0%, #fef2f2 100%);
  padding: 16px;
  margin: 16px 0;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.15),
    0 1px 3px rgba(239, 68, 68, 0.1);
}

#analysisContent ul {
  margin-left: 20px;
}

#analysisContent .reference-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 8px;
}

#analysisContent .reference-link:hover {
  text-decoration: underline;
}

/* Statistics Section */
.stats-section {
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-secondary);
  color: var(--primary-color);
}

.stat-info h3 {
  font-size: 1.75rem;
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.stat-info p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.875rem;
}

/* Dashboard Section */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.chart-card {
  min-height: 320px;
}

.chart-card canvas {
  max-height: 280px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Chat Section */
.chat-card {
  max-width: 100%;
  margin: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  margin-bottom: 16px;
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--primary-color);
  color: white;
}

.user-message .message-avatar {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.message-content {
  background: transparent;
  padding: 0;
  max-width: 80%;
  word-wrap: break-word;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-input-area {
  display: flex;
  gap: 8px;
}

#chatInput {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
  background: var(--bg-primary);
}

#chatInput:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.cache-info {
  margin-top: 8px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Data Table */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.table-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input,
.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  font-size: 0.9rem;
  background: var(--bg-primary);
}

.search-input:focus,
.filter-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
}

thead {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  font-size: 0.85rem;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: var(--bg-secondary);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.pagination button:hover {
  background: var(--bg-hover);
}

.pagination button.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-export {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.btn-export:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Loading Overlay */
/* Inline Loading - Smooth & Non-blocking */
.inline-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 100;
  padding: 30px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.2s ease-in;
}

.inline-loading.active {
  display: flex;
}

.loading-spinner {
  border: 4px solid rgba(0, 123, 255, 0.1);
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: #495057;
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Responsive */
@media (max-width: 1400px) {
  .layout-grid {
    grid-template-columns: 380px 1fr;
  }

  .right-sidebar {
    display: none;
  }
}

@media (max-width: 1200px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .left-column {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.3rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .upload-area {
    padding: 30px 15px;
  }

  .table-header {
    flex-direction: column;
    align-items: stretch;
  }

  .table-controls {
    flex-direction: column;
  }

  .message-content {
    max-width: 85%;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
   ENHANCED ANALYSIS STYLES
   ============================================ */

/* Phone Analysis Header */
.phone-analysis-header {
  background: linear-gradient(135deg, var(--primary-color), #0d8f6f);
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.phone-analysis-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
}

/* Analysis Sections */
.analysis-section {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s ease;
}

.analysis-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.analysis-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-secondary);
}

.analysis-section h3 i {
  color: var(--primary-color);
}

.analysis-section h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 16px 0 12px 0;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.info-item .label {
  font-weight: 500;
  color: var(--text-secondary);
}

.info-item .value {
  font-weight: 600;
  color: var(--text-primary);
}

.status-active {
  color: var(--primary-color) !important;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(16, 163, 127, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Peak Hours */
.peak-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-primary {
  background: var(--primary-color);
  color: white;
}

.badge-info {
  background: #3b82f6;
  color: white;
}

.badge-sms {
  background: #f59e0b;
  color: white;
}

.badge-voice {
  background: #10b981;
  color: white;
}

/* Warning Section */
.warning-section {
  background: #fffbeb;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12),
    0 1px 3px rgba(245, 158, 11, 0.08);
  border-radius: 12px;
}

.warning-list {
  list-style: none;
  padding: 0;
}

.warning-list li {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.warning-list li:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.warning-danger {
  border-top-color: #ef4444 !important;
}

.warning-warning {
  border-top-color: #f59e0b !important;
}

.warning-info {
  border-top-color: #3b82f6 !important;
}

/* Travel List */
.travel-list {
  list-style: none;
  padding: 0;
}

.travel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.travel-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.travel-item.international {
  background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12),
    0 1px 3px rgba(239, 68, 68, 0.08);
}

.travel-item.domestic-ago {
  background: linear-gradient(to right, #fffbeb 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12),
    0 1px 3px rgba(245, 158, 11, 0.08);
}

.travel-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.85rem;
}

.travel-info {
  flex: 1;
}

.travel-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.travel-location {
  font-weight: 600;
  color: var(--text-primary);
  margin: 2px 0;
}

.travel-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Characteristics */
.characteristics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.characteristic-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.characteristic-item:hover {
  transform: translateX(4px);
}

.characteristic-item.priority-high {
  background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15),
    0 1px 3px rgba(239, 68, 68, 0.1);
}

.characteristic-item.priority-medium {
  background: linear-gradient(to right, #fffbeb 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15),
    0 1px 3px rgba(245, 158, 11, 0.1);
}

.characteristic-item.priority-low {
  background: linear-gradient(to right, #f0fdf4 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15),
    0 1px 3px rgba(16, 185, 129, 0.1);
}

.char-icon {
  font-size: 1.2rem;
}

.char-content {
  flex: 1;
}

.char-desc {
  font-weight: 500;
  color: var(--text-primary);
}

.char-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Dense Periods Table */
.dense-periods-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.dense-periods-table thead {
  background: var(--bg-secondary);
}

.dense-periods-table th {
  padding: 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dense-periods-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}

.dense-periods-table tr:hover {
  background: var(--bg-secondary);
}

.intensity-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.intensity-badge.very-high {
  background: #ef4444;
  color: white;
}

.intensity-badge.high {
  background: #f59e0b;
  color: white;
}

.intensity-badge.medium {
  background: #3b82f6;
  color: white;
}

/* Contact List */
.contact-list {
  list-style: none;
  padding: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.contact-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

.contact-details {
  flex: 1;
}

.contact-number {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.contact-number i {
  color: var(--primary-color);
  margin-right: 6px;
}

.contact-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-sms {
  color: #f59e0b;
  font-weight: 500;
}

.stat-voice {
  color: #10b981;
  font-weight: 500;
}

/* Activity List */
.activity-list {
  list-style: none;
  padding: 0;
}

.activity-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin-bottom: 6px;
  background: white;
  border-radius: 6px;
  font-size: 0.9rem;
}

.activity-time {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
}

.activity-type {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.activity-type.badge-sms {
  background: #fef3c7;
  color: #92400e;
}

.activity-type.badge-voice {
  background: #d1fae5;
  color: #065f46;
}

.activity-contact {
  flex: 1;
  color: var(--text-primary);
}

.activity-location {
  width: 100%;
  margin-top: 4px;
  padding-left: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.activity-more {
  padding: 8px;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* IMEI List */
.imei-summary {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.summary-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-value.highlight {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.imei-list {
  list-style: none;
  padding: 0;
}

.imei-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.imei-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.imei-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.imei-content {
  flex: 1;
}

.imei-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.imei-header strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.imei-details {
  margin-bottom: 10px;
}

.imei-info-row {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.imei-info-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.imei-info-row i {
  color: var(--primary-color);
  font-size: 0.85rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Section Notes */
.section-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 12px;
}

/* Timeline Container */
.timeline-container {
  position: relative;
  padding-left: 40px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: -20px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.timeline-item.international .timeline-marker {
  background: #ef4444;
}

.timeline-item.border .timeline-marker {
  background: #f59e0b;
}

.timeline-content {
  flex: 1;
  background: var(--bg-primary);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(16, 163, 127, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-content:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(16, 163, 127, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.timeline-item.international .timeline-content {
  background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12),
    0 1px 3px rgba(239, 68, 68, 0.08);
}

.timeline-item.border .timeline-content {
  background: linear-gradient(to right, #fffbeb 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12),
    0 1px 3px rgba(245, 158, 11, 0.08);
}

.timeline-period {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.timeline-duration {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 8px;
}

.timeline-location {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.timeline-location i {
  color: var(--primary-color);
  margin-right: 6px;
}

.timeline-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Behavior Patterns */
.behavior-patterns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.behavior-item {
  padding: 14px;
  border-radius: 6px;
  border-left: 4px solid var(--border-color);
  background: var(--bg-secondary);
}

.behavior-item.risk-high {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.behavior-item.risk-medium {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.behavior-item.risk-low {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.behavior-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.behavior-icon {
  font-size: 1.1rem;
}

.behavior-desc {
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.behavior-evidence {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-left: 20px;
}

/* Route Analysis Styles */
.route-summary {
  margin-bottom: 20px;
}

.route-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.route-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(16, 163, 127, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.route-stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.route-stat-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.route-stat-content {
  flex: 1;
}

.route-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.route-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Frequent Routes List */
.frequent-routes-list {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
}

.route-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-primary);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.route-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.route-item.international {
  background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12),
    0 1px 3px rgba(239, 68, 68, 0.08);
}

.route-item.border {
  background: linear-gradient(to right, #fffbeb 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12),
    0 1px 3px rgba(245, 158, 11, 0.08);
}

.route-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.route-details {
  flex: 1;
}

.route-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.route-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.route-period {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

.badge-international {
  background: #fee2e2;
  color: #991b1b;
}

.badge-border {
  background: #fef3c7;
  color: #92400e;
}

.badge-domestic {
  background: #dbeafe;
  color: #1e40af;
}

/* Suspicious Patterns List */
.suspicious-patterns-list {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
}

.pattern-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}

.pattern-item.danger {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.pattern-item i {
  color: #f59e0b;
  font-size: 1.1rem;
}

.pattern-item.danger i {
  color: #ef4444;
}

.pattern-content {
  flex: 1;
  color: var(--text-primary);
}

/* Movement Summary Table */
.movement-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.movement-summary-table thead {
  background: var(--bg-secondary);
}

.movement-summary-table th {
  padding: 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}

.movement-summary-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

/* Expandable Section Styles */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 12px;
}

.section-header h3,
.section-header h4 {
  margin: 0;
  flex: 1;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  background: var(--bg-hover);
}

.toggle-btn i {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.toggle-btn.collapsed i {
  transform: rotate(-90deg);
}

.expandable-content {
  max-height: 400px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.expandable-content.collapsed {
  max-height: 0;
}

.expandable-content.expanded {
  max-height: none;
}

/* Show More Button */
.show-more-container {
  margin-top: 16px;
  text-align: center;
}

.show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-primary);
  box-shadow: 0 2px 6px rgba(16, 163, 127, 0.1);
  border-radius: 8px;
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.show-more-btn:hover {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
  transform: translateY(-2px);
}

.show-more-btn i {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.show-more-btn.expanded i {
  transform: rotate(180deg);
}

.hidden-items {
  margin-top: 12px;
}

.movement-summary-table tr:hover {
  background: var(--bg-secondary);
}

.movement-summary-table tr.has-risk {
  background: #fffbeb;
}

.highlight-danger {
  color: #ef4444;
  font-weight: 600;
}

.highlight-warning {
  color: #f59e0b;
  font-weight: 600;
}

/* Subscriber Info Card */
.subscriber-info-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.subscriber-info-card h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subscriber-info-card h3 i {
  color: var(--primary-color);
}

.subscriber-info-card .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.subscriber-info-card .info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.subscriber-info-card .info-item .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.subscriber-info-card .info-item .value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.subscriber-info-card .info-item .value.status-active {
  color: #059669;
  font-weight: 600;
}

/* Stats with Chart Layout */
.stats-with-chart {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.stats-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.chart-column {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.chart-column canvas {
  max-height: 400px;
}

@media (max-width: 1024px) {
  .stats-with-chart {
    grid-template-columns: 1fr;
  }

  .stats-column {
    grid-template-columns: 1fr;
  }

  .chart-column {
    margin-top: 12px;
  }
}
