/* ── FOLIO — components.css ── */

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); }

.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.btn-danger:hover:not(:disabled) { background: #fce8e8; }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 6px; min-width: 32px; justify-content: center; }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  animation: toastIn 0.25s ease;
  max-width: 300px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}
.toast.success { background: var(--accent); }
.toast.error { background: var(--danger); }
.toast.info { background: #2563eb; }

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

/* ── SPINNER ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EXCEL TABLE ── */
.excel-toolbar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.sheets-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.sheet-tab {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}
.sheet-tab:hover { background: var(--accent-light); }
.sheet-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.excel-preview {
  overflow: auto;
  max-height: calc(90vh - 160px);
}
.excel-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.excel-table th {
  background: var(--bg);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border);
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}
.excel-table td {
  padding: 6px 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.excel-table tr:nth-child(even) td { background: #fafaf8; }
.excel-table tr:hover td { background: var(--accent-light); }

/* ── CHART ── */
.chart-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  align-items: center;
  margin-bottom: 16px;
}
.select-sm {
  margin-left: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.chart-wrapper {
  position: relative;
  height: 360px;
}

/* ── PDF VIEWER ── */
.pdf-controls {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.page-info {
  font-size: 12px;
  color: var(--muted);
  min-width: 50px;
  text-align: center;
}
.pdf-modal-body {
  padding: 20px;
  background: #e8e8e8;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 200px;
}
.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--muted);
  font-size: 13px;
}
#pdf-viewer-canvas {
  display: block;
  max-width: 100%;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
}
