/* ==========================================================================
   MathGraph Studio - Modern Dark/Light Theme Stylesheet
   ========================================================================== */

:root {
  /* Dark Theme Colors (Default) */
  --bg-app: #0f141c;
  --bg-sidebar: #151b26;
  --bg-card: #1c2433;
  --bg-card-hover: #242e42;
  --bg-input: #101622;
  --bg-modal: #18202f;
  --bg-overlay: rgba(10, 14, 22, 0.75);

  --border-subtle: #232f44;
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);

  --accent: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --canvas-bg: #090d14;
  --grid-major: rgba(255, 255, 255, 0.12);
  --grid-minor: rgba(255, 255, 255, 0.04);
  --axis-color: rgba(255, 255, 255, 0.65);
  --axis-text: #94a3b8;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', Consolas, Monaco, monospace;

  --header-height: 56px;
  --sidebar-width: 380px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
body.light-theme {
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --bg-overlay: rgba(15, 23, 42, 0.5);

  --border-subtle: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --canvas-bg: #fdfdfd;
  --grid-major: rgba(0, 0, 0, 0.12);
  --grid-minor: rgba(0, 0, 0, 0.04);
  --axis-color: rgba(0, 0, 0, 0.65);
  --axis-text: #475569;
  --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Base Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 30;
  user-select: none;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.logo .badge {
  font-size: 0.65rem;
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Mode Switcher (2D / 3D) */
.mode-switcher {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn svg {
  width: 15px;
  height: 15px;
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.action-btn.sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

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

.action-btn.primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.action-btn.secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.action-btn.secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
}

.icon-btn-sm {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn-sm:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.icon-btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Theme Icon Visibility */
.sun-icon { display: block; }
.moon-icon { display: none; }
body.light-theme .sun-icon { display: none; }
body.light-theme .moon-icon { display: block; }

.mobile-only {
  display: none;
}

/* Main Layout */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 20;
  gap: 1.25rem;
  padding: 1rem;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.section-title svg {
  width: 15px;
  height: 15px;
}

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

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  min-width: 210px;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 50;
}

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

.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.dropdown-menu button:hover {
  background: var(--primary);
  color: white;
}

.dropdown-menu button svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Equation Cards */
.equation-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.eq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
  position: relative;
}

.eq-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.eq-card.disabled {
  opacity: 0.55;
}

.eq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eq-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eq-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.15s ease;
  position: relative;
}

.eq-color-dot input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.eq-color-dot:hover {
  transform: scale(1.2);
}

.eq-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
}

.eq-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.eq-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  gap: 0.5rem;
  transition: border-color 0.2s;
}

.eq-input-group:focus-within {
  border-color: var(--border-focus);
}

.eq-prefix {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.eq-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.eq-input::placeholder {
  color: var(--text-dim);
}

.eq-error {
  font-size: 0.75rem;
  color: var(--danger);
  display: none;
  align-items: center;
  gap: 0.3rem;
}

.eq-card.has-error .eq-error {
  display: flex;
}

.eq-card.has-error .eq-input-group {
  border-color: var(--danger);
}

/* Parametric Inputs Container */
.parametric-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.domain-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.domain-input {
  width: 55px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
}

/* Sliders Section */
.slider-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.slider-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.slider-controls-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.slider-input {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
}

.num-input {
  width: 60px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: center;
}

.num-input.sm {
  width: 50px;
  font-size: 0.78rem;
}

/* Calculus Section */
.calculus-tools {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tool-name {
  font-size: 0.83rem;
  font-weight: 600;
}

.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-subtle);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.custom-select {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
}

.calc-result {
  background: var(--bg-input);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider.round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-subtle);
  transition: 0.2s;
  border-radius: 34px;
}

.slider.round:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider.round {
  background-color: var(--primary);
}

input:checked + .slider.round:before {
  transform: translateX(14px);
}

/* Settings Checkboxes */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.setting-item input[type="checkbox"] {
  accent-color: var(--primary);
}

/* Viewport Area */
.viewport-area {
  flex: 1;
  position: relative;
  background: var(--canvas-bg);
  overflow: hidden;
}

.canvas-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

#graph-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#graph-canvas:active {
  cursor: grabbing;
}

.plot-3d-inner {
  width: 100%;
  height: 100%;
}

.overlay-3d-hint {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Viewport Overlay Controls */
.viewport-overlay-controls {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  z-index: 10;
}

.overlay-btn-group {
  display: flex;
  flex-direction: column;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.overlay-btn {
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.overlay-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.overlay-btn:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.coords-badge {
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  gap: 0.8rem;
  box-shadow: var(--shadow-card);
}

/* Hover Tooltip */
.hover-tooltip {
  position: absolute;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: white;
  pointer-events: none;
  transform: translate(12px, -12px);
  z-index: 20;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-backdrop.show {
  display: flex;
}

.modal-dialog {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.md {
  width: 600px;
}

.modal-dialog.lg {
  width: 820px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Preset Cards */
.preset-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cat-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.cat-btn.active, .cat-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  max-height: 480px;
  overflow-y: auto;
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preset-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.preset-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.preset-card-formula {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
  background: var(--bg-input);
  padding: 3px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.preset-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Data Table */
.table-controls-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.param-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.table-scroll-area {
  max-height: 350px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.data-table th, .data-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th:first-child, .data-table td:first-child {
  text-align: left;
}

.data-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  position: sticky;
  top: 0;
}

.data-table tr:hover {
  background: var(--bg-card-hover);
}

/* Help Content */
.help-content {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.6;
}

.help-content h4 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  margin-bottom: 0.4rem;
  color: var(--primary);
}

.help-content ul {
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.help-table th, .help-table td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-subtle);
}

.help-table th {
  background: var(--bg-card);
  text-align: left;
}

.help-table code {
  font-family: var(--font-mono);
  background: var(--bg-input);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--accent);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) 2.5s forwards;
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 320px;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: flex;
  }

  .modal-dialog.md, .modal-dialog.lg {
    width: 95vw;
  }

  .header-right .action-btn span {
    display: none;
  }
}