body {
    background: url('bg.gif') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
}

#login-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.596);
    padding: 32px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    text-align: center;
    z-index: 5;
}

#login-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
}
#google-img {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto;
    transition: scale 0.3s ease;
}

#google-img:hover {
    scale: 1.05;
}

#login-text {
    margin-top: 16px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    display: inline-block;
    font-size: 1.1em;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

#login-panel h2 {
    color: #fff;
    transition: scale 0.3s ease;
}

#login-panel h2:hover {
    scale: 1.05;
}

#orders {
    display: none;
    width: 1200px;
    height: 700px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.493);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 40px 60px;
    z-index: 1;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
}

#logout-btn{
    position: fixed;
    top: 100%;
    left: 100%;
    transform: translate(-100%, -100%);
    background: rgba(255, 0, 0, 0.726);
    color: #fff;
    font-size: 30px;
}

#order-options {
    background: rgba(24, 24, 24, 0.527);
    width: 28%;
    height: 90%;
    position: fixed;
    padding: 24px 20px; /* Added padding for margin inside */
    box-sizing: border-box;
}
#order-options label {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
}
#order-options select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 16px;
    text-align: left;
}

#order-body{
    background: rgba(24, 24, 24, 0.527);
    width: 90%;
    height: 90%;
    position: fixed;
    z-index: -1;
}

#profile-body{
    background: rgba(24, 24, 24, 0.527);
    width: 90%;
    height: 90%;
    position: fixed;
}

#commissions-body{
    background: rgba(24, 24, 24, 0.527);
    width: 90%;
    height: 90%;
    position: fixed;
}

#order-list {
  display: grid;
  gap: 16px;
  max-height: 95%; /* Adjust as needed */
  overflow-y: auto;
  padding: 16px;
  background: rgba(0, 0, 0, 0);
  border-radius: 8px; /* Optional: for style */
  scrollbar-width: thin;
  scrollbar-color: #888 #222; /* thumb color, track color for Firefox */
}

#order-list::-webkit-scrollbar {
  width: 10px;
  background: #222;
  border-radius: 8px;
}
#order-list::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 8px;
  border: 2px solid #222;
}
#order-list::-webkit-scrollbar-thumb:hover {
  background: #666;
}
#order-list::-webkit-scrollbar-corner {
  background: #222;
}

.order-item {
  background: #42424271;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  min-width: 0; /* Prevent overflow */
  color: #fff;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  position: relative; /* For positioning commission display */
  position: relative; /* For positioning commission display */
}

.commission-display {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9em;
  pointer-events: none;
}
.streak-bonus-display {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.75em;
  color: #00ff22;
  pointer-events: none;
}

.order-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.order-item > * {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Shake animation for prompting user */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
  100% { transform: translateX(0); }
}

.shake-animation {
  animation: shake 0.5s ease;
}

#open-order {
    width: 1200px;
    height: 700px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.493);
    border-radius: 18px;
    border-top-right-radius: 5px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 10; /* In front of #orders */
    /* display: none;  Hide by default, show when needed */
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 32px 32px 32px 32px;
    box-sizing: border-box;
    display: none;
}

#raw-images {
    width: 25%;
    height: 92%;
    margin-right: 24px;
    background: rgba(34,34,34,0.5);
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    position: absolute;
}
#raw-images img {
  max-width: 90%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
#raw-images {
  scrollbar-width: thin;
  scrollbar-color: #666666aa #222222bb; /* thumb color, track color for Firefox */
}
#raw-images::-webkit-scrollbar {
  width: 10px;
  background: rgba(34,34,34,0.5);
  border-radius: 12px;
}
#raw-images::-webkit-scrollbar-thumb {
  background: #666666aa;
  border-radius: 12px;
  border: 2px solid rgba(34,34,34,0.5);
}
#raw-images::-webkit-scrollbar-thumb:hover {
  background: #888888cc;
}
#raw-images::-webkit-scrollbar-corner {
  background: rgba(34,34,34,0.5);
}
#instructions {
    width: 67%;
    height: 92%;
    background: rgba(34,34,34,0.5);
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    position: absolute;
    left: 29%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
#instructions .image-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    margin-bottom: 16px;
}

#instruction-text {
    pointer-events: auto !important;
    overflow-y: auto !important;
}
#instructions img {
    width: 32%;
    height: 250px;
    border-radius: 8px;
    object-fit: contain;
    background: #222;
    border: 1px solid #444;
}
#open-order #xorder {
    position: fixed;
    top: 0%;
    right: 0%;
    width: 35px;
    height: 35px;
    border-radius: 5px;
    background: rgba(255, 0, 0, 0.658);
    color: #fff;
    font-size: 1em;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

/* Blurred background effect for when #open-order is open */
.blurred {
    filter: blur(6px) brightness(0.7);
    transition: filter 0.3s;
    pointer-events: none;
    user-select: none;
}

#finishOutput {
    width: 97%;
    margin: 10px 5px;
    margin: auto;
    cursor: default;
    transition: 0.3s ease;
}
#finishOutput:hover {
    cursor: pointer;
    background-color: rgba(0, 255, 0, 0.1);
}

#outputlink{
  width: 98%;
  height: 30px;
  margin: auto;
  margin-top:15px;
}

#pass{
    position: absolute;
    top: 101%;
    left: 50%;
    transform: translate(-50%);
    width: 200px;
    height: 50px;
    color: white;
    font-size: 24px;
    border-radius: 10px;
    background-color:rgba(43, 255, 0, 0.253);
    transition: 0.3s ease;
    cursor: pointer;
}

#pass:hover{
    background-color:rgba(43, 255, 0, 0.171)
}

/* Fullscreen Image Viewer Panel */
#fullscreen-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 95vw;
    height: 95vh;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#fullscreen-panel img#fullscreen-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
}

#fullscreen-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.7);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 1010;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}
/* Add styles for order-list to have 2 columns */
#order-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Ensure order-item fills the grid cell */
.order-item {
  width: 100%;
  box-sizing: border-box;
}

#navButtons{
  position: fixed;
  top: -5%;
  left: 0%;
}
#navButtons button {
  border-top-right-radius: 12px;
  background-color: #494949b4; /* Match the theme color for "new" status */
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: #fff;
  transition: background-color 0.3s ease;
}

#navButtons button:hover {
  background-color: #3b3b3b29; /* Slightly darker on hover */
}

#instructionDiv{
  width: 100%;
  height: 92%;
}

#instructionDiv #finishOutput{
  height: 100%;
  width: 45%;
}

#instruction-text {
    width: 50%;
    height: 95%;
    resize: none;
    background: #181818;
    color: #fff;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    font-size: 1.1em;
    font-family: inherit;
    pointer-events: none;
}

#mobile-warning {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    text-align: center;
    z-index: 2000;
    background: rgba(0, 255, 13, 0.7);
    padding: 20px 40px;
    border-radius: 12px;
}

#streakPenalty{
  position: fixed;
  right: 16px;
  top: -6%;
  cursor: default;
  margin: 0;
  padding: 6px 10px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border-radius: 8px;
  font-size: 1.0em;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 120;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#streakPenaltyInfo {
  position: fixed;
  left: 67%;
  top: 2%;
  width: 380px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.6);
  font-size: 0.9em;
  z-index: 100;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.3s ease;
}

#streakPenaltyInfo h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 1.1em;
}

#streakPenaltyInfo ul {
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 8px;
}

#streakPenaltyInfo ul li {
  margin-bottom: 4px;
}

#streakPenaltyInfo #visualBoard div {
  border-radius: 4px;
}

#currentStreakPenalty{
  text-align: center;
  margin-top: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}
#currentStreakPenalty .quota {
  color: white;
  position: relative;
  left: 0;
  white-space: nowrap;
  font-weight: bold;
}
#currentStreakPenalty .status {
  white-space: nowrap;
}

/* New styles for the Tasks label inserted in HTML */
/* Keep label text neutral; make .quota background follow parent's computed color */
#streakPenalty .tasks-label {
  color: #ddd;
  font-weight: 600;
  font-size: 0.95em;
}

/* .quota background should follow the indicator color set by JS.
   Quota text stays white for contrast; center text and add room for shadow */
#streakPenalty .quota {
  color: #fff;
  font-weight: 700;
  background: currentColor;
  padding: 4px 10px;
  border-radius: 8px;
  min-width: 28px;
  text-align: center; /* centered as requested */
  display: inline-block;
  box-shadow: 0 0 0 rgba(0,0,0,0); /* placeholder for JS-managed glow */
  transition: background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

#leave {
  position: fixed;
  top: 100%;
  left: 0%;
  width: 200px;
  height: 35px;
  padding-left: 20px;
  padding-right: 20px;
  border-bottom-left-radius: 10px;
  background-color: rgba(187, 255, 0, 0.5);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#leave:hover::after {
  content: "Leave Request Rules:\A- Max 2 editors can be inactive (on leave) per day\A- Cannot request if you have revision tasks\A- Approved leave means no quota/tasks next day\A- Can still work on revisions during leave\A- 3 leaves per month limit";
  white-space: pre;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(-80%, -120%);
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 10px;
  border-radius: 5px;
  z-index: 1000;
  width: 300px;
  font-size: 14px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#emergency {
  position: fixed;
  top: 100%;
  left: 15.2%;
  width: 210px;
  height: 35px;
  padding-left: 20px;
  padding-right: 20px;
  border-bottom-right-radius: 10px;
  background-color: rgba(255, 94, 0, 0.5);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#emergency:hover::after {
  content: "Emergency Rules:\A- When active, no penalty for unfinished quota\A- Streak will not reset even quota is unfinished\A- Next day's quota will be added to remaining\A- 5 emergencies limit per month";
  white-space: pre;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(-80%, -120%);
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 10px;
  border-radius: 5px;
  z-index: 1000;
  width: 300px;
  font-size: 14px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#customer-name-display{
  position: fixed;
  left: 50%;
  top: -10%;
  transform: translate(-50%);
  padding: 5px 10px;
  border-radius: 5px;
  background-color:  rgba(0, 0, 0, 0.493);
  cursor: default;
}

/* Show mobile warning and hide #orders if height > width (portrait) or on mobile devices */
@media (orientation: portrait), (max-width: 768px) {
    #orders {
        display: none !important;
    }
    #mobile-warning {
        display: block !important;
    }
}
.plus {
    color: rgb(0, 255, 0);
}
.minus {
    color: red;
}

/* More Instructions Panel */
#more-instructions-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

#more-instructions-panel h2 {
    color: #fff;
    margin: 0;
    text-align: center;
}

#more-instructions-panel p {
    color: #ccc;
    margin: 0;
    line-height: 1.5;
    font-size: 15px;
    text-align: center;
    margin-top: 10px;
}

#more-instructions-reason {
    width: 95%;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-family: inherit;
    resize: none;
    margin-top: 10px;
}

#submit-more-instructions {
    background: rgba(255, 0, 0, 0.7);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    width: 95%;
    margin-top: 5px;
}

#submit-more-instructions:hover {
    background: rgba(255, 0, 0, 0.5);
}

#close-more-instructions {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ask {
    position: absolute;
    top: 101%;
    left: 0;
    width: 200px;
    height: 40px;
    background-color: rgba(255, 255, 0, 0.308);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

/* Version Overlay Styles */
#version-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-size: 24px;
    text-align: center;
}

.version-message {
    padding: 20px;
    background-color: rgba(0,0,0,0.7);
    border-radius: 10px;
    max-width: 80%;
    line-height: 1.5;
}

.version-message strong {
    color: #ffcc00;
    font-size: 1.2em;
}

.fullscreen-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.upload-loading-spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.upload-loading-text {
  color: white;
  font-size: 18px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.outputIsUpdated{
  position: absolute;
  left: 55.5%;
  height: auto;
  width: 40%;
  top: 0%;
  text-align: center;
  color: #ff0000; /* bright green text */
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.95); /* stroke for WebKit browsers */
  text-shadow: 0 0 2px rgba(17, 17, 17, 0.85), 0 1px 0 rgba(0,0,0,0.25); /* fallback stroke/glow */
  font-weight: 800;
}


#instructionDiv h4{
  top: 75%;
}
/* Instruction h4 positioning and popping animation */
#instructionDiv {
  position: relative; /* ensure absolutely positioned children are relative to this container */
}

#instructionDiv h4{
  position: absolute;
  top: 87%;
  left: 76.5%;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: pop 1.2s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, opacity;
}

/* Popping loop keyframes */
@keyframes pop {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0.98;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.hidden{
  display: none;
}
/* Chat widget styles (moved from script) - bottom-left placement */
.chatsup {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.chatsup img#chatsup {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}
.chatsup img#chatsup:hover { transform: scale(1.05); }

.chat-box {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  background: #f5f5f5;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 2100;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.chat-box.visible { display: flex; }
.chat-header { background:#007c0a; color:#fff; padding:10px 12px; display:flex; justify-content:space-between; align-items:center; }
.chat-header h3 { font-size:14px; margin:0; font-weight:600; display:flex; align-items:center; gap:8px; }
.chat-header .lang-note { font-size:0.75em; font-weight:400; opacity:0.9; margin-left:8px; color: #e6f7ff; }
.chat-header p#minimize_chat { cursor:pointer; margin:0; font-weight:700; }

.chats {
  flex:1;
  padding:10px;
  overflow-y:auto;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* Chat input area */
.chat-inputs { display:flex; gap:8px; padding:10px; background:#fff; border-top:1px solid #e0e0e0; align-items:center; }
.chat-inputs input#chatInput { flex:1; padding:8px 0px; border-radius:8px; border:1px solid #ccc; outline:none; }
.chat-inputs button#sendMessage { background:#007c0a; color:#fff; border:none; padding:8px 10px; border-radius:8px; cursor:pointer; }
.chat-inputs button#addImageMessage { background:transparent; border:none; font-size:20px; cursor:pointer; }

/* Messages */
.chat-message { max-width:78%; padding:8px 10px; border-radius:10px; font-size:13px; line-height:1.3; word-break:break-word; }
.from-customer { background:#e5f5ea; color:#111; align-self:flex-end; border-bottom-right-radius:2px; }
.from-chromations { background:#007c0a; color:#fff; align-self:flex-start; border-bottom-left-radius:2px; }
.image-message { max-width:200px; border-radius:8px; cursor:pointer; }

/* Email modal */
#emailModal {
  position:fixed;
  z-index:2200;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  background:#fff;
  padding:16px;
  border-radius:8px;
  box-shadow:0 8px 30px rgba(0,0,0,0.4);
  display:none;
  width:320px;
}
#emailModal.show { display:block; }
#emailModal input { width:100%; padding:8px; margin:8px 0; border-radius:6px; border:1px solid #ccc; }
#emailModal .actions { display:flex; gap:8px; justify-content:flex-end; }
#emailModal .actions button { padding:6px 8px; border-radius:6px; border:none; cursor:pointer; }

/* Small responsive tweaks */
@media (max-width: 480px) {
  .chat-box { left: 10px; right: 10px; width: calc(100% - 20px); bottom: 10px; height: 420px; }
  .chatsup { bottom: 12px; left: 12px; }
}
/* Chat unread badge (top-right of chatsup icon) */
.chatsup .chat-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(30%, -30%);
  background: #ff3b30;
  color: #fff;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: none; /* JS will toggle display */
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 999;
  pointer-events: none; /* Let clicks pass through to the icon */
}

/* Ensure badge text doesn't wrap */
.chatsup .chat-badge::after {
  /* Avoid duplicating the visible number.
     JS already sets the element textContent; leave data-count available for scripts
     but don't render it again via ::after. */
  content: '';
}

/* Small adjustment for large numbers */
.chatsup .chat-badge.small {
  min-width: 20px;
  padding: 0 6px;
}

.chatsup .chat-badge.large {
  min-width: 28px;
  padding: 0 8px;
}
/* Payslip table: make table scrollable while keeping rounded container (overlap-safe) */
#payslipTableRoot {
  display: block;
  width: 100%;
  max-height: 340px; /* adjust as needed for viewport */
  overflow: auto;
  border-radius: 6px;
  -webkit-overflow-scrolling: touch;
}

/* Keep headers and rows aligned while enabling scrolling */
#payslipTableRoot table,
#payslipTableRoot thead,
#payslipTableRoot tbody,
#payslipTableRoot tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Cell behaviour: prevent wildly wrapping content, show ellipsis */
#payslipTableRoot th,
#payslipTableRoot td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px;
}

/* Ensure outer themed wrapper hides overflow (preserve rounded edges) */
#paySlip > div[style*="overflow"] {
  overflow: hidden !important;
  border-radius: 8px;
}
/* Themed scrollbar for payslip table */
#payslipTableRoot {
  /* ensure the element remains scrollable */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(74,194,154,0.9) rgba(255,255,255,0.02); /* thumb track for Firefox */
}

/* WebKit browsers */
#payslipTableRoot::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

#payslipTableRoot::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  margin: 2px;
}

#payslipTableRoot::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(126,231,135,0.95), rgba(74,194,154,0.95));
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,0.18);
  min-height: 24px;
}

#payslipTableRoot::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(96,201,115,1), rgba(44,174,134,1));
}

/* Horizontal thumb (matching theme) */
#payslipTableRoot::-webkit-scrollbar-track-piece:horizontal {
  background: rgba(255,255,255,0.02);
}

/* Ensure the rounded container hides overflow nicely */
#paySlip > div[style*="overflow"] {
  overflow: hidden !important;
  border-radius: 8px;
  position: relative;
}

/* Small accessibility tweak: make scrollbar easier to grab on touch */
@media (pointer: coarse) {
  #payslipTableRoot::-webkit-scrollbar {
    height: 14px;
    width: 14px;
  }
}
/* Keep payslipOrders from pushing totals down */
#payslipOrders {
  display: block;
  max-height: 300px; /* adjust as needed */
  overflow: auto;
  width: 100%;
}

/* Themed scrollbar for the tbody scroll area */
#payslipOrders {
  scrollbar-width: thin;
  scrollbar-color: rgba(74,194,154,0.9) rgba(255,255,255,0.02);
}

#payslipOrders::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#payslipOrders::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}

#payslipOrders::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(126,231,135,0.95), rgba(74,194,154,0.95));
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,0.18);
}

#payslipOrders::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(96,201,115,1), rgba(44,174,134,1));
}

/* Profile form styling to match the site theme */
.editor-form {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 18px;
  border-radius: 12px;
  color: #e6eef8;
  box-shadow: 0 6px 22px rgba(0,0,0,0.45);
  margin-bottom: 12px;
  flex-direction: column; /* stack rows vertically to avoid overlapping picture with address */
  box-sizing: border-box;
}

/* Top row: profile picture + basic info */
.editor-form-row {
  display: flex;
  gap: 18px;
  width: 100%;
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-picture {
  width: 160px;
  min-width: 160px;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  flex: 0 0 160px;
}

.profile-picture img#editorProfilePic {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.profile-picture img#editorProfilePic:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.editor-info-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Generic row behavior */
.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* Specific sizing rules to ensure Email expands and Gcash is a fixed column,
   and Address occupies full width below both elements */
.form-row.email-gcash-row {
  align-items: flex-start;
}

.form-row.email-gcash-row .form-group.email {
  flex: 1 1 auto;
  min-width: 0;
}

.form-row.email-gcash-row .form-group.gcash {
  flex: 0 0 260px;
  max-width: 260px;
}

/* Address form-group should always span full width */
.form-group.address {
  width: 100%;
  box-sizing: border-box;
}

/* Labels and inputs */
.form-group label {
  font-size: 0.85rem;
  color: #cfece0;
  font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  background: rgba(0,0,0,0.45);
  color: #e6eef8;
  border: 1px solid rgba(255,255,255,0.04);
  padding: 8px 10px;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
  width: 100%;
  box-sizing: border-box;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(74,194,154,0.95);
  box-shadow: 0 6px 18px rgba(74,194,154,0.08);
  transform: translateY(-1px);
}

/* Disabled/read-only appearance for stats fields */
.form-group input[disabled],
.form-group select[disabled],
.form-group textarea[disabled] {
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.06));
  color: rgba(230,238,248,0.8);
  border: 1px dashed rgba(255,255,255,0.03);
  cursor: default;
  box-shadow: none;
}

/* Layout for stats and totals column */
.statsTotalHeads {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.02);
  min-width: 220px;
  box-sizing: border-box;
}

.stat-card {
  background: linear-gradient(90deg, rgba(74,194,154,0.06), rgba(74,194,154,0.02));
  padding: 10px;
  border-radius: 8px;
  color: #e6eef8;
}

.stat-card h3 {
  margin: 0 0 6px 0;
  font-size: 0.9rem;
  color: #dff6ea;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

/* Total edits block */
.totalEdits {
  width: 170px;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0.28), rgba(0,0,0,0.22));
  border: 1px solid rgba(255,255,255,0.02);
}

.totalEdits .stats-header {
  color: #cfece0;
  font-weight: 700;
  margin-bottom: 6px;
}

.totalEdits .stats-value {
  font-size: 2rem;
  color: #fff;
  font-weight: 800;
}

/* Small helper text */
.editor-form + div[style] {
  margin-top: 8px;
  color: #cfdaf0;
  font-size: 0.9rem;
}

/* Make the profile panel scroll if content is taller than the fixed container */
#profile-body {
  overflow: auto;
  padding: 18px;
  box-sizing: border-box;
}

/* Responsive tweaks for profile form inside the fixed container */
@media (max-width: 1100px) {
  .editor-form {
    gap: 12px;
  }
  .editor-form-row {
    flex-direction: column;
    align-items: center;
  }
  .profile-picture { margin: 0 auto; }
  .totalEdits { width: 100%; display: flex; justify-content: center; }
}