*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:#f4f6fa;color:#1f2937}.app-shell{min-height:100vh;display:flex}.sidebar{width:250px;background:#111827;color:#fff;padding:24px 16px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}.brand{font-size:24px;font-weight:800;padding:4px 12px 28px}.brand span{font-weight:500;color:#9ca3af}.sidebar nav{display:flex;flex-direction:column;gap:6px}.nav-item{color:#cbd5e1;text-decoration:none;padding:12px 13px;border-radius:10px;font-size:14px;display:flex;gap:10px;align-items:center}.nav-item:hover,.nav-item.active{background:#253047;color:#fff}.sidebar-bottom{margin-top:auto;border-top:1px solid #263246;padding:16px 8px 0}.user-chip{font-size:13px;color:#e5e7eb;margin-bottom:10px}.logout{color:#9ca3af;text-decoration:none;font-size:13px}.content{margin-left:250px;width:calc(100% - 250px);padding:34px 42px;max-width:1500px}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:26px}.topbar h1{margin:0;font-size:30px}.topbar p{margin:6px 0 0;color:#6b7280}.btn{border:0;border-radius:9px;padding:10px 15px;font-weight:650;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-size:13px}.btn.primary{background:#2563eb;color:white}.btn.ghost{background:#eef2f7;color:#334155}.btn.danger-outline{background:#fff0f0;color:#b91c1c}.btn.full{width:100%;margin-top:18px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:20px}.stat,.panel{background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 2px 10px #00000008}.stat{padding:20px}.stat small{display:block;color:#6b7280;margin-bottom:8px}.stat strong{font-size:24px}.ok{color:#16a34a}.panel{padding:22px;margin-bottom:20px}.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.panel-head h2{margin:0;font-size:19px}.panel-head p{margin:5px 0 0;color:#6b7280;font-size:13px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:13px 12px;border-bottom:1px solid #edf0f4;font-size:13px}th{font-size:12px;text-transform:uppercase;color:#64748b}.badge{display:inline-block;padding:5px 9px;border-radius:999px;background:#eef2ff;color:#4338ca;font-size:12px}.status{font-size:12px;font-weight:700}.status.active{color:#16a34a}.status.inactive{color:#9ca3af}.channel-list{display:flex;flex-direction:column}.channel-row{display:grid;grid-template-columns:46px 1fr 100px auto auto;align-items:center;gap:14px;padding:15px 5px;border-bottom:1px solid #edf0f4}.channel-row:last-child{border-bottom:0}.channel-icon{width:40px;height:40px;border-radius:10px;background:#eff6ff;display:flex;align-items:center;justify-content:center;font-size:20px}.channel-main{display:flex;flex-direction:column;gap:4px}.channel-main span{font-size:12px;color:#64748b}.alert{padding:12px 14px;border-radius:9px;margin-bottom:18px;font-size:13px}.alert.success{background:#ecfdf5;color:#047857}.alert.error{background:#fef2f2;color:#b91c1c}.modal-backdrop{position:fixed;inset:0;background:#0f172a99;display:none;align-items:center;justify-content:center;padding:30px;z-index:20}.modal-backdrop.show{display:flex}.modal{background:#fff;border-radius:16px;width:min(760px,95vw);max-height:90vh;overflow:auto;padding:25px;box-shadow:0 25px 70px #0005}.modal.large{width:min(900px,95vw)}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:20px}.modal-head h2{margin:0;font-size:21px}.modal-head p{margin:5px 0 0;color:#64748b;font-size:13px}.close{border:0;background:#f1f5f9;border-radius:8px;font-size:22px;width:34px;height:34px;cursor:pointer}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin-bottom:15px}.form-grid .wide{grid-column:1/-1}label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:700;color:#475569}input,textarea{border:1px solid #cbd5e1;border-radius:8px;padding:10px 11px;font:inherit;font-size:13px;outline:none;background:#fff}input:focus,textarea:focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb18}textarea{resize:vertical;min-height:250px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.5}.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}.switchline{flex-direction:row;align-items:center;margin:12px 0 18px}.switchline input{width:17px;height:17px}.template-help{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:10px;color:#64748b;font-size:12px}.empty{min-height:180px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;color:#64748b;text-align:center}.empty strong{color:#334155;font-size:15px}.empty .btn{margin-top:10px}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.setting{border:1px solid #e5e7eb;border-radius:10px;padding:16px;display:flex;justify-content:space-between;gap:15px}.setting span{color:#64748b}.inline-form{display:flex;gap:10px}.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f4f6fa}.login-card{width:390px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:32px;box-shadow:0 15px 50px #00000012}.login-card .brand{color:#111827;padding:0;font-size:28px}.login-card .brand span{color:#64748b}.login-card label{margin-top:14px}@media(max-width:850px){.sidebar{width:72px;padding:18px 10px}.brand{font-size:0;padding:5px 8px 25px}.brand:first-letter{font-size:24px}.nav-item span,.sidebar-bottom .user-chip,.logout{display:none}.content{margin-left:72px;width:calc(100% - 72px);padding:25px 18px}.channel-row{grid-template-columns:40px 1fr auto}.channel-row>.btn,.channel-row>form{grid-column:2}.stats{grid-template-columns:1fr}.form-grid,.settings-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.inline-form{flex-wrap:wrap}}
.back-link{display:inline-block;color:#2563eb;text-decoration:none;font-size:13px;margin-bottom:10px}
.muted{font-size:11px;font-weight:500;color:#64748b}
.info-box{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:16px;color:#475569;font-size:13px}
.info-box strong{color:#334155}
.info-box p{margin:7px 0 0;line-height:1.5}

.queue-head-actions{display:flex;gap:8px}
.queue-panel{overflow:hidden}
.queue-table-wrap{overflow-x:auto;margin:0 -1px}
.queue-table{width:100%;min-width:1320px;border-collapse:collapse;font-size:12px}
.queue-table th{background:#f8fafc;color:#64748b;font-weight:700;text-align:left;padding:12px 10px;border-bottom:1px solid #e5e7eb;white-space:nowrap}
.queue-table td{padding:13px 10px;border-bottom:1px solid #eef2f7;vertical-align:middle;white-space:nowrap}
.queue-table tbody tr:hover{background:#fafcff}
.product-title{min-width:190px;max-width:260px;white-space:normal}
.product-title strong{display:block;color:#1e293b;line-height:1.35}
.product-title small{display:block;color:#94a3b8;margin-top:4px}
.channel-pill{display:inline-block;background:#eff6ff;color:#2563eb;border-radius:999px;padding:5px 9px;font-weight:600}
.affiliate-cell{max-width:190px;overflow:hidden;text-overflow:ellipsis}
.queue-status{font-weight:700;font-size:11px}
.queue-status.queued{color:#d97706}
.queue-status.published{color:#16a34a}
.queue-status.error{color:#dc2626}
.row-actions{display:flex;gap:5px}
.icon-action{border:0;border-radius:7px;width:32px;height:32px;cursor:pointer;background:#f1f5f9}
.icon-action.publish:hover{background:#dcfce7}
.icon-action.delete:hover{background:#fee2e2}
.queue-legend{display:flex;gap:14px;color:#64748b;font-size:11px;align-items:center}
.queue-empty{min-height:280px}
.empty-icon{font-size:30px}

.queue-page{max-width:1600px}
.queue-toolbar{display:flex;justify-content:space-between;align-items:center;gap:18px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:14px 16px;margin-bottom:12px;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.queue-main-actions,.queue-settings{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.queue-settings label{display:flex;align-items:center;gap:7px;color:#64748b;font-size:13px;font-weight:600}
.queue-settings input{height:36px;border:1px solid #cbd5e1;border-radius:7px;padding:0 8px;font:inherit;color:#0f172a}
.btn.dark{background:#0f172a;color:#fff}
.btn.lightning{background:#f59e0b;color:#fff}
.btn.danger-outline{background:#fff;border:1px solid #fecaca;color:#dc2626}
.channel-tabs{display:flex;gap:8px;overflow:auto;padding:4px 0 12px}
.channel-tab{display:inline-flex;align-items:center;gap:7px;padding:10px 15px;border-radius:9px;background:#e8eef7;color:#334155;text-decoration:none;font-size:13px;font-weight:700;white-space:nowrap}
.channel-tab:hover{background:#dbe6f5}
.channel-tab.selected{background:#2563eb;color:#fff}
.queue-statusbar{display:flex;justify-content:space-between;align-items:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:11px 15px;margin-bottom:10px}
.queue-statusbar strong{color:#0f172a;margin-right:10px}
.queue-statusbar span{color:#64748b;font-size:12px}
.running-state{font-size:13px;font-weight:800}
.running-state.running{color:#16a34a}
.running-state.stopped{color:#64748b}
.queue-table.local-style{min-width:1250px}
.queue-table.local-style th,.queue-table.local-style td{white-space:nowrap}
.check-col{width:36px;text-align:center}
.check-col input{width:16px;height:16px}

/* Hacoo v2.4 queue/history improvements */
.queue-status-right{display:flex;align-items:center;gap:18px;flex-wrap:wrap}.queue-countdown{font-size:13px;color:#334155;font-weight:650}.queue-countdown strong{font-variant-numeric:tabular-nums;font-size:15px;color:#2563eb}.queue-table.local-style{table-layout:fixed;min-width:1320px}.queue-table.local-style th,.queue-table.local-style td{white-space:normal;overflow-wrap:anywhere;word-break:normal}.queue-table.local-style th:nth-child(1),.queue-table.local-style td:nth-child(1){width:3%}.queue-table.local-style th:nth-child(2),.queue-table.local-style td:nth-child(2){width:30%}.queue-table.local-style th:nth-child(3),.queue-table.local-style td:nth-child(3){width:8%}.queue-table.local-style th:nth-child(4),.queue-table.local-style td:nth-child(4){width:9%}.queue-table.local-style th:nth-child(5),.queue-table.local-style td:nth-child(5){width:8%}.queue-table.local-style th:nth-child(6),.queue-table.local-style td:nth-child(6){width:7%}.queue-table.local-style th:nth-child(7),.queue-table.local-style td:nth-child(7){width:7%}.queue-table.local-style th:nth-child(8),.queue-table.local-style td:nth-child(8){width:6%}.queue-table.local-style th:nth-child(9),.queue-table.local-style td:nth-child(9){width:8%}.queue-table.local-style th:nth-child(10),.queue-table.local-style td:nth-child(10){width:10%}.queue-table.local-style th:nth-child(11),.queue-table.local-style td:nth-child(11){width:7%}.queue-table.local-style th:nth-child(12),.queue-table.local-style td:nth-child(12){width:4%}.queue-table.local-style td.product-title{white-space:normal;overflow-wrap:anywhere;word-break:break-word;line-height:1.35}.queue-table.local-style td:nth-child(3),.queue-table.local-style td:nth-child(4),.queue-table.local-style td:nth-child(5),.queue-table.local-style td:nth-child(6),.queue-table.local-style td:nth-child(7),.queue-table.local-style td:nth-child(8),.queue-table.local-style td:nth-child(11),.queue-table.local-style td:nth-child(12){white-space:nowrap;overflow-wrap:normal}.history-table{width:100%;min-width:1050px;table-layout:fixed}.history-table th,.history-table td{overflow:hidden}.history-table th:nth-child(1),.history-table td:nth-child(1){width:6%}.history-table th:nth-child(2),.history-table td:nth-child(2){width:34%}.history-table th:nth-child(3),.history-table td:nth-child(3){width:10%}.history-table th:nth-child(4),.history-table td:nth-child(4){width:12%}.history-table th:nth-child(5),.history-table td:nth-child(5){width:22%}.history-table th:nth-child(6),.history-table td:nth-child(6){width:16%}.history-table td.product-title{white-space:normal;overflow-wrap:anywhere;word-break:break-word;line-height:1.35}.history-table td:nth-child(3){white-space:nowrap}.history-table td:nth-child(4){white-space:nowrap}.history-table td:nth-child(5){white-space:nowrap;text-overflow:ellipsis}.history-table td:nth-child(6){white-space:nowrap}


/* Hacoo dashboard v1.1 */
.dashboard-stats{grid-template-columns:repeat(5,1fr)}
.dashboard-stats .stat{padding:17px 18px}
.dashboard-stats .stat small{font-size:12px;margin-bottom:6px}
.dashboard-stats .stat strong{font-size:23px}
.error-stat{color:#dc2626}
.compact-activity .activity-row{grid-template-columns:40px minmax(240px,1fr) minmax(150px,190px) 118px 118px;gap:12px;padding:11px 4px}
.compact-activity .activity-icon{width:34px;height:34px;font-size:16px}
.compact-activity .activity-product strong{font-size:12.5px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compact-activity .activity-channel strong{font-size:11.5px}
.compact-activity .activity-channel span{font-size:9px}
.compact-activity .activity-badge{padding:5px 8px;font-size:10.5px}
.compact-activity .activity-time{font-size:10.5px}
.dashboard-history-link{border-top:1px solid #edf0f4;margin-top:2px;padding:12px 4px 0;text-align:right}
.dashboard-history-link a{font-size:12px;color:#2563eb;text-decoration:none;font-weight:650}
.dashboard-history-link a:hover{text-decoration:underline}
@media(max-width:1100px){.dashboard-stats{grid-template-columns:repeat(3,1fr)}.compact-activity .activity-row{grid-template-columns:36px minmax(200px,1fr) 140px 110px}.compact-activity .activity-time{display:none}}
@media(max-width:700px){.dashboard-stats{grid-template-columns:1fr 1fr}.compact-activity .activity-row{grid-template-columns:34px minmax(0,1fr) 110px}.compact-activity .activity-channel{display:none}}
/* Hacoo v2.5 dashboard activity */
.activity-list{display:flex;flex-direction:column}.activity-row{display:grid;grid-template-columns:44px minmax(240px,1fr) minmax(170px,220px) 130px 150px;align-items:center;gap:14px;padding:14px 4px;border-bottom:1px solid #edf0f4}.activity-row:last-child{border-bottom:0}.activity-icon{width:38px;height:38px;border-radius:10px;background:#eff6ff;display:flex;align-items:center;justify-content:center;font-size:18px}.activity-product{min-width:0}.activity-product strong{display:block;color:#1e293b;font-size:13px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.activity-product small{display:block;margin-top:4px;color:#94a3b8;font-size:11px}.activity-channel{display:flex;flex-direction:column;gap:4px;min-width:0}.activity-channel span{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#94a3b8}.activity-channel strong{font-size:12px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.activity-status{display:flex;justify-content:flex-start}.activity-badge{display:inline-flex;align-items:center;padding:6px 9px;border-radius:999px;font-size:11px;font-weight:750;white-space:nowrap}.activity-badge.queued{background:#fff7ed;color:#d97706}.activity-badge.published{background:#ecfdf5;color:#16a34a}.activity-badge.error{background:#fef2f2;color:#dc2626}.activity-badge.scheduled{background:#eff6ff;color:#2563eb}.activity-badge.paused{background:#f1f5f9;color:#64748b}.activity-time{font-size:11px;color:#64748b;text-align:right;white-space:nowrap}.activity-time:before{content:'🕐 ';}@media(max-width:1050px){.activity-row{grid-template-columns:40px minmax(180px,1fr) 150px 120px}.activity-time{display:none}}@media(max-width:700px){.activity-row{grid-template-columns:40px minmax(0,1fr) 120px}.activity-channel{display:none}.activity-product strong{white-space:normal}.activity-status{justify-content:flex-end}}

/* Dashboard activity table */
.activity-table-wrap{width:100%;overflow-x:auto}.activity-table{width:100%;border-collapse:collapse;table-layout:fixed}.activity-table th,.activity-table td{padding:13px 12px;border-bottom:1px solid #edf0f4;text-align:left;vertical-align:middle}.activity-table th{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#64748b;font-weight:750;background:#f8fafc}.activity-table th:nth-child(1){width:48%}.activity-table th:nth-child(2){width:22%}.activity-table th:nth-child(3){width:16%}.activity-table th:nth-child(4){width:14%}.activity-table tbody tr:last-child td{border-bottom:0}.activity-table tbody tr:hover{background:#fafcff}.activity-product-cell{display:flex;align-items:center;gap:10px;min-width:0}.activity-product-cell strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#1e293b;font-size:13px}.activity-icon{flex:0 0 34px;width:34px;height:34px;border-radius:9px;background:#eff6ff;display:inline-flex;align-items:center;justify-content:center;font-size:16px}.activity-channel-cell{display:flex;align-items:center;gap:8px;color:#334155;font-size:12px}.activity-channel-cell strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.channel-dot{width:10px;height:10px;flex:0 0 10px;border-radius:50%;background:#2563eb;box-shadow:0 0 0 3px #dbeafe}.activity-time-cell{font-size:12px;color:#64748b;white-space:nowrap}.activity-time-cell:before{content:'🕐 ';}
@media(max-width:800px){.activity-table{min-width:650px}}

/* Hacoo v1.2 · cola avanzada */
.channel-tab-wrap{display:inline-flex;align-items:center;gap:3px;background:#e8eef7;border-radius:9px;padding:0 4px 0 0}
.channel-tab-wrap .channel-tab{background:transparent}
.channel-tab-wrap .channel-tab.selected{background:#2563eb}
.channel-tab-toggle{border:0;background:transparent;color:#475569;border-radius:7px;width:30px;height:30px;cursor:pointer;font-weight:800}
.channel-tab-toggle:hover{background:#dbe6f5}
.queue-status.publishing{color:#2563eb}
.queue-status.retry{color:#d97706}
.channel-substatus{display:flex;align-items:center;gap:5px;margin-top:2px}
.telegram-status{font-size:11px;font-weight:700}
.telegram-status.connected{color:#16a34a}
.telegram-status.error{color:#dc2626}
.telegram-status.unknown{color:#64748b}
.checked-at{font-size:10px;color:#94a3b8}
.queue-channel-state{font-size:10px;color:#64748b;margin-top:4px}
.channel-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
