
*{
margin:0;
padding:0;
box-sizing:border-box;
}

html,
body{
overflow-x:clip;
background:#081223;
font-family:Arial;
}

/*
=====================================================
TOP BAR
=====================================================
*/

.top{
background:#0f172a;
padding:12px;
display:flex;
gap:10px;
align-items:center;
position:fixed;
top:0;
left:0;
right:0;
width:100%;
z-index:9999;
flex-wrap:wrap;
box-shadow:0 2px 12px rgba(0,0,0,.6);
}

/* Push content below fixed header — height set dynamically by JS */
.header-spacer{
display:block;
}

.top input,
.top select{
padding:10px;
border:none;
outline:none;
font-size:14px;
border-radius:3px;
}

#search{
flex:1;
min-width:120px;
background:#ffffff !important;
color:#000000 !important;
}
#search::placeholder{
color:#64748b !important;
}

#sort{
width:130px;
}

.top-row{
display:flex;
gap:10px;
align-items:center;
width:100%;
}

.top-meta{
display:flex;
gap:10px;
align-items:center;
margin-left:auto;
flex-shrink:0;
}

.logout{
background:#dc2626;
color:#fff;
border:none;
padding:10px 15px;
cursor:pointer;
font-weight:bold;
border-radius:3px;
white-space:nowrap;
}

.adminbtn{
background:#2563eb;
color:#fff;
border:none;
padding:10px 15px;
cursor:pointer;
font-weight:bold;
border-radius:3px;
white-space:nowrap;
}

/*
=====================================================
WRAPPER
=====================================================
*/

.wrap{
padding:15px;
}

/*
=====================================================
CARD
=====================================================
*/

.card{
background:#162033;
border:1px solid #1e3a5f;
border-bottom:6px solid #2563eb;
margin-bottom:28px;
border-radius:8px;
overflow:hidden;
scroll-margin-top:110px;
width:100%;
box-sizing:border-box;
}

/*
=====================================================
HEADER
=====================================================
*/

.head{
display:flex;
align-items:center;
min-height:55px;
gap:0;
touch-action:manipulation;
cursor:pointer;
width:100%;
box-sizing:border-box;
}

.pid{
width:190px;
min-width:190px;
height:55px;
display:flex;
align-items:center;
justify-content:center;
background:#1d4ed8;
color:#fff;
font-weight:700;
font-size:16px;
font-family:'Calibri', 'Segoe UI', Arial, sans-serif !important;
letter-spacing:.4px;
padding:0 6px;
box-sizing:border-box;
flex-shrink:0;
}

.title{
flex:1 1 auto;
max-width:none;
min-width:160px;
padding:8px 12px;
color:#e2e8f0;
font-size:14px;
font-weight:600;
line-height:1.45;
word-break:break-word;
box-sizing:border-box;
}

.card-meta{
display:flex;
flex-direction:row;
align-items:center;
gap:6px;
padding:0 6px;
flex-shrink:0;
flex-wrap:nowrap;
justify-content:flex-end;
margin-left:auto;
}

.card-meta.admin-meta{
flex-wrap:nowrap;
}

.status{
padding:6px 12px;
color:#fff;
font-size:11px;
font-weight:bold;
width:112px;
text-align:center;
border-radius:4px;
margin:0;
letter-spacing:.5px;
}

.Pending{
background:#0369a1;
}

.Generated{
background:#b91c1c;
}

.AllGenerated{
background:#7f1d1d;
box-shadow:inset 0 0 0 1px rgba(248, 113, 113, 0.4);
}

.Approved,
.Updated{
background:#15803d;
}

.Working{
background:#f59e0b;
}

.Paused{
background:#2563eb;
}

.WorkDone{
background:#16a34a;
}

.AIWork{
background:#7c3aed;
}

.AIDone{
background:#16a34a;
}

.InfoDone{
background:#16a34a;
}

.Published{
background:#1d4ed8;
}

.InfoWork{
background:#f59e0b;
}

.ContentPending{
background:#6d28d9;
}

.InQA{
background:#7c3aed;
}

.SEOReview{
background:#0891b2;
}

.Hold{
background:#92400e;
}

.NoCharge{
background:#64748b;
color:#e2e8f0;
opacity:.72;
}

.Changes{
background:#d97706 !important;
}

.ChangesInContent{
background:#db2777 !important;
}

.Changing{
background:#ea580c !important;
}

.Republish{
background:#0d9488;
}

/*
=====================================================
URGENT
=====================================================
*/

.card.urgent-card{
border:1px solid #FF6969;
}

.pid.urgent-pid{
background:#FF6969 !important;
color:#fff !important;
}

.card.urgent-card .toggle,
.toggle.urgent-toggle{
background:#FF6969 !important;
color:#fff !important;
border-left:1px solid #FF6969 !important;
}

.card.urgent-card .toggle:hover,
.toggle.urgent-toggle:hover{
background:#FF6969 !important;
}

.card.urgent-card.open .toggle{
background:#FF6969 !important;
border-left-color:#FF6969 !important;
}

.urgent-badge{
display:inline-flex;
align-items:center;
gap:4px;
background:#FF6969;
color:#fff;
font-size:10px;
font-weight:bold;
padding:3px 8px;
border-radius:3px;
letter-spacing:.5px;
white-space:nowrap;
}

.toggle{
width:50px;
min-width:50px;
height:55px;
background:#0f2744;
border:none;
border-left:1px solid #1e3a5f;
color:#94a3b8;
font-size:16px;
cursor:pointer;
}

/*
=====================================================
INLINE ASSIGN
=====================================================
*/

.inline-assign-sel{
padding:4px 6px;
font-size:11px;
border-radius:4px;
border:1px solid #334155;
background:#0f2744;
color:#e2e8f0;
outline:none;
cursor:pointer;
width:132px;
flex-shrink:0;
}

.inline-assign-btn{
border:none;
padding:5px 12px;
border-radius:4px;
font-size:11px;
font-weight:bold;
cursor:pointer;
flex-shrink:0;
white-space:nowrap;
background:#2563eb;
color:#fff;
transition:background .2s;
width:134px;
}

.inline-assign-btn.assigned{
background:#16a34a !important;
color:#fff;
}

/*
=====================================================
BODY
=====================================================
*/

.body{
display:none;
flex-direction:column;
padding:15px;
background:#0d1f36;
border-top:1px solid #1e3a5f;
}

.body.open{
display:flex;
}

/*
=====================================================
BUTTONS
=====================================================
*/

.actions{
display:flex;
gap:10px;
margin-top:14px;
flex-wrap:wrap;
}

.qa-submit-box{
display:grid;
grid-template-columns:110px 1fr 140px;
gap:10px;
align-items:stretch;
margin-top:14px;
}

.qa-labels{
display:grid;
grid-template-rows:1fr 1fr;
gap:12px;
color:#e2e8f0;
font-size:18px;
align-items:center;
}

.qa-fields{
display:grid;
grid-template-rows:1fr 1fr;
gap:12px;
}

.qa-fields input{
width:100%;
border:none;
outline:none;
padding:12px;
font-size:14px;
background:#fff;
color:#111827;
}

.qa-submit-btn{
border:none;
background:#00a84f;
color:#07111f;
font-size:18px;
font-weight:bold;
cursor:pointer;
}

.qa-links-box{
display:flex;
gap:10px;
flex-wrap:wrap;
margin-top:14px;
}

.qa-links-box a{
display:inline-flex;
align-items:center;
justify-content:center;
min-height:38px;
padding:8px 14px;
border-radius:5px;
background:#0f2744;
border:1px solid #2563eb;
color:#e2e8f0;
font-size:13px;
font-weight:bold;
text-decoration:none;
}

.qa-done-note{
margin-top:12px;
color:#86efac;
font-size:13px;
font-weight:bold;
}

.pager{
display:flex;
align-items:center;
justify-content:center;
gap:10px;
padding:10px 0 20px;
color:#e2e8f0;
font-size:13px;
}

.pager button{
border:none;
border-radius:5px;
padding:10px 16px;
background:#2563eb;
color:#fff;
font-weight:bold;
cursor:pointer;
}

.pager button:disabled{
opacity:.45;
cursor:not-allowed;
}

.actionbtn{
padding:11px 20px;
border:none;
font-weight:bold;
cursor:pointer;
border-radius:5px;
font-size:13px;
letter-spacing:.5px;
transition:opacity .15s;
}

.btn1{
background:#0ea5e9;
color:#fff;
}

.btn2{
background:#22c55e;
color:#fff;
}

.btn3{
background:#dc2626;
color:#fff;
}

.btn-writer-save{
background:#f59e0b;
color:#fff;
}

button:disabled{
opacity:.4;
cursor:not-allowed;
}

/*
=====================================================
EDITOR
=====================================================
*/

.editor{
background:#fff;
padding:20px;
min-height:300px;
line-height:1.8;
outline:none;
color:#1e293b;
white-space:pre-wrap;
overflow:auto;
word-break:break-word;
font-size:14px;
border-radius:6px;
border:2px solid transparent;
transition:border-color .2s;
}

.editor[contenteditable="true"]:focus{
border-color:#2563eb;
box-shadow:0 0 0 3px rgba(37,99,235,.15);
}

.locked{
background:#f8fafc;
color:#475569;
border-color:#e2e8f0;
}

/* Multi-Box Content Grid UI (Infographics & A+ Banners) */
.content-grid-wrap{margin:8px 0 12px 0;width:100%;box-sizing:border-box;}
.content-grid-header{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;margin-bottom:8px;border-radius:6px;font-size:12px;font-weight:700;letter-spacing:.5px;}
.content-grid-header.info-header{background:#082f49;color:#38bdf8;border:1px solid #0284c7;}
.content-grid-header.aplus-header{background:#1e1b4b;color:#c084fc;border:1px solid #7c3aed;}
.content-grid-header.locked-header{background:#0f172a;color:#94a3b8;border:1px solid #334155;}
.content-grid-6{display:grid;grid-template-columns:repeat(3, 1fr);gap:12px;width:100%;box-sizing:border-box;}
.content-grid-4{display:grid;grid-template-columns:repeat(2, 1fr);gap:12px;width:100%;box-sizing:border-box;}
@media (max-width: 1100px){.content-grid-6{grid-template-columns:repeat(2, 1fr);}}
@media (max-width: 700px){.content-grid-6, .content-grid-4{grid-template-columns:1fr;}}
.content-card-box{border:1.5px solid #2563eb;border-radius:6px;overflow:hidden;background:#ffffff;display:flex;flex-direction:column;box-shadow:0 1px 3px rgba(0,0,0,0.1);transition:border-color .15s, box-shadow .15s;}
.content-card-box:focus-within{border-color:#1d4ed8;box-shadow:0 0 0 2px rgba(37,99,235,0.25);}
.content-card-box.is-locked{border-color:#64748b;}
.content-box-head{display:flex;align-items:stretch;height:32px;min-height:32px;border-bottom:1.5px solid #2563eb;box-sizing:border-box;}
.content-card-box.is-locked .content-box-head{border-bottom-color:#64748b;}
.content-box-badge{background:#2563eb;color:#ffffff;font-size:12px;font-weight:700;padding:0 14px;display:flex;align-items:center;justify-content:center;white-space:nowrap;border-right:1px solid #1d4ed8;user-select:none;}
.content-card-box.is-locked .content-box-badge{background:#475569;border-right-color:#334155;color:#e2e8f0;}
.content-box-title{background:#dbeafe;color:#1e3a8a;font-size:11.5px;font-weight:700;padding:0 10px;display:flex;align-items:center;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.content-card-box.is-locked .content-box-title{background:#e2e8f0;color:#334155;}
.content-box-body{background:#ffffff;color:#0f172a;font-size:13px;line-height:1.6;padding:12px 14px;min-height:150px;max-height:320px;overflow-y:auto;outline:none;white-space:pre-wrap;word-break:break-word;font-family:inherit;box-sizing:border-box;flex:1;}
.content-box-body[contenteditable="true"]:focus{background:#f8faff;}
.content-box-body.locked, .content-box-body[contenteditable="false"]{background:#f8fafc;color:#334155;cursor:default;}
.content-extra-bar{margin-top:10px;background:#0f172a;border:1px dashed #334155;border-radius:6px;padding:10px 14px;}
.content-extra-title{font-size:11px;font-weight:700;color:#94a3b8;margin-bottom:6px;}
.content-extra-body{background:#ffffff;color:#0f172a;font-size:12.5px;line-height:1.5;padding:8px 12px;border-radius:4px;border:1px solid #cbd5e1;min-height:48px;outline:none;white-space:pre-wrap;}


/*
=====================================================
DIFF
=====================================================
*/

.diff-bar{
display:none;
align-items:center;
justify-content:space-between;
flex-wrap:wrap;
gap:8px;
margin-top:10px;
padding:8px 12px;
background:#0a1628;
border:1px solid #1e3a5f;
border-radius:6px;
}

.diff-legend{
font-size:12px;
color:#94a3b8;
font-weight:600;
}

.diff-legend-add{
color:#4ade80;
}

.diff-legend-del{
color:#f87171;
}

.btn-revert{
background:#334155;
color:#e2e8f0;
border:1px solid #475569;
padding:5px 12px;
border-radius:5px;
font-size:12px;
font-weight:bold;
cursor:pointer;
white-space:nowrap;
}

.btn-revert:hover{
background:#475569;
color:#fff;
}

.diff-preview{
margin-top:8px;
background:#0a1628;
border:1px solid #1e3a5f;
border-radius:6px;
padding:16px 20px;
font-size:14px;
line-height:1.9;
color:#cbd5e1;
white-space:pre-wrap;
word-break:break-word;
}

.diff-add{
outline:2px solid #22c55e;
background:rgba(34,197,94,.12);
border-radius:2px;
padding:0 2px;
}

.diff-del{
text-decoration:underline;
text-decoration-color:#ef4444;
text-decoration-thickness:2px;
color:#f87171;
background:rgba(239,68,68,.10);
border-radius:2px;
padding:0 2px;
}

/*
=====================================================
WORKER STATUS BAR
=====================================================
*/

.worker-status-bar{
padding:12px 16px;
border-radius:6px;
font-size:14px;
font-weight:600;
margin-bottom:12px;
text-align:center;
}

.worker-ready{
background:rgba(34,197,94,.15);
border:1px solid #22c55e;
color:#4ade80;
}

.worker-pending{
background:rgba(251,191,36,.10);
border:1px solid #f59e0b;
color:#fbbf24;
}

.worker-paused{
background:rgba(180,83,9,.15);
border:1px solid #b45309;
color:#fbbf24;
}

/*
=====================================================
WORK TIME BADGE (worker view)
=====================================================
*/

.work-time-badge{
display:inline-flex;
align-items:center;
gap:6px;
background:#0f2744;
border:1px solid #1e3a5f;
color:#94a3b8;
font-size:12px;
font-weight:600;
padding:6px 12px;
border-radius:5px;
margin-bottom:12px;
}

.work-time-badge span{
color:#e2e8f0;
}

/*
=====================================================
USER BOX
=====================================================
*/

.tab-btn{
border-bottom:3px solid transparent !important;
transition:border-color 0.15s, opacity 0.15s;
opacity:0.75;
}
.tab-btn.active{
border-bottom:3px solid #60a5fa !important;
opacity:1 !important;
}
.tab-btn:hover:not(.active){ opacity:0.9; }
.userbox{
background:#162033;
padding:20px;
margin:20px;
border-radius:10px;
display:none;
}

.userbox h2{
color:#fff;
margin-bottom:15px;
}

.userbox input,
.userbox select{
width:100%;
padding:10px;
margin-bottom:10px;
border:none;
outline:none;
}

.userbox button{
padding:10px 15px;
background:#2563eb;
border:none;
color:#fff;
cursor:pointer;
}

/*
=====================================================
ADMIN PANEL
=====================================================
*/

.admin-cols{
display:grid;
grid-template-columns:minmax(320px,1fr) minmax(420px,480px);
gap:30px;
align-items:flex-start;
}

.admin-col-left{
min-width:0;
}

.admin-col-right{
min-width:0;
overflow:hidden;
}

/*
=====================================================
TABLE
=====================================================
*/

table{
width:100%;
border-collapse:collapse;
margin-top:20px;
table-layout:fixed;
}

table th,
table td{
padding:10px 12px;
border-bottom:1px solid #334155;
color:#fff;
text-align:left;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
vertical-align:middle;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1){
width:40%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2){
width:34%;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3){
width:96px;
text-align:right;
overflow:visible;
}

.users-table button{
width:auto;
min-width:64px;
padding:8px 10px;
font-size:12px;
border-radius:4px;
}

/*
=====================================================
INVOICE / PAYROLL PANELS
=====================================================
*/

.inv-panel{
background:#162033;
padding:24px;
margin:16px;
border-radius:10px;
display:none;
}

.inv-panel h2{
color:#fff;
margin-bottom:16px;
font-size:18px;
}

.inv-panel h3{
color:#94a3b8;
font-size:14px;
margin-bottom:12px;
margin-top:20px;
border-top:1px solid #1e3a5f;
padding-top:14px;
}

.inv-section{
background:#0d1f36;
border:1px solid #1e3a5f;
border-radius:8px;
padding:18px;
margin-bottom:18px;
}

.inv-row{
display:flex;
gap:10px;
align-items:center;
flex-wrap:wrap;
margin-bottom:10px;
}

.inv-row label{
color:#94a3b8;
font-size:13px;
min-width:80px;
}

.inv-input{
padding:8px 12px;
background:#0a1628;
border:1px solid #334155;
border-radius:5px;
color:#e2e8f0;
font-size:13px;
outline:none;
}

.inv-select{
padding:8px 12px;
background:#0a1628;
border:1px solid #334155;
border-radius:5px;
color:#e2e8f0;
font-size:13px;
outline:none;
min-width:160px;
}

.inv-btn{
padding:9px 18px;
border:none;
border-radius:5px;
font-size:13px;
font-weight:bold;
cursor:pointer;
white-space:nowrap;
}

.inv-btn-blue{ background:#2563eb; color:#fff; }
.inv-btn-green{ background:#16a34a; color:#fff; }
.inv-btn-red{ background:#dc2626; color:#fff; }
.inv-btn-gray{ background:#475569; color:#fff; }

.inv-table{
width:100%;
border-collapse:collapse;
margin-top:10px;
font-size:13px;
}

.inv-table th{
background:#0a1628;
color:#94a3b8;
padding:8px 10px;
text-align:left;
border-bottom:1px solid #1e3a5f;
font-weight:600;
}

.inv-table td{
padding:8px 10px;
color:#e2e8f0;
border-bottom:1px solid #1e3a5f;
vertical-align:middle;
}

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

.inv-product-list{
overflow-y:visible;
}
.inv-filter-bar{
display:flex;
align-items:center;
gap:12px;
margin-bottom:10px;
flex-wrap:wrap;
}
#inv-table-wrap{
max-height:320px;
overflow-y:auto;
border:1px solid #1e3a5f;
border-radius:6px;
}

.inv-product-row{
display:flex;
align-items:center;
gap:10px;
padding:8px 0;
border-bottom:1px solid #1e3a5f;
}

.inv-product-row:last-child{
border-bottom:none;
}

.inv-product-row input[type="checkbox"]{
width:16px;
height:16px;
cursor:pointer;
flex-shrink:0;
}

.inv-product-label{
flex:1;
color:#e2e8f0;
font-size:12px;
line-height:1.4;
}

.inv-price-input{
width:100px;
padding:5px 8px;
background:#0a1628;
border:1px solid #334155;
border-radius:4px;
color:#e2e8f0;
font-size:12px;
outline:none;
text-align:right;
}

.inv-status-badge{
display:inline-block;
padding:3px 10px;
border-radius:12px;
font-size:11px;
font-weight:bold;
}

.inv-status-pending{ background:#92400e; color:#fde68a; }
.inv-status-paid{ background:#14532d; color:#86efac; }
.inv-status-generated{ background:#1e3a5f; color:#93c5fd; }

.inv-detail-box{
background:#0a1628;
border:1px solid #2563eb;
border-radius:8px;
padding:18px;
margin-top:14px;
display:none;
}

.inv-detail-box.open{ display:block; }

.inv-total-row td{
font-weight:bold;
color:#4ade80;
font-size:14px;
border-top:2px solid #1e3a5f;
}

.inv-badge-invoiced{
display:inline-block;
padding:2px 7px;
border-radius:10px;
font-size:10px;
font-weight:bold;
background:#1e3a5f;
color:#93c5fd;
margin-left:4px;
vertical-align:middle;
}

.inv-badge-paid{
display:inline-block;
padding:2px 7px;
border-radius:10px;
font-size:10px;
font-weight:bold;
background:#14532d;
color:#86efac;
margin-left:4px;
vertical-align:middle;
}

.type-badge-info{
display:inline-block;
padding:2px 7px;
border-radius:10px;
font-size:10px;
font-weight:bold;
background:#7c3aed;
color:#fff;
margin-left:4px;
vertical-align:middle;
}

.type-badge-infographics{
display:inline-block;
padding:2px 7px;
border-radius:10px;
font-size:10px;
font-weight:bold;
background:#d97706;
color:#fff;
margin-left:4px;
vertical-align:middle;
}

.type-badge-aplus{
display:inline-block;
padding:2px 7px;
border-radius:10px;
font-size:10px;
font-weight:bold;
background:#0284c7;
color:#fff;
margin-left:4px;
vertical-align:middle;
}

.product-research-link{
display:inline-flex;
align-items:center;
gap:4px;
padding:2px 8px;
background:#1e3a5f;
color:#93c5fd;
border:1px solid #3b82f6;
border-radius:6px;
font-size:11px;
font-weight:500;
text-decoration:none;
margin-left:8px;
vertical-align:middle;
transition:all 0.2s ease;
}

.product-research-link:hover{
background:#2563eb;
color:#ffffff;
border-color:#60a5fa;
box-shadow:0 0 8px rgba(37, 99, 235, 0.4);
}

/* Invoice preview modal */
.inv-preview-modal{
display:none;
position:fixed;
inset:0;
background:rgba(0,0,0,.7);
z-index:99999;
overflow-y:auto;
padding:30px 16px;
}
.inv-preview-modal.open{ display:flex; justify-content:center; align-items:flex-start; }
.inv-preview-inner{
background:#fff;
color:#111;
border-radius:10px;
padding:36px 40px;
max-width:700px;
width:100%;
font-family:Arial,sans-serif;
position:relative;
}
.inv-preview-close{
position:absolute;
top:12px;right:16px;
background:none;border:none;font-size:22px;cursor:pointer;color:#64748b;
}
.inv-preview-header{
display:flex;justify-content:space-between;align-items:flex-start;
margin-bottom:28px;border-bottom:2px solid #e2e8f0;padding-bottom:20px;
}
.inv-preview-company{
font-size:22px;font-weight:bold;color:#0f172a;
}
.inv-preview-meta{
text-align:right;font-size:13px;color:#475569;line-height:1.8;
}
.inv-preview-meta strong{ color:#0f172a; }
.inv-preview-to{
margin-bottom:20px;font-size:13px;
}
.inv-preview-to strong{ font-size:14px;color:#0f172a; }
.inv-preview-table{
width:100%;border-collapse:collapse;margin-bottom:0;font-size:13px;
}
.inv-preview-table th{
background:#f1f5f9;color:#475569;padding:9px 12px;
text-align:left;border-bottom:2px solid #e2e8f0;
}
.inv-preview-table td{
padding:9px 12px;border-bottom:1px solid #f1f5f9;color:#111;
}
.inv-preview-total-row td{
font-weight:bold;font-size:14px;background:#f8fafc;border-top:2px solid #e2e8f0;
}
.inv-preview-notes{
margin-top:18px;padding:12px;background:#f8fafc;border-radius:6px;
font-size:12px;color:#475569;
}
.inv-preview-footer{
margin-top:24px;text-align:center;font-size:11px;color:#94a3b8;border-top:1px solid #e2e8f0;padding-top:14px;
}

.rate-input{
width:90px;
padding:5px 8px;
background:#0a1628;
border:1px solid #334155;
border-radius:4px;
color:#e2e8f0;
font-size:13px;
outline:none;
text-align:right;
}

/*
=====================================================
TABLET
=====================================================
*/

@media(max-width:768px){

.top{
align-items:stretch;
padding:10px;
}

.top select{
width:130px;
height:40px;
font-size:13px;
}

#search{
flex:1;
height:40px;
font-size:13px;
min-width:0;
}

.logout,
.adminbtn{
height:40px;
padding:0 12px;
font-size:13px;
}

.wrap{
padding:10px;
}

.head{
min-height:52px;
}

.pid{
width:105px;
min-width:105px;
min-height:52px;
font-size:14px;
font-family:'Agency FB', 'Arial Narrow', sans-serif;
}

.title{
font-size:12px;
padding:9px 10px;
line-height:1.5;
flex:0 1 36%;
max-width:36%;
}

.status{
width:88px;
padding:8px;
font-size:11px;
}

.card-meta{
gap:5px;
padding:0 5px;
}

.card-meta.admin-meta{
flex-wrap:nowrap;
}

.inline-assign-sel{
width:112px;
}

.inline-assign-btn{
width:110px;
}

.top-meta{
flex-wrap:wrap;
}

.toggle{
width:46px;
min-width:46px;
min-height:52px;
font-size:14px;
}

.body{
padding:12px;
}

.actions{
gap:8px;
margin-top:12px;
margin-bottom:0;
order:2;
}

.actionbtn{
flex:1;
font-size:13px;
padding:12px 10px;
}

.qa-submit-box{
grid-template-columns:90px 1fr 120px;
}

.qa-labels{
font-size:16px;
}

.editor{
min-height:240px;
padding:15px;
font-size:15px;
line-height:1.9;
order:1;
}

.userbox{
margin:10px;
padding:15px;
}

.admin-cols{
grid-template-columns:1fr;
gap:20px;
}

.admin-col-right{
min-width:0;
width:100%;
overflow-x:auto;
}

}

/*
=====================================================
MOBILE
=====================================================
*/

@media(max-width:480px){

.top{
padding:8px;
gap:6px;
}

.top select{
width:100px;
height:36px;
font-size:12px;
padding:6px 6px;
}

#search{
flex:1;
height:36px;
font-size:12px;
padding:6px 8px;
min-width:80px;
}

.logout,
.adminbtn{
height:36px;
font-size:12px;
padding:0 10px;
}

/* Admin top-meta wraps to second row on mobile */
.top-meta{
width:100%;
margin-left:0;
flex-wrap:wrap;
justify-content:flex-end;
gap:6px;
}

.wrap{
padding:6px;
}

.card{
margin-bottom:20px;
border-bottom:6px solid #2563eb;
scroll-margin-top:110px;
}

.head{
min-height:44px;
flex-wrap:wrap;
align-items:stretch;
}

.pid{
order:1;
width:90px;
min-width:90px;
height:auto;
min-height:44px;
font-size:13px;
font-family:'Agency FB', 'Arial Narrow', sans-serif;
align-self:stretch;
}

.title{
order:2;
font-size:11.5px;
padding:8px 10px;
line-height:1.5;
}

.toggle{
order:3;
width:40px;
min-width:40px;
height:auto;
min-height:44px;
font-size:13px;
padding:0 8px;
align-self:stretch;
}

/* card-meta: second row on mobile */
.card-meta{
order:4;
width:100%;
display:flex !important;
flex-direction:row;
flex-wrap:wrap;
gap:6px;
padding:6px 8px 8px;
border-top:1px solid #1e3a5f;
align-items:center;
}

.card-meta.admin-meta{
display:flex !important;
}

.status{
width:auto !important;
flex-shrink:0;
padding:5px 12px;
font-size:10px;
border-radius:4px;
margin:0;
}

.inline-assign-sel{
flex:1;
min-width:0;
max-width:160px;
font-size:10px;
padding:4px 6px;
}

.inline-assign-btn{
flex-shrink:0;
width:auto;
font-size:10px;
padding:5px 10px;
}

.body{
padding:10px 8px;
display:flex;
flex-direction:column;
}

.assign-row{
padding:6px 8px;
gap:6px;
}

.assign-row select{
font-size:11px;
padding:5px 7px;
}

.btn-assign{
font-size:11px;
padding:6px 10px;
}

.inline-assign-sel{
width:84px;
font-size:10px;
padding:3px 4px;
}

.inline-assign-btn{
font-size:10px;
padding:4px 7px;
width:84px;
}

.actions{
gap:8px;
margin-top:12px;
margin-bottom:0;
order:2;
}

.actionbtn{
font-size:13px;
padding:13px 8px;
flex:1;
border-radius:6px;
}

.perform-row,.reset-row{
display:flex;
align-items:center;
gap:6px;
flex-wrap:wrap;
margin-top:4px;
width:100%;
}

.perform-sel{
flex:1;
min-width:0;
background:linear-gradient(135deg,#1c1a2e 0%,#2d1b4e 100%);
color:#e2e8f0;
border:2px solid #f59e0b;
border-radius:8px;
padding:6px 10px;
font-size:12px;
font-weight:600;
cursor:pointer;
outline:none;
box-shadow:0 0 8px rgba(245,158,11,0.25);
}

.perform-sel:focus{
border-color:#fbbf24;
box-shadow:0 0 12px rgba(251,191,36,0.4);
}

.perform-apply-btn{
background:linear-gradient(135deg,#d97706,#ea580c);
color:#fff;
border:none;
border-radius:8px;
padding:6px 14px;
font-size:12px;
font-weight:700;
cursor:pointer;
white-space:nowrap;
box-shadow:0 2px 8px rgba(234,88,12,0.4);
transition:opacity 0.15s,transform 0.1s;
}

.perform-apply-btn:hover{
opacity:0.9;
transform:translateY(-1px);
}

.reset-sel{
flex:1;
min-width:0;
background:linear-gradient(135deg,#1a1a2e 0%,#16213e 100%);
color:#e2e8f0;
border:2px solid #6366f1;
border-radius:8px;
padding:6px 10px;
font-size:12px;
font-weight:600;
cursor:pointer;
outline:none;
box-shadow:0 0 8px rgba(99,102,241,0.25);
}

.reset-sel:focus{
border-color:#818cf8;
box-shadow:0 0 12px rgba(129,140,248,0.4);
}

.reset-apply-btn{
background:linear-gradient(135deg,#4f46e5,#7c3aed);
color:#fff;
border:none;
border-radius:8px;
padding:6px 14px;
font-size:12px;
font-weight:700;
cursor:pointer;
white-space:nowrap;
box-shadow:0 2px 8px rgba(124,58,237,0.4);
transition:opacity 0.15s,transform 0.1s;
}

.reset-apply-btn:hover{
opacity:0.9;
transform:translateY(-1px);
}

.qa-submit-box{
grid-template-columns:1fr;
gap:8px;
}

.qa-labels{
display:none;
}

.qa-fields input{
height:42px;
}

.qa-submit-btn{
height:50px;
}

.editor{
min-height:calc(100dvh - 250px);
height:calc(100dvh - 250px);
font-size:16px;
padding:14px;
line-height:2;
order:1;
overflow-y:auto;
}

.card{
scroll-margin-top:110px;
}

.diff-label{
order:3;
font-size:12px;
margin-top:10px;
}

.diff-preview{
order:4;
font-size:14px;
line-height:1.9;
}

.userbox{
margin:6px;
padding:12px;
}

.userbox h2{
font-size:18px;
}

table th,
table td{
font-size:12px;
padding:8px;
}

}

/* ──────────────────────────────────────────────────
   STITCH MOBILE UI DESIGN SYSTEM OVERRIDES (<= 640px)
   ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* ── Body ── */
    body {
        background: #0b1326 !important;
        font-family: 'Geist', sans-serif !important;
    }

    /* ── Topbar / Header ── */
    #topbar {
        background: rgba(11, 19, 38, 0.85) !important;
        border-bottom: 1px solid #424754 !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        height: 48px !important;
        padding: 0 16px !important;
        box-shadow: none !important;
    }
    #header-spacer {
        height: 48px !important;
    }
    
    #topbar .nav-left {
        gap: 0 !important;
    }
    #topbar .nav-left .tab-btn {
        display: none !important; /* Hide tabs in topbar on mobile */
    }
    
    #topbar .nav-logo-container {
        border-right: none !important;
        padding-right: 0 !important;
        margin-right: 0 !important;
    }
    
    #topbar .nav-logo {
        font-family: 'Geist', sans-serif !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        letter-spacing: -0.02em !important;
    }
    
    #topbar .nav-user,
    #topbar #theme-toggle-btn {
        display: none !important; /* Hide username and theme toggle from header on mobile */
    }
    
    #topbar .nav-logout {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        color: #adc6ff !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    #topbar .nav-logout .logout-text {
        display: none !important;
    }
    #topbar .nav-logout .logout-icon {
        display: inline-block !important;
        font-size: 22px !important;
    }

    /* ── Filter Bar ── */
    .filter-bar {
        background: #0b1326 !important;
        border-bottom: 1px solid #424754 !important;
        padding: 12px 16px !important;
        top: 48px !important;
        gap: 8px !important;
    }
    
    .filter-input,
    .filter-select {
        background: #171f33 !important;
        border: 1px solid #424754 !important;
        border-radius: 8px !important;
        color: #dae2fd !important;
        font-family: 'Geist', sans-serif !important;
        font-size: 13px !important;
        padding: 8px 12px !important;
        height: 38px !important;
    }
    
    #search {
        height: 38px !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    #search::placeholder {
        color: #64748b !important;
    }
    
    /* Mobile scrolling pills */
    #mobile-filter-pills {
        margin-top: 4px;
        padding-bottom: 4px;
    }
    .no-scrollbar::-webkit-scrollbar {
        display: none !important;
    }
    .no-scrollbar {
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }

    /* ── Task Cards ── */
    .card {
        background: #171f33 !important;
        border: 1px solid #424754 !important;
        border-radius: 12px !important;
        margin: 0 12px 12px 12px !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15) !important;
        border-bottom: 1px solid #424754 !important; /* Remove solid bottom border */
        overflow: hidden !important;
    }
    
    .card.urgent-card {
        border: 1px solid #FF6969 !important;
        box-shadow: 0 0 10px rgba(255, 105, 105, 0.12) !important;
        animation: none !important; /* Stop aggressive blinking */
    }
    
    .head {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 12px !important;
        min-height: auto !important;
        background: transparent !important;
    }
    
    .pid {
        order: 1 !important;
        width: 100% !important;
        background: transparent !important;
        color: #c2c6d6 !important;
        font-size: 11px !important;
        font-family: 'JetBrains Mono', monospace !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        height: auto !important;
        min-height: auto !important;
        padding: 0 0 6px 0 !important;
        border-bottom: 1px solid #2d3449 !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.05em !important;
    }
    .pid div:first-child {
        font-weight: 600 !important;
    }
    /* Move typeBadge inside pid row */
    .pid div:last-child {
        position: static !important;
        width: auto !important;
        display: inline-block !important;
    }
    
    .title {
        order: 2 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        padding: 0 !important;
        color: #adc6ff !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
        font-family: 'Geist', sans-serif !important;
    }
    
    .card-meta {
        order: 3 !important;
        width: 100% !important;
        border-top: none !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
        margin-top: 4px !important;
    }
    
    .toggle {
        display: none !important; /* Hide the arrow button */
    }

    /* ── Status Badges (Soft Palette) ── */
    .status {
        font-size: 10px !important;
        font-family: 'JetBrains Mono', monospace !important;
        font-weight: 600 !important;
        padding: 3px 10px !important;
        border-radius: 9999px !important; /* Capsule shape */
        width: auto !important;
        min-width: 0 !important;
        letter-spacing: 0.05em !important;
        text-transform: uppercase !important;
        margin: 0 !important;
        border: 1px solid transparent !important;
    }
    
    .Pending {
        background: rgba(140, 144, 159, 0.15) !important;
        border-color: #8c909f !important;
        color: #c2c6d6 !important;
    }
    .Generated {
        background: rgba(255, 180, 171, 0.15) !important;
        border-color: #ffb4ab !important;
        color: #ffb4ab !important;
    }
    .AllGenerated {
        background: rgba(185, 28, 28, 0.25) !important;
        border-color: #ef4444 !important;
        color: #fecaca !important;
    }
    .Approved, .Updated {
        background: rgba(78, 222, 163, 0.15) !important;
        border-color: #4edea3 !important;
        color: #4edea3 !important;
    }
    .Working {
        background: rgba(245, 158, 11, 0.18) !important;
        border-color: #f59e0b !important;
        color: #fcd34d !important;
    }
    .Changing {
        background: rgba(234, 88, 12, 0.15) !important;
        border-color: #ea580c !important;
        color: #fdba74 !important;
    }
    .Paused {
        background: rgba(37, 99, 235, 0.15) !important;
        border-color: #2563eb !important;
        color: #93c5fd !important;
    }
    .WorkDone {
        background: rgba(0, 165, 114, 0.15) !important;
        border-color: #00a572 !important;
        color: #4edea3 !important;
    }
    .InfoDone {
        background: rgba(22, 163, 74, 0.15) !important;
        border-color: #16a34a !important;
        color: #86efac !important;
    }
    .Published {
        background: rgba(77, 142, 255, 0.15) !important;
        border-color: #4d8eff !important;
        color: #adc6ff !important;
    }
    .InfoWork {
        background: rgba(245, 158, 11, 0.18) !important;
        border-color: #f59e0b !important;
        color: #fcd34d !important;
    }
    .ContentPending {
        background: rgba(109, 40, 217, 0.15) !important;
        border-color: #6d28d9 !important;
        color: #c2c6d6 !important;
    }
    .InQA {
        background: rgba(124, 58, 237, 0.15) !important;
        border-color: #7c3aed !important;
        color: #c2c6d6 !important;
    }
    .SEOReview {
        background: rgba(8, 145, 178, 0.15) !important;
        border-color: #0891b2 !important;
        color: #adc6ff !important;
    }
    .Hold {
        background: rgba(146, 64, 14, 0.15) !important;
        border-color: #92400e !important;
        color: #ffb690 !important;
    }
    .NoCharge {
        background: rgba(100, 116, 139, 0.12) !important;
        border-color: #64748b !important;
        color: #cbd5e1 !important;
        opacity: .72;
    }
    .Changes {
        background: rgba(217, 119, 6, 0.15) !important;
        border-color: #d97706 !important;
        color: #ffb690 !important;
    }
    .ChangesInContent {
        background: rgba(219, 39, 119, 0.15) !important;
        border-color: #db2777 !important;
        color: #ffb4ab !important;
    }
    .Republish {
        background: rgba(13, 148, 136, 0.15) !important;
        border-color: #0d9488 !important;
        color: #4edea3 !important;
    }

    /* ── Card Body ── */
    .body {
        background: #131b2e !important;
        border-top: 1px solid #2d3449 !important;
        padding: 16px !important;
    }
    
    /* ── Content Editors ── */
    .editor {
        background: #ffffff !important;
        border: 1px solid #424754 !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
        padding: 12px !important;
    }
    
    /* ── Admin Action / Perform Dropdowns ── */
    .inline-assign-sel,
    select[id^="performSel_"],
    select[id^="resetSel_"] {
        background: #171f33 !important;
        border: 1px solid #424754 !important;
        border-radius: 8px !important;
        color: #dae2fd !important;
        font-size: 11px !important;
        height: 34px !important;
        padding: 6px 10px !important;
    }
    
    .inline-assign-btn,
    button[onclick^="applyPerform"],
    button[onclick^="applyReset"] {
        border-radius: 8px !important;
        font-size: 11px !important;
        height: 34px !important;
        padding: 0 14px !important;
    }

    /* Floating action buttons and primary actions */
    .adminbtn, #addProductBtn {
        border-radius: 8px !important;
        font-family: 'Geist', sans-serif !important;
        font-weight: 600 !important;
    }
    
    /* Action Buttons in card body */
    .actionbtn {
        border-radius: 8px !important;
        font-family: 'Geist', sans-serif !important;
        font-weight: 600 !important;
        padding: 10px 14px !important;
    }
}

/* ── Notification Area ── */
.nav-notif-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.nav-notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #162033;
    border: 1px solid #1e3a5f;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}
.nav-notif-btn:hover {
    background: #1e2e47;
    color: #38bdf8;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.notif-bell-svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}
.nav-notif-btn:hover .notif-bell-svg {
    transform: rotate(15deg);
}
.notif-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a1628;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    font-family: 'JetBrains Mono', monospace, sans-serif;
    pointer-events: none;
    animation: notifPulse 2.5s infinite;
}
@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 12px rgba(239, 68, 68, 0.85); }
}

/* ── Notification Dropdown ── */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 20px);
    background: #0d1829;
    border: 1px solid #1e3a5f;
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 2000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.notif-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.notif-title {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: 0.3px;
}
.notif-count-pill {
    font-size: 11px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 2px 7px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.notif-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.notif-close-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
}
.notif-subtitle {
    padding: 0 16px 10px;
    font-size: 11px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.notif-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.notif-item {
    background: #132034;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}
.notif-item:hover {
    background: #1a2c47;
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateX(2px);
}
.notif-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}
.notif-item-prodno {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 1px 5px;
    border-radius: 4px;
}
.notif-item-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.notif-item-tag.work-done {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.notif-item-tag.info-done {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.notif-item-tag.in-qa {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.notif-item-tag.working {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.notif-item-tag.pending {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.notif-item-title {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}
.notif-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 10px;
    color: #64748b;
}
.notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}
.notif-footer {
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 20, 35, 0.7);
    display: flex;
    justify-content: center;
}
.notif-action-btn {
    font-size: 11px;
    font-weight: 600;
    color: #38bdf8;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}
.notif-action-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
}

/* Light theme overrides */
html.light-theme .nav-notif-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}
html.light-theme .nav-notif-btn:hover {
    background: #e2e8f0;
    color: #0284c7;
    border-color: #0284c7;
}
html.light-theme .notif-badge {
    border-color: #ffffff;
}
html.light-theme .notif-dropdown {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
html.light-theme .notif-title {
    color: #0f172a;
}
html.light-theme .notif-header {
    border-bottom-color: #f1f5f9;
}
html.light-theme .notif-subtitle {
    color: #64748b;
    border-bottom-color: #f1f5f9;
}
html.light-theme .notif-item {
    background: #f8fafc;
    border-color: #e2e8f0;
}
html.light-theme .notif-item:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
}
html.light-theme .notif-item-title {
    color: #334155;
}
html.light-theme .notif-footer {
    background: #f8fafc;
    border-top-color: #e2e8f0;
}

/* Card highlight pulse when clicked from notification */
@keyframes cardNotifHighlight {
    0% { outline: 3px solid #38bdf8; box-shadow: 0 0 20px rgba(56, 189, 248, 0.8); }
    50% { outline: 3px solid #38bdf8; box-shadow: 0 0 30px rgba(56, 189, 248, 1); }
    100% { outline: 3px solid transparent; box-shadow: none; }
}
.card-notif-highlight {
    animation: cardNotifHighlight 2.5s ease-out;
}



/* ── Rigid symmetry rules for Card Header ───────────── */
.head .title {
    flex: 1 1 auto !important;
    max-width: none !important;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.head .card-meta {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

.head .toggle {
    flex-shrink: 0 !important;
}

.head .title-text {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.head .research-link-slot {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    width: 155px;
    min-width: 155px;
}

.product-research-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 10px;
    height: 24px;
    background: #1e3a5f;
    color: #93c5fd;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
}

.head .status {
    width: 115px !important;
    min-width: 115px !important;
    max-width: 115px !important;
    padding: 6px 4px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex-shrink: 0 !important;
}

.head .inline-assign-sel,
.inline-assign-sel {
    width: 125px !important;
    min-width: 125px !important;
    max-width: 125px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    height: 32px !important;
}

.head .inline-assign-btn,
.inline-assign-btn {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    height: 32px !important;
}

.badge-ai-slot {
    width: 85px;
    min-width: 85px;
    max-width: 85px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 700;
    border-radius: 12px;
    flex-shrink: 0;
}

.badge-info-slot {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 700;
    border-radius: 12px;
    flex-shrink: 0;
}

.badge-aplus-slot {
    width: 85px;
    min-width: 85px;
    max-width: 85px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 700;
    border-radius: 12px;
    flex-shrink: 0;
}

.badge-group-slot {
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.badge-group-placeholder {
    visibility: hidden !important;
    pointer-events: none !important;
    border: none !important;
    background: transparent !important;
    user-select: none !important;
}

/* Fixed metadata columns keep every card header aligned even when a product
   has no priority, revision, invoice, vendor, group, time, or assignment tag. */
.card-meta .meta-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    flex: 0 0 auto;
    box-sizing: border-box;
    overflow: hidden;
}
.card-meta .meta-priority { width: 96px; }
.card-meta .meta-revision { width: 90px; }
.card-meta .meta-invoice { width: 180px; justify-content: flex-start; }
.card-meta .meta-vendor { width: 92px; }
.card-meta .meta-group { width: 74px; }
.card-meta .meta-bulk { width: 28px; }
.card-meta .meta-time { width: 110px; }
.card-meta .meta-status { width: 115px; }
.card-meta .meta-assignment { width: 225px; gap: 5px; }
.card-meta .meta-qa-seo { width: 115px; }
.card-meta .meta-assignment:empty,
.card-meta .meta-qa-seo:empty { visibility: hidden; }

/* Initial service stages must remain visible against the blue product panel. */
.service-stage-badge.Pending {
    background: #cbd5e1 !important;
    color: #334155 !important;
    border: 1px solid #94a3b8;
    opacity: 1 !important;
}

/* ── Bulk Action Bar Sticky ──────────────────── */
#bulk-action-bar {
    position: sticky !important;
    top: 104px;
    z-index: 38 !important;
    background: #1e293b !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 4px 8px -2px rgba(0, 0, 0, 0.4) !important;
}

/* ── Pager & Load More Button ───────────────── */
.load-more-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5) !important;
}
.load-more-btn:active {
    transform: translateY(0);
}
html.light-theme #bulk-action-bar {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.06) !important;
}
html.light-theme #bulk-action-bar span,
html.light-theme #bulk-action-bar label {
    color: #1e293b !important;
}
html.light-theme #bulk-action-select {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-theme .pager-container {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06) !important;
}
html.light-theme .pager-container strong {
    color: #0f172a !important;
}
html.light-theme #pageSizeSelect {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-theme .load-more-btn {
    background: linear-gradient(135deg, #2563eb, #6366f1) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
}
