:root {
  --demo-bg: #ffffff;
  --demo-surface: #ffffff;
  --demo-border: rgba(0,0,0,.10);
  --demo-muted: rgba(0,0,0,.65);
  --demo-shadow: 0 10px 25px rgba(0,0,0,.10);
  --demo-radius: 14px;
  --demo-green: #22C55E;
  --demo-blue: #3B82F6;
  --demo-purple: #8B5CF6;
  --demo-amber: #F59E0B;
  --demo-red: #EF4444;
}

.demo-wrap { max-width: 100%; margin: 0 auto; padding: 28px 24px 56px; font-family: Inter, system-ui, -apple-system, Segoe UI, Arial; }
.demo-topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding: 14px 16px; border-radius: var(--demo-radius); background: rgba(0,0,0,.04); }
.demo-topbar a { text-decoration:none; }
.demo-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px dashed rgba(0,0,0,.18); background: rgba(0,0,0,.03); }
.demo-tabs { display:flex; flex-wrap:wrap; gap:10px; margin-top: 14px; }
.demo-tab { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--demo-border); background:#fff; opacity:.9; cursor: pointer; user-select:none; transition: all 0.2s; }
.demo-tab:hover:not(.demo-tab-disabled) { border-color: rgba(34,197,94,.35); transform: translateY(-1px); }
.demo-tab.active { border-color: rgba(34,197,94,.35); box-shadow: 0 6px 14px rgba(34,197,94,.10); }
.demo-tab-disabled { opacity: 0.5; cursor: not-allowed; position: relative; }
.demo-tab-disabled:hover { opacity: 0.6; }

/* Tooltip para pestañas bloqueadas */
.demo-tab-disabled::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.demo-tab-disabled::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1001;
}

.demo-tab-disabled:hover::after,
.demo-tab-disabled:hover::before {
    opacity: 1;
}
.demo-tab-content { margin-top: 14px; }

.demo-kpis { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.demo-card { background: #fff; border: 1px solid var(--demo-border); border-radius: var(--demo-radius); padding: 16px; }
.demo-card h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; opacity: .75; }
.demo-card .big { font-size: 22px; font-weight: 700; margin: 0; }
.demo-muted { color: var(--demo-muted); font-size: 13px; }

.demo-toolbar { display:flex; align-items:center; justify-content:space-between; gap: 10px; margin-top: 14px; }
.demo-toolbar .left { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
.demo-pill { display:inline-flex; align-items:center; gap:8px; padding: 8px 10px; border-radius: 999px; border: 1px solid var(--demo-border); background:#fff; }
.demo-input { border: none; outline: none; font: inherit; min-width: 220px; }
.demo-btn { border: 1px solid var(--demo-border); background: #fff; border-radius: 12px; padding: 10px 12px; font-weight: 600; cursor: default; }
.demo-btn.primary { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.demo-btn.disabled { opacity: .55; pointer-events:none; }

.demo-kanban { margin-top: 14px; display:grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .demo-kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .demo-kanban { grid-template-columns: 1fr; } }
.demo-col { background: rgba(0,0,0,.03); border: 1px solid var(--demo-border); border-radius: var(--demo-radius); padding: 12px; min-height: 320px; }
.demo-col-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom: 10px; }
.demo-col-title { display:flex; align-items:center; gap:10px; font-weight: 800; }
.demo-dot { width: 10px; height: 10px; border-radius: 999px; background: rgba(0,0,0,.25); }
.demo-count { font-size: 12px; color: var(--demo-muted); border: 1px solid var(--demo-border); background:#fff; padding: 4px 8px; border-radius: 999px; }
.demo-stack { display:flex; flex-direction:column; gap:10px; }

.demo-task { background:#fff; border: 1px solid var(--demo-border); border-radius: 14px; padding: 12px; box-shadow: 0 8px 18px rgba(0,0,0,.06); cursor: pointer; }
.demo-task:hover { border-color: rgba(0,0,0,.18); }
.demo-task-title { font-weight: 700; margin: 0 0 8px; }
.demo-task-meta { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.demo-badge { display:inline-flex; align-items:center; gap:6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; border: 1px solid rgba(0,0,0,.10); background: rgba(0,0,0,.04); }
.badge-success { background: rgba(34,197,94,.12); }
.badge-warning { background: rgba(245,158,11,.12); }
.badge-danger  { background: rgba(239,68,68,.12); }
.badge-info    { background: rgba(59,130,246,.12); }
.badge-neutral { background: rgba(0,0,0,.06); }

.demo-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; padding: 18px; z-index: 9999; }
.demo-modal { width: min(980px, 100%); background:#fff; border-radius: 18px; border: 1px solid rgba(255,255,255,.25); box-shadow: var(--demo-shadow); overflow:hidden; }
.demo-modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap: 10px; padding: 16px 18px; background: linear-gradient(135deg, rgba(34,197,94,.14) 0%, rgba(34,197,94,.06) 100%); border-bottom: 1px solid var(--demo-border); }
.demo-modal-title { margin: 0; font-size: 16px; font-weight: 800; }
.demo-close { border: 1px solid var(--demo-border); background:#fff; border-radius: 12px; padding: 8px 10px; font-weight: 700; cursor:pointer; }
.demo-modal-body { display:grid; grid-template-columns: 1.05fr .95fr; gap: 14px; padding: 14px; }
@media (max-width: 900px) { .demo-modal-body { grid-template-columns: 1fr; } }
.demo-panel { background:#fff; border: 1px solid var(--demo-border); border-radius: 16px; padding: 12px; }
.demo-panel h4 { margin: 0 0 10px; font-size: 12px; letter-spacing:.6px; text-transform: uppercase; opacity:.75; }
.demo-kv { display:grid; grid-template-columns: 140px 1fr; gap: 10px; font-size: 14px; }
.demo-kv .k { color: var(--demo-muted); }
.demo-kv .v { font-weight: 600; }
.demo-people { display:flex; flex-wrap:wrap; gap:8px; }
.demo-avatar { width: 28px; height: 28px; border-radius: 999px; background: rgba(0,0,0,.08); display:flex; align-items:center; justify-content:center; font-weight: 800; font-size: 12px; }

.demo-files { display:flex; flex-direction:column; gap:10px; }
.demo-file { display:flex; align-items:center; justify-content:space-between; gap:10px; padding: 10px; border-radius: 12px; border: 1px solid var(--demo-border); background: rgba(0,0,0,.02); }
.demo-file-left { display:flex; align-items:center; gap:10px; min-width: 0; }
.demo-file-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(59,130,246,.12); display:flex; align-items:center; justify-content:center; font-weight: 900; color: rgba(59,130,246,1); }
.demo-file-name { font-weight: 700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.demo-file-meta { color: var(--demo-muted); font-size: 12px; }
.demo-file-btn { border: 1px solid var(--demo-border); background:#fff; border-radius: 10px; padding: 8px 10px; font-weight: 700; opacity:.55; pointer-events:none; }

.demo-chat { display:flex; flex-direction:column; gap:10px; max-height: 360px; overflow:auto; padding-right: 6px; }
.demo-msg { display:flex; gap:10px; }
.demo-bubble { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--demo-border); background:#fff; max-width: 75%; }
.demo-msg.me { justify-content:flex-end; }
.demo-msg.me .demo-bubble { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.35); }
.demo-msg-meta { font-size: 12px; color: var(--demo-muted); margin-top: 6px; }
.demo-chat-input { display:flex; gap:10px; margin-top: 10px; }
.demo-chat-input textarea { flex: 1; border: 1px solid var(--demo-border); border-radius: 14px; padding: 10px 12px; font-family: inherit; resize:none; min-height: 44px; }
.demo-chat-input button { border: 1px solid var(--demo-border); background: rgba(34,197,94,.12); border-radius: 14px; padding: 10px 14px; font-weight: 800; opacity:.55; pointer-events:none; }

.demo-toast { position: fixed; right: 16px; bottom: 16px; background:#111; color:#fff; padding: 10px 12px; border-radius: 12px; font-size: 13px; display:none; z-index: 10000; }

/* Kanban más ancho y sin scrollbar horizontal */
.kanban-board {
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    width: 100%;
    padding: 8px 0;
}

.kanban-board::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
    height: 0;
    width: 0;
}

.kanban-board .kanban-column {
    flex: 0 0 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
}

/* Asegurar que el kanban tenga espacio suficiente */
.demo-wrap .kanban-board {
    margin-top: 14px;
    width: 100%;
    max-width: 100%;
}

/* Ancho completo para tareas igual que tickets */
#demo-content-todolist {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#demo-content-todolist .kanban-board {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ancho completo para tickets - ocupar toda la pantalla */
#demo-content-tickets {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    box-sizing: border-box;
    position: relative;
}

/* Asegurar que el contenedor padre no limite el ancho */
.demo-wrap {
    overflow-x: visible;
}

body {
    overflow-x: hidden;
}

#demo-content-tickets .page-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#demo-content-tickets .tickets-filter-bar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#demo-content-tickets .tickets-grid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#demo-content-tickets .tickets-empty-state {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Asegurar que los tickets usen todo el espacio disponible */
#demo-content-tickets .tickets-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Estilos del modal real de tareas - TEMA BLANCO */
.demo-modal {
    max-width: 980px !important;
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding-bottom: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,.10);
}

.demo-modal-head {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14) 0%, rgba(34, 197, 94, 0.06) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 18px;
}

.demo-modal-body {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 14px;
    padding: 14px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #ffffff;
}

@media (max-width: 900px) {
    .demo-modal-body {
        grid-template-columns: 1fr;
    }
}

.demo-panel {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    min-width: 0;
}

.demo-panel--scroll {
    overflow: auto;
}

.demo-panel h4,
.task-demo-panel-title {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.65);
    font-weight: 600;
}

.demo-kv,
.task-demo-kv {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    font-size: 14px;
    align-items: center;
}

.demo-kv .k,
.task-demo-kv .k {
    color: rgba(0, 0, 0, 0.65);
}

.demo-kv .v,
.task-demo-kv .v {
    font-weight: 600;
    color: #000000;
    min-width: 0;
}

.demo-people {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.demo-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    border: 2px solid rgba(59, 130, 246, 0.2);
}

.demo-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.demo-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

.demo-file-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.demo-file-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #3b82f6;
    flex-shrink: 0;
}

.demo-file-name {
    font-weight: 700;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-file-meta {
    color: rgba(0, 0, 0, 0.65);
    font-size: 12px;
}

.demo-file-btn {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.65);
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* Chat estilo real - TEMA BLANCO */
.demo-chat {
    flex: 1 1 0 !important;
    height: 0 !important;
    min-height: 280px !important;
    max-height: none !important;
    overflow-y: auto !important;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 16px;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    scroll-behavior: smooth;
}

.demo-msg {
    display: flex;
    gap: 10px;
}

.demo-msg.me {
    justify-content: flex-end;
}

.demo-bubble {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    max-width: 75%;
    color: #000000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.demo-msg.me .demo-bubble {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

.demo-msg-meta {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.65);
    margin-top: 6px;
}

.demo-chat-input {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 12px;
    background: #ffffff;
    border-radius: 20px;
    border: 2px solid rgba(34, 197, 94, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.demo-chat-input textarea {
    flex: 1;
    border: none;
    border-radius: 16px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.02);
    color: #000000;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    height: 44px;
    max-height: 120px;
    overflow-y: hidden;
    outline: none;
}

.demo-chat-input button {
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    cursor: pointer;
    opacity: 0.55;
    pointer-events: none;
}

.demo-muted {
    color: rgba(0, 0, 0, 0.65) !important;
}

.demo-modal-title {
    color: #000000;
}

.demo-close {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000000;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Asegurar que los estilos de tickets se apliquen correctamente */
#demo-content-tickets .ticket-card {
    border: 1px solid var(--border-color, #d0d0d0) !important;
    background: var(--bg-card, #ffffff) !important;
}

#demo-content-tickets .tickets-filter-chip {
    border: 1px solid var(--border-color, #d0d0d0) !important;
    background: var(--bg-secondary, #eeeeee) !important;
}

#demo-content-tickets .tickets-filter-chip.active {
    background: var(--accent, #000000) !important;
    border-color: var(--accent, #000000) !important;
    color: #fff !important;
}

#demo-content-tickets .tickets-sort-btn {
    border: 1px solid var(--border-color, #d0d0d0) !important;
    background: var(--bg-secondary, #eeeeee) !important;
}

#demo-content-tickets .tickets-sort-btn.active {
    background: var(--accent, #000000) !important;
    border-color: var(--accent, #000000) !important;
    color: #fff !important;
}

/* Botones en tickets con el mismo estilo que tareas (demo) */
#demo-content-tickets .btn-primary,
#demo-content-tickets .btn.btn-primary {
    background: rgba(34,197,94,.12) !important;
    border-color: rgba(34,197,94,.35) !important;
    color: #000 !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(34,197,94,.35) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s !important;
}

#demo-content-tickets .btn-primary:hover,
#demo-content-tickets .btn.btn-primary:hover {
    background: rgba(34,197,94,.20) !important;
    border-color: rgba(34,197,94,.50) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 14px rgba(34,197,94,.10) !important;
}

#demo-content-tickets .btn-secondary,
#demo-content-tickets .btn.btn-secondary {
    background: #fff !important;
    border: 1px solid var(--demo-border, rgba(0,0,0,.10)) !important;
    color: rgba(0,0,0,.8) !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s !important;
}

#demo-content-tickets .btn-secondary:hover,
#demo-content-tickets .btn.btn-secondary:hover {
    background: rgba(0,0,0,.04) !important;
    border-color: rgba(0,0,0,.18) !important;
    transform: translateY(-1px) !important;
}

/* Panel derecho con adjuntos y chat */
#demo-right-attachments {
    flex: 0 0 auto;
    max-height: 170px;
    overflow: hidden;
    margin-bottom: 14px;
}

#demo-right-chat {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

