/* ============================================================
   ENFOQUE MEDIA SOCIAL MANAGER — app.css
   ============================================================ */

:root {
  --c-brand:       #e8001c;
  --c-brand-dark:  #b50016;
  --c-brand-bg:    #fff0f2;
  --c-brand-muted: rgba(232,0,28,.08);
  --c-success:     #16a34a;
  --c-success-bg:  #f0fdf4;
  --c-warning:     #d97706;
  --c-warning-bg:  #fffbeb;
  --c-danger:      #dc2626;
  --c-danger-bg:   #fef2f2;
  --c-info:        #1d4ed8;
  --c-info-bg:     #eff6ff;

  --sidebar-w:     220px;
  --topbar-h:      56px;

  --bg:            #f8f8f7;
  --bg-card:       #ffffff;
  --bg-secondary:  #f3f2ee;
  --border:        rgba(0,0,0,.1);
  --border-strong: rgba(0,0,0,.18);
  --text-primary:  #1a1a18;
  --text-secondary:#6b6b65;
  --text-muted:    #9b9b93;

  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);

  font-size: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #1a1a18;
    --bg-card:       #242420;
    --bg-secondary:  #2c2c28;
    --border:        rgba(255,255,255,.10);
    --border-strong: rgba(255,255,255,.18);
    --text-primary:  #e8e8e2;
    --text-secondary:#9b9b93;
    --text-muted:    #6b6b65;
    --c-brand-bg:    rgba(232,0,28,.15);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { height: 100%; background: var(--bg); color: var(--text-primary); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- APP SHELL ---- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
  grid-column: 1;
  grid-row: 1;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-card);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--c-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.logo-mark.large { width: 40px; height: 40px; font-size: 18px; }
.logo-name  { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.logo-sub   { font-size: 11px; color: var(--text-secondary); }

.sidebar-nav { padding: 8px; flex: 1; }
.nav-group { margin-bottom: 16px; }
.nav-group-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; padding: 0 8px; margin-bottom: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary);
  transition: background .12s, color .12s;
  cursor: pointer;
}
.nav-item:hover { background: var(--bg-secondary); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--c-brand-bg); color: var(--c-brand); font-weight: 500; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--c-brand); color: #fff; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center; }
.nav-badge.warn { background: var(--c-warning); }

.sidebar-footer {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px;
  border-top: 0.5px solid var(--border);
  flex-shrink: 0;
}
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--c-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: 12px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: var(--text-secondary); }
.logout-btn { color: var(--text-muted); padding: 4px; border-radius: 4px; display: flex; }
.logout-btn:hover { color: var(--c-brand); background: var(--c-brand-bg); }

/* ---- MAIN CONTENT ---- */
.main-content {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 4px; }
.page-title { font-size: 15px; font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; align-items: center; position: relative; flex-shrink: 0; }

.page-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: var(--bg);
}

/* ---- ALERTS ---- */
.alert {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-md);
  font-size: 13px; margin: 0 0 12px;
  border: 0.5px solid transparent;
}
.alert-success { background: var(--c-success-bg); color: var(--c-success); border-color: #bbf7d0; }
.alert-error   { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: #fde68a; }
.alert-info    { background: var(--c-info-bg);    color: var(--c-info);    border-color: #bfdbfe; }
.alert-close { background: none; border: none; cursor: pointer; font-size: 16px; color: inherit; line-height: 1; padding: 0 2px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 0.5px solid var(--border-strong);
  background: var(--bg-card); color: var(--text-primary);
  transition: background .12s, border-color .12s, transform .08s;
  white-space: nowrap; font-family: inherit;
  text-decoration: none;
}
.btn:hover { background: var(--bg-secondary); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.btn-primary:hover { background: var(--c-brand-dark); border-color: var(--c-brand-dark); }
.btn-success { background: var(--c-success-bg); color: var(--c-success); border-color: #bbf7d0; }
.btn-success:hover { background: #dcfce7; }
.btn-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: #fde68a; }
.btn-warning:hover { background: #fef3c7; }
.btn-danger  { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }
.btn-danger:hover  { background: #fee2e2; }
.btn-error   { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ---- FORMS ---- */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 10px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit;
  background: var(--bg-card); color: var(--text-primary);
  transition: border-color .12s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-muted);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; }
.form-label-link { float: right; font-weight: 400; color: var(--c-brand); }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-hint  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.required { color: var(--c-brand); }

.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 38px; }
.input-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; }

/* ---- FORM LAYOUT ---- */
.form-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 16px; }
.form-sidebar { display: flex; flex-direction: column; gap: 12px; }
.form-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.form-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 0.5px solid var(--border); }
.form-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ---- TABLES ---- */
.table-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 0.5px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; padding: 10px 16px; background: var(--bg-secondary); border-bottom: 0.5px solid var(--border); }
.data-table td { padding: 10px 16px; font-size: 13px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-secondary); }
.row-error td { background: rgba(220,38,38,.04); }
.actions-col { width: 1px; white-space: nowrap; }
.actions-cell { display: flex; gap: 5px; }
.muted-cell { color: var(--text-secondary); }
.muted-text { font-size: 11px; color: var(--text-muted); }

/* ---- STATS GRID ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 14px 16px; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 600; color: var(--text-primary); line-height: 1; }
.stat-delta { font-size: 11px; margin-top: 5px; }
.stat-delta.up   { color: var(--c-success); }
.stat-delta.down { color: var(--c-danger); }
.stat-delta.warn { color: var(--c-warning); }
.stat-delta.err  { color: var(--c-brand); }
.stat-delta.neutral { color: var(--text-muted); }

/* ---- CARDS GRID ---- */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 13px; font-weight: 600; }
.card-link  { font-size: 12px; color: var(--c-brand); }

/* ---- STATUS PILLS ---- */
.status-pill { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.status-draft     { background: var(--bg-secondary); color: var(--text-secondary); }
.status-pending   { background: var(--c-warning-bg); color: #92400e; }
.status-approved  { background: #eff6ff; color: #1d4ed8; }
.status-scheduled { background: #eff6ff; color: #1d4ed8; }
.status-queued    { background: #f5f3ff; color: #6d28d9; }
.status-published { background: var(--c-success-bg); color: #14532d; }
.status-partial   { background: #fff7ed; color: #c2410c; }
.status-error     { background: var(--c-danger-bg); color: #9f1239; }
.status-cancelled { background: var(--bg-secondary); color: var(--text-muted); }
.status-active    { background: var(--c-success-bg); color: #14532d; }
.status-inactive  { background: var(--bg-secondary); color: var(--text-muted); }
.status-disconnected { background: var(--bg-secondary); color: var(--text-muted); }

/* ---- NETWORK COLORS ---- */
.net-facebook  { --nc: #1877f2; --nc-bg: #e7f0fd; }
.net-instagram { --nc: #c13584; --nc-bg: #fce7f3; }
.net-x         { --nc: #000;    --nc-bg: #f0f0f0; }
.net-tiktok    { --nc: #ee1d52; --nc-bg: #ffe8f0; }
.net-badge, .net-chip-sm, .net-chip-xs { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--nc-bg); color: var(--nc); }
.net-chip-xs { font-size: 9px; padding: 1px 6px; }
.net-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--nc); }
.net-bar  { height: 6px; border-radius: 3px; background: var(--nc); transition: width .3s; }

.net-connect-btn.net-facebook  { background: #e7f0fd; color: #1877f2; border-color: #c5d8f9; }
.net-connect-btn.net-instagram { background: #fce7f3; color: #c13584; border-color: #f5c0db; }
.net-connect-btn.net-x         { background: #f0f0f0; color: #000; border-color: #d0d0d0; }
.net-connect-btn.net-tiktok    { background: #ffe8f0; color: #ee1d52; border-color: #ffc0cc; }

/* ---- NETWORK CHIPS (selector) ---- */
.network-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.net-chip-label { cursor: pointer; }
.net-chip-label input { display: none; }
.net-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 20px;
  border: 1.5px solid var(--border-strong);
  font-size: 13px; color: var(--text-secondary);
  transition: all .12s; user-select: none;
}
.net-chip-label input:checked + .net-chip { font-weight: 600; }
.net-chip-label.net-facebook  input:checked + .net-chip { border-color: #1877f2; color: #1877f2; background: #e7f0fd; }
.net-chip-label.net-instagram input:checked + .net-chip { border-color: #c13584; color: #c13584; background: #fce7f3; }
.net-chip-label.net-x         input:checked + .net-chip { border-color: #333; color: #000; background: #f0f0f0; }
.net-chip-label.net-tiktok    input:checked + .net-chip { border-color: #ee1d52; color: #ee1d52; background: #ffe8f0; }
.net-chip-label.disabled .net-chip { opacity: .4; cursor: not-allowed; }

/* ---- TABS ---- */
.tabs-bar { display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: 7px 12px; font-size: 12px; font-family: inherit;
  cursor: pointer; border: none; background: none;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .12s;
}
.tab-btn.active { color: var(--c-brand); border-bottom-color: var(--c-brand); font-weight: 500; }
.tab-btn:hover:not(.active) { color: var(--text-primary); }
.tab-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.char-counter { text-align: right; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- FILTERS BAR ---- */
.filters-bar { margin-bottom: 14px; }
.filters-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-input { width: 200px; }
.filter-select { width: 160px; }

/* ---- DASHBOARD ITEMS ---- */
.post-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.post-row:last-child { border-bottom: none; }
.post-nets { display: flex; gap: 3px; }
.post-info { flex: 1; min-width: 0; }
.post-title-text { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta-text  { font-size: 11px; color: var(--text-secondary); }

.account-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.account-row:last-child { border-bottom: none; }
.account-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.account-status-dot.status-active { background: #22c55e; }
.account-status-dot.status-error  { background: #ef4444; }
.account-status-dot.status-inactive, .account-status-dot.status-disconnected { background: #d1d5db; }
.account-info { flex: 1; min-width: 0; }
.account-name { font-size: 13px; font-weight: 500; }
.account-sub  { font-size: 11px; color: var(--text-secondary); }

.approval-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.approval-card { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 10px; }
.approval-title { font-size: 12px; font-weight: 500; margin-bottom: 3px; }
.approval-meta  { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.approval-actions { display: flex; gap: 6px; }

.net-stat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.net-label { font-size: 12px; width: 70px; color: var(--text-secondary); }
.net-bar-wrap { flex: 1; height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.net-count { font-size: 12px; font-weight: 500; width: 28px; text-align: right; }
.net-bar.net-facebook  { background: #1877f2; }
.net-bar.net-instagram { background: #c13584; }
.net-bar.net-x         { background: #333; }
.net-bar.net-tiktok    { background: #ee1d52; }

.activity-bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; padding-bottom: 16px; }
.act-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; }
.act-bar { width: 100%; border-radius: 2px 2px 0 0; background: var(--c-brand); opacity: .3; min-height: 4px; }
.act-bar.today { opacity: 1; }
.act-label { font-size: 9px; color: var(--text-muted); }

.error-row { padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.error-row:last-child { border-bottom: none; }
.error-title { font-size: 12px; font-weight: 500; }
.error-msg   { font-size: 11px; color: var(--c-danger); margin-top: 2px; }
.error-time  { font-size: 10px; color: var(--text-muted); }
.error-detail { font-size: 11px; color: var(--c-danger); margin-top: 3px; }

/* ---- MEDIA GRID ---- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.media-card:hover { border-color: var(--c-brand); box-shadow: var(--shadow-sm); }
.media-preview { aspect-ratio: 1; overflow: hidden; position: relative; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-video-thumb { font-size: 36px; }
.media-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; gap: 10px; opacity: 0; transition: opacity .15s; }
.media-card:hover .media-overlay { opacity: 1; }
.media-action { color: #fff; font-size: 16px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.2); border-radius: 50%; cursor: pointer; text-decoration: none; }
.media-action:hover { background: rgba(255,255,255,.35); }
.media-delete:hover { background: rgba(220,38,38,.7); }
.media-info { padding: 8px; }
.media-name { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.media-uploader { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.media-selected { display: flex; flex-wrap: wrap; gap: 8px; min-height: 24px; margin-bottom: 10px; }
.media-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-secondary); border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12px; }
.media-chip button { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; line-height: 1; }
.media-chip button:hover { color: var(--c-danger); }

.upload-zone, .upload-dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.upload-zone:hover, .upload-dropzone:hover,
.drag-over { border-color: var(--c-brand); background: var(--c-brand-bg); color: var(--c-brand); }
.upload-hint { font-size: 11px; color: var(--text-muted); }
.upload-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.upload-progress-bar > div { height: 100%; background: var(--c-brand); border-radius: 2px; transition: width .2s; }

.media-grid-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.media-thumb-picker {
  aspect-ratio: 1; background: var(--bg-secondary);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; font-size: 20px; gap: 3px; transition: border-color .12s;
}
.media-thumb-picker:hover { border-color: var(--c-brand); }
.media-thumb-picker.selected { border-color: var(--c-brand); border-width: 2px; background: var(--c-brand-bg); }
.media-thumb-name { font-size: 9px; color: var(--text-secondary); text-align: center; padding: 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }

/* ---- MODAL ---- */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-box { position: relative; background: var(--bg-card); border-radius: var(--radius-lg); border: 0.5px solid var(--border); width: 620px; max-width: 95vw; max-height: 80vh; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 0.5px solid var(--border); font-weight: 500; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-muted); line-height: 1; }
.modal-body { overflow-y: auto; padding: 16px; flex: 1; }
.modal-footer { padding: 12px 16px; border-top: 0.5px solid var(--border); display: flex; justify-content: flex-end; }

/* ---- CALENDAR ---- */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.cal-month-label { font-size: 15px; font-weight: 600; min-width: 160px; text-align: center; }
.calendar-wrap { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cal-header-row { display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 0.5px solid var(--border); }
.cal-head { padding: 10px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; background: var(--bg-secondary); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-cell { min-height: 90px; padding: 6px 8px; border-right: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.cal-empty { background: var(--bg-secondary); }
.cal-cell.cal-today { background: var(--c-brand-bg); }
.cal-day-num { font-size: 12px; font-weight: 500; margin-bottom: 4px; color: var(--text-secondary); }
.cal-cell.cal-today .cal-day-num { color: var(--c-brand); font-weight: 700; }
.cal-event { display: block; font-size: 10px; padding: 2px 5px; border-radius: 3px; background: var(--bg-secondary); color: var(--text-primary); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-event:hover { opacity: .8; }
.cal-more { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ---- POST STATUS BAR ---- */
.post-status-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 14px; background: var(--bg-secondary); border: 0.5px solid var(--border); }

/* ---- POST SHOW ---- */
.post-copy-box { background: var(--bg-secondary); border-radius: var(--radius-sm); padding: 12px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; margin-bottom: 10px; }
.hashtags-display { font-size: 13px; color: var(--c-info); margin-bottom: 8px; }
.variant-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.variant-row:last-child { border-bottom: none; }
.variant-copy { font-size: 13px; flex: 1; }
.notes-box { margin-top: 12px; padding: 10px 12px; background: var(--c-warning-bg); border: 0.5px solid var(--c-warning); border-radius: var(--radius-sm); font-size: 13px; }
.notes-label { font-weight: 500; color: var(--c-warning); }
.post-campaign-tag { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.target-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 0.5px solid var(--border); flex-wrap: wrap; }
.target-row:last-child { border-bottom: none; }

.approval-card { border: 1.5px solid #fde68a; background: var(--c-warning-bg); }
.comment-row { padding: 10px 0; border-bottom: 0.5px solid var(--border); }
.comment-row:last-child { border-bottom: none; }
.comment-row.action-approved .comment-header { color: var(--c-success); }
.comment-row.action-rejected .comment-header { color: var(--c-danger); }
.comment-header { font-size: 12px; display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.comment-action { font-style: italic; color: var(--text-secondary); }
.comment-body { font-size: 13px; padding: 6px 10px; background: var(--bg-secondary); border-radius: var(--radius-sm); }

.media-attachments { display: flex; gap: 12px; flex-wrap: wrap; }
.media-attach-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100px; }
.media-attach-item img { width: 100px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); }
.video-thumb { width: 100px; height: 70px; background: var(--bg-secondary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.media-attach-name { font-size: 10px; color: var(--text-muted); text-align: center; word-break: break-all; }

/* ---- AUDIT ---- */
.audit-action-badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-secondary); font-family: monospace; }
.audit-action-badge.action-error { background: var(--c-danger-bg); color: var(--c-danger); }
.audit-action-badge.action-auth  { background: #eff6ff; color: #1d4ed8; }

/* ---- ROLES ---- */
.role-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.role-badge.role-Superadministrador, .role-badge.role-superadmin { background: #fdf2f8; color: #9d174d; }
.role-badge.role-admin_social { background: #eff6ff; color: #1e40af; }
.role-badge.role-editor    { background: var(--c-success-bg); color: #14532d; }
.role-badge.role-redactor  { background: var(--c-warning-bg); color: #78350f; }
.role-badge.role-publicador { background: #f5f3ff; color: #5b21b6; }
.role-badge.role-analista  { background: var(--bg-secondary); color: var(--text-secondary); }

/* ---- STATUS DOTS ---- */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-green { background: #22c55e; }
.dot-red   { background: #ef4444; }
.dot-gray  { background: #d1d5db; }

/* ---- BADGES ---- */
.badge { display: inline-block; font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 10px; }
.badge-warn { background: var(--c-warning-bg); color: #92400e; }

/* ---- MISC ---- */
.empty-state { font-size: 13px; color: var(--text-muted); padding: 12px 0; }
.empty-table { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-table p { margin-bottom: 12px; }
.empty-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 32px; text-align: center; color: var(--text-secondary); }
.info-box { background: var(--c-info-bg); border: 0.5px solid #bfdbfe; border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px; color: var(--text-secondary); }
.info-box strong { color: var(--c-info); }
.post-title-main a { font-weight: 500; color: var(--text-primary); }
.post-title-main a:hover { color: var(--c-brand); }
.post-campaign { font-size: 11px; color: var(--text-muted); }
.code-block { background: var(--bg-secondary); border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-family: monospace; font-size: 12px; color: var(--text-primary); word-break: break-all; margin-bottom: 8px; }
.template-btn { display: block; width: 100%; text-align: left; background: none; border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12px; cursor: pointer; color: var(--text-secondary); margin-bottom: 5px; transition: background .1s; font-family: inherit; }
.template-btn:hover { background: var(--c-brand-bg); color: var(--c-brand); border-color: var(--c-brand); }

/* ---- AUTH PAGES ---- */
.auth-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--bg); }
.auth-wrap { width: 100%; max-width: 400px; padding: 20px; }
.auth-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-md); }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-title  { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-footer { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 20px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 4px; padding: 12px 16px; justify-content: center; border-top: 0.5px solid var(--border); }
.page-btn { padding: 5px 10px; border-radius: var(--radius-sm); font-size: 13px; border: 0.5px solid var(--border); background: var(--bg-card); color: var(--text-secondary); transition: background .1s; text-decoration: none; }
.page-btn:hover { background: var(--bg-secondary); text-decoration: none; }
.page-btn.active { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }

/* ---- NOTIFICATION BELL ---- */
.notif-bell {
  position: relative; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-secondary); transition: background .12s, color .12s; flex-shrink: 0;
}
.notif-bell:hover { background: var(--bg-secondary); color: var(--text-primary); }
.notif-count {
  position: absolute; top: 4px; right: 4px;
  background: var(--c-brand); 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 3px; border: 2px solid var(--bg-card);
}
.notif-panel {
  position: absolute; top: calc(var(--topbar-h) - 4px); right: 0;
  width: 320px; background: var(--bg-card);
  border: 0.5px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); z-index: 500; overflow: hidden;
}
.notif-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 0.5px solid var(--border); font-size: 13px; font-weight: 600; }
.notif-item { padding: 10px 14px; border-bottom: 0.5px solid var(--border); cursor: pointer; transition: background .1s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-secondary); }
.notif-item.unread { background: var(--c-brand-bg); }
.notif-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notif-body  { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.notif-time  { font-size: 10px; color: var(--text-muted); }
.notif-empty { padding: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ---- RESPONSIVE — móvil ---- */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    position: static;
  }
  .sidebar.open {
    max-height: 100vh;
    overflow-y: auto;
  }
  .main-content {
    grid-column: 1;
    grid-row: 2;
    height: calc(100vh - var(--topbar-h));
  }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .form-sidebar { order: -1; }
  .form-row-2 { grid-template-columns: 1fr; }
  .approval-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filters-form { flex-direction: column; }
  .filter-input, .filter-select { width: 100%; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .data-table th:nth-child(n+4), .data-table td:nth-child(n+4) { display: none; }
}