:root {
    --bg: #0f1115;
    --card: #1a1d24;
    --text: #e6e6e6;
    --accent: #F24E1E;
    --green: #34d399;
    --border: #2a2f3d;
  }

  * {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui;
  }

  /* Scrollbar styling */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: #2e3342; border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: #3e4355; }

  /* ---------- Fondo decorativo ---------- */
  .bg-grid {
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(var(--border) 1px, transparent 1px),
      linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: .25;
    pointer-events: none;
    z-index: 0;
  }
  .bg-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(255, 114, 98, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  /* HEADER */
  .app-header {
    margin-top: 20px;
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
  }

  .logos-title {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px;
  }

  .logo {
    width: 320px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: default;
  }

  .logo:hover {
    transform: scale(1.05);
  }

  /* TOOLBAR ACTIONS (below search) */
  .toolbar-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 1100px;
    margin: 10px auto 0;
  }

  /* ------- SEARCH BAR ------- */
  .search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 340px;
    max-width: 480px;
    background: var(--card);
    border: 1px solid #2e3342;
    border-radius: 14px;
    padding: 6px 8px 6px 8px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    margin: 0 auto;
  }

  .search-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(242, 78, 30, 0.2);
    background: #1a1d24;
  }

  .search-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a90a1;
    font-size: 12px;
    flex-shrink: 0;
    order: -1;
  }

  #searchInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 14px;
    min-width: 0;
    font-family: system-ui;
  }

  #searchInput::placeholder {
    color: #5a5f6e;
    user-select: none;
  }

  .search-count {
    font-size: 11px;
    color: #5a5f6e;
    background: #262a34;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .clear-search {
    background: transparent;
    border: none;
    color: #5a5f6e;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: 0.2s;
    flex-shrink: 0;
  }

  .clear-search:hover {
    background: var(--accent);
    color: #fff;
    transform: rotate(90deg);
  }

  .clear-search.hidden {
    display: none;
  }

  .btn-icon-header {
    background: transparent;
    border: 1px solid #3a3f4f;
    color: var(--text);
    font-size: 16px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-icon-header:hover {
    background: #2c3242;
    border-color: var(--accent);
  }

  .year-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
  }

  .year-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    min-width: 40px;
    text-align: center;
  }

  /* NOTIF BADGE */
  .notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
  }

  .notif-badge.hidden {
    display: none;
  }

  .notif-bell-wrap {
    position: relative;
  }

  /* NOTIF DRAWER */
  .notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
  }
  .notif-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
  .notif-overlay.hidden {
    display: none;
  }

  .notif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    background: var(--card);
    border-left: 1px solid #2e3342;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
    box-shadow: -8px 0 30px rgba(0,0,0,0.5);
  }
  .notif-drawer.open {
    transform: translateX(0);
  }
  .notif-drawer.hidden {
    display: none;
  }

  .notif-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #2e3342;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
  }
  .notif-drawer-header span {
    text-align: left;
  }
  .notif-drawer-actions {
    display: flex;
    gap: 4px;
  }

  .notif-drawer-btn {
    background: none;
    border: none;
    color: #8a90a1;
    cursor: pointer;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
  }
  .notif-drawer-btn:hover {
    color: var(--text);
    background: #2c3242;
  }

  .notif-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
  }

  .notif-empty {
    color: #8a90a1;
    font-size: 13px;
    text-align: center;
    padding: 32px 20px;
    margin: 0;
  }

  .notif-drawer-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 18px;
    font-size: 13px;
    border-bottom: 1px solid rgba(46,51,66,0.4);
    transition: background 0.15s;
  }
  .notif-drawer-item:hover {
    background: rgba(255,255,255,0.03);
  }
  .notif-drawer-item-text {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
  }
  .notif-drawer-item-text span:first-child {
    flex: 1;
    line-height: 1.4;
    text-align: left;
  }
  .notif-drawer-time {
    flex-shrink: 0;
    font-size: 11px;
    color: #5a5f6e;
    line-height: 1.4;
    margin-top: 1px;
  }

  .notif-drawer-dismiss {
    background: none;
    border: none;
    color: #5a5f6e;
    cursor: pointer;
    font-size: 12px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.2s;
  }
  .notif-drawer-dismiss:hover {
    color: var(--text);
    background: #2c3242;
  }

  /* CALENDAR */
  .calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 1;
  }

  .calendar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 0;
  }
  
  .month {
    background: var(--card);
    padding: 12px;
    border-radius: 16px;
    width: 100%;
    transition: box-shadow 0.3s ease;
  }
  .month:hover {
    box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent);
  }
  
  .month h3 {
    text-transform: capitalize;
  }

  .month-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
  }

  .month-title:hover {
    opacity: 0.8;
  }

  .collapse-icon {
    font-size: 12px;
    color: #8a90a1;
    transition: transform 0.2s;
  }

  .month.collapsed .weekdays,
  .month.collapsed .days {
    display: none;
  }

  .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
  }

  .weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #8a90a1;
    padding: 4px 0;
  }
  
  .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }

  .day.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
  }

  .day.empty:hover {
    background: transparent;
  }
  
  .day {
    position: relative;
    padding: 8px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    background: #232733;
    border: 2px solid transparent;
    transition: 0.2s;
    min-height: 34px;
  }

  .day-num {
    position: relative;
    z-index: 1;
  }

  /* Badge con cantidad de slots completos */
  .day-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.35);
    border-radius: 999px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .day-badge:empty {
    display: none;
  }

  /* Estado: parcial (1-2 slots completos) */
  .day.partial {
    background: #3d3a1e;
    box-shadow: inset 0 0 0 1px #b89b1e;
  }

  /* Estado: completo (3+ slots completos) */
  .day.full {
    background: #1e3d2c;
    box-shadow: inset 0 0 0 1px #1e8f5a;
  }

  .day.today {
    box-shadow: inset 0 0 0 2px var(--green), 0 0 12px rgba(52, 211, 153, 0.35);
  }

  .day:hover {
    border-color: var(--accent);
  }

  .day.partial:hover,
  .day.full:hover {
    border-color: var(--accent);
  }

  /* SEARCH STATES */
  .day.search-match {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    animation: pulseMatch 1.2s ease-out;
  }

  .day.search-dim {
    opacity: 0.25;
  }

  @keyframes pulseMatch {
    0%   { box-shadow: 0 0 0 0 rgba(242, 78, 30, 0.6); }
    100% { box-shadow: 0 0 0 10px rgba(242, 78, 30, 0); }
  }
  
  /* MODAL */
  .modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .modal.hidden {
    display: flex;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.97);
  }
  .modal-content {
    background: var(--card);
    padding: 20px;
    border-radius: 16px;
    width: 95%;
    max-width: 1000px;
    max-height: 95vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
  }

  .modal-header h2 {
    margin: 0;
    font-size: 18px;
  }

  .modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
  }

  .modal-close-btn:hover {
    background: #2c3242;
  }

  #captureArea {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-actions {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .btn-export-option {
    background: var(--card);
    color: var(--text);
    border: 1px solid #2e3342;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    text-align: left;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .btn-export-option:hover {
    border-color: var(--accent);
    background: #1f232e;
  }

  .slot-actions {
    display: flex;
    gap: 8px;
  }

  .btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid #3a3f4f;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
  }

  .btn-secondary:hover:not(:disabled) {
    background: #2c3242;
    border-color: var(--accent);
  }

  .btn-secondary:disabled {
    cursor: not-allowed;
  }

  #captureBtn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
  }

  #captureBtn:hover {
    filter: brightness(1.1);
  }

  /* TABLE */
  .planner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }

  .content-reference-table td {
    padding: 12px;
    vertical-align: middle;
  }

  .format-tag {
    display: inline-block;
    background: #2c3242;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px;
    font-size: 11px;
  }

  .drag-handle-cell {
    text-align: center;
    width: 40px;
    color: #4a4f5d;
  }

  .unit-cell-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px; /* Match drop-zone height */
    width: 100%;
  }

  .format-tag.clickable,
  .format-clickable {
    cursor: pointer;
    transition: background 0.2s;
  }
  .format-clickable:hover {
    background: #3a4050;
  }

  .drop-zone {
    min-height: 40px;
  }

  .remove-format {
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
  }

  .remove-format:hover {
    opacity: 1;
    color: #ff4d4d;
  }

  /* Format Picker (click-to-assign) */
  .format-picker {
    background: #1a1d24;
    border: 1px solid #2e3342;
    border-radius: 10px;
    padding: 8px;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    min-width: 180px;
  }
  .format-picker-header {
    font-size: 12px;
    color: #8a90a1;
    padding: 4px 8px 8px;
    border-bottom: 1px solid #2e3342;
    margin-bottom: 6px;
  }
  .format-picker-unit {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
  }
  .format-picker-unit:hover {
    background: #2c3242;
  }
  .format-picker-unit.picked {
    color: var(--green);
    opacity: 0.6;
    cursor: default;
  }
  .format-picker-unit.picked:hover {
    background: none;
  }

  .remove-unit {
    cursor: pointer;
    opacity: 0.3;
    font-size: 10px;
    transition: opacity 0.2s, color 0.2s;
    margin-left: 8px;
  }

  .remove-unit:hover {
    opacity: 1;
    color: #ff4d4d;
  }

  .unit-manager-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
  }
  
  .planner-table th,
  .planner-table td {
    border: 1px solid #333;
    padding: 6px;
    vertical-align: middle;
  }
  
  /* INPUTS */
  select,
  input,
  textarea {
    width: 100%;
    background: #111;
    color: white;
    border: none;
    padding: 4px;
  }
  
  textarea {
    resize: none;
  }
  
  /* Eliminar fondos y ajustar expansión de campos específicos */
  .planner-table input[type="number"],
  .planner-table textarea {
    background: transparent;
  }

  .planner-table td:last-child {
    padding: 0;
  }

  .planner-table textarea {
    display: block;
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 44px;
  }

  /* FOOTER */
  .app-footer {
    text-align: center;
    padding: 40px 20px;
    color: #8a90a1;
    position: relative;
    z-index: 1;
  }
  .app-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
  }
  .app-footer a:hover {
    text-decoration: underline;
  }

  /* REDES */
  .checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    justify-items: center;
  }
  
  .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
  }
  
  .checkbox-group label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #1f2330;
    cursor: pointer;
    transition: 0.2s;
  }
  
  .checkbox-group input {
    display: none;
  }
  
  .checkbox-group i {
    font-size: 14px;
    color: #474747;
  }
  
  /* Estado activo */
  .checkbox-group input:checked + i {
    color: #fff;
  }
  
  /* Hover */
  .checkbox-group label:hover {
    background: #2c3242;
  }

/* FORMATO COLORS (VERSIÓN LEGIBLE DARK MODE) */
.format-capcut { background: #780000; color: #fff; }
.format-carrusel { background: #023e8a; color: #fff; }
.format-memes { background: #ffc600; color: #fff; }
.format-stream { background: #7b2cbf; color: #fff; }
.format-greenscreen { background: #2a9d8f; color: #fff; }
.format-vlog { background: #bc6c25; color: #fff; }
.format-fyp { background: #dd2d4a; color: #fff; }
.format-comentarios { background: #4a4e69; color: #fff; }
.format-trend { background: #e85d04; color: #fff; }
.format-podcast { background: #004e89; color: #fff; }
.format-proyectos-ia { background: #d80032; color: #fff; }
.format-portfolio { background: #3b28cc; color: #fff; }

/* =======================================
   TOAST
   ======================================= */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3242;
  color: var(--text);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  white-space: nowrap;
}
#toast.visible {
  opacity: 1;
}

/* =======================================
   TOGGLE SWITCH
   ======================================= */
.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  cursor: pointer;
}
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  background: #3a3f4f;
  border-radius: 24px;
  cursor: pointer;
  transition: 0.3s;
}
.slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.switch input:checked + .slider {
  background: var(--accent);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* =======================================
   SETTINGS
   ======================================= */
.settings-section {
  margin-bottom: 16px;
}
.settings-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #8a90a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.settings-inline-input {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.settings-inline-input input {
  flex: 1;
}
.settings-inline-input .btn-secondary {
  padding: 6px 12px;
  flex-shrink: 0;
}
.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #232733;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}
.settings-item-actions {
  display: flex;
  gap: 4px;
}
.settings-item-actions .edit-btn,
.settings-item-actions .remove-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.settings-item-actions .edit-btn {
  color: #8a90a1;
}
.settings-item-actions .edit-btn:hover {
  color: var(--text);
  background: #2c3242;
}
.settings-item-actions .remove-btn {
  color: #ff4d4d;
  opacity: 0.5;
}
.settings-item-actions .remove-btn:hover {
  opacity: 1;
  background: rgba(255,77,77,0.1);
}

/* =======================================
   ONBOARDING
   ======================================= */
.onboarding-steps {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.onboarding-steps li {
  padding: 8px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.onboarding-steps li i {
  width: 20px;
  text-align: center;
  color: var(--accent);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}
.btn-primary:hover {
  filter: brightness(1.1);
}

.vis-toggle-unit {
  background: transparent;
  border: 1px solid #3a3f4f;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text);
  transition: 0.2s;
}
.vis-toggle-unit:hover {
  border-color: var(--accent);
}

/* =======================================
   WEEK VIEW
   ======================================= */
.week-day {
  background: #232733;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.week-day-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: capitalize;
}
.week-slot {
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #2e3342;
}
.week-slot:last-child {
  border-bottom: none;
}
.week-slot.empty {
  color: #6b7180;
  font-style: italic;
}

/* =======================================
   STATS
   ======================================= */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: #232733;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}
.stat-card span:last-child {
  font-size: 11px;
  color: #8a90a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stats-list h4 {
  font-size: 13px;
  color: #8a90a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px;
}
.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 13px;
  background: #232733;
  border-radius: 6px;
  margin-bottom: 4px;
}
@media (max-width: 1024px) and (min-width: 769px) {
  .calendar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .app-header {
    padding: 14px;
  }

  .logos-title {
    gap: 8px;
  }

  .logo {
    width: 180px;
    font-size: 18px;
  }

  .calendar {
    grid-template-columns: 1fr;
  }

  .app-header h1 {
    font-size: 20px;
  }

  /* Toolbar compacta en móvil */
  .search-wrap {
    flex: 1 1 100%;
    max-width: none;
    padding: 5px 7px;
    border-radius: 12px;
  }

  .search-icon {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  #searchInput {
    font-size: 15px; /* ≥16px para evitar zoom iOS en foco, pero 15 es aceptable acá */
  }

  .search-count {
    font-size: 9px;
    padding: 4px 8px;
  }

  .clear-search {
    width: 26px;
    height: 26px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
  }

  .toolbar-actions .btn-icon-header {
    font-size: 17px;
    padding: 8px;
    width: 38px;
    height: 38px;
  }

  .toolbar-actions .year-nav {
    order: 10;
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }
  .toolbar-actions .year-nav .year-display {
    font-size: 18px;
    padding: 4px 14px;
  }
  .toolbar-actions .year-nav .btn-icon-header {
    font-size: 16px;
    padding: 8px;
  }

  .notif-drawer {
    width: 85vw;
  }

  .calendar {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 12px;
  }

  /* Modal general en móvil */
  .modal {
    padding: 6px;
    align-items: flex-start;
  }

  .modal-content {
    padding: 14px;
    border-radius: 14px;
    max-height: 98vh;
    width: 100%;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  /* Evitar scroll horizontal: tabla pasa a tarjetas */
  #captureArea {
    overflow-x: visible;
  }

  /* --- TABLA COMO TARJETAS --- */
  .planner-table,
  .planner-table thead,
  .planner-table tbody,
  .planner-table tr,
  .planner-table th,
  .planner-table td {
    display: block;
    width: 100%;
  }

  /* Ocultar cabeceras */
  .planner-table thead {
    position: absolute;
    left: -9999px;
    top: -9999px;
  }

  .planner-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  /* Cada fila = tarjeta */
  .planner-table tbody tr {
    background: #232733;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid #2e3342;
  }

  /* Cada celda = bloque con etiqueta */
  .planner-table td {
    border: none;
    border-bottom: 1px dashed #3a3f4f;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .planner-table td:last-child {
    border-bottom: none;
  }

  /* Etiquetas generadas con ::before */
  .planner-table td::before {
    content: attr(data-label);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #8a90a1;
    font-weight: 600;
  }

  /* Labels por posición (orden fijo de columnas) */
  .planner-table tbody tr td:nth-child(1)::before { content: "Hora"; }
  .planner-table tbody tr td:nth-child(2)::before { content: "Unidad"; }
  .planner-table tbody tr td:nth-child(3)::before { content: "Formato"; }
  .planner-table tbody tr td:nth-child(4)::before { content: "Redes"; }
  .planner-table tbody tr td:nth-child(5)::before { content: "Likes"; }
  .planner-table tbody tr td:nth-child(6)::before { content: "Alcance"; }
  .planner-table tbody tr td:nth-child(7)::before { content: "Comentarios"; }

  /* Inputs más cómodos (font-size >= 16px evita zoom en iOS) */
  .planner-table input,
  .planner-table select,
  .planner-table textarea {
    width: 100%;
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    background: #111;
  }

  .planner-table textarea {
    min-height: 70px;
  }

  /* Redes: permitir que los 6 iconos respiren */
  .planner-table .checkbox-group {
    gap: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
  }

  .planner-table .checkbox-group label {
    width: 36px;
    height: 36px;
  }

  .planner-table .checkbox-group i {
    font-size: 16px;
  }

  /* Botones full-width en móvil */
  .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .slot-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .btn-secondary {
    justify-content: center;
    padding: 10px;
    font-size: 14px;
  }

  #captureBtn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {

  .modal-content {
    padding: 12px;
  }

  .modal-header h2 {
    font-size: 14px;
  }

  .planner-table tbody tr {
    padding: 10px;
    margin-bottom: 12px;
  }
}
