/* OfficeNinja - Modern Office Suite Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1e293b;
  --light: #f8fafc;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --transition: all 0.2s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #94a3b8;
  --dark: #f1f5f9;
  --light: #1e293b;
  --border: #334155;
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .app-card,
[data-theme="dark"] .toolbar,
[data-theme="dark"] .app-header,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .modal,
[data-theme="dark"] .dropdown-menu {
  background: var(--bg-secondary);
  color: var(--text);
}

[data-theme="dark"] .document,
[data-theme="dark"] .slide-canvas,
[data-theme="dark"] .spreadsheet-area {
  background: var(--bg-secondary);
  color: var(--text);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .toolbar-select,
[data-theme="dark"] .formula-input {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .template-item,
[data-theme="dark"] .animation-item {
  background: var(--bg);
}

/* Dark Mode Toolbar Text */
[data-theme="dark"] .toolbar-btn {
  color: var(--text);
}

[data-theme="dark"] .toolbar-btn:hover {
  background: var(--bg);
}

[data-theme="dark"] .toolbar-btn b,
[data-theme="dark"] .toolbar-btn i,
[data-theme="dark"] .toolbar-btn u,
[data-theme="dark"] .toolbar-btn s,
[data-theme="dark"] .toolbar-btn sub,
[data-theme="dark"] .toolbar-btn sup,
[data-theme="dark"] .toolbar-btn span {
  color: inherit;
}

[data-theme="dark"] .style-btn {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
}

[data-theme="dark"] .style-btn:hover {
  background: var(--bg-secondary);
}

[data-theme="dark"] .tab {
  color: var(--text-secondary);
}

[data-theme="dark"] .tab:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

[data-theme="dark"] .tab.active {
  color: var(--primary);
  background: var(--bg-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--light);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

/* Dashboard Styles */
.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.app-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.app-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.app-icon.word { background: linear-gradient(135deg, #2b579a, #124078); color: white; }
.app-icon.excel { background: linear-gradient(135deg, #217346, #0d5c2e); color: white; }
.app-icon.powerpoint { background: linear-gradient(135deg, #d24726, #b7381e); color: white; }

.app-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.app-card p {
  color: var(--secondary);
  font-size: 0.95rem;
}

.app-features {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.feature-tag {
  background: var(--light);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--secondary);
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Toolbar */
.toolbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  border-right: 1px solid var(--border);
}

.toolbar-group:last-child {
  border-right: none;
}

.toolbar-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  min-width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

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

.toolbar-btn.active {
  background: var(--primary);
  color: white;
}

.toolbar-btn svg {
  width: 18px;
  height: 18px;
}

.toolbar-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

.toolbar-input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 60px;
  text-align: center;
}

/* App Header */
.app-header {
  background: white;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.app-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.app-logo-icon.word { background: #2b579a; }
.app-logo-icon.excel { background: #217346; }
.app-logo-icon.powerpoint { background: #d24726; }

.app-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.file-name {
  background: var(--light);
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.file-name:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
}

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

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

.btn-secondary {
  background: var(--light);
  color: var(--dark);
  border: 1px solid var(--border);
}

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

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

/* Word Specific */
.word-container {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.document-area {
  flex: 1;
  background: #525659;
  padding: 2rem;
  overflow: auto;
  display: flex;
  justify-content: center;
}

.document {
  background: white;
  width: 8.5in;
  min-height: 11in;
  padding: 1in;
  box-shadow: var(--shadow-lg);
  outline: none;
}

.document:focus {
  outline: none;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: white;
  border-left: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.template-item {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.template-item:hover {
  border-color: var(--primary);
  background: white;
}

/* Excel Specific */
.excel-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.formula-bar {
  background: white;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cell-ref {
  width: 80px;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  font-family: monospace;
  background: var(--light);
}

.formula-input {
  flex: 1;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: monospace;
}

.formula-input:focus {
  outline: none;
  border-color: var(--primary);
}

.spreadsheet-area {
  flex: 1;
  overflow: auto;
  background: white;
}

/* PowerPoint Specific */
.ppt-container {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.slide-panel {
  width: 200px;
  background: #f1f1f1;
  border-right: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.slide-thumbnail {
  background: white;
  border: 2px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.slide-thumbnail:hover,
.slide-thumbnail.active {
  border-color: var(--primary);
}

.slide-thumbnail.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--primary);
  border-radius: 2px;
}

.slide-number {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
}

.slide-editor {
  flex: 1;
  background: #525659;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: auto;
}

.slide-canvas {
  background: white;
  width: 960px;
  height: 540px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.slide-element {
  position: absolute;
  cursor: move;
  min-width: 50px;
  min-height: 30px;
}

.slide-element.selected {
  outline: 2px solid var(--primary);
}

.slide-text {
  padding: 0.5rem;
  outline: none;
}

.slide-text:focus {
  background: rgba(37, 99, 235, 0.05);
}

.ppt-sidebar {
  width: 260px;
  background: white;
  border-left: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

/* Tabs */
.tab-container {
  border-bottom: 1px solid var(--border);
  display: flex;
  background: var(--light);
}

.tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--secondary);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.tab:hover {
  color: var(--dark);
  background: white;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: white;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1001;
}

.toast {
  background: var(--dark);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Track Changes */
.track-changes-panel {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.change-item {
  padding: 0.5rem;
  background: white;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  border-left: 3px solid var(--primary);
}

.change-item .change-type {
  font-weight: 600;
  color: var(--primary);
}

.change-item .change-time {
  color: var(--secondary);
  font-size: 0.75rem;
}

/* Charts */
.chart-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}

/* Animations Panel */
.animation-list {
  list-style: none;
}

.animation-item {
  padding: 0.75rem;
  background: var(--light);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.animation-item:hover {
  background: var(--border);
}

.animation-icon {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
}

/* Speaker Notes */
.speaker-notes {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1rem;
  border-top: 1px solid var(--border);
  height: 150px;
}

.speaker-notes textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: inherit;
  resize: none;
  font-family: inherit;
}

.speaker-notes textarea:focus {
  outline: none;
}

/* Presenter View */
.presenter-view {
  position: fixed;
  inset: 0;
  background: #1e1e1e;
  z-index: 2000;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  padding: 1rem;
}

.presenter-current {
  background: white;
  border-radius: var(--radius);
}

.presenter-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.presenter-next {
  background: #2d2d2d;
  border-radius: var(--radius);
  padding: 1rem;
  flex: 1;
}

.presenter-notes {
  background: #2d2d2d;
  border-radius: var(--radius);
  padding: 1rem;
  flex: 1;
  color: white;
}

.presenter-timer {
  background: #2d2d2d;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: white;
  font-size: 2rem;
  font-family: monospace;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar,
  .ppt-sidebar {
    width: 220px;
  }

  .slide-canvas {
    width: 100%;
    max-width: 720px;
    height: auto;
    aspect-ratio: 16/9;
  }
}

@media (max-width: 768px) {
  .app-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }

  .dashboard-header {
    padding: 1.5rem 1rem;
  }

  .dashboard-header h1 {
    font-size: 1.75rem;
  }

  .app-card {
    padding: 1.5rem;
  }

  .document {
    width: 100%;
    min-height: auto;
    padding: 1rem;
  }

  .document-area {
    padding: 1rem;
  }

  .sidebar,
  .slide-panel,
  .ppt-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    z-index: 1000;
    transition: right 0.3s ease;
    width: 280px;
  }

  .sidebar.mobile-open,
  .slide-panel.mobile-open,
  .ppt-sidebar.mobile-open {
    right: 0;
  }

  .slide-panel {
    left: -100%;
    right: auto;
  }

  .slide-panel.mobile-open {
    left: 0;
    right: auto;
  }

  .toolbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .toolbar-group {
    flex-shrink: 0;
    padding: 0 0.25rem;
  }

  .toolbar-btn {
    min-width: 36px;
    height: 36px;
    padding: 0.5rem;
  }

  .app-header {
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .header-actions .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .file-name {
    width: 100%;
    max-width: none;
  }

  .modal {
    width: 95%;
    max-height: 85vh;
  }

  .slide-editor {
    padding: 0.5rem;
  }

  .slide-canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    max-height: 50vh;
  }

  .formula-bar {
    flex-wrap: wrap;
  }

  .formula-input {
    width: 100%;
    margin-top: 0.5rem;
  }

  .status-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.7rem;
  }

  .tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  /* Mobile Menu Toggle */
  .mobile-menu-btn {
    display: flex;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.25rem;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
  }

  .mobile-overlay.active {
    display: block;
  }
}

@media (max-width: 480px) {
  .dashboard-header h1 {
    font-size: 1.5rem;
  }

  .app-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .feature-list {
    display: none;
  }

  .toolbar-group {
    border-right: none;
  }

  .presenter-view {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 0.5rem;
  }

  .toast {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .toolbar-btn,
  .btn,
  .template-item,
  .dropdown-item {
    min-height: 44px;
    min-width: 44px;
  }

  .dropdown-item {
    padding: 0.75rem 1rem;
  }

  .slide-element {
    min-width: 60px;
    min-height: 44px;
  }
}

/* Print Styles */
@media print {
  .toolbar,
  .app-header,
  .sidebar {
    display: none !important;
  }

  .document-area {
    background: white;
    padding: 0;
  }

  .document {
    box-shadow: none;
    width: 100%;
  }
}

/* Color Picker */
.color-picker-wrapper {
  position: relative;
}

.color-picker-btn {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 100;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item:hover {
  background: var(--light);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* Status Bar */
.status-bar {
  background: var(--light);
  border-top: 1px solid var(--border);
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--secondary);
  display: flex;
  justify-content: space-between;
}

/* Conditional Formatting Legend */
.cf-legend {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  background: var(--light);
  border-radius: 4px;
  margin: 0.5rem 0;
}

.cf-legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.cf-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

/* Spell Check */
.spelling-error {
  text-decoration: wavy underline red;
}

.grammar-error {
  text-decoration: wavy underline green;
}

/* Mail Merge Fields */
.merge-field {
  background: #dbeafe;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.85em;
  border: 1px solid #93c5fd;
}

/* Pivot Table */
.pivot-table {
  border-collapse: collapse;
  width: 100%;
}

.pivot-table th,
.pivot-table td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
}

.pivot-table th {
  background: var(--light);
  font-weight: 600;
}

.pivot-row-header {
  background: #e0f2fe;
}

.pivot-col-header {
  background: #fef3c7;
}

.pivot-value {
  text-align: right;
  font-family: monospace;
}
