/* Georgi — nueva interfaz de escritorio.
   Sistema único: tokens, navegación, espacios de trabajo, componentes y móvil. */

/* 1. Tema y elementos básicos */
:root {
  --bg: #e9ecf1;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #eff2f7;
  --chrome: #f4f5f8;
  --text: #1b2434;
  --muted: #69758a;
  --border: #dce1ea;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e4edff;
  --on-primary: #ffffff;
  --danger: #c83f54;
  --success: #268568;
  --orange: #b47820;
  --shadow: 0 16px 48px #1b284a14;
  --dock-width: 104px;
  --bar-height: 68px;
  --radius: 12px;
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color-scheme: light;
  color: var(--text);
  background: var(--bg);
}
html[data-theme="dark"] {
  --bg: #0d0f13; --canvas: #14171d; --surface: #1b1f27;
  --surface-alt: #232935; --chrome: #11141a;
  --text: #ecf0f7; --muted: #919caf; --border: #2b313d;
  --primary: #74a5ff; --primary-hover: #93baff; --primary-soft: #23334e;
  --on-primary: #101b30; --danger: #fa8b9a; --success: #79c5b0; --orange: #e4b36c;
  --shadow: 0 24px 80px #00000050;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0d0f13; --canvas: #14171d; --surface: #1b1f27;
    --surface-alt: #232935; --chrome: #11141a;
    --text: #ecf0f7; --muted: #919caf; --border: #2b313d;
    --primary: #74a5ff; --primary-hover: #93baff; --primary-soft: #23334e;
    --on-primary: #101b30; --danger: #fa8b9a; --success: #79c5b0; --orange: #e4b36c;
    --shadow: 0 24px 80px #00000050;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 29px; line-height: 1.2; font-weight: 650; letter-spacing: -.04em; }
h2 { font-size: 16px; font-weight: 620; letter-spacing: -.015em; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 10px 0; }
small { font-size: 12px; }
strong { font-weight: 600; }
svg.icon { flex: none; width: 20px; height: 20px; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
#main:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 500; left: 20px; top: -70px; padding: 12px 20px; background: var(--primary); color: var(--on-primary); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.muted, .caption, .help-text, .empty-copy, .chart-caption { color: var(--muted); }
.caption, .help-text, .chart-caption, .small { font-size: 12px; }
.text-link { color: var(--primary); }
.text-danger { color: var(--danger); }
.full-width { width: 100%; }
code, pre { font-family: "Cascadia Code", Consolas, monospace; font-size: .9em; }
code { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; }
kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
button:disabled, .btn:disabled { opacity: .4; cursor: default; }
.btn, .icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 8px; border: 1px solid transparent; font-weight: 550; text-decoration: none; transition: background .15s, border-color .15s; }
.btn { min-height: 38px; padding: 8px 15px; border-radius: 8px; font-size: 13px; }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn.secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.secondary:hover { background: var(--surface-alt); border-color: var(--muted); }
.btn.danger, .btn.danger-quiet { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.icon-btn:hover, .icon-btn.selected { background: var(--surface-alt); color: var(--text); }
.small-btn { min-height: 32px; padding: 5px 11px; font-size: 12px; }
.back-link { display: inline-flex; color: var(--muted); margin-bottom: 20px; font-size: 13px; }

/* 2. Barra global y dock lateral */
.topbar { position: fixed; inset: 0 0 auto; height: var(--bar-height); z-index: 70; display: grid; grid-template-columns: 1fr minmax(240px, 420px) 1fr; align-items: center; gap: 24px; padding: 0 25px; background: var(--bg); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { justify-content: flex-end; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 33px; height: 33px; display: flex; align-items: center; justify-content: center; flex: none; background: linear-gradient(180deg, #40216d 0%, #a476e4 100%); border-radius: 10px; color: white; font-size: 27px; font-weight: 750; line-height: 1; letter-spacing: -2px; padding-right: 3px; padding-bottom: 4px; }
.brand-mark span { color: #d9c4ff; }
.brand-text { font-size: 16px; font-weight: 650; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--canvas); padding: 0 12px; height: 37px; color: var(--muted); }
.top-search .icon { width: 17px; height: 17px; }
.top-search input { width: 100%; min-width: 0; background: none; border: 0; outline: 0; padding: 0; font-size: 12px; color: var(--text); }
.top-search:focus-within { border-color: var(--primary); }
.mobile-search { display: none; }
.profile-menu { position: relative; }
.topbar-avatar, .avatar { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); border-radius: 50%; font-size: 13px; font-weight: 650; }
.topbar-avatar { position: relative; list-style: none; }
summary::-webkit-details-marker { display: none; }
.profile-popover { position: absolute; top: 46px; right: 0; width: 270px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); z-index: 100; }
.profile-identity { display: flex; align-items: center; gap: 12px; padding: 12px 10px 17px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.profile-identity small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.profile-popover > a, .profile-popover > button, .profile-popover > form > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 10px; border: 0; background: none; border-radius: 7px; font-size: 13px; text-align: left; color: var(--text); }
.profile-popover > a:hover, .profile-popover > button:hover, .profile-popover > form > button:hover { background: var(--surface-alt); }
.profile-popover > .profile-logout { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.sidebar { position: fixed; left: 12px; top: calc(var(--bar-height) + 9px); bottom: 18px; width: var(--dock-width); z-index: 60; background: var(--chrome); border: 1px solid var(--border); border-radius: 16px; padding: 8px 6px; }
.main-nav { display: flex; flex-direction: column; gap: 5px; height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.nav-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 64px; padding: 9px 5px; border-radius: 10px; color: var(--muted); text-align: center; }
.nav-link span { font-size: 10px; line-height: 1.25; max-width: 100%; }
.nav-link .icon { width: 21px; height: 21px; }
.nav-link:hover { background: var(--surface-alt); color: var(--text); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.sidebar-small { --dock-width: 60px; }
.sidebar-small .nav-link { min-height: 44px; padding: 10px 4px; }
.sidebar-small .nav-link span { display: none; }
.sidebar-overlay { display: none; }
.app-shell { margin-left: calc(var(--dock-width) + 30px); padding: calc(var(--bar-height) + 9px) 18px 18px 0; min-height: 100vh; }
.main-content { min-height: calc(100vh - var(--bar-height) - 27px); background: var(--canvas); border: 1px solid var(--border); border-radius: 16px; padding: 32px; min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 29px; min-width: 0; }
.page-heading > div { min-width: 0; }
.page-heading h1 { overflow-wrap: anywhere; }
.page-date, .section-caption { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.spaced-panel { padding: 24px; margin: 22px 0; }
.spaced-panel > h2 { margin-bottom: 18px; }
.two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.two-col > .spaced-panel { margin: 0; }

/* 3. Inicio: widgets de trabajo */
.dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; align-items: start; }
.dashboard-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-width: 0; }
.widget-heading { margin: 0; min-height: 49px; padding: 6px 12px; background: color-mix(in srgb, var(--surface-alt) 55%, var(--surface)); border-bottom: 1px solid var(--border); gap: 10px; }
.widget-heading h2 { flex: 1; font-size: 13px; min-width: 0; }
.widget-heading h2 a { display: inline-flex; gap: 9px; align-items: center; }
.widget-heading h2 .icon { width: 17px; height: 17px; color: var(--muted); }
.widget-heading .icon-btn { width: 27px; height: 27px; }
.widget-heading .widget-open .icon { width: 15px; height: 15px; }
.drag-handle { color: var(--muted); font-size: 18px; line-height: 1; cursor: grab; touch-action: none; }
.card-tools { display: flex; align-items: center; gap: 2px; opacity: 0; }
.dashboard-card:hover .card-tools, .dashboard-card:focus-within .card-tools { opacity: 1; }
.widget-content { padding: 24px; }
.large-number { font-size: 38px; line-height: 1.15; letter-spacing: -.055em; font-weight: 600; display: block; font-variant-numeric: tabular-nums; }
.finance-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-bottom: 25px; }
.finance-head .muted { font-size: 12px; display: block; margin-bottom: 9px; }
.finance-head > div:last-child { text-align: right; }
.finance-head > div:last-child strong { color: var(--primary); font-size: 18px; font-weight: 550; }
.split-row, .agenda-row, .task-row, .habit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.split-row:last-child, .agenda-row:last-child, .task-row:last-child, .habit-row:last-child { border-bottom: 0; }
.split-row { font-size: 13px; }
.split-row > * { min-width: 0; overflow-wrap: anywhere; }
.agenda-row { justify-content: flex-start; align-items: flex-start; font-size: 13px; }
.agenda-date { flex: 0 0 80px; color: var(--primary); font-size: 12px; font-weight: 550; }
.agenda-date small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.inline-metrics { display: flex; gap: 40px; margin-bottom: 20px; }
.inline-metrics strong { display: block; font-size: 34px; letter-spacing: -.04em; line-height: 1.2; }
.inline-metrics span { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.task-row { justify-content: flex-start; }
.task-row::before { content: ""; width: 12px; height: 12px; border: 1px solid var(--muted); border-radius: 4px; flex: none; }
.task-row small { margin-left: auto; color: var(--muted); }
.habit-row { justify-content: flex-start; font-size: 13px; padding: 11px 0; }
.habit-check { width: 24px; height: 24px; background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; }
.habit-check.checked { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.simple-list > .large-number { margin-bottom: 18px; }
.simple-list p { padding: 9px 0; margin: 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.simple-list p:last-of-type { border-bottom: 0; }
.card-picker { position: relative; flex: none; }
.card-picker > summary { list-style: none; }
.picker-popover { position: absolute; right: 0; top: 49px; z-index: 35; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 12px; padding: 22px; width: 340px; max-width: calc(100vw - 40px); }
.picker-popover h2 { margin-bottom: 16px; }
.card-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 14px 0 20px; }
.card-options label { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 34px; padding: 5px 2px; }
.dashboard-empty { grid-column: 1/-1; }
.dashboard-card.dragging, .module-switch-row.dragging, .kanban-task.dragging { opacity: .3; }
.drop-target { outline: 2px dashed var(--primary); outline-offset: 3px; }
.pointer-drag-label { position: fixed; z-index: 1000; padding: 12px 18px; background: var(--primary); color: var(--on-primary); border-radius: 9px; box-shadow: var(--shadow); pointer-events: none; }
.is-pointer-dragging { cursor: grabbing; user-select: none; }

/* 4. Listas, pestañas y resúmenes */
.module-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 5px; background: var(--surface-alt); border-radius: 10px; width: fit-content; max-width: 100%; margin-bottom: 27px; }
.module-tabs a { font-size: 12px; color: var(--muted); padding: 8px 15px; border-radius: 7px; white-space: nowrap; }
.module-tabs a:hover { color: var(--text); }
.module-tabs a.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px #00000010; }
.money-tabs + .module-tabs { display: none; }
.summary-grid { display: flex; border: 1px solid var(--border); border-radius: 12px; padding: 22px 0; margin-bottom: 26px; background: var(--surface); overflow: hidden; }
.stat-card { flex: 1; padding: 0 25px; border-right: 1px solid var(--border); min-width: 0; }
.stat-card:last-child { border-right: 0; }
.stat-card > span { font-size: 12px; color: var(--muted); display: block; margin-bottom: 10px; }
.stat-card > strong { display: block; font-size: 28px; letter-spacing: -.04em; font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.records-panel { background: transparent; border-radius: 10px; overflow: hidden; }
.records-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 15px; background: var(--surface); border-bottom: 1px solid var(--border); }
.filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-width: 0; }
.records-toolbar .filter-form { flex: 1; }
.table-actions { display: flex; align-items: center; gap: 6px; }
.search-field { display: flex; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: 7px; padding: 0 9px; background: var(--canvas); }
.search-field .icon { width: 16px; height: 16px; color: var(--muted); }
.search-field input { border: 0; background: none; padding-left: 0; width: 145px; }
.filter-form input, .filter-form select { font-size: 12px; min-height: 34px; }
.date-filter { position: relative; font-size: 12px; }
.date-filter summary { padding: 7px 10px; color: var(--muted); }
.date-filter[open] { border: 1px solid var(--border); background: var(--surface-alt); padding: 5px 10px; border-radius: 8px; }
.date-filter label { display: inline-flex; align-items: center; gap: 5px; margin: 5px; }
.table-scroll { position: relative; max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.data-table th { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--canvas); padding: 13px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 15px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--surface-alt); }
.data-table td:first-child { min-width: 170px; }
.data-table .icon-btn { width: 29px; height: 29px; }
.data-table .icon-btn .icon { width: 16px; height: 16px; }
.record-title { font-weight: 550; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 5px; background: var(--surface-alt); color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.badge-paid, .badge-done, .badge-completada { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.priority-high, .badge-high { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.table-foot, .pagination { padding: 13px 18px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; }
.empty-state, .mini-empty { text-align: center; padding: 55px 24px; color: var(--muted); }
.empty-state h2, .mini-empty h2 { color: var(--text); margin-bottom: 9px; }
.empty-state .btn { margin-top: 16px; }
.empty-state .empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; background: var(--surface-alt); border-radius: 15px; margin-bottom: 20px; color: var(--primary); }
.feature-links { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 18px 0; }

/* 5. Formularios e inspector */
:where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) { border: 1px solid var(--border); background: var(--canvas); border-radius: 7px; color: var(--text); padding: 9px 11px; max-width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; flex: none; }
input[type=color] { min-height: 40px; }
textarea { resize: vertical; min-height: 105px; }
.form-panel { padding: 27px; max-width: 920px; margin: 0 auto 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.form-field > label, .form-field > fieldset > legend { font-size: 12px; font-weight: 550; }
.form-field input, .form-field select, .form-field textarea { width: 100%; }
.form-field input[type=checkbox], .form-field input[type=radio] { width: 16px; height: 16px; min-height: 16px; }
.form-field > .help-text { font-size: 11px; font-weight: 400; }
.full-field { grid-column: 1/-1; }
.checkbox-field { justify-content: center; }
.checkbox-field label, .checkbox-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.checkbox-field input { width: 16px; }
.choice-fieldset, .recurrence-scope, .scope-options { min-width: 0; padding: 16px; margin: 0; border: 1px solid var(--border); border-radius: 9px; }
.choice-fieldset label, .recurrence-scope label, .scope-options label { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 9px 0; }
.recurrence-scope { margin-bottom: 25px; }
.form-actions, .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.field-errors, .errorlist { color: var(--danger); font-size: 12px; margin: 3px 0; list-style: none; padding-left: 0; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.required { color: var(--primary); padding-left: 3px; }
.message.error, .callout { padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--danger) 7%, transparent); font-size: 13px; }
.message.error { color: var(--danger); margin-bottom: 20px; }
.stack-form { display: grid; gap: 22px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 55px !important; }
.password-wrap button { position: absolute; right: 5px; top: 5px; bottom: 5px; background: none; color: var(--muted); border: 0; padding: 0 10px; font-size: 11px; border-radius: 4px; }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
dialog::backdrop { background: #00000060; backdrop-filter: blur(3px); }
.record-modal { position: fixed; inset: 16px 16px 16px auto; width: min(770px,calc(100vw - 160px)); max-width: none; max-height: none; height: calc(100dvh - 32px); margin: 0; padding: 0; border-radius: 15px; overflow: hidden; }
.record-modal[open] { display: flex; flex-direction: column; }
.record-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--chrome); flex: none; }
.record-modal-header h2 { font-size: 15px; font-weight: 550; }
.record-modal-content { overflow-y: auto; padding: 28px; min-height: 0; flex: 1; overscroll-behavior: contain; }
.record-modal-content .page-heading, .record-modal-content > .back-link { display: none; }
.record-modal-content .form-panel { margin: 0; padding: 0; border: 0; background: none; max-width: none; }
.record-modal-content .detail-layout { grid-template-columns: minmax(0,1fr); }
.record-modal-content .detail-panel { padding: 20px; }
.record-modal-content .detail-actions { border: 0; padding: 20px 0 0; }
.action-confirm, .app-dialog { width: min(480px,calc(100vw - 32px)); border-radius: 14px; padding: 25px; max-height: calc(100dvh - 40px); overflow-y: auto; }
.action-confirm p { color: var(--muted); margin-top: 15px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-head h2 { font-size: 18px; }
.scope-options { margin-top: 20px; }
.record-modal .empty-state { padding: 30px 0; }
.confirm-panel { padding: 30px; max-width: 650px; margin: 0 auto; }
.danger-icon { color: var(--danger); }
.save-status { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.save-status:empty { display: none; }

/* 6. Fichas, gráficos y herramientas */
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 22px; align-items: start; }
.detail-panel, .detail-actions { padding: 25px; }
.detail-actions { display: grid; gap: 12px; }
.detail-actions > h2 { font-size: 13px; margin-bottom: 5px; color: var(--muted); }
.detail-actions .btn { width: 100%; }
.detail-grid { margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 24px; }
.detail-grid > div { padding: 15px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.detail-grid dt { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.detail-grid dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.progress-track { height: 7px; background: var(--surface-alt); border-radius: 7px; overflow: hidden; margin: 12px 0; }
.progress-track > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.equivalent-info span { display: flex; justify-content: space-between; font-size: 11px; padding: 8px 0; color: var(--muted); }
.hub-section { padding: 25px; margin-bottom: 22px; }
.hub-section > h2 { margin-bottom: 20px; }
.hub-section > h3 { margin: 20px 0 12px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr)); gap: 16px; }
.hub-tool { padding: 20px; }
.hub-tool h3 { margin-bottom: 16px; }
.hub-inline { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.hub-inline > label, .hub-inline > p { display: grid; gap: 7px; flex: 1 1 140px; min-width: 0; margin: 0; font-size: 12px; }
.hub-inline input, .hub-inline select { width: 100%; }
.hub-inline .errorlist { color: var(--danger); }
.hub-row { display: flex; align-items: center; gap: 15px; justify-content: space-between; flex-wrap: wrap; padding: 15px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.hub-row:last-child { border-bottom: 0; }
.hub-row small { display: block; color: var(--muted); margin-top: 3px; }
.hub-row > div, .hub-row > a { overflow-wrap: anywhere; min-width: 0; }
.number-with-label strong { font-size: 36px; letter-spacing: -.04em; }
.number-with-label > span { display: block; color: var(--muted); }
.weather-emoji { font-size: 30px; display: block; margin: 12px 0; }
.weather-day { font-size: 12px; color: var(--muted); }
.chart { padding: 12px 0; max-width: 100%; }
.chart svg { width: 100%; height: auto; display: block; max-height: 240px; overflow: visible; }
.chart-grid-line { stroke: var(--border); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 9px; }
.chart-bar { fill: var(--primary); opacity: .65; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2; }
.chart-point { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.chart-data { font-size: 11px; color: var(--muted); padding: 8px 0; }
.chart-data ul { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 8px 0; }
.habit-history { display: flex; gap: 5px; flex-wrap: wrap; }
.habit-day { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--surface-alt); color: var(--muted); border-radius: 5px; font-size: 10px; }
.habit-day.complete { background: var(--primary-soft); color: var(--primary); }
.heatmap-scroll { position: relative; max-width: 100%; overflow-x: auto; padding: 12px 0; }
.habit-heatmap { border-collapse: separate; border-spacing: 3px; min-width: 740px; }
.habit-heatmap th { color: var(--muted); font-size: 10px; padding-right: 8px; }
.heat-cell { width: 12px; height: 12px; min-width: 12px; border-radius: 3px; background: var(--surface-alt); }
.heat-cell.level-1 { background: color-mix(in srgb,var(--primary) 25%,var(--surface)); }
.heat-cell.level-2 { background: color-mix(in srgb,var(--primary) 50%,var(--surface)); }
.heat-cell.level-3 { background: color-mix(in srgb,var(--primary) 75%,var(--surface)); }
.heat-cell.level-4 { background: var(--primary); }
.heat-cell.outside { opacity: .2; }
.heat-legend { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.heat-legend i { display: inline-block; }

 .weather-temperature { display: flex; gap: 15px; align-items: center; margin-top: 8px; }
.weather-temperature > span { font-size: 36px; }
.weather-temperature strong { font-size: 39px; font-weight: 550; letter-spacing: -.05em; }
.weather-now p { font-size: 12px; color: var(--muted); margin: 0 0 23px; }
.weather-forecast { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--border); padding-top: 19px; gap: 20px; }
.weather-forecast > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.weather-forecast > div > span:first-child { color: var(--muted); font-size: 10px; }
.weather-forecast strong { grid-column: 1/-1; font-size: 15px; font-weight: 500; }
.weather-credit { display: inline-block; font-size: 10px; color: var(--muted); margin-top: 19px; }

/* 7. Biblioteca y recetas */
.library-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 0 0 22px; }
.library-view-tabs { display: flex; gap: 24px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.library-view-tabs a { color: var(--muted); font-size: 13px; padding: 0 0 13px; border-bottom: 2px solid transparent; }
.library-view-tabs a.active { border-color: var(--primary); color: var(--text); }
.library-heading, .library-row { display: grid; grid-template-columns: minmax(0,1fr) 120px 90px 35px; gap: 20px; align-items: center; }
.library-heading { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 20px 12px; }
.library-list { border-top: 1px solid var(--border); }
.library-row { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.library-row:hover { background: var(--surface); }
.library-title { display: flex; align-items: center; gap: 17px; min-width: 0; }
.library-symbol { width: 46px; height: 56px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; border-radius: 6px; flex: none; background: var(--surface-alt); color: var(--primary); }
.library-symbol.series { color: #b9a4e8; }
.library-title > div { min-width: 0; }
.library-title h2 { font-size: 14px; margin-bottom: 4px; overflow-wrap: anywhere; }
.library-title p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.library-score { font-size: 13px; font-variant-numeric: tabular-nums; }
.library-score span { color: var(--muted); font-size: 11px; }
.library-progress { font-size: 10px; margin-top: 5px; color: var(--muted); }
.library-total { font-size: 11px; color: var(--muted); padding: 18px 20px; }
.recommendation-list { counter-reset: recommendations; }
.recommendation-row { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--border); padding: 24px 6px; }
.recommendation-row::before { counter-increment: recommendations; content: counter(recommendations, decimal-leading-zero); font-size: 30px; line-height: 1; letter-spacing: -.04em; color: var(--muted); opacity: .45; width: 46px; flex: none; }
.recommendation-info { flex: 1; min-width: 0; }
.recommendation-info h2 { font-size: 17px; margin: 4px 0 7px; }
.recommendation-info p, .media-kind { font-size: 11px; color: var(--muted); }
.media-taste { padding: 17px 20px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 10px; background: var(--surface); }
.media-taste > summary { font-size: 13px; }
.media-taste .card-options { grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); }
.recipes-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 20px; }
.recipe-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.recipe-cover { display: flex; align-items: center; justify-content: space-between; height: 94px; background: var(--surface-alt); padding: 24px; color: var(--primary); }
.recipe-cover > .icon { width: 30px; height: 30px; }
.recipe-cover > span { color: var(--muted); font-size: 11px; }
.recipe-content { padding: 22px; }
.recipe-content h2 { font-size: 18px; margin-bottom: 12px; }
.recipe-content .recipe-summary { color: var(--muted); font-size: 12px; min-height: 38px; margin-bottom: 20px; }
.recipe-meta { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 11px; margin-bottom: 20px; }
.recipe-meta .icon { width: 14px; height: 14px; }

/* 8. Ajustes y tableros */
.settings-layout { display: grid; grid-template-columns: 150px minmax(0,850px); gap: 35px; align-items: start; }
.settings-nav { position: sticky; top: 95px; display: grid; gap: 5px; font-size: 13px; }
.settings-nav a { display: flex; align-items: center; gap: 9px; padding: 11px 12px; color: var(--muted); border-radius: 7px; }
.settings-nav a:hover { color: var(--text); background: var(--surface-alt); }
.settings-nav .icon { width: 16px; height: 16px; }
.settings-section { padding: 26px; margin-bottom: 22px; scroll-margin-top: 90px; }
.settings-section > h2 { margin-bottom: 24px; font-size: 18px; }
.settings-section .form-grid { margin-bottom: 25px; }
.module-switch-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.module-switch-row:last-child { border-bottom: 0; }
.module-icon { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; color: var(--muted); background: var(--surface-alt); border-radius: 8px; flex: none; }
.module-icon .icon { width: 18px; height: 18px; }
.module-copy { flex: 1; min-width: 0; }
.module-copy h3 { font-size: 13px; font-weight: 500; }
.module-controls, .module-order-actions { display: flex; align-items: center; gap: 7px; }
.module-order-actions .icon-btn { width: 28px; height: 28px; }
.order-grip { color: var(--muted); font-size: 21px; cursor: grab; touch-action: none; padding: 0 8px; }
.switch { display: inline-flex; align-items: center; width: 35px; height: 21px; border-radius: 20px; border: 0; padding: 3px; background: var(--border); }
.switch span { width: 15px; height: 15px; background: var(--muted); border-radius: 50%; transition: transform .15s; }
.switch.is-on { background: var(--primary); }
.switch.is-on span { transform: translateX(14px); background: var(--on-primary); }
.kanban-board { display: grid; grid-template-columns: repeat(3,minmax(230px,1fr)); overflow-x: auto; gap: 16px; padding: 20px; }
.kanban-lane { background: var(--surface-alt); border-radius: 10px; min-width: 230px; padding: 15px 12px; }
.kanban-lane > h2 { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 0 3px 14px; }
.kanban-lane > h2 small { margin-left: auto; font-size: 10px; color: var(--muted); }
.lane-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.lane-dot.in_progress { background: var(--primary); }
.lane-dot.done { background: var(--success); }
.kanban-dropzone { min-height: 180px; }
.kanban-task { position: relative; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.kanban-task h3 { margin: 12px 0 8px; font-size: 14px; }
.kanban-task p { font-size: 12px; color: var(--muted); }
.kanban-task small { font-size: 10px; color: var(--muted); }
.kanban-grip { position: absolute; right: 10px; top: 10px; color: var(--muted); cursor: grab; touch-action: none; padding: 3px 5px; }
.kanban-status-form { display: flex; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.kanban-status-form select { width: 100%; font-size: 11px; padding: 6px; }
.lane-empty { color: var(--muted); font-size: 12px; padding: 15px 3px; }

/* 9. Calendario */
.calendar-sources { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.source-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; font-size: 11px; }
.source-chip input { width: 13px; height: 13px; }
.calendar-panel { padding: 22px; }
.fc { --fc-border-color: var(--border); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--canvas); --fc-today-bg-color: color-mix(in srgb,var(--primary) 7%,var(--surface)); --fc-list-event-hover-bg-color: var(--surface-alt); --fc-button-bg-color: var(--surface); --fc-button-border-color: var(--border); --fc-button-text-color: var(--muted); --fc-button-hover-bg-color: var(--surface-alt); --fc-button-hover-border-color: var(--muted); --fc-button-active-bg-color: var(--primary-soft); --fc-button-active-border-color: var(--primary-soft); --fc-event-border-color: var(--primary); --fc-event-bg-color: var(--primary); --fc-event-text-color: var(--on-primary); font-size: 12px; }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.fc .fc-button { font-size: 11px; border-radius: 6px; padding: 7px 11px; box-shadow: none !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: var(--primary); }
.fc .fc-col-header-cell-cushion { font-size: 10px; text-transform: uppercase; font-weight: 500; color: var(--muted); padding: 13px 4px; }
.fc .fc-daygrid-day-number { font-size: 11px; padding: 9px; }
.fc .fc-daygrid-day-top { flex-direction: row; }
.fc .fc-daygrid-event { font-size: 10px; border-radius: 4px; padding: 2px 3px; margin: 2px 4px; }
.fc .fc-list-day-cushion, .fc .fc-timegrid-axis-cushion, .fc .fc-timegrid-slot-label-cushion { color: var(--muted); font-size: 11px; }
.fc .fc-scrollgrid { border-radius: 8px; overflow: hidden; }
.fc .fc-timegrid-slot { height: 35px; }
.calendar-movable { cursor: grab; }
.calendar-readonly { cursor: pointer; }
.scope-options legend { font-size: 12px; color: var(--muted); }

/* 10. Búsqueda, avisos y acceso */
.search-panel { padding: 25px; }
.big-search { display: flex; align-items: center; gap: 12px; }
.big-search input { flex: 1; min-width: 0; }
.search-result { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); padding: 16px 0; }
.search-result > span:nth-child(2) { flex: 1; min-width: 0; }
.search-result small { display: block; color: var(--muted); margin-top: 4px; font-size: 11px; }
.notice-history-item { align-items: flex-start; padding: 20px 0; }
.notice-history-item.unread { border-left: 3px solid var(--primary); padding-left: 17px; }
.notice-history-item p { overflow-wrap: anywhere; }
.toast-region { position: fixed; right: 25px; top: 82px; width: min(370px,calc(100vw - 32px)); display: grid; gap: 10px; z-index: 1000; pointer-events: none; }
.notice-toast { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 17px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow); overflow: hidden; pointer-events: auto; }
.notice-mark { display: flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex: none; background: var(--primary-soft); color: var(--primary); border-radius: 50%; font-size: 12px; }
.level-error .notice-mark { color: var(--danger); background: color-mix(in srgb,var(--danger) 15%,transparent); }
.notice-body { flex: 1; min-width: 0; }
.notice-body p { margin: 0 0 7px; font-size: 12px; overflow-wrap: anywhere; }
.notice-history { font-size: 10px; color: var(--muted); }
.notice-close { background: none; border: 0; padding: 0 3px; font-size: 20px; line-height: 1; color: var(--muted); }
.notice-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--primary); transform-origin: left; }
.auth-main { min-height: 100dvh; display: grid; place-items: center; padding: 30px; }
.access-window { width: min(400px,100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.access-brand { display: flex; align-items: center; gap: 12px; padding: 20px 27px; border-bottom: 1px solid var(--border); background: var(--chrome); font-size: 15px; }
.access-content { padding: 32px; }
.access-content h1 { font-size: 25px; margin-bottom: 27px; }
.access-content .btn.primary { margin-top: 3px; }
.setup-notice { color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.setup-notice h2 { color: var(--text); }

/* 11. Adaptación táctil y pantallas pequeñas */
@media (min-width: 1500px) {
  .main-content { padding: 38px 44px; }
  .dashboard-grid { gap: 24px; }
}
@media (max-width: 1100px) {
  .main-content { padding: 26px; }
  .topbar { gap: 20px; }
  .dashboard-grid { gap: 16px; }
  .widget-content { padding: 20px; }
  .large-number { font-size: 32px; }
  .detail-layout { grid-template-columns: minmax(0,1fr) 220px; }
  .settings-layout { grid-template-columns: 120px minmax(0,1fr); gap: 20px; }
  .stat-card { padding: 0 19px; }
  .stat-card > strong { font-size: 24px; }
}
@media (max-width: 900px) {
  :root { --bar-height: 62px; }
  .topbar { padding: 0 16px; grid-template-columns: 1fr auto; gap: 12px; border-bottom: 1px solid var(--border); }
  .topbar-left { gap: 8px; }
  .top-search { display: none; }
  .mobile-search { display: inline-flex; }
  .topbar-right { gap: 10px; }
  .brand-text { font-size: 14px; }
  .brand-mark { width: 30px; height: 30px; font-size: 24px; border-radius: 9px; }
  .sidebar { top: 73px; left: 12px; bottom: 12px; width: 265px; transform: translateX(calc(-100% - 30px)); transition: transform .18s; padding: 12px; box-shadow: var(--shadow); z-index: 85; }
  .menu-open .sidebar { transform: none; }
  .nav-link, .sidebar-small .nav-link { flex-direction: row; justify-content: flex-start; padding: 12px; min-height: 44px; gap: 14px; text-align: left; }
  .nav-link span, .sidebar-small .nav-link span { display: block; font-size: 13px; }
  .nav-link .icon { width: 19px; height: 19px; }
  .menu-open .sidebar-overlay { display: block; position: fixed; inset: var(--bar-height) 0 0; z-index: 80; border: 0; background: #00000065; backdrop-filter: blur(2px); }
  .app-shell { margin-left: 0; padding: calc(var(--bar-height) + 12px) 12px 12px; }
  .main-content { min-height: calc(100dvh - var(--bar-height) - 24px); }
  .record-modal { width: min(700px,calc(100vw - 32px)); }
  .card-tools { opacity: 1; }
  .settings-nav { top: 84px; }
  .toast-region { top: 74px; right: 16px; }
}
@media (max-width: 620px) {
  h1 { font-size: 25px; }
  .brand-text { max-width: 130px; }
  .topbar-right { gap: 7px; }
  .topbar-left { gap: 5px; }
  .topbar .icon-btn { width: 31px; }
  .app-shell { padding: var(--bar-height) 0 0; }
  .main-content { border: 0; border-radius: 0; padding: 24px 18px; min-height: calc(100dvh - var(--bar-height)); }
  .page-heading { gap: 12px; margin-bottom: 24px; align-items: flex-start; }
  .page-heading > .btn { font-size: 11px; padding: 8px 11px; min-height: 36px; }
  .page-date { font-size: 11px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .widget-content { padding: 22px; }
  .widget-heading { padding: 6px 12px; }
  .picker-popover { width: min(340px,calc(100vw - 36px)); }
  .card-picker .btn { font-size: 11px; padding: 8px 11px; }
  .summary-grid { padding: 18px 0; margin-bottom: 20px; }
  .stat-card { padding: 0 12px; }
  .stat-card > strong { font-size: 20px; }
  .stat-card > span { font-size: 10px; min-height: 30px; margin-bottom: 6px; }
  .module-tabs { gap: 2px; padding: 4px; width: 100%; margin-bottom: 23px; }
  .module-tabs a { font-size: 11px; padding: 7px 10px; }
  .records-toolbar { padding: 12px; align-items: stretch; }
  .filter-form { gap: 7px; }
  .filter-form input:not([type=checkbox]), .filter-form select { min-height: 38px; max-width: 100%; }
  .filter-form > input, .filter-form > select { flex: 1 1 125px; width: 125px; }
  .filter-form .search-field { flex: 1 1 100%; }
  .search-field input { width: 100%; }
  .table-actions { margin-left: auto; }
  .data-table td, .data-table th { padding: 13px 12px; font-size: 12px; }
  .detail-layout, .form-grid, .two-col { grid-template-columns: minmax(0,1fr); }
  .detail-grid { column-gap: 14px; }
  .form-panel, .detail-panel, .detail-actions, .spaced-panel { padding: 20px; }
  .full-field { grid-column: auto; }
  .record-modal { inset: 8px 8px 8px auto; width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 12px; }
  .record-modal-header { padding: 12px 17px; }
  .record-modal-content { padding: 22px 18px; }
  .record-modal-header h2 { font-size: 14px; }
  .form-actions { position: sticky; bottom: -22px; background: var(--surface); padding: 16px 0; }
  .form-actions .btn { flex: 1; }
  .form-field input, .form-field select, .form-field textarea, .password-wrap input { font-size: 16px; min-height: 42px; }
  .form-field .checkbox-field input { min-height: 16px; }
  .hub-section { padding: 20px; }
  .hub-row { gap: 10px; align-items: flex-start; }
  .hub-inline > label { flex-basis: 100%; }
  .calendar-panel { padding: 12px; }
  .fc .fc-header-toolbar { flex-wrap: wrap; gap: 14px; }
  .fc .fc-toolbar-chunk:nth-child(2) { order: -1; width: 100%; }
  .fc .fc-icon { font-family: inherit !important; font-size: 24px; line-height: .8; }
.fc .fc-toolbar-title { font-size: 19px; }
  .fc .fc-button { font-size: 10px; padding: 6px 8px; }
  .fc .fc-daygrid-event { font-size: 9px; margin: 1px; }
  .calendar-sources { gap: 5px; }
  .source-chip { font-size: 10px; padding: 6px 8px; }
  .library-heading { display: none; }
  .library-row { grid-template-columns: minmax(0,1fr) 32px; gap: 10px; padding: 19px 0; }
  .library-title { gap: 12px; grid-column: 1; }
  .library-symbol { width: 37px; height: 47px; }
  .library-row > .library-state { grid-column: 1; padding-left: 49px; margin-top: -7px; }
  .library-row > .library-score { grid-column: 1; padding-left: 49px; }
  .library-row > .icon-btn { grid-column: 2; grid-row: 1/4; align-self: center; }
  .library-title h2 { font-size: 14px; }
  .library-toolbar .filter-form { width: 100%; }
  .library-total { padding-left: 0; }
  .recommendation-row { flex-wrap: wrap; gap: 12px; padding: 20px 0; }
  .recommendation-row::before { font-size: 24px; width: 32px; }
  .recommendation-info { flex-basis: calc(100% - 44px); }
  .recommendation-row > form, .recommendation-row > .btn { margin-left: 44px; }
  .recipes-grid { grid-template-columns: minmax(0,1fr); }
  .settings-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .settings-nav { display: flex; flex-wrap: wrap; position: static; border-bottom: 1px solid var(--border); padding-bottom: 12px; gap: 0; }
  .settings-nav a { padding: 8px 10px; font-size: 12px; }
  .settings-nav .icon { display: none; }
  .settings-section { padding: 21px 16px; }
  .module-switch-row { gap: 9px; }
  .module-copy h3 { font-size: 12px; }
  .module-order-actions { gap: 0; }
  .module-order-actions .icon-btn { width: 25px; }
  .order-grip { padding: 0 4px; }
  .module-icon { width: 29px; height: 29px; }
  .module-controls { gap: 3px; }
  .profile-popover { right: -3px; }
  .auth-main { padding: 20px; }
  .access-content { padding: 27px; }
  .access-brand { padding: 18px 25px; }
  .notice-history-item { flex-wrap: wrap; }
  .big-search { flex-wrap: wrap; }
  .big-search input { flex-basis: calc(100% - 40px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .sidebar, .heading-actions, .feature-links, .card-tools, .icon-btn, .toast-region, .card-picker { display: none !important; }
  .app-shell { margin: 0; padding: 0; }
  .main-content { border: 0; padding: 0; background: white; color: black; }
  .panel, .dashboard-card { break-inside: avoid; border-color: #ccc; color: black; background: white; }
}

/* Perfil y administración */
.topbar-avatar img,.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.admin-shell .topbar { grid-template-columns: 1fr auto; }
.admin-shell .topbar-right { grid-column: 2; }
.profile-popover > form > button { display:flex;align-items:center;gap:10px;width:100%;padding:11px 10px;background:none;border:0;border-radius:7px;text-align:left;font-size:13px; }
.profile-popover > form > button:hover { background:var(--surface-alt); }
.profile-editor-avatar { display:flex;align-items:center;gap:22px;margin-bottom:25px; }
.profile-editor-avatar > img,.profile-editor-avatar > .avatar { width:90px;height:90px;object-fit:cover;border-radius:50%;font-size:32px; }
.access-return { display:block;margin-top:24px;font-size:12px;text-align:center; }
.access-content > p { margin-bottom:22px;font-size:13px; }
.access-content > code { display:block;padding:14px;background:var(--canvas);border:1px solid var(--border);border-radius:7px;margin:15px 0; }
/* Estados compartidos: el texto acompaña siempre al color. */
.tone-danger, select[data-choice-value="high"], select[data-choice-value="cancelled"] { --tone: var(--danger); }
.tone-warning, select[data-choice-value="normal"], select[data-choice-value="todo"], select[data-choice-value="planned"], select[data-choice-value="withdrawal"] { --tone: var(--orange); }
.tone-info, select[data-choice-value="low"], select[data-choice-value="in_progress"], select[data-choice-value="watching"] { --tone: var(--primary); }
.tone-success, select[data-choice-value="done"], select[data-choice-value="paid"], select[data-choice-value="received"], select[data-choice-value="watched"], select[data-choice-value="active"], select[data-choice-value="deposit"], select[data-choice-value="contribution"] { --tone: var(--success); }
.tone-muted { --tone: var(--muted); }
.badge[class*="tone-"], select[data-choice-value]:not([data-choice-value=""]) { color: var(--tone,var(--text)); background: color-mix(in srgb,var(--tone,var(--surface-alt)) 12%,var(--surface)); border: 1px solid color-mix(in srgb,var(--tone,var(--border)) 28%,var(--border)); }
.document-row { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px; border-bottom:1px solid var(--border); }
.document-row:last-child { border-bottom:0; }
.document-title, .document-files, .countdown-value { display:flex; align-items:center; gap:12px; min-width:0; }
.document-title h2 { font-size:15px; margin:0 0 8px; overflow-wrap:anywhere; }
.document-files { flex-wrap:wrap; justify-content:flex-end; }
.document-files a { max-width:100%; overflow-wrap:anywhere; }
.weather-widget { display:grid; gap:16px; }
.weather-current { display:flex; align-items:center; gap:16px; }
.weather-icon { width:40px; height:40px; flex:none; }
.weather-current>.weather-icon { width:60px; height:60px; }
.weather-temperature { display:block; font-size:30px; line-height:1.2; font-weight:650; letter-spacing:-.04em; }
.weather-temperature>span { font-size:20px; color:var(--muted); }
.weather-description { display:block; margin-top:6px; color:var(--muted); }
.weather-place { display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:var(--muted); }
.weather-place .icon { width:14px; height:14px; }
.weather-days { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.weather-day { display:flex; flex-direction:column; align-items:flex-start; gap:10px; padding:16px; border:1px solid var(--border); border-radius:10px; background:var(--surface-alt); min-width:0; }
.weather-day-label { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.08em; }
.weather-day-condition { display:flex; align-items:center; gap:8px; font-size:12px; flex-wrap:wrap; }
.weather-rain { color:var(--muted); font-size:11px; }
.weather-source { justify-self:end; }
.weather-preview { padding:24px; max-width:560px; }
@media(max-width:620px) { .document-row { align-items:flex-start; flex-direction:column; padding:16px; } .document-files { justify-content:flex-start; } .weather-day { padding:12px; } .weather-day-condition { gap:4px; } }
