/* Tandivo's shared interface. Catalogue typography remains independently configurable. */
:root {
  --font-ui: "basic-sans", "Avenir Next", sans-serif;
  --font-heading: var(--font-ui);
  --bg: #f5f7fa; --surface: #fff; --surface-2: #f8fafc; --surface-3: #edf1f6;
  --text: #202936; --muted: #5f6d7c; --line: #dce2ea; --line-strong: #c4cedb;
  --panel-radius: 12px; --panel-inset: 22px;
}
body[data-theme="dark"] {
  --bg: #151c25; --surface: #1e2733; --surface-2: #19222d; --surface-3: #293444;
  --text: #edf2f8; --muted: #b0bdcc; --line: #354252; --line-strong: #4b5b6e;
}
body { font-family: var(--font-ui); font-weight: 300; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font-family: var(--font-ui); font-weight: 300; }
.page-heading h1, .confirmation-dialog h2, .tutorial-dialog h2, .journey h1,
.site-welcome h1, .site-welcome h2, .site-setup-dialog h2, .access-panel h1, .brand-panel h1,
.form-panel h2, .access-card h2, .modal-header h2,
.company-answer input { font-family: var(--font-ui); font-weight: 300; letter-spacing: -.025em; }
.page-heading h1 { font-size: 30px; line-height: 1.2; margin-bottom: 8px; }
.panel-heading h2, .section-heading-row h2, .editor-section-heading h3,
.settings-content h2, .dashboard-widget h2 { font-family: var(--font-ui); font-weight: 400; letter-spacing: -.015em; }
.btn, .text-button, .mini-button, .nav-item, .nav-item.active, .settings-tab,
.analytics-tab, .field > span, .table-primary, .activity-copy strong, .task-row-title,
.sidebar-bottom .user-info strong, .empty-state strong { font-weight: 400; }
.stat-value, .metric-value, .analytics-metric strong { font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.subheading, .panel-heading p, .field small { font-weight: 300; line-height: 1.55; }
.page-wrap { padding: 28px 32px 32px; max-width: 1600px; margin: 0 auto; }
.page-heading { margin-bottom: 24px; }
.btn { min-height: 40px; padding: 9px 16px; font-size: 14px; border-radius: 7px; }
.text-button, .mini-button { font-size: 13px; }
.data-table { font-size: 14px; }
.data-table th { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); padding-block: 14px; }
.data-table td { padding-block: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.table-secondary { font-size: 12px; line-height: 1.5; }
.data-table tbody tr:hover { background: var(--surface-2); }
.topbar { min-height: 72px; gap: 22px; }
.topbar-brand { text-decoration: none; color: var(--text); flex-shrink: 0; gap: 9px; }
.topbar-brand .brand-logo { width: 28px; height: 28px; object-fit: contain; }
.topbar-brand .brand-copy strong { font-family: var(--font-ui); font-weight: 500; font-size: 22px; letter-spacing: -.8px; }
.topbar-brand .brand-copy span { display: none; }
.topbar .breadcrumb { font-size: 13px; }
.sidebar > .desktop-menu { margin-left: 8px; }
.workspace-avatar { width: 40px; height: 40px; flex: 0 0 40px; overflow: hidden; border-radius: 10px; display: grid; place-items: center; }
.workspace-avatar img { width: 100%; height: 100%; object-fit: contain; }
.workspace-meta { min-width: 0; }
.workspace-meta select { max-width: 100%; }
.nav-item { gap: 12px; align-items: center; }
.nav-icon { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; }
.nav-icon svg { width: 20px; height: 20px; }
.sidebar .nav-label { font-weight: 300; color: var(--muted); }
.nav-item:focus-visible, .topbar-brand:focus-visible, .site-element-toolbar button:focus-visible {
  outline: 2px solid var(--accent-label); outline-offset: 3px;
}
@media (min-width:801px) {
  body.sidebar-collapsed .workspace-switch { display: flex; justify-content: center; padding: 4px 0 14px; }
  body.sidebar-collapsed .workspace-meta { display: none; }
  body.sidebar-collapsed .topbar .brand-copy { display: flex; }
  body.sidebar-collapsed .sidebar > .desktop-menu { align-self: center; margin-left: 0; }
  body.sidebar-collapsed .nav-item { padding: 10px 0; min-height: 42px; }
  body.sidebar-collapsed .user-profile { padding-inline: 0; }
}
/* One focal point; the remaining widgets retain their configurable order and sizes. */
#page-dashboard:has([data-widget="today"]:not([hidden]):not(.permission-hidden)) > .page-heading { display: none; }
.dashboard-widgets { gap: 16px; margin-top: 0; grid-auto-rows: 160px; }
.dashboard-widgets.is-editing { grid-auto-rows: 180px; margin-top: 20px; }
.dashboard-widgets:not(.is-editing) > [data-widget="today"] { grid-column: 1 / -1; grid-row: span 1; order: -1; }
.dashboard-widget.daily-focus {
  padding: 22px 28px; border: 0; color: var(--accent-ink);
  background: linear-gradient(110deg,var(--accent),color-mix(in srgb,var(--accent) 68%,var(--hero-blend,#101e38)));
  box-shadow: none; border-radius: 14px;
}
.daily-focus .widget-content { display: flex; justify-content: space-between; align-items: end; gap: 24px; width: 100%; }
.daily-focus #dashboardGreeting { margin: 0 0 10px; font: 300 21px/1.25 var(--font-ui); letter-spacing: -.025em; color: inherit; }
.daily-focus #dashboardGreeting strong, #dashboardFallbackGreeting strong { font-size: inherit !important; font-weight: 600; letter-spacing: inherit; }
.daily-focus .metric-label { margin: 0 0 2px; color: inherit; font-weight: 300; font-size: 12px; }
.daily-focus #todayRevenue { display: block; font: 300 40px/1.05 var(--font-ui); letter-spacing: -.04em; color: inherit; }
.daily-focus #todayTransactions { margin: 6px 0 0; font-size: 12px; color: inherit; }
.daily-focus .daily-context { text-align: right; max-width: 260px; }
.daily-focus .daily-context p, .daily-focus .daily-context > span:last-child { color: inherit; font-weight: 300; font-size: 12px; }
.dashboard-widgets:not(.is-editing) .daily-focus .daily-context { display: block; }
.dashboard-widget.stat-card { padding: 20px 22px; }
.dashboard-widget .stat-value { margin-top: 12px; font-size: 32px; }
.dashboard-widget .stat-icon { display: none; }
.dashboard-widget .panel-heading { margin-bottom: 12px; }
.dashboard-widget .task-row, .dashboard-widget .activity-row { padding: 9px 0; }
.dashboard-widget .activity-copy p { margin-top: 3px; }
.dashboard-widget h2 { font-size: 17px; }
.dashboard-widget .full-btn { margin-top: 12px; }
.dashboard-widgets.is-editing .daily-focus #dashboardGreeting { font-size: 16px; }
.dashboard-widgets.is-editing .daily-focus { padding: 16px; }
.dashboard-widgets.is-editing .daily-focus #todayRevenue { font-size: 30px !important; }
.dashboard-widgets.is-editing .daily-focus .daily-context { display: none; }
/* Contextual catalogue editing; original controls are moved, never cloned. */
.direct-site-editor .editor-controls, .direct-site-editor .editor-tabs { display: none; }
.direct-site-editor .website-editor-layout { display: block; }
.direct-site-editor .preview-column { min-width: 0; }
.direct-site-editor .preview-shell { width: 100%; max-width: 100%; margin-inline: auto; }
.direct-site-editor .preview-shell.mobile { max-width: 390px; }
.direct-site-editor .editor-toolbar { margin-bottom: 8px; }
.direct-site-editor .editor-controls-footer { position: static; padding: 0; border: 0; justify-content: flex-end; margin-bottom: 16px; }
.direct-site-editor .editor-controls-footer > :first-child { margin-right: auto; }
.editor-help { font-size: 13px; color: var(--muted); margin: 12px 0; max-width: 74ch; }
.site-element-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.site-element-toolbar button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 7px; padding: 7px 12px; min-height: 36px; font-size: 13px; }
.site-element-toolbar button:hover, .site-element-toolbar button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-label); color: var(--accent-label); }
.site-editor-mode { margin-right: auto; display: flex; gap: 6px; }
.site-editor-mode button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-label); }
.website-preview.is-editing [data-edit-element] { cursor: pointer; outline: 2px solid transparent; outline-offset: 5px; transition: outline-color .12s; }
.website-preview.is-editing [data-edit-element]:hover:not(:has([data-edit-element]:hover)),
.website-preview.is-editing [data-edit-element]:focus-visible,
.website-preview.is-editing [data-edit-selected] { outline-color: var(--accent); }
.website-preview.is-editing [data-edit-selected] { outline-style: dashed; }
.website-preview.is-editing .store-hero.no-image { grid-template-columns: 1fr .65fr; }
.website-preview.is-editing .store-hero-deco { position: static; display: grid; place-items: center; width: 100%; height: 150px; border: 1px dashed var(--store-muted); border-radius: 8px; pointer-events: auto; }
.website-preview.is-editing .store-hero-deco:after { content: "Añadir imagen"; border: 1px dashed currentColor; padding: 12px 20px; font: 300 14px/1.5 var(--font-ui); background: #ffffffcc; color: #202936; border-radius: 8px; }
.site-context-panel { position: fixed; z-index: 65; width: min(360px,calc(100vw - 24px)); max-height: min(620px,calc(100dvh - 24px)); overflow: auto; padding: 18px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 16px 50px #0003; }
.site-context-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.site-context-heading h2 { margin: 0; font: 400 18px/1.3 var(--font-ui); }
.site-context-heading button { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); border-radius: 7px; font-size: 22px; }
.site-context-fields { display: grid; gap: 14px; }
.site-context-fields .field { margin: 0; }
.site-context-fields .field > input:not([type=color]), .site-context-fields textarea, .site-context-fields select { width: 100%; font-size: 16px; }
.site-context-fields .toggle-row { margin: 0; padding: 8px 0; }
.site-context-fields .toggle-row strong { font-weight: 400; }
.site-context-fields .toggle-row small { font-weight: 300; }
.site-context-fields .image-upload-preview { max-height: 120px; }
.site-context-fields .image-upload-preview img { max-height: 110px; }
.site-context-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 0; }
.site-context-fields > .btn { justify-self: start; }
.site-context-panel:focus { outline: none; }
.team-dialog .panel-heading h2 { font: 300 24px/1.3 var(--font-ui); }
.website-preview.is-editing.mobile-layout .store-hero.no-image { grid-template-columns: 1fr; }
.website-preview.is-editing.mobile-layout .store-hero-deco { height: 68px; }
@media (max-width:1100px) {
  .page-wrap { padding-inline: 24px; }
  .topbar { gap: 12px; }
  .dashboard-widgets { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .dashboard-widget .stat-top { font-size: 12px; }
}
@media (max-width:980px) {
  .dashboard-widgets { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-widgets:not(.is-editing) [data-widget="tasks"], .dashboard-widgets:not(.is-editing) [data-widget="activity"] { grid-column: span 1; }
  .topbar .today-label { display: none; }
}
@media (max-width:600px) {
  .page-wrap { padding: 20px 16px; }
  .topbar { height: 136px; padding: 10px 16px; gap: 6px 12px; align-content: center; }
  .main-area { padding-top: 136px; }
  .sidebar { top: 136px; height: calc(100dvh - 136px); }
  .topbar-brand .brand-copy { display: flex; }
  .topbar-brand .brand-copy strong { font-size: 20px; }
  .topbar .breadcrumb { flex: 1; font-size: 12px; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .topbar-actions .btn { min-height: 40px; font-size: 13px; padding: 8px 12px; }
  .page-heading h1 { font-size: 27px; }
  .dashboard-widgets { grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: auto; gap: 12px; }
  .dashboard-widgets:not(.is-editing) .dashboard-widget { min-height: 136px; }
  .dashboard-widgets:not(.is-editing) .dashboard-widget:not(.stat-card) { grid-column: 1 / -1; }
  .dashboard-widgets:not(.is-editing) .daily-focus { padding: 24px; min-height: 212px; max-height: none; }
  .daily-focus .widget-content { display: block; }
  .daily-focus #dashboardGreeting { font-size: 20px; }
  .daily-focus #todayRevenue { font-size: 42px !important; }
  .daily-focus .daily-context { text-align: left; max-width: none; }
  .daily-focus .daily-context p { margin: 10px 0 2px; }
  .daily-focus .daily-context > span:last-child { font-size: 11px; }
  .dashboard-widget.stat-card { padding: 18px; }
  .dashboard-widget .stat-value { font-size: 27px; }
  .dashboard-widgets.is-editing { grid-template-columns: 1fr; }
  .site-context-panel { inset: auto 12px 12px !important; width: auto; max-height: 58dvh; border-radius: 16px; padding: 16px; }
  .website-preview.is-editing .store-hero.no-image { grid-template-columns: 1fr; }
  .website-preview.is-editing .store-hero-deco { height: 68px; }
  .site-element-toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 3px 2px 8px; }
  .site-element-toolbar button { white-space: nowrap; flex-shrink: 0; min-height: 40px; }
  .direct-site-editor .editor-controls-footer { flex-wrap: wrap; gap: 8px; }
  .direct-site-editor .editor-controls-footer .btn { flex: 1; font-size: 13px; }
  .direct-site-editor .editor-controls-footer > :first-child { flex-basis: 100%; text-align: left; }
  .direct-site-editor .editor-toolbar { gap: 12px; flex-wrap: wrap; }
  .site-editor-mode button { min-height: 40px; }
}
@media (prefers-reduced-motion:reduce) {
  .website-preview [data-edit-element] { transition: none; }
}
