/* ============================================================
   Proyectos — Mobile-First Professional Stylesheet
   320px → tablet → desktop
   ============================================================ */

:root {
  --primary:       #1B4F9C;
  --primary-dark:  #0f3570;
  --primary-light: #e8f0fc;
  --sidebar-bg:    #0d2b4e;
  --sidebar-w:     240px;
  --header-h:      52px;
  --content-bg:    #f0f2f7;
  --card-bg:       #ffffff;
  --border:        #e2e6ed;
  --text:          #1a2332;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --warning:       #d97706;
  --warning-bg:    #fffbeb;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --info:          #0891b2;
  --info-bg:       #ecfeff;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 4px 6px rgba(0,0,0,.07);
  --shadow-lg:     0 10px 25px rgba(0,0,0,.1);
  --radius:        8px;
  --radius-sm:     5px;
  --radius-lg:     12px;
  --font:          'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:    .15s ease;
  /* Tipografía unificada — máx. 3 tamaños */
  --fs-base:       0.875rem;   /* 14px — cuerpo, tablas, botones */
  --fs-sm:         0.8125rem;  /* 13px — metadatos secundarios */
  --fs-lg:         1.125rem;    /* 18px — títulos y cifras destacadas */
}

/* ======================== RESET ======================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  min-width: 0;
}
html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  background: var(--content-bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img, video, iframe, canvas { max-width: 100%; height: auto; display: block; }

/* ======================== LAYOUT ======================== */
.app-layout { display: flex; min-height: 100vh; width: 100%; }

/* ── Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 998;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ── Sidebar — mobile: hidden drawer ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: min(82vw, 280px);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 999;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.sidebar.open { transform: translateX(0); }

.sidebar-brand {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 36px;
  padding: 6px 8px 0;
  flex-shrink: 0;
}
.sidebar-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  padding: 6px 16px 14px;
  box-sizing: border-box;
}
.sidebar-close-btn {
  position: static;
  display: block;
  margin: 0;
  background: none; border: none;
  color: rgba(255,255,255,.5);
  font-size: 1.1rem; cursor: pointer; padding: 6px 10px;
  border-radius: 4px; line-height: 1;
}
.sidebar-close-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.brand-text { color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.25; word-break: break-word; width: 100%; }
.brand-sub  { color: rgba(255,255,255,.45); font-size: .68rem; line-height: 1.2; width: 100%; }
.brand-icon {
  width: 40px; height: 40px;
  background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  margin: 0 auto;
}

.sidebar-nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.nav-group-label {
  color: rgba(255,255,255,.28);
  font-size: .63rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 14px 18px 5px;
}
.nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  color: rgba(255,255,255,.7); font-size: .86rem;
  transition: all var(--transition);
  position: relative;
}
.nav-item a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav-item a.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: #60a5fa; border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: .63rem; padding: 1px 6px; border-radius: 99px; font-weight: 700;
}
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.35); font-size: .68rem; text-align: center;
  flex-shrink: 0;
}

/* ── Main wrap — mobile: full width ── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  min-width: 0;
}

/* ── Topbar ── */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 12px; gap: 8px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
  width: 100%;
  flex-shrink: 0;
}

/* ── Hamburger — visible on mobile ── */
.hamburger-btn {
  display: flex;
  flex-shrink: 0;
  width: 40px; height: 40px;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  background: transparent; border: none;
  cursor: pointer; border-radius: 6px;
  padding: 0;
}
.ham-line {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all .2s;
}
.hamburger-btn:hover .ham-line { background: var(--primary); }

.topbar-title {
  font-size: .9rem; font-weight: 600;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-title small { font-weight: 400; color: var(--text-muted); margin-left: 6px; font-size: .75rem; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-icon-only-mobile { display: inline; }
.btn-text-desktop { display: none; }

/* ── Page content ── */
.page-content {
  padding: 14px;
  flex: 1;
  overflow-x: hidden;
  width: 100%;
}

/* ======================== CARDS ======================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .88rem;
  flex-wrap: wrap;
}
.card-title { flex: 1; }
.card-body    { padding: 16px; }
.card-body-sm { padding: 12px 14px; }
.mb-16 { margin-bottom: 16px; }

/* ======================== STAT CARDS ======================== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: box-shadow var(--transition);
  text-align: left;
}
.stat-card { cursor: default; }
.stat-card.stat-clickable { cursor: pointer; }
.stat-card.stat-clickable:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--sc-color, var(--primary));
}
.stat-icon  { font-size: 1.2rem; display: flex; justify-content: flex-start; align-items: center; align-self: flex-start; margin-bottom: 4px; color: var(--sc-color, var(--primary)); width: 100%; }
.stat-value { font-size: var(--fs-lg); font-weight: 700; color: var(--sc-color, var(--primary)); line-height: 1; }
.stat-label { font-size: var(--fs-base); color: var(--text-muted); margin-top: 3px; font-weight: 500; }
.stat-card-extra {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.35;
}
.stat-extra-item { display: inline-flex; align-items: center; gap: 6px; }
.stat-extra-late { color: #dc2626; font-weight: 600; }
.stat-extra-stopped { color: #ef4444; font-weight: 600; }
.stat-extra-postponed { color: #8b5cf6; font-weight: 600; }
.stat-sublabel { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; }
.month-summary-value { font-size: var(--fs-lg); font-weight: 700; color: var(--primary); }
.month-summary-text { font-size: var(--fs-base); font-weight: 600; }
.month-summary-sub { font-size: var(--fs-base); color: var(--text-muted); font-weight: 400; }

/* Dropdown flotante (estado, comentarios) */
.quick-dd {
  position: fixed; z-index: 9999;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  min-width: 200px; max-width: 340px; overflow: hidden;
}
.quick-dd-header {
  padding: 10px 14px; font-size: var(--fs-sm); font-weight: 600;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.quick-dd-item {
  padding: 9px 14px; cursor: pointer; font-size: var(--fs-base);
  display: flex; align-items: center; gap: 8px;
  transition: background .12s;
}
.quick-dd-item:hover { background: var(--primary-light); }
.quick-dd-comment {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: var(--fs-base); line-height: 1.45;
}
.quick-dd-comment:last-child { border-bottom: none; }
.quick-dd-comment-meta { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; }
.quick-dd-body { max-height: 280px; overflow-y: auto; }

/* ======================== BUTTONS ======================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 11px 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: .88rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition); line-height: 1.3;
  font-family: var(--font); white-space: nowrap;
  text-decoration: none; min-height: 44px;
  touch-action: manipulation;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--card-bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f8fafc; border-color: var(--primary); color: var(--primary); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }
.btn-sm   { padding: 7px 12px; font-size: .82rem; min-height: 38px; }
.btn-icon { padding: 8px 10px; min-height: 44px; }

/* ======================== BADGES ======================== */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: .73rem; font-weight: 600;
  background: var(--bs-bg); color: var(--bs-color); white-space: nowrap;
}
.badge-status .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-priority {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--bp-bg); color: var(--bp-color);
}
.badge-mini { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: .7rem; font-weight: 600; }
.badge-tag  { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: var(--fs-base); background: var(--primary-light); color: var(--primary); font-weight: 500; }

/* ======================== TABLES ======================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.data-table thead th {
  background: #f8fafc; color: var(--text-muted);
  font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 7px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table tbody td { padding: 6px 10px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.td-name { font-weight: 600; }
.project-pedido { font-weight: 500; color: var(--text-muted); margin-left: 0.35em; white-space: nowrap; }
.td-date { font-size: var(--fs-base); white-space: nowrap; }
.td-date-late { color: var(--danger); font-weight: 600; }
.td-date-rem { color: var(--success); font-weight: 500; }
.date-changed-hint { font-size: var(--fs-sm); line-height: 1.3; margin-top: 2px; }
.date-changed-label { color: var(--warning); font-weight: 600; font-size: var(--fs-sm); }
.td-num  { text-align: right; font-weight: 600; }

.progress-cell { min-width: 80px; }
.progress-bar-wrap { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.progress-bar-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s; }
.progress-bar-fill.done { background: var(--success); }
.progress-label { font-size: var(--fs-sm); color: var(--text-muted); }

/* Desktop table / Mobile cards */
.desktop-table { display: none; }
.mobile-cards-list { display: flex; flex-direction: column; gap: 0; }

/* ======================== FORMS ======================== */
.form-section-title {
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 12px; margin-top: 4px;
}
.form-grid   { display: grid; gap: 14px; }
.form-grid-2,
.form-grid-3,
.form-grid-4 { grid-template-columns: 1fr; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }

label.form-label { font-size: .8rem; font-weight: 600; color: var(--text); }
label.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; /* prevents iOS zoom */
  font-family: var(--font); color: var(--text);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5; -webkit-appearance: none; appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,79,156,.1);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px;
}
.form-hint  { font-size: .73rem; color: var(--text-muted); margin-top: 2px; }
.form-actions { display: flex; gap: 10px; padding-top: 6px; justify-content: flex-end; flex-wrap: wrap; }
.form-panel { max-width: 100%; }

/* ======================== TABS ======================== */
.tabs-nav {
  display: flex; border-bottom: 2px solid var(--border);
  margin-bottom: 16px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; gap: 0;
}
.tab-link {
  padding: 10px 14px; font-size: var(--fs-base); font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition); flex-shrink: 0;
  min-height: 44px; display: flex; align-items: center; gap: 5px;
}
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count { color: var(--text-muted); font-weight: 500; font-size: var(--fs-base); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ======================== CHECKLIST ======================== */
.checklist-list { display: flex; flex-direction: column; gap: 2px; }
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  background: #fafbfd; border: 1px solid var(--border);
  transition: background var(--transition);
}
.checklist-item:hover { background: var(--primary-light); }
.checklist-item.done  { background: var(--success-bg); border-color: #bbf7d0; }
.checklist-item.done .chk-label { color: var(--text-muted); text-decoration: line-through; }
.chk-checkbox { width: 22px; height: 22px; cursor: pointer; accent-color: var(--success); flex-shrink: 0; }
.chk-num   { font-size: .7rem; color: var(--text-light); min-width: 18px; }
.chk-label { flex: 1; font-size: .875rem; }
.chk-meta  { font-size: .68rem; color: var(--text-muted); display: none; flex-direction: column; align-items: flex-end; gap: 1px; }

/* ======================== TIMELINE ======================== */
.timeline { position: relative; padding-left: 4px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { display: flex; gap: 12px; padding: 0 0 14px 0; position: relative; }
.tl-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--card-bg); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; flex-shrink: 0; z-index: 1;
}
.tl-dot.created   { border-color: var(--primary); background: var(--primary-light); }
.tl-dot.updated   { border-color: #a855f7; background: #faf5ff; }
.tl-dot.checklist { border-color: var(--success); background: var(--success-bg); }
.tl-dot.proposal  { border-color: var(--info); background: var(--info-bg); }
.tl-dot.incident  { border-color: var(--danger); background: var(--danger-bg); }
.tl-dot.note      { border-color: var(--warning); background: var(--warning-bg); }
.tl-content { flex: 1; padding-top: 4px; min-width: 0; }
.tl-msg     { font-size: .86rem; word-break: break-word; }
.tl-meta    { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ======================== PROPOSALS ======================== */
.proposal-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 14px; background: #fafbfd; margin-bottom: 10px; }
.prop-header   { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.prop-type     { font-weight: 600; font-size: .875rem; }
.prop-body     { font-size: .84rem; color: var(--text-muted); }
.prop-footer   { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ======================== INCIDENTS ======================== */
.incident-card { border-left: 3px solid var(--danger); background: var(--danger-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 11px 14px; margin-bottom: 10px; }
.incident-card.resolved { border-left-color: var(--success); background: var(--success-bg); }
.inc-title  { font-weight: 600; font-size: .875rem; }
.inc-body   { font-size: .84rem; color: var(--text-muted); margin-top: 4px; word-break: break-word; }
.inc-footer { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ======================== SEARCH & FILTERS ======================== */
.filter-bar {
  display: flex; flex-direction: column;
  gap: 8px; margin-bottom: 10px;
}

/* 2-column grid for filter selects on mobile */
.filter-selects-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Button row */
.filter-buttons-group {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.filter-buttons-group .btn {
  flex: 1; justify-content: center; min-width: 80px;
}

/* Active filter info banner */
.filter-active-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .78rem; color: var(--primary);
  background: var(--primary-light);
  padding: 7px 11px; border-radius: var(--radius-sm);
  border: 1px solid rgba(27,79,156,.15);
  margin-bottom: 2px;
}
.filter-active-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: 99px;
  font-size: .7rem; font-weight: 600;
}
.filter-active-note {
  color: var(--text-muted); font-size: .72rem;
}
.filter-active-clear {
  margin-left: auto; color: var(--text-muted); font-size: .72rem;
  text-decoration: underline; cursor: pointer;
}
.filter-active-clear:hover { color: var(--danger); }

/* Month group headers in project list */
.month-group-row td {
  padding: 6px 12px 4px;
  background: var(--content-bg);
  border-top: 1px solid var(--border);
}
.month-group-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.month-group-divider {
  padding: 7px 14px 4px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  background: var(--content-bg);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.search-box {
  display: flex; align-items: center;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 10px; gap: 6px;
  width: 100%;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,79,156,.1); }
.search-box input {
  border: none; outline: none; padding: 7px 4px;
  font-size: var(--fs-base); width: 100%; font-family: var(--font);
  color: var(--text); background: transparent; min-height: 36px;
}
.filter-select {
  padding: 7px 26px 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--fs-base); font-family: var(--font); color: var(--text);
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  width: 100%; min-height: 36px; height: 36px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

/* Status tabs — horizontal scroll row */
.status-tabs {
  display: flex; gap: 6px;
  overflow-x: auto; flex-wrap: nowrap;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  /* hide scrollbar on mobile for cleaner look */
  scrollbar-width: none; -ms-overflow-style: none;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border);
  font-size: .8rem; font-weight: 500; cursor: pointer; background: var(--card-bg);
  color: var(--text-muted); transition: all var(--transition); white-space: nowrap;
  flex-shrink: 0; min-height: 36px; display: flex; align-items: center; gap: 4px;
  touch-action: manipulation; user-select: none;
}
.status-tab:hover { border-color: var(--primary); color: var(--primary); }
.status-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ======================== DASHBOARD ======================== */
.dashboard-grid { display: flex; flex-direction: column; gap: 16px; }

/* Tabla compacta dentro de tarjetas del dashboard (misma estructura que lista de entregas) */
.chart-card .data-table { font-size: var(--fs-base); }
.chart-card .data-table th,
.chart-card .data-table td { padding: 8px 10px; }
.chart-card .table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); }

.upcoming-list { display: flex; flex-direction: column; gap: 8px; }
.upcoming-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px; border-radius: var(--radius-sm); background: #fafbfd; border: 1px solid var(--border); font-size: .84rem; flex-wrap: wrap; }
.ui-days { font-size: .78rem; font-weight: 700; padding: 3px 7px; border-radius: 4px; min-width: 46px; text-align: center; flex-shrink: 0; }
.ui-days.urgent { background: var(--danger-bg); color: var(--danger); }
.ui-days.soon   { background: var(--warning-bg); color: var(--warning); }
.ui-days.ok     { background: var(--success-bg); color: var(--success); }
.ui-name   { font-weight: 500; word-break: break-word; }
.ui-client { color: var(--text-muted); font-size: .76rem; }

/* ======================== ALERTS ======================== */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: .875rem; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-left: 3px solid var(--warning); }
.alert-danger  { background: var(--danger-bg);  color: #7f1d1d; border-left: 3px solid var(--danger); }
.alert-success { background: var(--success-bg); color: #14532d; border-left: 3px solid var(--success); }
.alert-info    { background: var(--info-bg);    color: #164e63; border-left: 3px solid var(--info); }

/* ======================== PROJECT HERO ======================== */
.project-hero { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.ph-top     { display: flex; flex-direction: column; gap: 12px; }
.ph-info    { flex: 1; min-width: 0; }
.ph-client  { font-size: .82rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ph-name    { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; word-break: break-word; }
.ph-badges  { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.ph-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; width: 100%; }
.ph-actions .btn { flex: none; justify-content: center; min-width: 0; }
.ph-meta    { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.ph-meta-item  { display: flex; flex-direction: column; gap: 2px; min-width: 42%; }
.ph-meta-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.ph-meta-val   { font-size: .875rem; font-weight: 600; }
.ph-meta-val.late { color: var(--danger); }

/* ======================== EMPTY STATES ======================== */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.es-icon  { font-size: 2.8rem; display: block; margin-bottom: 10px; }
.es-title { font-size: .95rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.es-text  { font-size: .875rem; margin-bottom: 14px; }

/* ======================== MODALS ======================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,20,40,.45);
  z-index: 900; display: none;
  align-items: flex-end; justify-content: center;
  padding: 0;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 100%;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.modal-header { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title  { font-weight: 700; font-size: .95rem; flex: 1; }
.modal-body   { padding: 16px 18px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal-footer { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

/* ======================== PROJECT PANEL ======================== */
.project-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.pp-header {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.pp-header-info  { flex: 1; min-width: 0; }
.pp-header-actions { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.pp-header-actions .btn { flex: 1; justify-content: center; }

.pp-name   { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; word-break: break-word; }
.pp-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.pp-meta-bar {
  display: flex; flex-wrap: wrap;
  padding: 0; border-bottom: 1px solid var(--border);
}
.pp-meta-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  min-width: 50%; max-width: 50%;
  border-bottom: 1px solid var(--border);
}
.ppm-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.ppm-val   { font-size: .875rem; font-weight: 600; word-break: break-word; }
.ppm-val.late { color: var(--danger); }
.ppm-days  { font-size: .72rem; font-weight: 700; margin-left: 4px; }

.pp-path-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: #fafbfd; border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.pp-path-code { font-family: monospace; font-size: .75rem; color: var(--text); background: var(--primary-light); padding: 3px 7px; border-radius: 3px; word-break: break-all; flex: 1; }
.pp-copy-btn  { flex-shrink: 0; }

.pp-section { padding: 16px; border-bottom: 1px solid var(--border); }
.pp-section:last-child { border-bottom: none; }
.pp-section-compact { padding: 10px 16px; }
.pp-section-notes { display: flex; flex-direction: column; gap: 14px; }
.pp-note-block { flex: 1; min-width: 0; }
.pp-id-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pp-id     { font-family: monospace; font-size: .78rem; color: var(--text-muted); }

.pp-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 14px;
}
.pp-toggle-title { cursor: pointer; user-select: none; margin-bottom: 0; }
.pp-toggle-title:hover { color: var(--primary); }
.pp-section-count { font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }
.pp-chk-hint { font-size: .72rem; color: var(--text-light); margin-top: 10px; }

/* ======================== PROPOSALS TABLE ======================== */
.prop-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
.prop-table {
  width: 100%; border-collapse: collapse;
  font-size: .84rem; min-width: 420px;
}
.prop-table thead th {
  background: #f8fafc; color: var(--text-muted);
  font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.prop-table tbody td { padding: 8px 10px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
.prop-table tbody tr:hover td { background: #fafcff; }
.prop-table tbody tr:last-child td { border-bottom: none; }
.prop-form-table .form-control { min-width: 80px; }
.prop-status-select {
  font-size: .75rem; padding: 3px 22px 3px 6px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 5px center;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}

/* ======================== CHECKLIST LABEL EDITING ======================== */
.chk-label[contenteditable="true"],
.chk-label.chk-label-editing {
  background: var(--primary-light); padding: 1px 6px;
  border-radius: 3px; outline: 2px solid var(--primary);
  cursor: text; color: var(--primary);
}

/* ======================== MISC / UTILITIES ======================== */
.fc-sm { padding: 5px 8px; font-size: .82rem; }
.modal.modal-lg { max-width: 100%; }
.modal.modal-xl { max-width: 100%; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.fs-sm   { font-size: .78rem; }
.ml-auto { margin-left: auto; }

/* ======================== TOAST ======================== */
.toast-wrap {
  position: fixed; bottom: 12px; left: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 7px; z-index: 9999;
}
.toast {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 15px; box-shadow: var(--shadow-lg); font-size: .875rem;
  display: flex; align-items: center; gap: 9px;
  width: 100%; max-width: 100%;
  animation: toastIn .25s ease; border-left: 3px solid var(--primary);
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }

/* ======================== SIDEBAR USER ======================== */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.su-info  { flex: 1; min-width: 0; }
.su-name  { color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-role  { color: rgba(255,255,255,.45); font-size: .65rem; margin-top: 1px; }
.su-logout {
  color: rgba(255,255,255,.4); font-size: 1rem; text-decoration: none;
  padding: 6px 8px; border-radius: 4px; transition: all .15s; flex-shrink: 0;
  min-height: 36px; display: flex; align-items: center; justify-content: center;
}
.su-logout:hover { color: #f87171; background: rgba(239,68,68,.15); }

/* ======================== EMOJI BAR ======================== */
.emoji-bar {
  display: flex; flex-wrap: wrap; gap: 4px;
  align-items: center; margin-bottom: 8px;
}
.emoji-bar-label { font-size: .7rem; color: var(--text-muted); margin-right: 4px; white-space: nowrap; }
.emoji-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 6px; font-size: 1rem; cursor: pointer; line-height: 1.3;
  transition: background .12s, border-color .12s;
  min-width: 36px; min-height: 36px; text-align: center;
  touch-action: manipulation;
}
.emoji-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.canvas-emoji-bar { margin-bottom: 12px; padding: 8px 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ======================== QUICK NOTE DELETE BTN ======================== */
.qn-del {
  position: absolute; top: 5px; right: 6px;
  background: none; border: none; color: rgba(0,0,0,.3);
  font-size: .68rem; cursor: pointer; padding: 4px 6px; border-radius: 3px;
  line-height: 1; transition: color .15s, background .15s; z-index: 2;
  min-height: 28px;
}
.qn-del:hover { color: #dc2626; background: rgba(220,38,38,.1); }
.qn-card { position: relative; }

/* ======================== MOBILE PROJECT CARDS ======================== */
.mobile-project-card {
  display: block; padding: 14px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: filter .15s;
}
.mobile-project-card:last-child { border-bottom: none; }
.mobile-project-card:active { filter: brightness(.96); }
.mpc-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 7px; }
.mpc-name   { font-size: var(--fs-base); font-weight: 600; margin-bottom: 2px; line-height: 1.35; word-break: break-word; }
.mpc-client { font-size: var(--fs-base); color: var(--text-muted); font-weight: 500; }
.mpc-meta   { display: flex; gap: 10px; align-items: center; margin-bottom: 7px; flex-wrap: wrap; font-size: var(--fs-base); }
.mpc-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mpc-progress { display: flex; align-items: center; gap: 6px; }
.mpc-progress span { font-size: var(--fs-base); color: var(--text-muted); }

/* ======================== PIE CHARTS ======================== */
.charts-row { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.chart-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.chart-title { font-size: var(--fs-base); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.chart-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.chart-canvas-wrap { flex-shrink: 0; width: 110px; height: 110px; }
.chart-canvas-wrap canvas { width: 110px !important; height: 110px !important; }
.chart-legend { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.cl-item { display: flex; align-items: center; gap: 7px; font-size: var(--fs-base); }
.cl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cl-label { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-val { margin-left: auto; font-weight: 600; color: var(--text); font-size: .8rem; }

/* ======================== PRINT ======================== */
@media print {
  .sidebar, .topbar, .topbar-actions, .btn, .modal-backdrop, .toast-wrap, .hamburger-btn { display: none !important; }
  .main-wrap { margin-left: 0 !important; }
  .page-content { padding: 0; }
  .card { box-shadow: none; }
}

/* ======================== TABLET+ (min-width: 640px) ======================== */
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .charts-row { grid-template-columns: 1fr 1fr; }
  .chart-canvas-wrap { width: 130px; height: 130px; }
  .chart-canvas-wrap canvas { width: 130px !important; height: 130px !important; }
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ======================== DESKTOP (min-width: 769px) ======================== */
@media (min-width: 769px) {

  /* Sidebar always visible */
  .sidebar {
    position: fixed;
    width: var(--sidebar-w);
    transform: translateX(0) !important;
  }
  .sidebar-close-btn { display: none !important; }
  .sidebar-brand-toolbar { display: none !important; }
  .sidebar-brand-stack { padding-top: 16px; }
  .sidebar-overlay { display: none !important; }

  /* Main wrap: offset for sidebar */
  .main-wrap { margin-left: var(--sidebar-w); }

  /* Hamburger hidden */
  .hamburger-btn { display: none !important; }

  /* Topbar */
  .topbar { padding: 0 22px; gap: 12px; height: 56px; }
  .btn-icon-only-mobile { display: none; }
  .btn-text-desktop { display: inline; }

  /* Page */
  .page-content { padding: 22px; }

  /* Buttons: smaller on desktop */
  .btn { min-height: 34px; padding: 7px 15px; font-size: .85rem; }
  .btn-sm { min-height: 28px; padding: 4px 10px; font-size: .78rem; }
  .btn-icon { padding: 5px 7px; min-height: 32px; }

  /* Inputs */
  .form-control { font-size: .875rem; padding: 8px 11px; }
  select.form-control { font-size: .875rem; }
  .search-box input { font-size: .875rem; padding: 7px 4px; min-height: auto; }
  .filter-select { font-size: .8125rem; padding: 6px 24px 6px 8px; height: 32px; min-height: 32px; width: auto; max-width: 168px; }
  .status-tab { min-height: auto; padding: 5px 12px; }

  /* Filter bar: row on desktop */
  .filter-bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .search-box { flex: 1; min-width: 180px; width: auto; }

  /* Filter selects: inline flex on desktop */
  .filter-selects-group {
    display: contents; /* children join the flex row directly */
  }

  /* Button group: no stretch on desktop */
  .filter-buttons-group { flex-wrap: nowrap; }
  .filter-buttons-group .btn { flex: none; }

  /* Tables */
  .desktop-table { display: block; }
  .mobile-cards-list { display: none !important; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
  .stat-card  { padding: 16px 18px; }
  .stat-icon  { font-size: 1.4rem; margin-bottom: 6px; }
  .stat-value { font-size: 1.8rem; }

  /* Charts */
  .charts-row { gap: 16px; margin-bottom: 20px; }
  .chart-canvas-wrap { width: 140px; height: 140px; }
  .chart-canvas-wrap canvas { width: 140px !important; height: 140px !important; }
  .chart-card { padding: 18px 20px; }

  /* Modals: centered */
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { max-width: 540px; border-radius: var(--radius-lg); max-height: 90vh; }
  .modal.modal-lg  { max-width: 720px; }
  .modal.modal-xl  { max-width: 860px; }
  @keyframes modalIn { from { opacity:0; transform: scale(.95) translateY(-10px); } to { opacity:1; transform: scale(1) translateY(0); } }

  /* Project hero */
  .project-hero { padding: 18px 22px; margin-bottom: 18px; }
  .ph-top  { flex-direction: row; align-items: flex-start; gap: 14px; }
  .ph-name { font-size: 1.25rem; }
  .ph-actions { width: auto; }
  .ph-actions .btn { flex: none; justify-content: unset; }
  .ph-meta  { gap: 20px; }
  .ph-meta-item { min-width: auto; }

  /* Project panel */
  .pp-header { flex-direction: row; align-items: flex-start; padding: 20px 22px; }
  .pp-header-actions { width: auto; }
  .pp-header-actions .btn { flex: none; justify-content: unset; }
  .pp-name { font-size: 1.2rem; }
  .pp-meta-item { min-width: 100px; max-width: none; border-right: 1px solid var(--border); border-bottom: none; padding: 12px 20px; }
  .pp-meta-item:last-child { border-right: none; }
  .pp-section { padding: 20px 22px; }
  .pp-section-compact { padding: 12px 22px; }
  .pp-section-notes { flex-direction: row; gap: 20px; }
  .pp-path-bar { padding: 10px 22px; }
  .pp-path-code { font-size: .8rem; }

  /* Form grids */
  .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .form-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .form-panel  { max-width: 820px; margin: 0 auto; }

  /* Checklist meta */
  .chk-meta { display: flex; }

  /* Toast */
  .toast-wrap { bottom: 22px; right: 22px; left: auto; width: auto; }
  .toast { width: auto; min-width: 250px; max-width: 340px; }
  @keyframes toastIn { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform: translateX(0); } }

  /* Emoji bar */
  .emoji-btn { min-width: 28px; min-height: 28px; font-size: .95rem; padding: 2px 5px; }
  .chk-checkbox { width: 18px; height: 18px; }
}

/* ======================== LARGE DESKTOP (min-width: 1100px) ======================== */
@media (min-width: 1100px) {
  .dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
  .dashboard-grid .col-full { grid-column: 1 / -1; }
  .dashboard-grid .col-2    { grid-column: span 2; }
}

/* ======================== STICKY NOTES WALL ======================== */
.sticky-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  align-items: start;
}

.sticky {
  position: relative;
  border-radius: 4px 4px 4px 0;
  padding: 30px 12px 10px 12px;
  box-shadow: 3px 4px 10px rgba(0,0,0,.15), 1px 1px 3px rgba(0,0,0,.08);
  transform: none;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: default;
  min-height: 110px;
  display: flex;
  flex-direction: column;
}
.sticky:hover {
  box-shadow: 5px 8px 18px rgba(0,0,0,.2);
  z-index: 2;
}

.sticky::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 18px; height: 18px;
  background: rgba(0,0,0,.12);
  clip-path: polygon(0 100%, 100% 100%, 0 0);
  border-radius: 0 0 0 4px;
}

@media (min-width: 640px) {
  .sticky-wall { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
  .sticky { min-height: 140px; }
  .sticky:hover { transform: scale(1.03); }
}

.sticky-del {
  position: absolute; top: 6px; right: 7px;
  background: none; border: none;
  color: rgba(0,0,0,.3);
  font-size: .75rem; cursor: pointer;
  padding: 4px 6px; border-radius: 3px;
  line-height: 1; transition: color .15s, background .15s;
  min-height: 28px;
}
.sticky-del:hover { color: #dc2626; background: rgba(220,38,38,.1); }

.sticky-proj-ref {
  font-size: .65rem; margin-bottom: 6px; opacity: .75;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sticky-proj-link { color: rgba(0,0,0,.55); text-decoration: underline dotted; }
.sticky-proj-link:hover { color: rgba(0,0,0,.85); }

.sticky-body {
  flex: 1; font-size: .875rem; line-height: 1.5;
  color: rgba(0,0,0,.78); word-break: break-word;
  white-space: pre-wrap; outline: none;
  min-height: 60px; border-radius: 3px;
  padding: 2px 3px; margin: 0 -3px;
  transition: background .15s;
}
.sticky-body:focus {
  background: rgba(255,255,255,.45);
  box-shadow: 0 0 0 2px rgba(0,0,0,.12);
  cursor: text;
}

.sticky-foot {
  margin-top: 8px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 4px; font-size: .62rem; opacity: .65; flex-wrap: wrap;
}
.sticky-client  { font-weight: 600; }
.sticky-creator { opacity: .75; }
.sticky-date    { margin-left: auto; white-space: nowrap; }

/* Add placeholder */
.sticky-add {
  border: 2px dashed rgba(0,0,0,.2);
  background: transparent !important;
  box-shadow: none !important;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; min-height: 110px;
  border-radius: 6px; transform: none !important;
  transition: border-color .15s, background .15s;
}
.sticky-add::after { display: none; }
.sticky-add:hover { border-color: var(--primary); background: var(--primary-light) !important; }
.sticky-add-icon { display: flex; align-items: center; justify-content: center; color: rgba(0,0,0,.35); line-height: 1; }
.sticky-add-icon .icon-svg { width: 32px; height: 32px; }
.sticky-add-label { font-size: var(--fs-base); color: rgba(0,0,0,.45); font-weight: 600; }
.sticky-add:hover .sticky-add-icon,
.sticky-add:hover .sticky-add-label { color: var(--primary); }

@media (min-width: 640px) { .sticky-add { min-height: 140px; } }

/* ── Color palette ── */
.note-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.note-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s, border-color .15s; padding: 0;
}
.note-swatch:hover { transform: scale(1.15); }
.note-swatch.active { border-color: rgba(0,0,0,.5); transform: scale(1.1); }

/* ======================== QUICK NOTES WALL ======================== */
.qn-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  padding-top: 4px;
}
.qn-card {
  width: 180px;
  flex-shrink: 0;
  min-height: 90px;
  padding: 11px 11px 8px;
  border-radius: 4px 4px 4px 0;
  box-shadow: 3px 4px 10px rgba(0,0,0,.14), 1px 1px 3px rgba(0,0,0,.07);
  transform: none;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative; display: flex; flex-direction: column; gap: 6px; cursor: default;
}
.qn-card::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 16px; height: 16px; background: rgba(0,0,0,.11);
  clip-path: polygon(0 100%, 100% 100%, 0 0); border-radius: 0 0 0 4px;
}
.qn-card:hover { box-shadow: 5px 8px 18px rgba(0,0,0,.2); z-index: 2; }

@media (min-width: 640px) {
  .qn-card:hover { transform: scale(1.05); }
}

/* ── Add card (canvas-style placeholder) ── */
.qn-card-add {
  border: 2px dashed rgba(0,0,0,.18) !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 5px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.qn-card-add::after { display: none; }
.qn-card-add:hover { border-color: var(--primary) !important; background: var(--primary-light) !important; }
.qn-add-icon { font-size: 1.6rem; color: rgba(0,0,0,.22); line-height: 1; }
.qn-add-label { font-size: .78rem; color: rgba(0,0,0,.32); font-weight: 600; text-align: center; }
.qn-card-add:hover .qn-add-icon, .qn-card-add:hover .qn-add-label { color: var(--primary); }

/* ── New comment card being edited ── */
.qn-card-new {
  box-shadow: 0 0 0 2px var(--primary), 3px 4px 12px rgba(0,0,0,.16) !important;
}
.qn-text-edit {
  flex: 1; font-size: .82rem; line-height: 1.5;
  color: rgba(0,0,0,.78); word-break: break-word;
  outline: none; cursor: text; min-height: 48px;
  white-space: pre-wrap;
}
.qn-text-edit:empty:not(:focus)::before {
  content: attr(data-placeholder);
  color: rgba(0,0,0,.3); pointer-events: none; font-style: italic;
}
.qn-text-edit:focus { background: rgba(255,255,255,.25); border-radius: 3px; }

.qn-text {
  font-size: .82rem; line-height: 1.5;
  color: rgba(0,0,0,.75); flex: 1;
  word-break: break-word; white-space: pre-wrap;
}
.qn-meta {
  font-size: .6rem; color: rgba(0,0,0,.45);
  border-top: 1px solid rgba(0,0,0,.09);
  padding-top: 5px; margin-top: auto;
}

/* ======================== CANVAS BOARD ======================== */
.canvas-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

@media (min-width: 480px) { .canvas-board { grid-template-columns: 1fr 1fr; } }
@media (min-width: 769px) { .canvas-board { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; } }

/* Per-card toolbar */
.sticky-toolbar {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 7px; flex-wrap: wrap;
}
.sticky-proj-sel {
  flex: 1; min-width: 0;
  font-size: 13px;
  border: none; background: rgba(0,0,0,.1);
  border-radius: 4px; padding: 4px 6px;
  color: rgba(0,0,0,.6); cursor: pointer; outline: none;
  font-family: var(--font); max-width: 140px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sticky-proj-sel:focus { background: rgba(0,0,0,.15); }

.sticky-color-btn {
  background: none; border: none;
  cursor: pointer; padding: 4px 5px;
  border-radius: 3px; font-size: .9rem; line-height: 1;
  opacity: .55; transition: opacity .15s, background .15s;
  flex-shrink: 0; min-height: 30px; min-width: 30px;
}
.sticky-color-btn:hover { opacity: 1; background: rgba(0,0,0,.1); }

.sticky-vis-btn {
  background: none; border: none;
  cursor: pointer; padding: 4px 5px;
  border-radius: 3px; font-size: .86rem; line-height: 1;
  opacity: .55; transition: opacity .15s, background .15s;
  flex-shrink: 0; min-height: 30px; min-width: 30px;
}
.sticky-vis-btn:hover { opacity: 1; background: rgba(0,0,0,.1); }
.sticky-priv { font-size: .7rem; opacity: .8; }

/* Palette */
.sticky-palette {
  display: none; flex-wrap: wrap; gap: 5px;
  padding: 8px; background: rgba(255,255,255,.9);
  border-radius: 6px; border: 1px solid rgba(0,0,0,.1);
  margin-bottom: 8px; box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.pal-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; padding: 0;
  flex-shrink: 0; transition: transform .12s, border-color .12s;
}
.pal-swatch.active { border-color: rgba(0,0,0,.55); transform: scale(1.15); box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px rgba(0,0,0,.25); }
.note-modal-palette { background: rgba(255,255,255,.95); padding: 10px; border-radius: 8px; border: 1px solid var(--border); }

/* Placeholder text */
.sticky-body[data-placeholder]:empty:not(:focus)::before {
  content: attr(data-placeholder);
  color: rgba(0,0,0,.28); pointer-events: none; font-style: italic;
}

/* Comentarios de proyecto: mismo grid que Canvan */
#comments-card .canvas-board { margin: 0; }

/* Entregas del mes — layout 2 columnas */
.month-deliveries-summary {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.month-deliveries-grid {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
@media (min-width: 768px) {
  .month-deliveries-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
.month-types-col { display: flex; flex-direction: column; gap: 10px; }
.month-type-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.month-type-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.month-type-name { font-size: var(--fs-base); font-weight: 600; }
.month-type-detail { font-size: var(--fs-base); color: var(--text-muted); margin-top: 2px; }

/* Notificaciones */
.notif-bell-btn { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 5px; border-radius: 99px; min-width: 16px; text-align: center;
}
.notif-dropdown { min-width: 300px; max-width: 360px; }
.notif-item {
  display: block; padding: 10px 14px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: background .12s;
}
.notif-item:hover { background: var(--primary-light); }
.notif-item.unread { background: #f8fafc; border-left: 3px solid var(--primary); }
.notif-title { font-size: var(--fs-base); font-weight: 600; }
.notif-msg { font-size: var(--fs-base); color: var(--text-muted); margin-top: 2px; }
.notif-meta { font-size: var(--fs-sm); color: var(--text-light); margin-top: 4px; }

/* Canvan — arrastrar */
.sticky.dragging { opacity: 0.45; }
.sticky.drag-over { outline: 2px dashed var(--primary); outline-offset: 2px; }
.sticky { cursor: default; }
.sticky-add { cursor: pointer; }
.sticky .sticky-body { cursor: text; }
.sticky-body-static {
  flex: 1; font-size: var(--fs-base); line-height: 1.5;
  color: rgba(0,0,0,.78); word-break: break-word; white-space: pre-wrap;
}


/* ======================== FAMILIAS WIDGET ======================== */
.familias-widget { display: flex; flex-direction: column; gap: 8px; }
.familias-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.familia-preset-btn {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px;
  font-size: .82rem; cursor: pointer; font-family: var(--font);
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.familia-preset-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.familia-preset-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.familias-chips-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 8px; }
.familia-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary); color: #fff;
  border-radius: 20px; padding: 3px 10px 3px 12px;
  font-size: .8rem; font-family: var(--font);
}
.familia-chip-rm {
  background: transparent; border: none; color: rgba(255,255,255,.7);
  cursor: pointer; padding: 0 2px; font-size: .9rem; line-height: 1;
  transition: color .12s;
}
.familia-chip-rm:hover { color: #fff; }

/* ======================== CALENDAR PAGE ======================== */
.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.calendar-nav-title {
  font-size: 1.15rem; font-weight: 700; color: var(--text); text-transform: capitalize;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.calendar-header-cell {
  text-align: center; font-size: .72rem; font-weight: 700;
  color: var(--text-muted); padding: 6px 2px; text-transform: uppercase;
  letter-spacing: .04em;
}
.calendar-day {
  min-height: 80px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 6px;
  display: flex; flex-direction: column; gap: 3px;
  transition: background .12s;
}
.calendar-day.other-month { background: #f3f4f6; opacity: .7; }
.calendar-day.today { background: var(--card-bg); border-color: var(--primary); border-width: 2px; }
.calendar-day.today.has-projects { background: var(--card-bg); }
.calendar-day-num {
  font-size: .78rem; font-weight: 700; color: var(--text-muted);
  line-height: 1; margin-bottom: 3px;
}
.calendar-day.today .calendar-day-num {
  background: var(--primary); color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem;
}
.calendar-proj-pill {
  display: block; padding: 2px 5px; border-radius: 3px;
  font-size: .68rem; font-weight: 600; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; color: var(--text-muted);
  background: #f1f5f9; transition: background .1s;
}
.calendar-proj-pill:hover { filter: brightness(0.94); color: inherit; }
.calendar-proj-pill.pill-running:hover   { background: #bbf7d0; }
.calendar-proj-pill.pill-stopped:hover   { background: #fecaca; }
.calendar-proj-pill.pill-postponed:hover { background: #ddd6fe; }
.calendar-proj-pill.pill-late:hover      { background: #fed7aa; }
.calendar-proj-pill.pill-done:hover      { background: #bfdbfe; }
.calendar-proj-pill.pill-cancelled:hover { background: #e5e7eb; }
@media (max-width: 640px) {
  .calendar-grid { gap: 1px; }
  .calendar-day { min-height: 54px; padding: 3px 4px; }
  .calendar-day-num { font-size: .7rem; }
  .calendar-proj-pill { font-size: .6rem; padding: 1px 3px; }
}

/* ======================== ANDON COLOR SYSTEM ========================
   Standard Andon palette used across calendar pills, note borders,
   and any status-indicator that needs industrial color semantics.
   Green=running/OK · Amber=pending/attention · Red=stopped/blocked
   Orange=overdue · Purple=review · Gray=completed/cancelled
   ================================================================== */
:root {
  --andon-green:  #22c55e;
  --andon-amber:  #f59e0b;
  --andon-red:    #ef4444;
  --andon-orange: #f97316;
  --andon-purple: #a855f7;
  --andon-gray:   #9ca3af;
  --andon-dark:   #6b7280;
}

.calendar-proj-pill.pill-running   { background: #d1fae5; color: #065f46;  border-left: 3px solid #22c55e; }
.calendar-proj-pill.pill-stopped   { background: #fee2e2; color: #991b1b;  border-left: 3px solid #ef4444; }
.calendar-proj-pill.pill-postponed { background: #ede9fe; color: #5b21b6;  border-left: 3px solid #8b5cf6; }
.calendar-proj-pill.pill-late      { background: #ffedd5; color: #9a3412;  border-left: 3px solid #f97316; }
.calendar-proj-pill.pill-done      { background: #dbeafe; color: #1e40af;  border-left: 3px solid #3b82f6; }
.calendar-proj-pill.pill-cancelled { background: #f3f4f6; color: #4b5563;  border-left: 3px solid #6b7280; }

/* Note color swatches */
.qn-swatches { display: flex; gap: 4px; margin-right: 4px; align-items: center; }
.qn-swatch { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.15); cursor: pointer; transition: transform .1s, border-color .1s; flex-shrink: 0; }
.qn-swatch:hover { transform: scale(1.25); border-color: rgba(0,0,0,.45); }
.qn-swatch.active { border-color: rgba(0,0,0,.55); transform: scale(1.15); box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px rgba(0,0,0,.3); }

.cal-last-step {
  font-size: .58rem; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; padding-left: 2px; margin-top: 1px;
}

/* ======================== QN NOTE META & MARKER DOTS ======================== */
.qn-meta { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.qn-meta-text { font-size: .72rem; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qn-dots { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.qn-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid transparent; padding: 0; cursor: pointer;
  background: transparent; flex-shrink: 0;
  transition: background .12s, transform .1s;
  touch-action: manipulation;
}
.qn-dot:hover { transform: scale(1.3); }
.qn-dot[data-marker="flag"]  { border-color: var(--andon-red); }
.qn-dot[data-marker="track"] { border-color: var(--andon-amber); }
.qn-dot[data-marker="done"]  { border-color: var(--andon-green); }
.qn-dot.active[data-marker="flag"]  { background: var(--andon-red); }
.qn-dot.active[data-marker="track"] { background: var(--andon-amber); }
.qn-dot.active[data-marker="done"]  { background: var(--andon-green); }

/* Note card marker borders (Andon glow) — quick notes + canvas stickies */
.qn-card.marker-flag,  .sticky.marker-flag  { box-shadow: 0 0 0 3px var(--andon-red),   0 0 8px rgba(239,68,68,.35),  3px 5px 10px rgba(0,0,0,.15); }
.qn-card.marker-track, .sticky.marker-track { box-shadow: 0 0 0 3px var(--andon-amber), 0 0 8px rgba(245,158,11,.35), 3px 5px 10px rgba(0,0,0,.15); }
.qn-card.marker-done,  .sticky.marker-done  { box-shadow: 0 0 0 3px var(--andon-green), 0 0 8px rgba(34,197,94,.35),  3px 5px 10px rgba(0,0,0,.15); }

/* Compact responsable column in project list table */
.td-responsible { max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* type cards re-use .stats-grid and .stat-card — no extra CSS needed */

/* ── Comment popover in projects list ── */
.proj-comments-pop {
  position: fixed; z-index: 9999;
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.22);
  width: 300px; max-height: 340px;
  display: flex; flex-direction: column; overflow: hidden;
}
.pcp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 13px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .82rem; flex-shrink: 0;
  background: #f8fafc;
}
.pcp-close {
  background: none; border: none; cursor: pointer; font-size: .9rem;
  color: var(--text-muted); padding: 2px 5px; border-radius: 4px;
}
.pcp-close:hover { background: var(--content-bg); }
.pcp-body {
  overflow-y: auto; padding: 10px 13px;
  display: flex; flex-direction: column; gap: 10px;
}
.pcp-item { font-size: .82rem; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.pcp-item:last-child { border-bottom: none; padding-bottom: 0; }
.pcp-text { color: var(--text); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.pcp-meta { color: var(--text-muted); font-size: .7rem; margin-top: 4px; }

/* qn-wall inside the comments drawer: single column */
.comments-drawer-body .qn-wall {
  flex-direction: column; flex-wrap: nowrap;
}
.comments-drawer-body .qn-card { width: 100%; }

/* ======================== COMMENTS DRAWER ======================== */
.comments-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 1100; opacity: 0; transition: opacity .25s;
}
.comments-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(400px, 100vw); z-index: 1101;
  display: flex; flex-direction: column;
  background: var(--surface); box-shadow: -4px 0 24px rgba(0,0,0,.18);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.comments-drawer.open { transform: translateX(0); }
.comments-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .95rem; flex-shrink: 0;
}
.comments-drawer-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-muted); padding: 4px 6px;
  border-radius: 4px;
}
.comments-drawer-close:hover { background: var(--bg); color: var(--text); }
.comments-drawer-body {
  flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px;
}
.comments-drawer-add {
  display: flex; gap: 8px; flex-direction: column;
}
.cd-qn-wall {
  display: flex; flex-direction: column; gap: 10px;
}
.cd-qn-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  position: relative; transition: box-shadow .15s;
}
.cd-qn-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.cd-qn-card.marker-flag  { border-left: 3px solid var(--andon-red);   box-shadow: 0 0 0 1px var(--andon-red),   0 0 6px rgba(239,68,68,.2); }
.cd-qn-card.marker-track { border-left: 3px solid var(--andon-amber); box-shadow: 0 0 0 1px var(--andon-amber), 0 0 6px rgba(245,158,11,.2); }
.cd-qn-card.marker-done  { border-left: 3px solid var(--andon-green); box-shadow: 0 0 0 1px var(--andon-green), 0 0 6px rgba(34,197,94,.2); }
.cd-qn-text { font-size: .875rem; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.cd-qn-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .72rem; color: var(--text-muted); }
.cd-qn-dots { display: flex; gap: 4px; margin-left: auto; }
.cd-qn-del { position: absolute; top: 6px; right: 8px; background: none; border: none; cursor: pointer; font-size: .75rem; color: var(--text-light); padding: 2px 4px; border-radius: 3px; }
.cd-qn-del:hover { color: var(--danger); background: rgba(220,38,38,.08); }
.comments-open-btn { display: inline-flex; align-items: center; gap: 6px; }

/* ── Brand logo / PWA ── */
.app-logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.app-logo-slot--sidebar { width: 72px; height: 44px; margin-left: auto; margin-right: auto; }
.app-logo-slot--settings {
  width: 120px; height: 72px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
}
.app-logo-slot--login { width: 140px; height: 72px; margin-left: auto; margin-right: auto; }

.app-logo { display: block; flex-shrink: 0; object-position: center; margin-left: auto; margin-right: auto; }

.app-logo--sidebar.app-logo--round  { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,.12); margin: 0 auto; }
.app-logo--sidebar.app-logo--square { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); padding: 2px; margin: 0 auto; }
.app-logo--sidebar.app-logo--rect   { max-width: 72px; max-height: 40px; width: auto; height: auto; border-radius: 6px; object-fit: contain; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); padding: 2px 4px; margin: 0 auto; display: block; }

.app-logo--login.app-logo--round  { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,.15); }
.app-logo--login.app-logo--square { width: 64px; height: 64px; border-radius: 12px; object-fit: contain; padding: 4px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); }
.app-logo--login.app-logo--rect   { max-width: 132px; max-height: 48px; width: auto; height: auto; border-radius: 8px; object-fit: contain; padding: 4px 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); }

.app-logo--settings.app-logo--round  { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.app-logo--settings.app-logo--square { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; padding: 4px; }
.app-logo--settings.app-logo--rect   { max-width: 112px; max-height: 44px; width: auto; height: auto; border-radius: 8px; object-fit: contain; padding: 2px 6px; }

.app-logo-fallback--login {
  width: 64px; height: 64px;
  background: var(--primary); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-left: auto; margin-right: auto;
}
.app-logo-fallback--settings {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.6rem;
}

.logo-settings-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview-wrap { display: flex; align-items: center; justify-content: center; }
.logo-style-options { display: flex; gap: 16px; flex-wrap: wrap; }
.logo-style-opt { display: flex; align-items: center; gap: 6px; font-size: var(--fs-base); cursor: pointer; }

.show-mobile-only { display: none !important; }
.show-mobile-only-block { display: none !important; }
@media (max-width: 768px) {
  .show-mobile-only { display: inline-flex !important; }
  .show-mobile-only-block { display: block !important; }
}

.notif-perm-banner {
  position: relative;
  padding: 12px 32px 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.notif-perm-banner p { margin: 0 0 10px; color: var(--text-muted); padding-right: 4px; }
.notif-perm-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
}
.notif-perm-close:hover { color: var(--text); background: rgba(0,0,0,.06); }

/* ── Sticky chrome (controles en esquinas) ── */
.sticky-chrome {
  position: absolute; top: 4px; left: 4px; right: 4px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 4px; z-index: 3;
}
.sticky-chrome-left {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap; max-width: calc(100% - 28px);
}
.sticky-chrome-dots { display: flex; gap: 3px; margin: 0; }
.sticky-chrome .sticky-del {
  position: static; flex-shrink: 0;
  width: 22px; height: 22px; min-width: 22px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; border-radius: 4px;
}
.sticky-chrome .sticky-color-btn,
.sticky-chrome .sticky-vis-btn {
  min-width: 24px; min-height: 24px; padding: 2px 4px; font-size: .78rem;
}
.sticky.has-chrome { padding-top: 30px; }
.sticky-foot-compact {
  margin-top: auto; display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; padding-top: 8px;
}
.sticky-user-line { font-size: var(--fs-sm); font-weight: 600; opacity: .72; line-height: 1.2; }
.sticky-datetime { font-size: var(--fs-sm); color: rgba(0,0,0,.42); line-height: 1.25; white-space: nowrap; }
.sticky.dragging { opacity: 0.55; cursor: grabbing; }

/* ── Paquete de iconos ── */
.app-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; line-height: 1; flex-shrink: 0; }
.app-icon.icon-emoji { font-size: 1.05em; }
.app-icon.icon-svg { stroke: currentColor; }
.nav-icon { width: 1.35rem; text-align: center; }
.nav-icon .icon-svg { display: block; margin: 0 auto; }
.stat-icon .icon-svg { display: block; margin: 0; opacity: .92; }
.stat-icon .app-icon { margin-left: 0 !important; margin-right: 0 !important; }
.stat-icon-svg.icon-svg { width: 22px; height: 22px; }
.sticky-chrome .app-icon.icon-svg { width: 16px; height: 16px; }
.sticky-vis-btn .icon-svg { width: 15px; height: 15px; }
.notif-bell-btn .app-icon { display: flex; }
.app-logo-fallback .app-icon { opacity: .85; }
.icon-pack-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 4px; }
.icon-pack-opt {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  background: #fff; transition: border-color .15s, background .15s;
}
.icon-pack-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-light, #eff6ff); }
.icon-pack-opt input { margin-right: 6px; }
.icon-pack-opt-title { font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.icon-pack-opt-desc { font-size: .75rem; color: var(--text-muted); padding-left: 22px; }
.icon-pack-preview-wrap { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: #fff; }
.icon-pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.icon-pack-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 6px; background: #f8fafc; text-align: center; }
.icon-pack-cell { font-size: 1.25rem; }
.icon-pack-label { font-size: .58rem; color: var(--text-muted); line-height: 1.2; word-break: break-word; }

.month-type-click { cursor: pointer; border-radius: var(--radius-sm); transition: background .12s; }
.month-type-click:hover { background: var(--primary-light, #eff6ff); }
