.channel-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 60%;
    margin-right: 0.35rem;
    overflow: visible;
}

.channel-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 40%;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

/* Videos Track header adjustments */
.vt-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
.vt-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.vt-client-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 260px;
}
.vt-client-note textarea {
  min-height: 72px;
  max-height: 120px;
  resize: vertical;
  padding: 0.5rem;
}

/* Channel badge overrides */
.vt-badges {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}
.vt-count-badge {
  font-size: 0.72rem;
  padding: 0 6px;
  border-radius: 999px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.vt-count-badge.unpaid {
  background-color: rgba(231,76,60,0.25);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.35);
  box-shadow: 0 0 0 2px rgba(231,76,60,0.1);
}
:root{--bg-main:#0d1117;--bg-surface:#161b22;--bg-primary:var(--bg-main);--bg-secondary:var(--bg-surface);--bg-tertiary:#21262d;--accent-color:var(--primary-color);--border-color:#30363d;--text-primary:#c9d1d9;--text-secondary:#8b949e;--primary-color:#2f81f7;--primary-hover:#58a6ff;--danger-color:#f85149;--danger-hover:#da3633;--success-color:#2ea043;--warning-color:#d29922;--info-color:#a371f7;--brand-start:#667eea;--brand-end:#764ba2}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background-color:var(--bg-main);color:var(--text-primary);margin:0;padding:2rem;padding-bottom:100px}.container{max-width:95%;margin:auto}.selection-container{text-align:center;padding-top:5vh}.selection-container h1{font-size:2.5rem;color:#fff}.selection-container p{font-size:1.2rem;color:var(--text-secondary);margin-bottom:2rem}.game-grid{display:flex;flex-wrap:wrap;gap:1.5rem;justify-content:center}.game-card{background-color:var(--bg-surface);border:1px solid var(--border-color);border-radius:8px;padding:2rem;text-decoration:none;color:var(--text-primary);min-width:250px;transition:transform .2s ease,box-shadow .2s ease}.game-card:hover{transform:translateY(-5px);box-shadow:0 8px 25px rgba(0,0,0,.5);border-color:var(--primary-color)}.game-card h2{margin:0 0 .5rem}.game-card span{color:var(--text-secondary);font-family:monospace}.panel-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border-color);padding-bottom:1rem;margin-bottom:2rem}.back-button{color:var(--primary-color);text-decoration:none;font-weight:700}.back-button:hover{text-decoration:underline}.filter-bar{display:flex;flex-direction:column;gap:1rem;margin-bottom:2rem;padding:1rem;background-color:var(--bg-surface);border-radius:8px;border:1px solid var(--border-color)}.search-container{width:100%}.search-container input{width:100%;padding:12px 16px;margin:0;background-color:var(--bg-main);border:1px solid var(--border-color);border-radius:6px;color:var(--text-primary);font-size:1rem;transition:all .2s ease}.search-container input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px rgba(47,129,247,.2)}.search-container input::placeholder{color:var(--text-secondary)}.filter-buttons{display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}.filter-btn{width:auto;padding:10px 20px;margin:0;background-color:var(--bg-main);border:1px solid var(--border-color);color:var(--text-secondary);cursor:pointer;border-radius:6px;transition:all .2s ease;font-weight:600}.filter-btn:hover{background-color:var(--border-color);color:var(--text-primary)}.filter-btn.active{background-color:var(--primary-color);color:#fff;border-color:var(--primary-color)}.main-layout{display:grid;grid-template-columns:300px 1fr 280px;gap:1.5rem;align-items:start;width:100%}.sidebar{position:sticky;top:2rem}.summary-sidebar{position:sticky;top:2rem}.card{background-color:var(--bg-surface);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem}.card h2{margin-top:0;border-bottom:1px solid var(--border-color);padding-bottom:.8rem;margin-bottom:1.5rem}input,select,button,textarea{width:100%;padding:12px;margin-bottom:12px;border-radius:6px;border:1px solid var(--border-color);background-color:var(--bg-main);color:var(--text-primary);box-sizing:border-box;font-size:1rem;font-family:inherit}textarea{resize:vertical;min-height:60px}input:focus,select:focus,textarea:focus{outline:2px solid var(--primary-color);border-color:var(--primary-color)}button{background-color:var(--primary-color);border:none;cursor:pointer;font-weight:700;transition:background-color .2s}button:hover{background-color:var(--primary-hover)}.duration-group{display:flex;gap:.5rem}.duration-group input{flex-grow:1}.duration-group select{width:100px;flex-shrink:0}.autocomplete-container{position:relative}.autocomplete-items{position:absolute;border:1px solid var(--border-color);border-top:none;z-index:99;top:100%;left:0;right:0;max-height:150px;overflow-y:auto;background-color:var(--bg-surface)}.autocomplete-items div{padding:10px;cursor:pointer;border-bottom:1px solid var(--border-color)}.autocomplete-items div:hover{background-color:#2a2a2a}.groups-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(500px,1fr));gap:2rem;width:100%}.group-card.pinned{border-color:var(--info-color)}.group-header{display:flex;justify-content:space-between;align-items:center}.group-header h2{border:none;margin-bottom:1rem;display:flex;align-items:center;gap:.5rem}.group-header h2 input{width:auto;display:inline-block;padding:5px}.group-header h2 button{width:auto;margin:0 0 0 5px;font-size:.8rem;padding:5px 10px}.group-actions{display:flex;gap:.5rem}.icon-btn{background:0 0;border:none;cursor:pointer;font-size:1.2rem;padding:0;margin:0}.table-wrapper{overflow-x:auto}table{width:100%;border-collapse:collapse}th,td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--border-color);white-space:nowrap}thead th{font-size:.9rem;color:var(--text-secondary)}tbody tr:nth-child(2n){background-color:#0d1117}tbody tr.selected{background-color:rgba(47,129,247,.2)}tbody tr.editing{background-color:rgba(163,113,247,.1)}td.actions{display:flex;gap:.5rem}td.actions button,.edit-btn,.save-btn,.delete-btn,.cancel-btn{width:auto;margin:0;font-size:.8rem;padding:5px 10px}.edit-btn{background-color:var(--info-color)}.save-btn,.save-group-btn{background-color:var(--success-color)}.delete-btn{background-color:var(--danger-color)}.cancel-btn,.cancel-group-btn{background-color:#6e7681}.permanent{color:var(--success-color);font-weight:700}.expired{color:var(--danger-color)}.expiring-soon{color:var(--warning-color)}.bulk-actions-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    padding: 1rem 2rem;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    box-sizing: border-box;
    z-index: 100;
    border-top: 1px solid var(--border-color);
}

.bulk-actions-bar.visible {
    transform: translateY(0);
}

.bulk-actions-bar .actions {
    display: flex;
    gap: 1rem;
}

.bulk-actions-bar button {
    width: auto;
}

.bulk-actions-bar .selected-count {
    font-weight: 600;
    color: var(--text-primary);
}

.channel-checkbox-wrapper {
    display: none; /* Hidden by default */
}

/* Circular selection indicator */
.channel-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.channel-item:hover .channel-checkbox-custom,
.channel-item.selected .channel-checkbox-custom {
    display: flex;
}

.channel-item.selected .channel-checkbox-custom {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.channel-item.selected .channel-checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.channel-item.selected {
    background-color: rgba(47, 129, 247, 0.15);
    color: var(--text-primary);
}

/* Hide default checkbox */
.channel-checkbox {
    display: none;
}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);display:none;justify-content:center;align-items:center;z-index:200}.modal-content{background-color:var(--bg-surface);padding:2rem;border-radius:8px;width:90%;max-width:400px}.modal-actions{display:flex;gap:1rem;margin-top:1.5rem}.modal-actions button{width:100%}.duration-cell-edit{min-width:220px}.expand-section{text-align:center;padding:.75rem 1rem;border-top:1px solid var(--border-color)}.expand-btn{width:auto;margin:0;padding:8px 20px;background-color:var(--bg-main);color:var(--primary-color);border:1px solid var(--border-color);font-size:.9rem}.expand-btn:hover{background-color:var(--border-color);color:var(--primary-hover)}.groups-summary{display:flex;flex-direction:column;gap:.75rem;max-height:calc(100vh - 200px);overflow-y:auto}.summary-item{padding:.75rem;background-color:var(--bg-main);border-radius:6px;border-left:3px solid var(--border-color);transition:all .2s ease}.summary-item.summary-expired{border-left-color:var(--danger-color);background-color:rgba(248,81,73,.1)}.summary-item.summary-expiring-soon{border-left-color:var(--warning-color);background-color:rgba(210,153,34,.1)}.summary-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.summary-header strong{color:var(--text-primary);font-size:.95rem}.summary-total{background-color:var(--primary-color);color:#fff;padding:2px 8px;border-radius:12px;font-size:.85rem;font-weight:700}.summary-stats{display:flex;flex-wrap:wrap;gap:.4rem;font-size:.8rem}.summary-stats span{padding:2px 6px;border-radius:4px;background-color:var(--bg-surface)}.stat-expired{color:var(--danger-color);border:1px solid var(--danger-color)}.stat-expiring{color:var(--warning-color);border:1px solid var(--warning-color)}.stat-permanent{color:var(--success-color);border:1px solid var(--success-color)}.stat-active{color:var(--info-color);border:1px solid var(--info-color)}.no-groups{text-align:center;color:var(--text-secondary);padding:2rem;font-style:italic}@media (max-width:1400px){.main-layout{grid-template-columns:320px 1fr}.summary-sidebar{display:none}}@media (max-width:900px){.main-layout{grid-template-columns:1fr}.sidebar{position:static;top:0}.summary-sidebar{display:none}.filter-bar{padding:.75rem}.filter-buttons{flex-direction:column;width:100%}.filter-btn{width:100%;padding:12px}}.history-log{max-height:400px;overflow-y:auto;display:flex;flex-direction:column;gap:1rem}.log-entry{background-color:var(--bg-main);padding:.8rem;border-radius:6px;border-left:3px solid var(--info-color)}.log-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.25rem}.log-header strong{color:var(--text-primary)}.log-ip{font-family:monospace;font-size:.8rem;color:var(--text-secondary);background-color:#0d1117;padding:2px 5px;border-radius:4px}.log-details{font-size:.9rem;color:var(--text-secondary);word-break:break-all}.log-timestamp{font-size:.8rem;color:#6e7681;margin-top:.5rem;text-align:right}.add-progress{margin-top:.5rem;padding:.75rem;border-radius:6px;font-size:.9rem;min-height:20px}.add-progress:empty{display:none}.progress-info{color:var(--info-color);display:block}.progress-success{color:var(--success-color);display:block;font-weight:600}.progress-warning{color:var(--warning-color);display:block;font-weight:600}.failed-ids{margin-top:.5rem;font-size:.85rem;color:var(--text-secondary);background-color:var(--bg-main);padding:.5rem;border-radius:4px;border-left:3px solid var(--danger-color)}label{display:block;margin-bottom:.5rem;color:var(--text-secondary);font-size:.9rem;font-weight:600}label[for="user-id"]{margin-top:0}.search-highlight{background-color:#ffeb3b;color:#000;padding:2px 4px;border-radius:3px;font-weight:600}.expiration-cell{cursor:help}.expiration-cell:hover{background-color:rgba(47,129,247,.1)}

/* ========== LOGIN PAGE STYLES ========== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundScroll 60s linear infinite;
}

@keyframes backgroundScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.login-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
}

.login-header h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 0.9rem 1rem;
    margin: 0;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: var(--brand-start);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin: -0.5rem 0;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-label span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: normal;
}

.error-message {
    display: none;
    padding: 0.75rem;
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    color: var(--danger-color);
    font-size: 0.9rem;
    margin: 0;
}

.login-button {
    width: 100%;
    padding: 1rem;
    margin: 0;
    background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

.button-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========== DASHBOARD STYLES ========== */
:root {
    /* Default; JS will keep this in sync with the actual navbar height at runtime. */
    --dashboard-navbar-height: 70px;
    /* Dynamic; JS will set to banner height (e.g. 44px) when a global announcement is visible. */
    --dashboard-announcement-height: 0px;
}

.dashboard-body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    min-height: 100vh;
    /* Never allow page-level horizontal scrollbars; components should handle their own overflow */
    overflow-x: hidden;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-navbar {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.navbar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
}

.navbar-brand h1 {
    margin: 0;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-avatars {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid var(--bg-surface);
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: default;
}

.navbar-avatar.online {
    outline: 2px solid rgba(46, 204, 113, 0.9);
    outline-offset: 1px;
}

.navbar-avatar.offline {
    opacity: 0.6;
    filter: grayscale(100%);
}

/* Instagram-style offline time badge */
.navbar-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.offline-time-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 8px;
    line-height: 1;
    white-space: nowrap;
    border: 1.5px solid var(--border-color);
    min-width: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-email {
    color: var(--text-primary);
    font-weight: 600;
}

.user-role {
    padding: 0.25rem 0.75rem;
    background-color: var(--info-color);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.logout-btn {
    width: auto;
    padding: 0.5rem 1.5rem;
    margin: 0;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: var(--danger-hover);
}

/* ========== NOTIFICATION BELL ========== */
.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    background: rgba(110, 118, 129, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.notification-btn:hover {
    background: rgba(110, 118, 129, 0.2);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.notification-btn .bell-icon {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #f85149 0%, #da3633 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(248, 81, 73, 0.4);
    animation: notification-pulse 2s ease-in-out infinite;
}

@keyframes notification-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.notification-bell.open .notification-dropdown {
    display: block;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.mark-all-read-btn {
    width: auto;
    padding: 0.35rem 0.65rem;
    margin: 0;
    background: rgba(46, 160, 67, 0.15);
    border: 1px solid rgba(46, 160, 67, 0.3);
    border-radius: 6px;
    color: #3fb950;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.mark-all-read-btn:hover {
    background: rgba(46, 160, 67, 0.25);
    border-color: rgba(46, 160, 67, 0.5);
}

.notification-tabs {
    display: flex;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.notification-tab {
    flex: 1;
    padding: 0.5rem;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-tab:hover {
    color: var(--text-primary);
    background: rgba(110, 118, 129, 0.1);
}

.notification-tab.active {
    background: var(--primary-color);
    color: white;
}

.notification-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

.notification-item:hover {
    background: rgba(110, 118, 129, 0.1);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: rgba(47, 129, 247, 0.08);
}

.notification-item.unread:hover {
    background: rgba(47, 129, 247, 0.12);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-icon.task-assigned {
    background: rgba(163, 113, 247, 0.2);
    color: #a371f7;
}

.notification-icon.task-co-assigned {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.notification-icon.comment-on-task,
.notification-icon.comment-reply {
    background: rgba(46, 160, 67, 0.2);
    color: #3fb950;
}

.notification-icon.deadline-passed,
.notification-icon.task-deadline {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

.notification-icon.task-unassigned {
    background: rgba(139, 148, 158, 0.2);
    color: #8b949e;
}

.notification-icon.task-priority-changed {
    background: rgba(210, 153, 34, 0.2);
    color: #d29922;
}

.notification-icon.task-description-updated {
    background: rgba(56, 139, 253, 0.2);
    color: #388bfd;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.notification-org {
    background: rgba(88, 101, 242, 0.2);
    color: #7289da;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.notification-actor {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.notification-actor-avatar {
    width: 14px;
    height: 14px;
    border-radius: 999px;
}

.notification-time {
    opacity: 0.7;
}

/* Mark as read button for individual notifications */
.notification-mark-read-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    pointer-events: none; /* Don't capture clicks when invisible */
    transition: all 0.15s ease;
    flex-shrink: 0;
    align-self: center;
}

.notification-item:hover .notification-mark-read-btn {
    opacity: 1;
    pointer-events: auto; /* Enable clicks when visible */
}

.notification-mark-read-btn:hover {
    background: rgba(46, 160, 67, 0.15);
    border-color: #3fb950;
    color: #3fb950;
}

.notification-mark-read-btn:active {
    transform: scale(0.95);
}

.notification-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.notification-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* ========== REDESIGNED USER INFO GROUP ========== */
.user-info-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 40px;
    padding: 0 0.75rem;
    background: rgba(110, 118, 129, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-info-group:hover {
    background: rgba(110, 118, 129, 0.12);
    border-color: var(--text-secondary);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    line-height: 1.2;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.user-role-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    color: white;
    width: fit-content;
    line-height: 1.4;
}

/* New logout button style */
.logout-btn-new {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 8px;
    color: #f85149;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.logout-btn-new:hover {
    background: rgba(248, 81, 73, 0.2);
    border-color: rgba(248, 81, 73, 0.5);
    color: #ff7b72;
}

/* Responsive adjustments for navbar */
@media (max-width: 900px) {
    .notification-dropdown {
        width: 320px;
        right: -50px;
    }
    
    .user-name {
        max-width: 80px;
    }
}

@media (max-width: 768px) {
    .user-meta {
        display: none;
    }
    
    .user-info-group {
        padding: 0.4rem;
    }
    
    .notification-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
    }
}

.dashboard-layout {
    display: flex;
    flex: 1;
    overflow: visible;
    overflow-x: hidden;
    /* Offset for the fixed navbar */
    padding-top: calc(var(--dashboard-navbar-height, 70px) + var(--dashboard-announcement-height, 0px));
}

.dashboard-body-container {
    display: flex;
    flex: 1;
}

.dashboard-sidebar {
    width: 304px;
    min-width: 288px;
    max-width: 352px;
    background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
    border-right: 1px solid var(--border-color);
    /* Small top padding for the floating collapse button, none at bottom */
    padding: 0.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    
    /* Fixed position so sidebar is always flush with the navbar bottom */
    position: fixed !important;
    top: calc(var(--dashboard-navbar-height, 70px) + var(--dashboard-announcement-height, 0px)) !important;
    left: 0 !important;
    height: calc(100vh - (var(--dashboard-navbar-height, 70px) + var(--dashboard-announcement-height, 0px)));
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
}

.sidebar-toggle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0;
    z-index: 10;
}

.sidebar-toggle button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(163, 113, 247, 0.25));
    color: var(--text-primary);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.2);
}

.sidebar-toggle button:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(163, 113, 247, 0.35));
    border-color: rgba(102, 126, 234, 0.8);
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 10px 22px rgba(102, 126, 234, 0.28);
}

.toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.95rem;
    transition: transform 0.2s ease;
    transform: rotate(180deg);
}

.sidebar-toggle .toggle-text {
    display: none;
}

.sidebar-toggle button[aria-pressed="true"] .toggle-icon {
    transform: rotate(0deg);
}

.dashboard-container.sidebar-collapsed .dashboard-sidebar {
    width: 78px;
    min-width: 78px;
    padding: 0.5rem 0.65rem;
}

.dashboard-container.sidebar-collapsed .dashboard-main {
    margin-left: 78px;
}

.dashboard-container.sidebar-collapsed .sidebar-section {
    margin-bottom: 1rem;
}

.dashboard-container.sidebar-collapsed .sidebar-section h3,
.dashboard-container.sidebar-collapsed .nav-category-header {
    display: none;
}

.dashboard-container.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 0.85rem 0.5rem;
}

.dashboard-container.sidebar-collapsed .nav-label {
    display: none;
}

.dashboard-container.sidebar-collapsed .nav-icon {
    margin: 0;
}

.dashboard-container.sidebar-collapsed .sidebar-nav {
    padding: 0;
}

.dashboard-container.sidebar-collapsed .sidebar-toggle .toggle-text {
    display: none;
}

.dashboard-container.sidebar-collapsed .sidebar-toggle button {
    padding: 0.85rem 0.5rem;
}

/* When sidebar is collapsed, toggle button needs more space from nav items */
.dashboard-container.sidebar-collapsed .sidebar-toggle {
    position: relative;
    top: auto;
    right: auto;
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

/* First section needs extra top margin to avoid overlap with floating toggle button */
.sidebar-toggle + .sidebar-section {
    margin-top: 2.5rem;
}

/* When collapsed, first section doesn't need extra margin since toggle is now in flow */
.dashboard-container.sidebar-collapsed .sidebar-toggle + .sidebar-section {
    margin-top: 0;
}

.sidebar-section h3 {
    padding: 0 1.5rem;
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--brand-start) 0%, var(--brand-end) 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 4px 4px 0;
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(4px);
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item.active .nav-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nav-icon {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-item:hover .nav-icon {
    background: rgba(102, 126, 234, 0.2);
    transform: rotate(5deg) scale(1.05);
}

.nav-item.active .nav-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.nav-label {
    flex: 1;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.admin-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.no-access {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.dashboard-main {
    flex: 1;
    padding: 2rem;
    overflow-y: visible;
    background-color: var(--bg-main);
    overflow-x: hidden;
    /* Offset for the fixed sidebar */
    margin-left: 304px;
}

.tab-content {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    overflow: visible;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Remove the previous hack */
#tab-content, 
.whitelist-tab-container, 
.main-layout {
    overflow: visible !important;
}

/* But we still must never allow global horizontal scrollbars */
#tab-content {
    overflow-x: hidden !important;
}

/* Ensure sticky sidebars work in tab content */
.tab-content .main-layout {
    position: relative;
}

.tab-content .sidebar,
.tab-content .summary-sidebar {
    position: sticky !important;
    top: 90px !important;
    align-self: flex-start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    z-index: 30;
}

/* Ensure the groups grid allows sidebars to be sticky */
.tab-content .groups-grid {
    min-height: 100vh;
}

.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-state .loader {
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin-bottom: 1rem;
}

.error-state {
    color: var(--danger-color);
}

.error-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* ========== ADMIN PANEL STYLES ========== */
.admin-container {
    width: 100%;
}

.admin-header {
    margin-bottom: 2rem;
}

.admin-header h2 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: var(--text-primary);
}

.admin-header p {
    margin: 0;
    color: var(--text-secondary);
}

.admin-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.admin-card h3 {
    margin: 0 0 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    margin: 0 !important;
}

.card-header .btn-primary,
.card-header .btn-secondary {
    flex-shrink: 0;
    width: auto;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-message {
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.form-message.success {
    background-color: rgba(46, 160, 67, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.form-message.error {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.form-message.info {
    background-color: rgba(47, 129, 247, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    width: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    background-color: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Team Tasks header: compact "tile" button (emoji on top, label below) */
.teamtasks-action-tile{
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    width: 78px;
    height: 78px;
    padding: 0.35rem 0.35rem;
    line-height: 1.05;
}
.teamtasks-action-emoji{
    font-size: 1.1rem;
}
.teamtasks-action-label{
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.95;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.users-list {
    overflow-x: auto;
    max-width: 100%;
}

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    display: table !important;
}

.users-table thead { display: table-header-group !important; }
.users-table tbody { display: table-row-group !important; }
.users-table tr { display: table-row !important; }

.users-table th, 
.users-table td { 
    display: table-cell !important; 
    vertical-align: middle !important;
}

.user-row {
    transition: all 0.3s ease;
    position: relative;
}

.user-row:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.2);
}

.master-admin-row {
    background: linear-gradient(135deg, rgba(163, 113, 247, 0.08) 0%, rgba(102, 126, 234, 0.08) 100%);
    border-left: 3px solid var(--info-color);
}

.master-admin-row:hover {
    background: linear-gradient(135deg, rgba(163, 113, 247, 0.15) 0%, rgba(102, 126, 234, 0.15) 100%);
}

.suspended-row {
    opacity: 0.6;
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.08) 0%, rgba(218, 54, 51, 0.08) 100%);
}

.suspended-row:hover {
    opacity: 0.8;
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.12) 0%, rgba(218, 54, 51, 0.12) 100%);
}

.user-cell {
    line-height: 1.3;
}

.user-display-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-email-small {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.system-role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-master_admin {
    background-color: var(--info-color);
    color: white;
}

.role-admin {
    background-color: var(--primary-color);
    color: white;
}

.role-user {
    background-color: var(--success-color);
    color: white;
}

.permissions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.permission-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    font-size: 0.9rem;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.permission-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.permission-label:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.permission-label:hover::before {
    transform: scaleY(1);
}

.permission-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #667eea;
}

.permission-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.permission-label input[type="checkbox"]:checked + span {
    color: var(--text-primary);
    font-weight: 600;
}

.permission-label span {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: capitalize;
    transition: color 0.2s ease;
}

.all-access {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(163, 113, 247, 0.2) 0%, rgba(102, 126, 234, 0.2) 100%);
    border-radius: 20px;
    border: 2px solid var(--info-color);
    color: var(--info-color);
    font-weight: 700;
    font-style: normal;
    box-shadow: 0 0 20px rgba(163, 113, 247, 0.3);
    animation: allAccessGlow 2s ease-in-out infinite;
}

.all-access::before {
    content: '⭐';
    font-size: 1.1rem;
}

@keyframes allAccessGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(163, 113, 247, 0.3); }
    50% { box-shadow: 0 0 30px rgba(163, 113, 247, 0.5); }
}

.actions-cell {
    text-align: center !important;
    white-space: nowrap !important;
}

.actions-cell button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 4px !important;
    border-radius: 8px !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    border: none !important;
    color: white !important;
    vertical-align: middle;
}

.edit-user-btn {
    background: #2f81f7 !important;
}

.suspend-user-btn {
    background: #d29922 !important;
}

.suspend-user-btn.suspended {
    background: #2ea043 !important;
}

.delete-user-btn {
    background: #f85149 !important;
}

.actions-cell button:hover {
    opacity: 0.8;
}

.actions-cell button span {
    line-height: 1;
}

.btn-danger-small {
    width: auto;
    padding: 0.4rem 0.8rem;
    margin: 0;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-danger-small:hover {
    background-color: var(--danger-hover);
}

/* ========== WHITELIST TAB SPECIFIC STYLES ========== */
.whitelist-tab-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tab-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-header h2 {
    margin: 0 0 0.5rem;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tab-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.game-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.game-selection-card {
    background: linear-gradient(135deg, var(--bg-surface) 0%, #0d1117 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.game-selection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.game-selection-card:hover {
    transform: translateY(-10px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.game-selection-card:hover::before {
    transform: scaleX(1);
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.game-selection-card h3 {
    margin: 1rem 0 0.5rem;
    font-size: 2rem;
    color: var(--text-primary);
}

.game-selection-card p {
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.9rem;
}

.select-game-btn {
    width: 100%;
    padding: 1rem 2rem;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.select-game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.select-game-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.select-game-btn:hover::before {
    left: 100%;
}

.game-back-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.back-to-games-btn {
    width: auto;
    padding: 0.6rem 1.2rem;
    margin: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-to-games-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateX(-5px);
}

.current-game-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.current-game-label strong {
    color: var(--text-primary);
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 0.5rem;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem;
    }
    
    .dashboard-navbar {
        position: sticky;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .dashboard-layout {
        flex-direction: column;
        padding-top: 0;
    }
    
    .dashboard-sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 0;
    }

    .sidebar-toggle {
        position: static;
        display: flex;
        justify-content: flex-end;
        padding: 0 0.75rem 0.5rem 0.75rem;
    }

    .sidebar-toggle + .sidebar-section {
        margin-top: 0;
    }
    
    .dashboard-main {
        padding: 1rem;
        margin-left: 0;
    }

    /* Keep sidebar readable on mobile even if user left it collapsed */
    .dashboard-container.sidebar-collapsed .dashboard-sidebar {
        position: static;
        width: 100%;
        min-width: 100%;
        height: auto;
        padding: 1rem 0;
    }

    .dashboard-container.sidebar-collapsed .dashboard-main {
        margin-left: 0;
    }

    .dashboard-container.sidebar-collapsed .nav-label,
    .dashboard-container.sidebar-collapsed .nav-category-header,
    .dashboard-container.sidebar-collapsed .sidebar-section h3,
    .dashboard-container.sidebar-collapsed .sidebar-toggle .toggle-text {
        display: inline;
    }

    .dashboard-container.sidebar-collapsed .nav-item {
        justify-content: flex-start;
        padding: 1rem 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .users-table {
        font-size: 0.85rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.5rem;
    }
    
    .game-selection-grid {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }
    
    .game-selection-card {
        padding: 2rem;
    }
    
    .game-icon {
        font-size: 3rem;
    }
    
    .game-back-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ========== SETTINGS PAGE STYLES ========== */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
}

.settings-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h2 {
    margin: 0 0 0.5rem;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.settings-card h3 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

.settings-form label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.settings-form input {
    padding: 0.75rem 1rem;
    margin: 0;
    border-radius: 8px;
    font-size: 1rem;
}

.settings-form input:disabled {
    background-color: rgba(48, 54, 61, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
}

.settings-form small {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.settings-form button[type="submit"] {
    width: auto;
    align-self: flex-start;
    padding: 0.875rem 2rem;
    margin: 0.5rem 0 0 0;
}

/* ========== EDIT USER MODAL STYLES ========== */
.edit-user-modal {
    max-width: 500px;
    width: 90%;
}

.edit-user-modal h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.edit-user-modal .form-group {
    margin-bottom: 1.25rem;
}

.edit-user-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.edit-user-modal .form-group input,
.edit-user-modal .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.edit-user-modal .form-group input:focus,
.edit-user-modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2);
}

.edit-user-modal .modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.edit-user-modal .modal-actions button {
    flex: 1;
    padding: 0.875rem 1.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.edit-user-modal .modal-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.edit-user-modal .modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.edit-user-modal .modal-actions .cancel-btn {
    background-color: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.edit-user-modal .modal-actions .cancel-btn:hover {
    background-color: var(--border-color);
}

.edit-user-modal #edit-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.edit-user-modal #edit-message.info {
    background-color: rgba(163, 113, 247, 0.1);
    color: var(--info-color);
    border: 1px solid var(--info-color);
}

.edit-user-modal #edit-message.success {
    background-color: rgba(46, 160, 67, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.edit-user-modal #edit-message.error {
    background-color: rgba(248, 81, 73, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.edit-user-modal #edit-message:empty {
    display: none;
}

/* ========== DISCORD ORDER MANAGEMENT STYLES ========== */

.discord-container {
    max-width: 1400px;
    margin: 0 auto;
}

.discord-header {
    margin-bottom: 2rem;
}

.discord-header h2 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: var(--text-primary);
}

.discord-header p {
    margin: 0;
    color: var(--text-secondary);
}

/* Statistics Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.stat-card.stat-overdue {
    border-left: 3px solid var(--danger-color);
}

.stat-card.stat-risk {
    border-left: 3px solid var(--warning-color);
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Overdue Alert */
.overdue-alert {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-text {
    flex: 1;
}

.alert-text strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--danger-color);
}

.alert-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.alert-btn:hover {
    background: var(--danger-hover);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.action-buttons button {
    width: auto;
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    max-width: 600px;
}

.filter-select {
    width: auto;
    min-width: 150px;
}

.search-input {
    flex: 1;
}

/* Orders Container */
.orders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Order Card */
.order-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.order-card.status-good {
    border-left: 3px solid var(--success-color);
}

.order-card.status-warning {
    border-left: 3px solid var(--warning-color);
}

.order-card.status-critical {
    border-left: 3px solid #ff8c00;
}

.order-card.status-overdue {
    border-left: 3px solid var(--danger-color);
    background: rgba(248, 81, 73, 0.05);
}

.order-card.status-attended {
    border-left: 3px solid var(--warning-color);
    background: rgba(210, 153, 34, 0.05);
}

.order-card.status-pending {
    border-left: 3px solid #6e7681;
    background: rgba(110, 118, 129, 0.05);
}

/* Rejected orders (match Worker Orders expectation: red) */
.order-card.status-rejected {
    border-left: 3px solid var(--danger-color);
    background: rgba(248, 81, 73, 0.06);
}

.blinking-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--warning-color);
    animation: blink 1.5s infinite;
    margin-right: 8px;
}

.blinking-dot.gray {
    background-color: #8b949e;
}

@keyframes blink {
    0% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.4; transform: scale(0.8); }
}

.attended-timer {
    font-family: monospace;
    font-weight: 600;
    color: var(--warning-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    background: rgba(210, 153, 34, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.order-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.order-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.status-icon {
    font-size: 1.2rem;
}

.badge-disabled {
    background: rgba(139, 148, 158, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.order-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.btn-icon.btn-cancel:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

.info-value.bonus {
    color: var(--success-color);
}

.info-value.penalty {
    color: var(--danger-color);
}

.penalty-row {
    background: rgba(248, 81, 73, 0.1);
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.time-overdue {
    color: var(--danger-color);
    font-weight: 700;
}

.time-today {
    color: var(--warning-color);
    font-weight: 700;
}

.time-soon {
    color: #ff8c00;
    font-weight: 600;
}

.time-normal {
    color: var(--text-secondary);
}

/* Progress Section */
.progress-section {
    margin-top: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.progress-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-overdue {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 0.75rem;
    background: rgba(248, 81, 73, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-fill.status-good {
    background: linear-gradient(90deg, var(--success-color), #3fb950);
}

.progress-fill.status-attended {
    background: linear-gradient(90deg, var(--warning-color), #f0c744);
}

.progress-fill.status-pending {
    background: linear-gradient(90deg, #6e7681, #8b949e);
}

.progress-fill.status-critical {
    background: linear-gradient(90deg, #ff8c00, #ffa500);
}

.progress-fill.status-overdue {
    background: linear-gradient(90deg, var(--danger-color), #ff6b6b);
}

.progress-fill.status-rejected {
    background: linear-gradient(90deg, var(--danger-color), #ff6b6b);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Ensure checklist prompt always layers above the task modal */
#teamtasks-checklist-modal {
    z-index: 1200;
}

.modal-overlay.show {
    display: flex !important;
    opacity: 1 !important;
}

.modal.show,
.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.form-actions button {
    width: auto;
    min-width: 100px;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: var(--danger-hover);
}

/* Order Details */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.details-section h4 {
    margin: 0 0 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.details-table {
    width: 100%;
}

.details-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.details-table td:first-child {
    color: var(--text-secondary);
    width: 40%;
}

.details-table td:last-child {
    color: var(--text-primary);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(46, 160, 67, 0.2);
    color: var(--success-color);
}

.status-badge.overdue {
    background: rgba(248, 81, 73, 0.2);
    color: var(--danger-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.extensions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.extensions-list li {
    padding: 0.5rem;
    background: var(--bg-main);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

/* Completed Orders */
.completed-summary {
    margin-bottom: 2rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.summary-card.success {
    border-color: var(--success-color);
}

.summary-card.danger {
    border-color: var(--danger-color);
}

.summary-card.total {
    background: linear-gradient(135deg, rgba(47, 129, 247, 0.2), rgba(163, 113, 247, 0.2));
    border-color: var(--primary-color);
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.completed-orders-list {
    max-height: 500px;
    overflow-y: auto;
}

.completed-order-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.completed-order-item:hover {
    border-color: var(--primary-color);
}

.completed-order-item.unpaid-item {
    cursor: pointer;
}

.completed-order-item.unpaid-item.selected {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
}

.unpaid-adjustment.bonus {
    border-left: 3px solid var(--success-color);
}

.unpaid-adjustment.penalty {
    border-left: 3px solid var(--danger-color);
}

.unpaid-select {
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Unpaid modal layout */
.unpaid-modal-body {
    display: flex;
    flex-direction: column;
    height: 70vh;
    max-height: 600px;
    padding: 0 !important;
}

.unpaid-summary-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.05));
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.unpaid-summary-bar .summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    min-width: 120px;
}

.unpaid-summary-bar .summary-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.unpaid-summary-bar .summary-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.unpaid-summary-bar .summary-stat.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.unpaid-summary-bar .summary-stat.highlight .stat-value {
    color: #fff;
}

.unpaid-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

/* Unpaid footer with pay buttons */
.unpaid-footer {
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.unpaid-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.unpaid-selection-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Toggle switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    display: inline-block;
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    transition: background 0.2s ease;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success-color);
    border-color: var(--success-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Pay buttons */
.unpaid-pay-btns {
    display: flex;
    gap: 0.75rem;
}

.unpaid-pay-btns .btn-primary {
    flex: 1;
}

.unpaid-pay-btns .btn-danger {
    flex: 1;
}

/* Unpaid item checkbox */
.unpaid-item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.completed-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.completed-icon {
    font-size: 1.2rem;
}

.completed-date {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.completed-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}

.completed-details span {
    color: var(--text-secondary);
}

.completed-total {
    font-weight: 700;
    color: var(--primary-color);
    margin-left: auto;
}

/* Loading and Empty States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loader {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 0.5rem 0;
}

.empty-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.error-state {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .orders-container {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

@media (max-width: 768px) {
    .orders-container {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls {
        max-width: none;
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
}
/* ========== DISCORD ORDER MANAGEMENT STYLES (REDESIGN) ========== */

/* Layout */
.discord-layout {
    display: flex;
    gap: 1.5rem;
    height: 100%;
    min-height: 600px;
    overflow: hidden;
}

/* Sidebar */
.discord-sidebar {
    width: 280px;
    min-width: 280px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

/* Categories and Channels */
.category-item {
    margin-bottom: 0.25rem;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.category-header:hover {
    color: var(--text-primary);
}

.category-arrow {
    font-size: 0.6rem;
    margin-right: 0.5rem;
    transition: transform 0.2s;
    display: inline-block;
}

.category-item.collapsed .category-arrow {
    transform: rotate(-90deg);
}

.category-item.collapsed .channel-list {
    display: none;
}

.channel-list {
    padding-left: 0;
}

.channel-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    row-gap: 0.25rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.7rem;
    margin: 0.1rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background-color 0.2s, color 0.2s;
    position: relative;
    user-select: none;
    min-height: 36px;
}

.channel-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.channel-item.active {
    background-color: rgba(47, 129, 247, 0.1);
    color: var(--primary-color);
}

.channel-icon {
    color: var(--text-secondary);
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-right: 2px;
}

.channel-name {
    flex: 1 1 auto;
    white-space: normal;
    overflow: visible;
    font-weight: 500;
    font-size: 0.95rem;
}

.channel-status {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    margin-left: 0.5rem;
}

.channel-status.status-overdue {
    background-color: var(--danger-color);
    box-shadow: 0 0 4px var(--danger-color);
}

.channel-status.status-active {
    background-color: var(--success-color);
}

.channel-count {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    font-weight: 600;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.channel-count.gray { background-color: #6e7681; }
.channel-count.yellow { background-color: var(--warning-color); color: #fff; }
.channel-count.orange { background-color: #ff8c00; color: #fff; }
.channel-count.green { background-color: var(--success-color); }
.channel-count.red { background-color: var(--danger-color); }

/* Time Badge Styles for Whitelist Management */
.permanent {
    color: var(--success-color);
    font-weight: 600;
}

.expired {
    color: var(--danger-color);
    font-weight: 600;
}

.expiring-soon {
    color: #ff8c00;
    font-weight: 600;
}

/* Main Content Area */
.discord-main {
    flex: 1;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
    min-width: 0;
}

.discord-main .discord-header {
    padding: 0 0 1.5rem 0;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon {
    color: var(--text-secondary);
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1;
}

.discord-main h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Existing Order/Card Styles (Refined for new layout) */
.orders-container {
    padding: 0;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.order-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border-color: var(--primary-color);
}

.order-card-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
}

.order-actions {
    display: flex;
    gap: 0.25rem;
}

.order-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.order-title-row h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word; /* Let it wrap */
    line-height: 1.3;
}

.stats-container {
    padding: 0 0 1.5rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Sidebar Footer (User Profile) */
.sidebar-footer {
    background-color: rgba(0,0,0,0.2);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}

.user-info:hover {
    background-color: rgba(255,255,255,0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .username {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.user-details .status {
    color: var(--success-color);
    font-size: 0.75rem;
}

/* Alert Banner */
.overdue-alert {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.alert-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.alert-text {
    color: var(--danger-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    width: auto;
}

.alert-btn:hover {
    background-color: var(--danger-hover);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-select {
    padding: 0.6rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.search-input {
    padding: 0.6rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    width: 250px;
}

/* Small Loader */
.loader-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-state-small {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

/* Right Panel */
.discord-right-panel {
    width: 320px;
    min-width: 320px;
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    border-radius: 0 8px 8px 0; /* Round right corners if main container is rounded, otherwise 0 */
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-left: 0; /* managed by parent gap if any */
}

.right-panel-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.right-panel-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.channel-info-small {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.right-panel-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.action-btn {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.btn-warning {
    background-color: rgba(210, 153, 34, 0.1);
    color: var(--warning-color);
    border-color: var(--warning-color);
}
.btn-warning:hover { background-color: rgba(210, 153, 34, 0.2); }

.btn-penalty {
    background-color: rgba(248, 81, 73, 0.1);
    color: var(--danger-color);
    border-color: var(--danger-color);
}
.btn-penalty:hover { background-color: rgba(248, 81, 73, 0.2); }

.btn-bonus {
    background-color: rgba(46, 160, 67, 0.1);
    color: var(--success-color);
    border-color: var(--success-color);
}
.btn-bonus:hover { background-color: rgba(46, 160, 67, 0.2); }

.right-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.log-item {
    padding: 0.75rem;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.03);
    margin-bottom: 0.75rem;
    border-left: 3px solid transparent;
}

.log-item.type-WARNING { border-left-color: var(--warning-color); }
.log-item.type-PENALTY { border-left-color: var(--danger-color); }
.log-item.type-BONUS { border-left-color: var(--success-color); }

.log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.log-amount {
    font-weight: 700;
}
.log-item.type-BONUS .log-amount { color: var(--success-color); }
.log-item.type-PENALTY .log-amount { color: var(--danger-color); }

.log-reason {
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
}


.log-details-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.log-author {
    color: var(--text-secondary);
    font-style: italic;
    margin-left: auto; /* Push to right if no amount, or next to amount */
}


.info-value-group {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}


.progress-status-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ========== CONFIGURATION PAGE STYLES ========== */

.nav-category {
    margin-bottom: 1rem;
}

.nav-category-header {
    padding: 0 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.nav-category-header::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Ensure existing nav-items inside category have correct indentation if needed */
/* They are flex items, so margin/padding already set in .nav-item class */

.config-container {
    padding: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.config-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.config-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-item label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.config-item input {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

.config-actions {
    position: sticky;
    bottom: 2rem;
    background-color: var(--bg-surface);
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 50;
}

.brand-preview-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
}

.brand-preview-img.small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.brand-gradient-preview {
    width: 120px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}


/* ========== PERMISSIONS MODAL STYLES ========== */
.permissions-modal {
    max-width: 600px;
}

.permission-category {
    margin-bottom: 1.5rem;
}

.permission-category h4 {
    margin: 0 0 0.8rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
}

.permission-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.permission-option:hover {
    border-color: var(--primary-color);
    background: rgba(47, 129, 247, 0.05);
}

.permission-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
}

/* ========== ROLE BADGE STYLES ========== */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
    vertical-align: middle;
    letter-spacing: 0.01em;
}

.role-badge-sm {
    font-size: 0.6rem;
    padding: 0.05rem 0.35rem;
    gap: 0.15rem;
}

.role-badge-lg {
    font-size: 0.75rem;
    padding: 0.15rem 0.55rem;
    gap: 0.25rem;
}

.role-badges-container {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* Role badge in header */
.user-meta .role-badges-container {
    margin-top: -1px;
}

/* Role management section */
.roles-management-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Priority indicator bar above the drag row */
.roles-priority-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-radius: 6px;
    background: var(--bg-main);
    border: 1px dashed var(--border-color);
    margin-bottom: 0.25rem;
}

.roles-priority-label.high {
    color: var(--primary-color);
    font-weight: 600;
}

.roles-priority-label.low {
    color: var(--text-secondary);
    font-weight: 600;
}

.roles-priority-hint {
    font-style: italic;
    opacity: 0.7;
}

/* Horizontal scrollable drag row */
.roles-drag-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem;
    min-height: 100px;
    scrollbar-width: thin;
}

.roles-drag-row::-webkit-scrollbar {
    height: 6px;
}

.roles-drag-row::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 3px;
}

.roles-drag-row::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.role-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.15s;
    position: relative;
    min-width: 200px;
    max-width: 280px;
    flex-shrink: 0;
    user-select: none;
}

.role-card-draggable {
    cursor: grab;
}

.role-card-draggable:active {
    cursor: grabbing;
}

.role-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Drag handle icon */
.role-card-drag-handle {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.35;
    pointer-events: none;
    letter-spacing: 2px;
}

.role-card:hover .role-card-drag-handle {
    opacity: 0.7;
}

/* Dragging state */
.role-card-dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border: 1px dashed var(--primary-color);
}

/* Drop indicators */
.role-card-drop-before {
    box-shadow: -3px 0 0 0 var(--primary-color);
}

.role-card-drop-after {
    box-shadow: 3px 0 0 0 var(--primary-color);
}

.role-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    margin-top: 0.25rem;
}

.role-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-card-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.role-card-actions button {
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.role-card-actions button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.role-card-actions button.delete-role:hover {
    border-color: #f85149;
    color: #f85149;
}

.role-card-perms {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.role-card-color-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* Role assignment chips in permissions modal */
.role-assignment-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.role-assignment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    user-select: none;
}

.role-assignment-chip:hover {
    opacity: 0.85;
}

.role-assignment-chip.selected {
    border-color: currentColor;
    box-shadow: 0 0 0 1px currentColor;
}

/* Effective permissions summary */
.effective-perms-summary {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.effective-perms-summary .perm-tag {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    background: rgba(56, 139, 253, 0.1);
    color: #58a6ff;
    border: 1px solid rgba(56, 139, 253, 0.2);
    margin: 0.15rem;
}

.effective-perms-summary .perm-tag-role {
    background: rgba(56, 139, 253, 0.1);
    color: #58a6ff;
    border-color: rgba(56, 139, 253, 0.2);
}

.effective-perms-summary .perm-tag-override {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border-color: rgba(210, 153, 34, 0.3);
    font-weight: 600;
}

.effective-perms-summary .perms-section {
    margin-bottom: 0.25rem;
}

.effective-perms-summary .perms-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.effective-perms-summary .perms-section-overrides {
    padding: 0.5rem;
    background: rgba(210, 153, 34, 0.06);
    border: 1px solid rgba(210, 153, 34, 0.2);
    border-radius: 4px;
}

.effective-perms-summary .perms-section-overrides .perms-section-header {
    color: #d29922;
}

.effective-perms-summary .perms-section-body {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* ========== CLEANING PAGE STYLES ========== */

.cleaning-container {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 600px;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card .limit-bar {
    margin-top: 0.5rem;
    height: 6px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.stat-card .limit-fill {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.5s ease, background-color 0.3s ease;
}

.stat-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-limit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.cleaning-table {
    width: 100%;
    border-collapse: collapse;
}

.cleaning-table th,
.cleaning-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.cleaning-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.cleaning-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.message-preview {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.status-good {
    border-left: 4px solid var(--success-color);
}

.status-warning {
    border-left: 4px solid var(--warning-color);
}

.status-danger {
    border-left: 4px solid var(--danger-color);
}

.error-text {
    color: var(--danger-color);
    padding: 2rem;
}

.cleaning-table .actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.cleaning-table .actions-cell button {
    width: auto !important;
    margin: 0 !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
}

.btn-link-muted {
    background: rgba(47, 129, 247, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    margin-left: 0;
    opacity: 1;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    white-space: nowrap;
    width: auto !important;
}

.btn-link-muted:hover {
    opacity: 1;
    color: white;
    border-color: var(--primary-hover);
    background-color: var(--primary-color);
}

.category-cell {
    display: flex;
    align-items: center;
}

.channel-name-cell {
    display: flex;
    align-items: center;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #fff;
}

.btn-warning:hover {
    background-color: #b0801d;
}

/* ========== CATEGORY SELECT STYLES ========== */
.category-select {
    padding: 0.35rem 0.5rem;
    padding-right: 1.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid;
    text-align: left;
    width: auto;
    min-width: 150px;
    white-space: nowrap;
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.8rem;
}

/* Category-specific styling with colors */
.category-select.category-on-demand {
    background-color: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.3);
    color: #3498db;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.category-select.category-monthly {
    background-color: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232ecc71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.category-select.category-mod {
    background-color: rgba(163, 113, 247, 0.2);
    border-color: rgba(163, 113, 247, 0.3);
    color: #a371f7;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a371f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.category-select:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.category-select:focus {
    filter: brightness(1.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Dropdown options - DARK background always */
.category-select option {
    background-color: #1c1e26 !important;
    background: #1c1e26 !important;
    color: var(--text-primary) !important;
    padding: 0.5rem !important;
    font-weight: 600;
}



    /* Searchable Select Styles */

    .searchable-select-wrapper {

        display: flex;

        flex-direction: column;

        gap: 0.5rem;

    }

    

    .search-input-small {

        padding: 0.5rem;

        border: 1px solid var(--border-color);

        border-radius: 4px;

        background: var(--bg-input);

        color: var(--text-primary);

        font-size: 0.9rem;

    }

    

    .searchable-select-wrapper select {

        padding: 0.5rem;

        border: 1px solid var(--border-color);

        border-radius: 4px;

        background: var(--bg-input);

        color: var(--text-primary);

        overflow-y: auto;

    }

    

    .searchable-select-wrapper select option {

        padding: 0.5rem;

        cursor: pointer;

    }

    

    .searchable-select-wrapper select option:hover,

    .searchable-select-wrapper select option:checked {

        background-color: var(--primary-color);

        color: white;

    }





    /* Channel List Badge Styles */

    .vt-channel-item {

        justify-content: flex-start; /* Changed from space-between or default */

    }

    

    .vt-channel-name {

        flex: 1;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;

    }



    .vt-badges {

        display: flex;

        gap: 4px;

        margin-left: 8px;

    }



    .vt-count-badge {

        font-size: 0.7rem;

        padding: 2px 6px;

        border-radius: 10px;

        font-weight: bold;

        min-width: 18px;

        text-align: center;

    }



    .vt-count-badge.unpaid {

        background-color: rgba(231, 76, 60, 0.2);

        color: #e74c3c;

        border: 1px solid rgba(231, 76, 60, 0.3);

    }



    .vt-count-badge.paid {

        background-color: rgba(46, 204, 113, 0.2);

        color: #2ecc71;

        border: 1px solid rgba(46, 204, 113, 0.3);

    }




/* Client Note Styles */
.vt-note-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-right: 1.5rem;
    min-width: 300px;
}

.vt-note-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

#vt-note-box {
    width: 100%;
    min-height: 70px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.2s ease;
}

#vt-note-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2);
}

#vt-note-box:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
}

#vt-note-box[readonly] {
    background-color: var(--bg-secondary);
    cursor: default;
}

.vt-actions-group {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}


/* ========== VIDEOS TRACKER HEADER REDESIGN ========== */

.vt-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, rgba(47, 129, 247, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.vt-header-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

.vt-title-section h2 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stats Cards */
.vt-stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.vt-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vt-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.vt-stat-card.outstanding {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.05) 100%);
    border-color: rgba(231, 76, 60, 0.3);
}

.vt-stat-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(47, 129, 247, 0.1);
    border-radius: 10px;
}

.vt-stat-card.outstanding .vt-stat-icon {
    background: rgba(231, 76, 60, 0.15);
}

.vt-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vt-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.vt-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Note Card */
.vt-note-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    min-width: 350px;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vt-note-card .vt-note-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.vt-note-icon {
    font-size: 1.2rem;
}

.vt-note-card #vt-note-box {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.vt-note-card #vt-note-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.15);
    background-color: var(--bg-main);
}

.vt-note-card #vt-note-box:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
}

.vt-note-card #vt-note-box[readonly] {
    background-color: var(--bg-secondary);
    cursor: default;
}

/* Header Controls */
.vt-header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.vt-header-controls #vt-main-search {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.vt-header-controls #vt-main-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.1);
}

.vt-header-controls #vt-filter-status {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vt-header-controls #vt-filter-status:hover {
    border-color: var(--primary-color);
}

.vt-header-controls .btn-primary {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.btn-icon-lg {
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 1400px) {
    .vt-header-top {
        grid-template-columns: 1fr;
    }
    
    .vt-note-card {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .vt-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .vt-header-controls {
        flex-wrap: wrap;
    }
    
    .vt-header-controls #vt-main-search {
        flex: 1 1 100%;
    }
}


/* ========== COMPACT HORIZONTAL HEADER ========== */

.vt-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vt-header-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Title and Stats */
.vt-title-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.vt-title-stats h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.vt-stats-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(47, 129, 247, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.vt-stat-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vt-stat-compact .stat-icon {
    font-size: 1.2rem;
}

.vt-stat-compact .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.vt-stat-compact .stat-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.vt-stat-compact.outstanding {
    color: #e74c3c;
}

.vt-stat-compact.outstanding .stat-value {
    color: #e74c3c;
}

.vt-stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

/* Search Controls */
.vt-search-controls {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    min-width: 300px;
}

.vt-search-controls #vt-main-search {
    flex: 1;
    min-width: 250px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.vt-search-controls #vt-main-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.1);
}

.vt-search-controls #vt-filter-status {
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.vt-search-controls #vt-filter-status:hover {
    border-color: var(--primary-color);
}

/* Compact Note */
.vt-note-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 220px;
}

.vt-note-compact label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    margin: 0;
}

.vt-note-compact #vt-note-box {
    flex: 1;
    min-width: 150px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.2s ease;
    max-height: 60px;
}

.vt-note-compact #vt-note-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.1);
    background-color: var(--bg-main);
}

.vt-note-compact #vt-note-box:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
}

.vt-note-compact #vt-note-box[readonly] {
    background-color: var(--bg-secondary);
    cursor: default;
}

/* Add Button */
.vt-header-row .btn-primary {
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 1400px) {
    .vt-header-row {
        flex-wrap: wrap;
    }
    
    .vt-search-controls {
        order: 3;
        flex: 1 1 100%;
    }
    
    .vt-note-compact {
        order: 4;
        flex: 1 1 100%;
    }
}

@media (max-width: 900px) {
    .vt-title-stats {
        flex-wrap: wrap;
    }
    
    .vt-stats-inline {
        width: 100%;
    }
}


/* ========== OPTIMIZED HORIZONTAL HEADER ========== */

.vt-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vt-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
}

/* Left Group: Title, Stats, Search, Add Button */
.vt-left-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    max-width: 65%;
}

.vt-title-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.vt-title-stats h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.vt-stats-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 1rem;
    background: rgba(47, 129, 247, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.vt-stat-compact {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.vt-stat-compact .stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.vt-stat-compact .stat-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.vt-stat-compact.outstanding {
    color: #e74c3c;
}

.vt-stat-compact.outstanding .stat-value {
    color: #e74c3c;
}

.vt-stat-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

/* Search & Actions Row */
.vt-search-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}

.vt-search-controls #vt-main-search {
    flex: 2;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.vt-search-controls #vt-main-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.1);
}

.vt-search-controls #vt-filter-status {
    flex: 1;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vt-search-controls #vt-filter-status:hover {
    border-color: var(--primary-color);
}

/* Compact Add Button */
.btn-compact {
    padding: 0.55rem 1rem;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.9rem;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Right Group: Note Section (Larger now) */
.vt-note-wide {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    height: 100%;
    min-width: 300px;
    max-width: 35%;
    background: var(--bg-surface);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.vt-note-label-inline {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vt-note-wide #vt-note-box {
    flex: 1;
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none; /* Fixed layout looks cleaner */
    transition: all 0.2s ease;
    box-sizing: border-box;
    height: 70px;
}

.vt-note-wide #vt-note-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.1);
    background-color: var(--bg-main);
}

.vt-note-wide #vt-note-box:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
}

/* Responsive */
@media (max-width: 1200px) {
    .vt-header-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vt-left-group {
        max-width: 100%;
    }
    
    .vt-note-wide {
        max-width: 100%;
        min-width: 100%;
    }
}


/* ========== FINAL HEADER FIXES ========== */

/* Ensure container is flex row */
.vt-header-row {
    display: flex;
    flex-direction: row;
    align-items: stretch; /* Match height */
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

/* Left Side (Stats + Controls) */
.vt-left-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    /* Ensure it doesn't overlap right side */
    max-width: calc(100% - 320px); 
}

/* Controls Container - Force single line */
.vt-search-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    flex-wrap: nowrap; /* Prevent wrapping */
}

/* Inputs */
.vt-search-controls #vt-main-search {
    flex: 2; /* Grow */
    min-width: 150px;
}

.vt-search-controls #vt-filter-status {
    flex: 1;
    min-width: 120px;
}

/* Add Button - Strict sizing */
#vt-add-btn.btn-compact {
    width: auto !important;
    flex-shrink: 0;
    padding: 0.6rem 1.2rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: auto;
    align-self: center;
}

/* Right Side (Note) */
.vt-note-wide {
    flex: 0 0 300px; /* Fixed width base */
    width: 300px;
    min-width: 300px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    height: auto; /* Fill height of row */
}

.vt-note-label-inline {
    display: block; /* Label on top */
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.vt-note-wide textarea {
    flex: 1; /* Fill remaining height */
    width: 100%;
    resize: none;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    background: var(--bg-input);
    color: var(--text-primary);
    min-height: 60px;
}

/* Mobile Fixes */
@media (max-width: 1100px) {
    .vt-header-row {
        flex-direction: column;
    }
    .vt-left-group {
        max-width: 100%;
    }
    .vt-note-wide {
        width: 100%;
        max-width: 100%;
        flex: none;
        min-height: 100px;
    }
    .vt-search-controls {
        flex-wrap: wrap;
    }
    #vt-add-btn.btn-compact {
        width: 100% !important; /* Full width on mobile is usually better */
    }
}


/* ========== VIDEOS TRACK SIDEBAR FIXES ========== */

/* Sidebar Header Layout */
.vt-sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Title Row with Plus Button */
.vt-sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vt-sidebar-title-row h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Plus Button in Corner */
#vt-add-channel-btn {
    background: rgba(47, 129, 247, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    padding: 0;
}

#vt-add-channel-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Sidebar Search Input */
#vt-sidebar-search {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
    display: inline-block;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top: none;
    z-index: 999; /* Increased Z-Index */
    top: 100%;
    left: 0;
    right: 0;
    background-color: #161b22; /* Force solid dark background */
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #161b22; /* Force solid dark background */
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.autocomplete-items div:hover {
    background-color: var(--bg-color);
}

.autocomplete-active {
    background-color: var(--primary-color) !important;
    color: #ffffff;
}

#vt-sidebar-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Remove Button in Channel List */
.vt-remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.vt-channel-item:hover .vt-remove-btn {
    opacity: 1;
}

.vt-remove-btn:hover {
    color: var(--danger-color);
    background: rgba(248, 81, 73, 0.1);
}


/* Client Channels list */
.channels-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.channel-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    height: 50px;
    min-height: 50px;
}

.channel-platform {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--primary-color);
    flex-shrink: 0;
    white-space: nowrap;
    line-height: normal;
}

.channel-link {
    flex: 1;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    line-height: normal;
    font-family: monospace;
}

.channel-link:hover {
    text-decoration: underline;
}

.delete-channel-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-channel-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--danger-color);
}
/* New styles for store and order management */



.category-compensation {

    border-color: #9b59b6 !important;

    color: #9b59b6 !important;

}



.needs-quote-badge {

    background: rgba(241, 196, 15, 0.15);

    color: #f1c40f;

    padding: 2px 6px;

    border-radius: 4px;

    font-size: 0.8rem;

    font-weight: 600;

}



.order-compact-row.needs-quote {

    border-left: 2px solid #f1c40f;

}



.item-actions-cell {

    display: flex;

    gap: 0.5rem;

    justify-content: flex-end;

}




/* New styles for store and order management */

.category-compensation {
    border-color: #9b59b6 !important;
    color: #9b59b6 !important;
}

.category-order {
    border-color: #3498db !important;
    color: #3498db !important;
}

.needs-quote-badge {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.order-compact-row.needs-quote {
    border-left: 2px solid #f1c40f;
}

.item-actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}


.quote-status-badge {
    font-size: 0.75rem;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.quote-status-badge.approved {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.quote-status-badge.denied {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}



.quote-status-badge.waiting {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ==========================================================
   Production: Team Tasks (Kanban)
   ========================================================== */
.teamtasks-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Column sizing: keep cards readable at 1080p by avoiding ultra-narrow columns */
  --teamtasks-col-min: 220px;
}

@media (max-width: 1366px) {
  .teamtasks-root {
    --teamtasks-col-min: 200px;
  }
}
.teamtasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: 10px;
}
.teamtasks-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.teamtasks-title-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(47, 129, 247, 0.12);
  border: 1px solid rgba(47, 129, 247, 0.25);
}
.teamtasks-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}
.teamtasks-actions {
  display: flex;
  gap: 0.5rem;
}
.teamtasks-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Horizontal filters row container */
.teamtasks-filters-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.25rem;
  border-top: 1px solid rgba(139, 148, 158, 0.18);
  border-bottom: 1px solid rgba(139, 148, 158, 0.18);
  overflow-x: auto;
  flex-wrap: wrap;
}
.teamtasks-filter-divider {
  width: 1px;
  height: 24px;
  background: rgba(139, 148, 158, 0.3);
  flex-shrink: 0;
}

/* Jira-like people filter row */
.teamtasks-assignee-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.teamtasks-assignee-filter-label {
  color: var(--text-secondary);
  font-weight: 850;
  font-size: 0.9rem;
  white-space: nowrap;
  margin-right: 0.25rem;
}
.teamtasks-assignee-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid var(--bg-main);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.teamtasks-assignee-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}
.teamtasks-assignee-avatar.fallback {
  color: var(--text-primary);
  font-weight: 950;
  font-size: 0.75rem;
}
.teamtasks-assignee-avatar.active {
  border-color: rgba(47, 129, 247, 0.85);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.15);
}
.teamtasks-assignee-avatar.all {
  width: auto;
  min-width: 42px;
  padding: 0 10px;
  font-weight: 950;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Category filter (inline with assignee filter) */
.teamtasks-category-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.teamtasks-category-filter-label {
  color: var(--text-secondary);
  font-weight: 850;
  font-size: 0.9rem;
  white-space: nowrap;
  margin-right: 0.25rem;
}
.teamtasks-category-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(139, 148, 158, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.teamtasks-category-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 148, 158, 0.4);
}
.teamtasks-category-btn.active {
  background: rgba(47, 129, 247, 0.15);
  border-color: rgba(47, 129, 247, 0.6);
  color: #58a6ff;
}
.teamtasks-category-btn.all {
  font-weight: 800;
}
.teamtasks-category-btn:not(.all) {
  border-left: 3px solid var(--cat-color, #6e7681);
}
.teamtasks-category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(139, 148, 158, 0.2);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.teamtasks-category-btn.active .teamtasks-category-count {
  background: rgba(47, 129, 247, 0.25);
  color: #58a6ff;
}

/* Reporter filter (My Reports toggle) */
.teamtasks-reporter-filter {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.teamtasks-reporter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(139, 148, 158, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.teamtasks-reporter-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 148, 158, 0.4);
}
.teamtasks-reporter-toggle.active {
  background: rgba(238, 130, 14, 0.15);
  border-color: rgba(238, 130, 14, 0.6);
  color: #f0883e;
}
.teamtasks-reporter-icon {
  font-size: 1rem;
}
.teamtasks-reporter-text {
  font-weight: 700;
}
.teamtasks-reporter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(139, 148, 158, 0.2);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.teamtasks-reporter-toggle.active .teamtasks-reporter-count {
  background: rgba(238, 130, 14, 0.25);
  color: #f0883e;
}

.teamtasks-search {
  flex: 1;
  margin: 0;
}
.teamtasks-select {
  margin: 0;
  width: auto;
  min-width: 220px;
}

/* Make datetime pickers usable/visible in dark UI (calendar/clock icon can be invisible otherwise) */
#teamtasks-task-deadline,
#teamtasks-worker-deadline,
#teamtasks-workerorder-deadline,
#teamtasks-orderedit-deadline {
  color-scheme: dark;
}

#teamtasks-task-deadline::-webkit-calendar-picker-indicator,
#teamtasks-worker-deadline::-webkit-calendar-picker-indicator,
#teamtasks-workerorder-deadline::-webkit-calendar-picker-indicator,
#teamtasks-orderedit-deadline::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.85;
  cursor: pointer;
}
.teamtasks-board {
  /* Jira-like: single row of columns, no wrapping */
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.5rem;
  overscroll-behavior-x: contain;
  /* Show horizontal scrollbar when needed */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(139, 148, 158, 0.4) transparent;
}
.teamtasks-board::-webkit-scrollbar {
  height: 8px;
}
.teamtasks-board::-webkit-scrollbar-thumb {
  background: rgba(139, 148, 158, 0.4);
  border-radius: 4px;
}
.teamtasks-board::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 148, 158, 0.6);
}
.teamtasks-board::-webkit-scrollbar-track {
  background: transparent;
}

/* Visual feedback for drag-to-scroll (cursor changes only; no visible scrollbar line) */
.teamtasks-board.is-grabbing {
  cursor: grabbing;
}
.teamtasks-board {
  cursor: default;
}
.teamtasks-columns {
  display: grid;
  /* grid-template-columns is set inline by JS based on status count */
  gap: 0.9rem;
  align-items: flex-start;
  min-height: 320px;
  /* Allow columns to distribute across the available width (Jira-style) */
  width: 100%;
  min-width: 0;
}

/* Compact mode: when columns are forced narrow, make text smaller */
.teamtasks-root.teamtasks-compact .teamtasks-card {
  padding: 0.5rem 0.55rem;
}
.teamtasks-root.teamtasks-compact .teamtasks-card-client {
  font-size: 0.7rem;
}
.teamtasks-root.teamtasks-compact .teamtasks-card-title {
  font-size: 0.82rem;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.teamtasks-root.teamtasks-compact .teamtasks-timers {
  font-size: 0.65rem;
}
.teamtasks-root.teamtasks-compact .teamtasks-chip,
.teamtasks-root.teamtasks-compact .teamtasks-priority {
  font-size: 0.62rem;
  padding: 1px 5px;
}
.teamtasks-root.teamtasks-compact .teamtasks-avatar {
  width: 20px;
  height: 20px;
}
.teamtasks-root.teamtasks-compact .teamtasks-card-key {
  font-size: 0.58rem;
  padding: 1px 3px;
}
.teamtasks-root.teamtasks-compact .teamtasks-card-service {
  font-size: 0.54rem;
}
.teamtasks-column {
  width: auto;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}
.teamtasks-column.urgent {
  border-color: rgba(248, 81, 73, 0.65);
  box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.12);
}
.teamtasks-column.outline-warning {
  border-color: rgba(210, 153, 34, 0.75);
  box-shadow: 0 0 0 3px rgba(210, 153, 34, 0.12);
}
.teamtasks-column.outline-warning .teamtasks-column-header {
  background: rgba(210, 153, 34, 0.06);
  border-bottom-color: rgba(210, 153, 34, 0.3);
}
.teamtasks-column.outline-warning .teamtasks-column-count {
  border-color: rgba(210, 153, 34, 0.55);
  background: rgba(210, 153, 34, 0.14);
  color: rgba(255, 220, 160, 0.98);
}

/* Bug Order modal */
.teamtasks-bugorder-row{
  display:flex;
  align-items:center;
  gap:0.75rem;
  padding:0.85rem 0.9rem;
  border:1px solid var(--border-color);
  border-radius:12px;
  background:rgba(255,255,255,0.02);
  cursor:pointer;
  user-select:none;
}
.teamtasks-bugorder-row:hover{
  background:rgba(255,255,255,0.04);
  border-color:rgba(47,129,247,0.35);
}
.teamtasks-bugorder-check{
  display:flex;
  align-items:center;
  justify-content:center;
  width:22px;
}
.teamtasks-bugorder-main{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0.35rem;
  flex:1;
  min-width:0;
}
.teamtasks-bugorder-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.75rem;
  min-width:0;
}
.teamtasks-bugorder-right{
  display:inline-flex;
  align-items:center;
  gap:0.5rem;
  flex-shrink:0;
}
.teamtasks-bugorder-title{
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}
.teamtasks-bugorder-key{
  font-weight:850;
  font-size:0.85rem;
  color:var(--text-secondary);
  border:1px solid rgba(139,148,158,0.22);
  border-radius:999px;
  padding:4px 10px;
  background:rgba(0,0,0,0.12);
  flex-shrink:0;
}
.teamtasks-bugorder-sub{
  display:flex;
  align-items:center;
  gap:0.5rem;
  flex-wrap:wrap;
  color:var(--text-secondary);
  font-size:0.8rem;
  font-weight:750;
}
.teamtasks-bugorder-meta{
  color:rgba(201, 209, 217, 0.72);
}
.teamtasks-bugorder-status{
  font-weight:900;
  font-size:0.78rem;
  color:rgba(255,255,255,0.85);
  border:1px solid rgba(139,148,158,0.22);
  border-radius:999px;
  padding:3px 9px;
  background:rgba(255,255,255,0.04);
}

/* Bug Order modal: collapsible status groups */
.teamtasks-bugorder-group{
  border:1px solid var(--border-color);
  border-radius:12px;
  overflow:hidden;
  background:rgba(255,255,255,0.01);
}
.teamtasks-bugorder-group + .teamtasks-bugorder-group{
  margin-top:0.5rem;
}
.teamtasks-bugorder-group-header{
  display:flex;
  align-items:center;
  gap:0.6rem;
  width:100%;
  padding:0.7rem 0.9rem;
  border:none;
  border-radius:0;
  background:rgba(255,255,255,0.03);
  color:var(--text-primary);
  font-weight:800;
  font-size:0.92rem;
  cursor:pointer;
  user-select:none;
  text-align:left;
  transition:background 0.15s;
}
.teamtasks-bugorder-group-header:hover{
  background:rgba(255,255,255,0.06);
}
.teamtasks-bugorder-group-arrow{
  font-size:0.7rem;
  color:var(--text-secondary);
  width:14px;
  text-align:center;
  flex-shrink:0;
}
.teamtasks-bugorder-group-name{
  flex:1;
  min-width:0;
}
.teamtasks-bugorder-group-count{
  font-size:0.78rem;
  font-weight:900;
  color:rgba(201,209,217,0.7);
  background:rgba(255,255,255,0.06);
  border-radius:999px;
  padding:2px 8px;
  flex-shrink:0;
}
.teamtasks-bugorder-group-info{
  display:flex;
  align-items:center;
  gap:0.5rem;
  padding:0.5rem 0.2rem 0.6rem;
  font-weight:800;
  font-size:0.92rem;
  color:var(--text-secondary);
}
.teamtasks-bugorder-group-selected{
  font-size:0.75rem;
  font-weight:800;
  color:rgba(47,129,247,0.95);
  background:rgba(47,129,247,0.12);
  border-radius:999px;
  padding:2px 8px;
  flex-shrink:0;
}
.teamtasks-bugorder-group-body{
  display:flex;
  flex-direction:column;
  gap:0.35rem;
  padding:0.5rem 0.6rem 0.6rem;
}
.teamtasks-bugorder-showmore{
  display:block;
  width:100%;
  padding:0.6rem;
  margin-top:0.25rem;
  border:1px dashed rgba(139,148,158,0.25);
  border-radius:8px;
  background:transparent;
  color:rgba(47,129,247,0.9);
  font-weight:750;
  font-size:0.85rem;
  cursor:pointer;
  text-align:center;
  transition:background 0.15s, border-color 0.15s;
}
.teamtasks-bugorder-showmore:hover{
  background:rgba(47,129,247,0.08);
  border-color:rgba(47,129,247,0.35);
}

/* Linked order badge on Bugs Fixes board cards */
.teamtasks-card-linked-order{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:0.75rem;
  font-weight:800;
  color:rgba(47,129,247,0.92);
  background:rgba(47,129,247,0.08);
  border:1px solid rgba(47,129,247,0.2);
  border-radius:6px;
  padding:2px 7px;
  margin-top:2px;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  cursor:default;
}
.teamtasks-card-linked-order svg{
  flex-shrink:0;
  opacity:0.85;
}

/* Linked Order panel inside bug task modal */
.teamtasks-linked-order-row{
  display:flex;
  align-items:center;
  gap:0.75rem;
  padding:0.75rem 0.9rem;
  border:1px solid rgba(47,129,247,0.2);
  border-radius:12px;
  background:rgba(47,129,247,0.04);
  cursor:pointer;
  transition:background 0.15s, border-color 0.15s;
}
.teamtasks-linked-order-row:hover{
  background:rgba(47,129,247,0.09);
  border-color:rgba(47,129,247,0.4);
}
.teamtasks-linked-order-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(47,129,247,0.9);
  flex-shrink:0;
}
.teamtasks-linked-order-info{
  flex:1;
  min-width:0;
}
.teamtasks-linked-order-title{
  font-weight:800;
  font-size:0.9rem;
  color:var(--text-primary);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.teamtasks-linked-order-status{
  font-size:0.78rem;
  font-weight:750;
  color:var(--text-secondary);
  margin-top:2px;
}

/* Priority badge variant for "Normal" (priority 0) */
.teamtasks-priority.normal{
  border-color: rgba(139,148,158,0.25);
  background: rgba(139,148,158,0.10);
  color: rgba(201, 209, 217, 0.88);
}

/* Linked bugs panel (inside Bug Bulk Order task modal) */
.teamtasks-linkedbug-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0.85rem 0.9rem;
  border:1px solid var(--border-color);
  border-radius:12px;
  background:rgba(255,255,255,0.02);
  cursor:pointer;
}
.teamtasks-linkedbug-row:hover{
  background:rgba(255,255,255,0.04);
  border-color:rgba(47,129,247,0.35);
}
.teamtasks-linkedbug-main{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.teamtasks-linkedbug-title{
  font-weight:950;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.teamtasks-linkedbug-meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.teamtasks-linkedbug-reported{
  color: rgba(201, 209, 217, 0.72);
  font-weight: 800;
  font-size: 12px;
}
.teamtasks-linkedbug-pill{
  font-weight:900;
  font-size:12px;
  color:rgba(255,255,255,0.88);
  border:1px solid rgba(139,148,158,0.22);
  border-radius:999px;
  padding:6px 10px;
  background:rgba(255,255,255,0.04);
}
.teamtasks-linkedbug-select{
  max-width:220px;
  min-width:160px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(139,148,158,0.22);
  background:rgba(0,0,0,0.15);
  color:var(--text-primary);
  color-scheme: dark;
}
.teamtasks-linkedbug-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.teamtasks-linkedbug-mini{
  padding:6px 10px;
  border-radius:10px;
  line-height:1;
  font-weight:900;
}
.teamtasks-linkedbug-select option{
  background-color: #161b22;
  color: #c9d1d9;
}

/* ToastUI editor: video toolbar + upload overlay */
.teamtasks-toolbar-video{
  font-weight: 900;
}
.teamtasks-editor-upload-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  border-radius: 12px;
}
.teamtasks-editor-upload-overlay-inner{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 14px;
  border: 1px solid rgba(139,148,158,0.22);
  border-radius: 12px;
  background: rgba(17,21,26,0.9);
  color: var(--text-primary);
  font-weight: 800;
}
.teamtasks-editor-upload-text{
  opacity: 0.95;
}
.teamtasks-column.final-zone {
  border-color: rgba(63, 185, 80, 0.65); /* green outline to indicate final zone */
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.12);
}
.teamtasks-column.final-zone .teamtasks-column-header {
  background: rgba(63, 185, 80, 0.06);
  border-bottom-color: rgba(63, 185, 80, 0.28);
}
.teamtasks-column.final-zone .teamtasks-column-count {
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.12);
  color: rgba(190, 255, 205, 0.95);
}
.teamtasks-column.urgent .teamtasks-column-header {
  background: rgba(248, 81, 73, 0.08);
  border-bottom-color: rgba(248, 81, 73, 0.35);
}
.teamtasks-column.urgent .teamtasks-column-count {
  border-color: rgba(248, 81, 73, 0.55);
  background: rgba(248, 81, 73, 0.18);
  color: #ffb4b4;
}
.teamtasks-column-header {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.teamtasks-column-title {
  font-weight: 800;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teamtasks-column-count {
  font-weight: 800;
  font-size: 0.8rem;
  min-width: 28px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 148, 158, 0.18);
  border: 1px solid rgba(139, 148, 158, 0.3);
  color: var(--text-primary);
}
.teamtasks-column-cards {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  /* Scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 148, 158, 0.4) transparent;
}
.teamtasks-column-cards::-webkit-scrollbar {
  width: 6px;
}
.teamtasks-column-cards::-webkit-scrollbar-thumb {
  background: rgba(139, 148, 158, 0.4);
  border-radius: 3px;
}
.teamtasks-column-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 148, 158, 0.6);
}
.teamtasks-column-cards::-webkit-scrollbar-track {
  background: transparent;
}
.teamtasks-column-cards.drag-over {
  outline: 2px dashed rgba(47, 129, 247, 0.6);
  outline-offset: -6px;
}
.teamtasks-column-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.5rem;
  text-align: center;
  border: 1px dashed rgba(139, 148, 158, 0.35);
  border-radius: 10px;
}
.teamtasks-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}

.teamtasks-card:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 129, 247, 0.55);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.teamtasks-card.dragging {
  opacity: 0.7;
}
.teamtasks-card-client {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 3.5rem; /* Space for the top-right task key badge */
}
.teamtasks-card-title {
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
  line-height: 1.2;
  /* Prevent long unbroken titles from overflowing the card */
  overflow: hidden;
  /* IMPORTANT: avoid per-character wrapping that makes the title look like a vertical line */
  overflow-wrap: break-word;
  word-break: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* clamp to 2 lines like Jira cards */
  line-clamp: 2;
}

.teamtasks-card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.teamtasks-card-chips {
  display: contents; /* Remove wrapper, let chips flow directly in parent */
}
.teamtasks-card-chips:empty {
  display: none;
}
.teamtasks-chip {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}
.teamtasks-card-right {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.teamtasks-card-right:empty {
  display: none;
}
.teamtasks-priority {
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(139,148,158,0.25);
  background: rgba(139,148,158,0.10);
  color: rgba(201, 209, 217, 0.88);
  white-space: nowrap;
}
/* Avatars inline with badges */
.teamtasks-avatars {
  display: inline-flex;
  align-items: center;
}
.teamtasks-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--bg-main);
  box-shadow: 0 2px 5px rgba(0,0,0,0.35);
}
.teamtasks-avatar + .teamtasks-avatar {
  margin-left: -6px;
}
.teamtasks-priority.high {
  /* High: stronger/more saturated yellow-orange */
  border-color: rgba(255, 211, 61, 0.60);
  background: rgba(255, 211, 61, 0.20);
  color: rgba(255, 237, 168, 0.98);
}
.teamtasks-priority.highest {
  /* Highest: softer orange */
  border-color: rgba(255, 160, 80, 0.50);
  background: rgba(255, 160, 80, 0.15);
  color: rgba(255, 200, 150, 0.95);
}
.teamtasks-priority.critical {
  border-color: rgba(248, 81, 73, 0.55);
  background: rgba(248, 81, 73, 0.18);
  color: #f85149;
}

/* Priority card highlights */
.teamtasks-card.priority-high:not(.is-final) {
  border-color: rgba(255, 211, 61, 0.45);
}
.teamtasks-card.priority-highest:not(.is-final) {
  border-color: rgba(255, 160, 80, 0.40);
}
.teamtasks-card.priority-critical {
  border-color: rgba(248, 81, 73, 0.60);
  background: rgba(248, 81, 73, 0.08);
}
.teamtasks-card.priority-high:not(.is-final)::before,
.teamtasks-card.priority-highest:not(.is-final)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.teamtasks-card.priority-high:not(.is-final)::before {
  background: rgba(255, 211, 61, 0.30);
  opacity: 0.22;
}
.teamtasks-card.priority-highest:not(.is-final)::before {
  background: rgba(255, 160, 80, 0.24);
  opacity: 0.16;
}
.teamtasks-card.priority-critical:not(.is-final)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(248, 81, 73, 0.30);
  opacity: 0.20;
  pointer-events: none;
  animation: teamtasks-critical-tint 1.8s ease-in-out infinite;
}
@keyframes teamtasks-critical-tint {
  0% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.55;
  }
  100% {
    opacity: 0.15;
  }
}

/* Overdue pulse animations - matches priority colors or defaults to yellow */
/* Priority High (yellow) pulse for overdue */
.teamtasks-card.priority-high.is-overdue:not(.is-final)::before {
  animation: teamtasks-high-pulse 1.8s ease-in-out infinite;
}
@keyframes teamtasks-high-pulse {
  0% { opacity: 0.15; }
  50% { opacity: 0.50; }
  100% { opacity: 0.15; }
}

/* Priority Highest (orange) pulse for overdue */
.teamtasks-card.priority-highest.is-overdue:not(.is-final)::before {
  animation: teamtasks-highest-pulse 1.8s ease-in-out infinite;
}
@keyframes teamtasks-highest-pulse {
  0% { opacity: 0.12; }
  50% { opacity: 0.45; }
  100% { opacity: 0.12; }
}

/* Default yellow pulse for cards without priority when overdue */
.teamtasks-card.is-overdue:not(.priority-high):not(.priority-highest):not(.priority-critical):not(.is-final)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: rgba(255, 211, 61, 0.30);
  animation: teamtasks-default-pulse 1.8s ease-in-out infinite;
}
/* Also add border color for no-priority overdue cards */
.teamtasks-card.is-overdue:not(.priority-high):not(.priority-highest):not(.priority-critical):not(.is-final) {
  border-color: rgba(255, 211, 61, 0.45);
}
@keyframes teamtasks-default-pulse {
  0% { opacity: 0.15; }
  50% { opacity: 0.50; }
  100% { opacity: 0.15; }
}

/* Reduced motion: disable overdue pulse */
@media (prefers-reduced-motion: reduce) {
  .teamtasks-card.is-overdue:not(.priority-critical)::before {
    animation: none;
    opacity: 0.28;
  }
}

/* Overdue clock icon - positioned as a sticker on the right side of the card */
.teamtasks-overdue-icon {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(248, 81, 73, 0.20);
  border: 1px solid rgba(248, 81, 73, 0.50);
  border-radius: 50%;
  color: #f85149;
  z-index: 2;
  animation: teamtasks-overdue-icon-pulse 1.8s ease-in-out infinite;
}
.teamtasks-overdue-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
@keyframes teamtasks-overdue-icon-pulse {
  0% { opacity: 0.6; transform: translateY(-50%) scale(1); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.1); }
  100% { opacity: 0.6; transform: translateY(-50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .teamtasks-overdue-icon {
    animation: none;
    opacity: 1;
  }
}

/* Stale clock icon (yellow, pulsing) - for cards >1 week without deadline */
.teamtasks-stale-icon {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 211, 61, 0.20);
  border: 1px solid rgba(255, 211, 61, 0.50);
  border-radius: 50%;
  color: #ffd33d;
  z-index: 2;
  animation: teamtasks-stale-icon-pulse 1.8s ease-in-out infinite;
}
.teamtasks-stale-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
@keyframes teamtasks-stale-icon-pulse {
  0% { opacity: 0.6; transform: translateY(-50%) scale(1); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.1); }
  100% { opacity: 0.6; transform: translateY(-50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .teamtasks-stale-icon {
    animation: none;
    opacity: 1;
  }
}
/* Final states (e.g., Done): critical keeps static red tint but no pulse.
   The pulse is already disabled via :not(.is-final) on the ::before overlay. */
@media (prefers-reduced-motion: reduce) {
  .teamtasks-card.priority-critical {
    animation: none;
  }
  .teamtasks-card.priority-critical:not(.is-final)::before {
    animation: none;
    opacity: 0.28;
  }
}
.teamtasks-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}
.teamtasks-timers {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
}
.teamtasks-timers > span {
  /* Each timer line: label + value inline */
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.3rem;
}
.teamtasks-timer-prefix {
  color: rgba(201, 209, 217, 0.5);
  font-weight: 800;
}
.teamtasks-created-date {
  color: var(--text-secondary);
}
.teamtasks-deadline {
  color: var(--text-secondary);
  flex-wrap: nowrap !important;
}
.teamtasks-deadline.overdue {
  color: #ffb4b4;
}
.teamtasks-deadline-countdown {
  margin-left: 0.4rem;
  color: rgba(255, 180, 100, 0.95);
  font-weight: 800;
  white-space: nowrap;
}
.teamtasks-deadline.overdue .teamtasks-deadline-countdown {
  display: none;
}
.teamtasks-autoclose {
  color: rgba(255, 205, 120, 0.92);
}
.teamtasks-autoclose.closing-soon {
  color: rgba(255, 205, 120, 0.92);
  font-style: italic;
}
.teamtasks-status-age {
  color: var(--text-secondary);
}

/* Status change checklist modal */
.teamtasks-checklist-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.teamtasks-checklist-group {
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}
.teamtasks-checklist-group-title {
  font-weight: 950;
  margin-bottom: 0.5rem;
}
.teamtasks-checklist-client-title {
  color: #e8a838;
}
.teamtasks-checklist-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
}
.teamtasks-checklist-item-left {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  cursor: pointer;
}
.teamtasks-checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #2f81f7;
}
.teamtasks-checklist-item-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  color: var(--text-primary);
}
.teamtasks-checklist-required {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 120, 0.35);
  background: rgba(255, 205, 120, 0.10);
  color: rgba(255, 205, 120, 0.92);
  font-weight: 900;
  font-size: 0.78rem;
}

/* Checklist editor (admin) */
.teamtasks-checklists-admin-enabled {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0.25rem 0 0.75rem;
  color: var(--text-secondary);
}
.teamtasks-checklists-admin-items-title {
  font-weight: 950;
  margin-top: 0.5rem;
}
.teamtasks-checklists-admin-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.teamtasks-checklists-admin-item {
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}
.teamtasks-checklists-admin-item-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.teamtasks-checklists-admin-item-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
}
.teamtasks-checklists-admin-item-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.teamtasks-checklists-admin-item-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Task modal: collapsible checklist panel */
.teamtasks-checklist-panel {
  margin-top: 0.75rem;
}
.teamtasks-checklist-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 148, 158, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-weight: 950;
  cursor: pointer;
}
.teamtasks-checklist-panel-toggle:hover {
  border-color: rgba(139, 148, 158, 0.32);
  background: rgba(255, 255, 255, 0.05);
}
.teamtasks-checklist-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.teamtasks-checklist-panel-caret {
  color: var(--text-secondary);
  font-weight: 900;
}
.teamtasks-checklist-panel-body {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.teamtasks-task-checklist-group {
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}
.teamtasks-task-checklist-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.teamtasks-task-checklist-title {
  font-weight: 950;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teamtasks-task-checklist-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(139, 148, 158, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 900;
  font-size: 0.78rem;
}
.teamtasks-task-checklist-badge.done {
  border-color: rgba(46, 160, 67, 0.35);
  background: rgba(46, 160, 67, 0.12);
  color: rgba(140, 255, 200, 0.92);
}
.teamtasks-task-checklist-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0;
  color: var(--text-secondary);
}
.teamtasks-task-checklist-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2f81f7;
}
.teamtasks-card-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-secondary);
  opacity: 0.85;
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 1px 4px;
  border-radius: 999px;
  border: 1px solid rgba(139, 148, 158, 0.2);
  background: rgba(0,0,0,0.15);
  pointer-events: none; /* don't interfere with click/drag */
}
.teamtasks-card-service {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(139, 148, 158, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -2px;
  margin-bottom: 2px;
}

/* Team Tasks - Worker channel picker (custom dropdown so we can render Worker Orders badges) */
.teamtasks-channel-picker {
  position: relative;
}
.teamtasks-channel-picker-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.teamtasks-channel-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  /* Must be above modal buttons and non-transparent */
  z-index: 350;
  background-color: var(--bg-card, var(--bg-surface));
  background-image: none;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.teamtasks-channel-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  user-select: none;
}
.teamtasks-channel-option:hover {
  background: rgba(255, 255, 255, 0.04);
}
.teamtasks-channel-option.active {
  background: rgba(47, 129, 247, 0.12);
}
.teamtasks-channel-option .teamtasks-channel-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teamtasks-channel-option .worker-badges {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

/* Team Tasks - Assignee picker (custom dropdown with green count badge) */
.teamtasks-user-picker {
  position: relative;
}
.teamtasks-user-picker-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.teamtasks-user-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 350;
  background-color: var(--bg-card, var(--bg-surface));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.teamtasks-user-picker-note {
  padding: 0.6rem 0.75rem 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted, rgba(139, 148, 158, 0.9));
  border-bottom: 1px solid rgba(139, 148, 158, 0.18);
}
.teamtasks-user-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  user-select: none;
}
.teamtasks-user-option:hover {
  background: rgba(255, 255, 255, 0.04);
}
.teamtasks-user-option.active {
  background: rgba(47, 129, 247, 0.12);
}
.teamtasks-user-option .teamtasks-user-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teamtasks-user-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 160, 67, 0.18);
  border: 1px solid rgba(46, 160, 67, 0.50);
  color: rgba(190, 255, 205, 0.96);
  font-weight: 950;
  font-size: 0.78rem;
  flex: 0 0 auto;
}

/* Finance block (task modal side panel) */
.teamtasks-finance-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.teamtasks-finance-group {
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}
.teamtasks-finance-group-title {
  font-weight: 950;
  margin-bottom: 0.35rem;
}
.teamtasks-finance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  padding: 0.2rem 0;
}
.teamtasks-finance-row .who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}
.teamtasks-finance-row .amt {
  font-weight: 900;
  color: var(--text-primary);
  flex: 0 0 auto;
}
.teamtasks-finance-total {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(139, 148, 158, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 950;
}

/* Overdue indicators in subtasks */
.teamtasks-overdue-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 81, 73, 0.18);
  border: 1px solid rgba(248, 81, 73, 0.55);
  color: #ffb4b4;
  font-weight: 950;
  font-size: 0.78rem;
}
.teamtasks-overdue-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.45);
  color: #ffb4b4;
  font-weight: 900;
  font-size: 0.78rem;
  margin-left: 6px;
}
.teamtasks-modal-grid {
  display: grid;
  /* Use minmax(0, ...) so grid items can shrink without overflow */
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
}
.teamtasks-inline-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.teamtasks-inline-label label {
  margin: 0;
}

.teamtasks-task-editor {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.teamtasks-desc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.teamtasks-desc-buttons {
  display: inline-flex;
  gap: 0.5rem;
}
.teamtasks-task-preview {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-main);
  padding: 0.75rem;
  color: var(--text-primary);
  min-height: 140px;
  max-height: 420px;
  overflow: auto;
}

/* Public share modal */
.teamtasks-publicshare-url {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
}
.teamtasks-publicshare-url:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47,129,247,0.25);
  border-color: rgba(47,129,247,0.45);
}
.teamtasks-publicshare-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-weight: 900;
  margin: 0.25rem 0 0.75rem;
  width: fit-content;
}
.teamtasks-publicshare-state.active {
  border-color: rgba(46,160,67,0.55);
  background: rgba(46,160,67,0.12);
}
.teamtasks-publicshare-state.inactive {
  border-color: rgba(248,81,73,0.55);
  background: rgba(248,81,73,0.12);
}

/* Toggle button emphasis */
.teamtasks-publicshare-toggle.is-active {
  border-color: rgba(248,81,73,0.45);
  background: rgba(248,81,73,0.12);
  color: #ffb4b4;
}
.teamtasks-publicshare-toggle.is-inactive {
  border-color: rgba(46,160,67,0.45);
  background: rgba(46,160,67,0.12);
  color: #baf7c7;
}
.teamtasks-modal-main,
.teamtasks-modal-side {
  /* Prevent children (editor/toolbars/selects) from forcing horizontal overflow */
  min-width: 0;
}

/* Team Tasks modal: wider + no horizontal scrollbars */
#teamtasks-task-modal .modal-content.modal-large {
  width: calc(100vw - 48px);
  max-width: 1400px;
  overflow-x: hidden;
}
#teamtasks-task-modal .modal-body {
  overflow-x: hidden;
}

/* Prevent long option labels from overflowing the side panel */
#teamtasks-task-modal .teamtasks-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
#teamtasks-task-modal select.teamtasks-select {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Categories admin modal */
.teamtasks-cats-admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
.teamtasks-cats-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.teamtasks-cat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 1fr;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-main);
}
.teamtasks-cat-row .teamtasks-cat-name {
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teamtasks-cat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.teamtasks-cats-create {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Toast UI Editor - Redesigned to match panel aesthetic */
#teamtasks-task-modal .teamtasks-task-editor {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}

/* Apply the same editor skin to the Worker Task modal */
#teamtasks-worker-modal .teamtasks-task-editor {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}
#teamtasks-worker-modal .toastui-editor-defaultUI {
  border: none;
  background: var(--bg-surface);
}
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar {
  background: var(--bg-main) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 10px 12px !important;
  min-height: auto !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}
#teamtasks-worker-modal .toastui-editor-toolbar-group {
  margin-right: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 32px !important;
}
#teamtasks-worker-modal .toastui-editor-toolbar-divider {
  background: var(--border-color) !important;
  height: 18px !important;
  margin: 0 4px !important;
  opacity: 0.6 !important;
}
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button {
  margin: 2px !important;
  border-radius: 6px !important;
  transition: background 150ms ease !important;
}
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons,
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
  outline: none !important;
  box-sizing: border-box !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
}
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:hover,
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:hover {
  background-color: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus,
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus,
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus-visible,
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.25) !important;
  border-color: rgba(47, 129, 247, 0.45) !important;
}
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:disabled,
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:disabled {
  opacity: 0.45 !important;
}
#teamtasks-worker-modal .toastui-editor-defaultUI-toolbar button:hover {
  background-color: rgba(255,255,255,0.08) !important;
}
#teamtasks-worker-modal .toastui-editor-main,
#teamtasks-worker-modal .toastui-editor-md-container,
#teamtasks-worker-modal .toastui-editor-ww-container {
  background: var(--bg-surface) !important;
}
#teamtasks-worker-modal .ProseMirror {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  padding: 16px !important;
  caret-color: var(--text-primary) !important;
}
#teamtasks-worker-modal .toastui-editor-contents,
#teamtasks-worker-modal .toastui-editor-contents p,
#teamtasks-worker-modal .toastui-editor-contents li,
#teamtasks-worker-modal .toastui-editor-contents h1,
#teamtasks-worker-modal .toastui-editor-contents h2,
#teamtasks-worker-modal .toastui-editor-contents h3,
#teamtasks-worker-modal .toastui-editor-contents h4,
#teamtasks-worker-modal .toastui-editor-contents h5,
#teamtasks-worker-modal .toastui-editor-contents h6,
#teamtasks-worker-modal .ProseMirror p,
#teamtasks-worker-modal .ProseMirror li,
#teamtasks-worker-modal .ProseMirror h1,
#teamtasks-worker-modal .ProseMirror h2,
#teamtasks-worker-modal .ProseMirror h3,
#teamtasks-worker-modal .ProseMirror h4,
#teamtasks-worker-modal .ProseMirror h5,
#teamtasks-worker-modal .ProseMirror h6 {
  color: var(--text-primary) !important;
}

#teamtasks-worker-modal .toastui-editor-mode-switch {
  background: var(--bg-main) !important;
  border-top: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}
#teamtasks-worker-modal .toastui-editor-mode-switch .tab-item {
  background: transparent !important;
  color: var(--text-secondary) !important;
}
#teamtasks-worker-modal .toastui-editor-mode-switch .tab-item.active {
  background: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
}

#teamtasks-worker-modal .CodeMirror,
#teamtasks-worker-modal .CodeMirror-scroll {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}
#teamtasks-worker-modal .CodeMirror-gutters {
  background: var(--bg-main) !important;
  border-right: 1px solid var(--border-color) !important;
}
#teamtasks-worker-modal .cm-editor,
#teamtasks-worker-modal .cm-scroller,
#teamtasks-worker-modal .cm-content {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}
#teamtasks-worker-modal .cm-gutters {
  background: var(--bg-main) !important;
  border-right: 1px solid var(--border-color) !important;
}

/* Editor frame - remove default borders and match panel colors */
#teamtasks-task-modal .toastui-editor-defaultUI,
#wiki-article-modal .toastui-editor-defaultUI,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI {
  border: none;
  background: var(--bg-surface);
}

/* Toolbar - flatter design with panel colors */
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar,
#wiki-article-modal .toastui-editor-defaultUI-toolbar,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar {
  background: var(--bg-main) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 10px 12px !important;
  min-height: auto !important;
  /* Use standard block/flex wrapping so groups flow naturally */
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}

/* ToastUI "More" menu / dropdowns inside modals (fix invisible/behind UI) */
#teamtasks-task-modal .toastui-editor-popup,
#teamtasks-task-modal .toastui-editor-tooltip,
#teamtasks-task-modal .toastui-editor-dropdown-menu,
#teamtasks-worker-modal .toastui-editor-popup,
#teamtasks-worker-modal .toastui-editor-tooltip,
#teamtasks-worker-modal .toastui-editor-dropdown-menu,
#wiki-article-modal .toastui-editor-popup,
#wiki-article-modal .toastui-editor-tooltip,
#wiki-article-modal .toastui-editor-dropdown-menu,
.teamtasks-desc-expanded-editor .toastui-editor-popup,
.teamtasks-desc-expanded-editor .toastui-editor-tooltip,
.teamtasks-desc-expanded-editor .toastui-editor-dropdown-menu {
  z-index: 10000 !important;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

#teamtasks-task-modal .toastui-editor-popup button,
#teamtasks-worker-modal .toastui-editor-popup button,
#wiki-article-modal .toastui-editor-popup button,
.teamtasks-desc-expanded-editor .toastui-editor-popup button {
  color: var(--text-primary) !important;
}

/* Toolbar button styling - subtle, flat design */
#teamtasks-task-modal .toastui-editor-toolbar-group,
#wiki-article-modal .toastui-editor-toolbar-group,
.teamtasks-desc-expanded-editor .toastui-editor-toolbar-group {
  margin-right: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 32px !important;
}

#teamtasks-task-modal .toastui-editor-toolbar-divider,
#wiki-article-modal .toastui-editor-toolbar-divider,
.teamtasks-desc-expanded-editor .toastui-editor-toolbar-divider {
  background: var(--border-color) !important;
  height: 18px !important;
  margin: 0 4px !important;
  opacity: 0.6 !important;
}

/* Let Toast UI handle button structure, but style the container for better hover */
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button {
  margin: 2px !important;
  border-radius: 6px !important;
  transition: background 150ms ease !important;
}

/* Toolbar icon buttons: use a "tile" background (no white outline) */
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons,
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
  outline: none !important;
  /* DO NOT override display/align/background-position as it breaks the sprite! */
  box-sizing: border-box !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
}

/* Table edge controls (Jira-like) */
#teamtasks-task-modal .teamtasks-table-edge-ui {
  position: absolute;
  inset: 0;
  pointer-events: none; /* buttons re-enable */
  z-index: 5;
}
#teamtasks-task-modal .teamtasks-table-edge-btn {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-weight: 950;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
#teamtasks-task-modal .teamtasks-table-edge-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.14);
}
#teamtasks-task-modal .teamtasks-table-edge-btn:focus,
#teamtasks-task-modal .teamtasks-table-edge-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47,129,247,0.25), 0 6px 18px rgba(0,0,0,0.35);
  border-color: rgba(47,129,247,0.45);
}
#teamtasks-task-modal .teamtasks-table-edge-btn.danger {
  background: rgba(248,81,73,0.16);
  border-color: rgba(248,81,73,0.35);
}

#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:hover,
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:hover,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:hover,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:hover,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:hover,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:hover {
  background-color: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus,
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus,
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus-visible,
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus-visible,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus-visible,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus-visible,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:focus-visible,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.25) !important;
  border-color: rgba(47, 129, 247, 0.45) !important;
}

#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:disabled,
#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:disabled,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:disabled,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:disabled,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons:disabled,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icon:disabled {
  opacity: 0.45 !important;
}

#teamtasks-task-modal .toastui-editor-defaultUI-toolbar button:hover,
#wiki-article-modal .toastui-editor-defaultUI-toolbar button:hover,
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI-toolbar button:hover {
  /* Use background-color (not background shorthand) so we don't wipe Toast UI icon sprites */
  background-color: rgba(255,255,255,0.08) !important;
}

/* Main editor area backgrounds */
#teamtasks-task-modal .toastui-editor-main,
#teamtasks-task-modal .toastui-editor-md-container,
#teamtasks-task-modal .toastui-editor-ww-container,
#wiki-article-modal .toastui-editor-main,
#wiki-article-modal .toastui-editor-md-container,
#wiki-article-modal .toastui-editor-ww-container,
.teamtasks-desc-expanded-editor .toastui-editor-main,
.teamtasks-desc-expanded-editor .toastui-editor-md-container,
.teamtasks-desc-expanded-editor .toastui-editor-ww-container {
  background: var(--bg-surface) !important;
}

#teamtasks-task-modal .ProseMirror,
#wiki-article-modal .ProseMirror,
.teamtasks-desc-expanded-editor .ProseMirror {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  padding: 16px !important;
  caret-color: var(--text-primary) !important;
}

#teamtasks-task-modal .toastui-editor-contents,
#teamtasks-task-modal .toastui-editor-contents p,
#teamtasks-task-modal .toastui-editor-contents li,
#teamtasks-task-modal .toastui-editor-contents h1,
#teamtasks-task-modal .toastui-editor-contents h2,
#teamtasks-task-modal .toastui-editor-contents h3,
#teamtasks-task-modal .toastui-editor-contents h4,
#teamtasks-task-modal .toastui-editor-contents h5,
#teamtasks-task-modal .toastui-editor-contents h6,
#teamtasks-task-modal .ProseMirror p,
#teamtasks-task-modal .ProseMirror li,
#teamtasks-task-modal .ProseMirror h1,
#teamtasks-task-modal .ProseMirror h2,
#teamtasks-task-modal .ProseMirror h3,
#teamtasks-task-modal .ProseMirror h4,
#teamtasks-task-modal .ProseMirror h5,
#teamtasks-task-modal .ProseMirror h6,
#wiki-article-modal .toastui-editor-contents,
#wiki-article-modal .toastui-editor-contents p,
#wiki-article-modal .toastui-editor-contents li,
#wiki-article-modal .toastui-editor-contents h1,
#wiki-article-modal .toastui-editor-contents h2,
#wiki-article-modal .toastui-editor-contents h3,
#wiki-article-modal .toastui-editor-contents h4,
#wiki-article-modal .toastui-editor-contents h5,
#wiki-article-modal .toastui-editor-contents h6,
#wiki-article-modal .ProseMirror p,
#wiki-article-modal .ProseMirror li,
#wiki-article-modal .ProseMirror h1,
#wiki-article-modal .ProseMirror h2,
#wiki-article-modal .ProseMirror h3,
#wiki-article-modal .ProseMirror h4,
#wiki-article-modal .ProseMirror h5,
#wiki-article-modal .ProseMirror h6,
.teamtasks-desc-expanded-editor .toastui-editor-contents,
.teamtasks-desc-expanded-editor .toastui-editor-contents p,
.teamtasks-desc-expanded-editor .toastui-editor-contents li,
.teamtasks-desc-expanded-editor .toastui-editor-contents h1,
.teamtasks-desc-expanded-editor .toastui-editor-contents h2,
.teamtasks-desc-expanded-editor .toastui-editor-contents h3,
.teamtasks-desc-expanded-editor .toastui-editor-contents h4,
.teamtasks-desc-expanded-editor .toastui-editor-contents h5,
.teamtasks-desc-expanded-editor .toastui-editor-contents h6,
.teamtasks-desc-expanded-editor .ProseMirror p,
.teamtasks-desc-expanded-editor .ProseMirror li,
.teamtasks-desc-expanded-editor .ProseMirror h1,
.teamtasks-desc-expanded-editor .ProseMirror h2,
.teamtasks-desc-expanded-editor .ProseMirror h3,
.teamtasks-desc-expanded-editor .ProseMirror h4,
.teamtasks-desc-expanded-editor .ProseMirror h5,
.teamtasks-desc-expanded-editor .ProseMirror h6,
.teamtasks-desc-expanded-preview .toastui-editor-contents,
.teamtasks-desc-expanded-preview .toastui-editor-contents p,
.teamtasks-desc-expanded-preview .toastui-editor-contents li,
.teamtasks-desc-expanded-preview .toastui-editor-contents h1,
.teamtasks-desc-expanded-preview .toastui-editor-contents h2,
.teamtasks-desc-expanded-preview .toastui-editor-contents h3,
.teamtasks-desc-expanded-preview .toastui-editor-contents h4,
.teamtasks-desc-expanded-preview .toastui-editor-contents h5,
.teamtasks-desc-expanded-preview .toastui-editor-contents h6 {
  color: var(--text-primary) !important;
}

/* Content styling inside editor/viewers (tables/code/etc) - make elements readable on dark backgrounds */
#teamtasks-task-modal .toastui-editor-contents table,
#teamtasks-task-modal .ProseMirror table,
#teamtasks-task-modal .toastui-editor-md-preview table,
#teamtasks-worker-modal .toastui-editor-contents table,
#teamtasks-worker-modal .ProseMirror table,
#teamtasks-worker-modal .toastui-editor-md-preview table,
#teamtasks-bugview-modal .toastui-editor-contents table,
#teamtasks-bugview-modal .ProseMirror table,
#teamtasks-bugview-modal .toastui-editor-md-preview table,
#wiki-article-modal .toastui-editor-contents table,
#wiki-article-modal .ProseMirror table,
#wiki-article-modal .toastui-editor-md-preview table,
.teamtasks-desc-expanded-editor .toastui-editor-contents table,
.teamtasks-desc-expanded-editor .ProseMirror table,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview table,
.teamtasks-desc-expanded-preview .toastui-editor-contents table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}
#teamtasks-task-modal .toastui-editor-contents th,
#teamtasks-task-modal .toastui-editor-contents td,
#teamtasks-task-modal .ProseMirror th,
#teamtasks-task-modal .ProseMirror td,
#teamtasks-task-modal .toastui-editor-md-preview th,
#teamtasks-task-modal .toastui-editor-md-preview td,
#teamtasks-worker-modal .toastui-editor-contents th,
#teamtasks-worker-modal .toastui-editor-contents td,
#teamtasks-worker-modal .ProseMirror th,
#teamtasks-worker-modal .ProseMirror td,
#teamtasks-worker-modal .toastui-editor-md-preview th,
#teamtasks-worker-modal .toastui-editor-md-preview td,
#teamtasks-bugview-modal .toastui-editor-contents th,
#teamtasks-bugview-modal .toastui-editor-contents td,
#teamtasks-bugview-modal .ProseMirror th,
#teamtasks-bugview-modal .ProseMirror td,
#teamtasks-bugview-modal .toastui-editor-md-preview th,
#teamtasks-bugview-modal .toastui-editor-md-preview td,
#wiki-article-modal .toastui-editor-contents th,
#wiki-article-modal .toastui-editor-contents td,
#wiki-article-modal .ProseMirror th,
#wiki-article-modal .ProseMirror td,
#wiki-article-modal .toastui-editor-md-preview th,
#wiki-article-modal .toastui-editor-md-preview td,
.teamtasks-desc-expanded-editor .toastui-editor-contents th,
.teamtasks-desc-expanded-editor .toastui-editor-contents td,
.teamtasks-desc-expanded-editor .ProseMirror th,
.teamtasks-desc-expanded-editor .ProseMirror td,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview th,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview td,
.teamtasks-desc-expanded-preview .toastui-editor-contents th,
.teamtasks-desc-expanded-preview .toastui-editor-contents td {
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  vertical-align: top;
  /* ToastUI table cells sometimes default to black; force our dark theme text color. */
  color: var(--text-primary) !important;
}
#teamtasks-task-modal .toastui-editor-contents th,
#teamtasks-task-modal .ProseMirror th,
#teamtasks-task-modal .toastui-editor-md-preview th,
#teamtasks-worker-modal .toastui-editor-contents th,
#teamtasks-worker-modal .ProseMirror th,
#teamtasks-worker-modal .toastui-editor-md-preview th,
#teamtasks-bugview-modal .toastui-editor-contents th,
#teamtasks-bugview-modal .ProseMirror th,
#teamtasks-bugview-modal .toastui-editor-md-preview th,
#wiki-article-modal .toastui-editor-contents th,
#wiki-article-modal .ProseMirror th,
#wiki-article-modal .toastui-editor-md-preview th,
.teamtasks-desc-expanded-editor .toastui-editor-contents th,
.teamtasks-desc-expanded-editor .ProseMirror th,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview th,
.teamtasks-desc-expanded-preview .toastui-editor-contents th {
  background: rgba(255,255,255,0.06);
  font-weight: 900;
}
#teamtasks-task-modal .toastui-editor-contents tbody tr:nth-child(even) td,
#teamtasks-task-modal .ProseMirror tbody tr:nth-child(even) td,
#teamtasks-task-modal .toastui-editor-md-preview tbody tr:nth-child(even) td,
#teamtasks-worker-modal .toastui-editor-contents tbody tr:nth-child(even) td,
#teamtasks-worker-modal .ProseMirror tbody tr:nth-child(even) td,
#teamtasks-worker-modal .toastui-editor-md-preview tbody tr:nth-child(even) td,
#teamtasks-bugview-modal .toastui-editor-contents tbody tr:nth-child(even) td,
#teamtasks-bugview-modal .ProseMirror tbody tr:nth-child(even) td,
#teamtasks-bugview-modal .toastui-editor-md-preview tbody tr:nth-child(even) td,
#wiki-article-modal .toastui-editor-contents tbody tr:nth-child(even) td,
#wiki-article-modal .ProseMirror tbody tr:nth-child(even) td,
#wiki-article-modal .toastui-editor-md-preview tbody tr:nth-child(even) td,
.teamtasks-desc-expanded-editor .toastui-editor-contents tbody tr:nth-child(even) td,
.teamtasks-desc-expanded-editor .ProseMirror tbody tr:nth-child(even) td,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview tbody tr:nth-child(even) td,
.teamtasks-desc-expanded-preview .toastui-editor-contents tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

#teamtasks-task-modal .toastui-editor-contents code,
#teamtasks-task-modal .ProseMirror code,
#teamtasks-task-modal .toastui-editor-md-preview code,
#wiki-article-modal .toastui-editor-contents code,
#wiki-article-modal .ProseMirror code,
#wiki-article-modal .toastui-editor-md-preview code,
.teamtasks-desc-expanded-editor .toastui-editor-contents code,
.teamtasks-desc-expanded-editor .ProseMirror code,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview code,
.teamtasks-desc-expanded-preview .toastui-editor-contents code {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.1em 0.35em;
  color: var(--text-primary) !important;
}
#teamtasks-task-modal .toastui-editor-contents pre,
#teamtasks-task-modal .ProseMirror pre,
#teamtasks-task-modal .toastui-editor-md-preview pre,
#wiki-article-modal .toastui-editor-contents pre,
#wiki-article-modal .ProseMirror pre,
#wiki-article-modal .toastui-editor-md-preview pre,
.teamtasks-desc-expanded-editor .toastui-editor-contents pre,
.teamtasks-desc-expanded-editor .ProseMirror pre,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview pre,
.teamtasks-desc-expanded-preview .toastui-editor-contents pre {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  overflow: auto;
  color: var(--text-primary) !important;
}

#teamtasks-task-modal .toastui-editor-contents blockquote,
#teamtasks-task-modal .ProseMirror blockquote,
#teamtasks-task-modal .toastui-editor-md-preview blockquote,
#wiki-article-modal .toastui-editor-contents blockquote,
#wiki-article-modal .ProseMirror blockquote,
#wiki-article-modal .toastui-editor-md-preview blockquote,
.teamtasks-desc-expanded-editor .toastui-editor-contents blockquote,
.teamtasks-desc-expanded-editor .ProseMirror blockquote,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview blockquote,
.teamtasks-desc-expanded-preview .toastui-editor-contents blockquote {
  margin: 0.6rem 0;
  padding: 0.6rem 0.9rem;
  border-left: 4px solid rgba(47,129,247,0.55);
  background: rgba(47,129,247,0.08);
  color: var(--text-primary);
}

#teamtasks-task-modal .toastui-editor-contents hr,
#teamtasks-task-modal .ProseMirror hr,
#teamtasks-task-modal .toastui-editor-md-preview hr,
#wiki-article-modal .toastui-editor-contents hr,
#wiki-article-modal .ProseMirror hr,
#wiki-article-modal .toastui-editor-md-preview hr,
.teamtasks-desc-expanded-editor .toastui-editor-contents hr,
.teamtasks-desc-expanded-editor .ProseMirror hr,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview hr,
.teamtasks-desc-expanded-preview .toastui-editor-contents hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.9rem 0;
}

#teamtasks-task-modal .toastui-editor-contents a,
#teamtasks-task-modal .ProseMirror a,
#teamtasks-task-modal .toastui-editor-md-preview a,
#wiki-article-modal .toastui-editor-contents a,
#wiki-article-modal .ProseMirror a,
#wiki-article-modal .toastui-editor-md-preview a,
.teamtasks-desc-expanded-editor .toastui-editor-contents a,
.teamtasks-desc-expanded-editor .ProseMirror a,
.teamtasks-desc-expanded-editor .toastui-editor-md-preview a,
.teamtasks-desc-expanded-preview .toastui-editor-contents a {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Mode switch - redesigned as a clean segmented control */
#teamtasks-task-modal .toastui-editor-mode-switch,
#wiki-article-modal .toastui-editor-mode-switch,
.teamtasks-desc-expanded-editor .toastui-editor-mode-switch {
  background: var(--bg-main) !important;
  border-top: 1px solid var(--border-color) !important;
  padding: 10px 12px !important;
  display: flex !important;
  justify-content: flex-end !important;
}

#teamtasks-task-modal .toastui-editor-mode-switch .tab-item,
#wiki-article-modal .toastui-editor-mode-switch .tab-item,
.teamtasks-desc-expanded-editor .toastui-editor-mode-switch .tab-item {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-color) !important;
  padding: 6px 14px !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  height: auto !important;
  line-height: 1.4 !important;
  transition: all 150ms ease !important;
  cursor: pointer !important;
}

#teamtasks-task-modal .toastui-editor-mode-switch .tab-item:first-child,
#wiki-article-modal .toastui-editor-mode-switch .tab-item:first-child,
.teamtasks-desc-expanded-editor .toastui-editor-mode-switch .tab-item:first-child {
  border-right-width: 0 !important;
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
}

#teamtasks-task-modal .toastui-editor-mode-switch .tab-item:last-child,
#wiki-article-modal .toastui-editor-mode-switch .tab-item:last-child,
.teamtasks-desc-expanded-editor .toastui-editor-mode-switch .tab-item:last-child {
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}

#teamtasks-task-modal .toastui-editor-mode-switch .tab-item:hover,
#wiki-article-modal .toastui-editor-mode-switch .tab-item:hover,
.teamtasks-desc-expanded-editor .toastui-editor-mode-switch .tab-item:hover {
  background: rgba(255,255,255,0.04) !important;
}

#teamtasks-task-modal .toastui-editor-mode-switch .tab-item.active,
#wiki-article-modal .toastui-editor-mode-switch .tab-item.active,
.teamtasks-desc-expanded-editor .toastui-editor-mode-switch .tab-item.active {
  background: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
}

/* Markdown editor (CodeMirror) */
#teamtasks-task-modal .CodeMirror,
#teamtasks-task-modal .CodeMirror-scroll,
#wiki-article-modal .CodeMirror,
#wiki-article-modal .CodeMirror-scroll,
.teamtasks-desc-expanded-editor .CodeMirror,
.teamtasks-desc-expanded-editor .CodeMirror-scroll {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}

#teamtasks-task-modal .CodeMirror-gutters,
#wiki-article-modal .CodeMirror-gutters,
.teamtasks-desc-expanded-editor .CodeMirror-gutters {
  background: var(--bg-main) !important;
  border-right: 1px solid var(--border-color) !important;
}

#teamtasks-task-modal .cm-editor,
#teamtasks-task-modal .cm-scroller,
#teamtasks-task-modal .cm-content,
#wiki-article-modal .cm-editor,
#wiki-article-modal .cm-scroller,
#wiki-article-modal .cm-content,
.teamtasks-desc-expanded-editor .cm-editor,
.teamtasks-desc-expanded-editor .cm-scroller,
.teamtasks-desc-expanded-editor .cm-content {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}

#teamtasks-task-modal .cm-gutters {
  background: var(--bg-main) !important;
  border-right: 1px solid var(--border-color) !important;
}

/* Preview pane */
#teamtasks-task-modal .toastui-editor-md-preview,
#teamtasks-task-modal .toastui-editor-md-preview-style {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}
.teamtasks-side-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

/* Modal title row with copy link button */
.teamtasks-modal-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.teamtasks-copy-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(47, 129, 247, 0.15);
  border: 1px solid rgba(47, 129, 247, 0.35);
  border-radius: 6px;
  color: #58a6ff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.teamtasks-copy-link-btn:hover {
  background: rgba(47, 129, 247, 0.25);
  border-color: rgba(47, 129, 247, 0.5);
}
.teamtasks-copy-link-btn:active {
  transform: scale(0.95);
}
.teamtasks-copy-link-btn.copied {
  background: rgba(46, 160, 67, 0.2);
  border-color: rgba(46, 160, 67, 0.5);
  color: #3fb950;
}

/* Modal sidebar timers */
.teamtasks-side-timers {
  margin: 0.75rem 0;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(139, 148, 158, 0.12);
}
.teamtasks-side-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0;
  font-size: 0.75rem;
}
.teamtasks-side-timer-label {
  color: rgba(201, 209, 217, 0.6);
  font-weight: 700;
}
.teamtasks-side-timer-value {
  color: var(--text-secondary);
  font-weight: 700;
}
.teamtasks-side-timer-value.overdue {
  color: #ffb4b4;
}
.teamtasks-side-timer-countdown {
  margin-left: 0.4rem;
  color: rgba(255, 180, 100, 0.95);
  font-weight: 800;
}

.teamtasks-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Task modal action bar: horizontal tile buttons with emoji on top */
#teamtasks-task-modal .teamtasks-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#teamtasks-task-modal .teamtasks-modal-actions .teamtasks-action-tile {
  flex: 1;
  width: auto;
  height: auto;
  min-height: 65px;
  padding: 0.5rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#teamtasks-task-modal .teamtasks-modal-actions .teamtasks-action-tile .teamtasks-action-emoji {
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
}
#teamtasks-task-modal .teamtasks-modal-actions .teamtasks-action-tile .teamtasks-action-label {
  font-size: 0.85rem;
  font-weight: bold;
}
#teamtasks-task-modal .teamtasks-modal-actions #teamtasks-modal-save {
  width: 100%;
  height: 40px;
  font-size: 1rem;
  font-weight: bold;
}
.teamtasks-modal-status {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.teamtasks-modal-status.success { color: #2ea043; }
.teamtasks-modal-status.error { color: #f85149; }
.teamtasks-modal-status.info { color: var(--text-secondary); }
.teamtasks-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.teamtasks-k { color: var(--text-secondary); font-weight: 800; }
.teamtasks-v { font-weight: 900; }
.teamtasks-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.teamtasks-cat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  font-size: 0.85rem;
}
.teamtasks-cat-item input {
  width: auto;
  margin: 0;
}
.teamtasks-groups {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}
.teamtasks-groups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

/* Default groups picker */
.teamtasks-groups-picker-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.teamtasks-groups-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

/* Group task modal: Dispatch list should be a clean single-column list (not the default groups grid) */
#teamtasks-grouptask-workers.teamtasks-groups-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.teamtasks-dispatch-worker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  user-select: none;
}
.teamtasks-dispatch-worker input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}
.teamtasks-dispatch-worker .teamtasks-dispatch-worker-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}
.teamtasks-dispatch-worker .worker-badges {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}
.teamtasks-group-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  user-select: none;
}
.teamtasks-group-item input {
  width: auto;
  margin: 0;
}
.teamtasks-group-item span {
  font-weight: 850;
}

/* Archived tasks modal */
.teamtasks-archived-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.teamtasks-archived-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-main);
}
.teamtasks-archived-title {
  font-weight: 950;
}
.teamtasks-archived-sub {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teamtasks-archived-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.teamtasks-nodes {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.teamtasks-nodes-empty,
.teamtasks-node-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.75rem;
  border: 1px dashed rgba(139, 148, 158, 0.35);
  border-radius: 10px;
}
.teamtasks-node {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-main);
  padding: 0.75rem;
}
.teamtasks-node.group {
  background: rgba(47, 129, 247, 0.06);
  border-color: rgba(47, 129, 247, 0.25);
}
.teamtasks-node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.teamtasks-node-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.teamtasks-node-children {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.teamtasks-node-worker-title {
  font-weight: 900;
}
.teamtasks-node-worker-meta {
  margin-top: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Worker node status (To do / In progress / Done) */
.teamtasks-worker-status-select {
  min-width: 140px;
  width: auto;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 850;
}

/* Task activity (Comments / History) */
.teamtasks-activity {
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.10);
  overflow: hidden;
}
.teamtasks-activity-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(139, 148, 158, 0.18);
  background: rgba(255, 255, 255, 0.02);
}
.teamtasks-activity-tab {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 900;
  cursor: pointer;
}
.teamtasks-activity-tab.active {
  border-color: rgba(47, 129, 247, 0.55);
  background: rgba(47, 129, 247, 0.18);
}
.teamtasks-activity-panel {
  padding: 0.75rem;
}
.teamtasks-comments-list,
.teamtasks-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Reddit-style threaded comments */
.teamtasks-comment-thread {
  position: relative;
}
.teamtasks-comment-thread-root {
  margin-bottom: 0.5rem;
}
.teamtasks-comment-thread-root > .teamtasks-comment {
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

/* Thread replies container with connecting line */
.teamtasks-thread-replies {
  position: relative;
  margin-left: 17px;
  padding-left: 20px;
  margin-top: 0.4rem;
}

/* Clickable thread line */
.teamtasks-thread-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: pointer;
  z-index: 1;
}
.teamtasks-thread-line::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(139, 148, 158, 0.25);
  border-radius: 1px;
  transition: background 0.15s ease, width 0.15s ease;
}
.teamtasks-thread-line:hover::before {
  background: rgba(47, 129, 247, 0.6);
  width: 3px;
  left: 4.5px;
}
.teamtasks-thread-replies .teamtasks-comment-thread {
  margin-top: 0.4rem;
}
.teamtasks-thread-replies .teamtasks-comment-thread:first-child {
  margin-top: 0;
}

/* Nested comment styling - no border/background for replies */
.teamtasks-thread-replies .teamtasks-comment {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.5rem 0;
}
.teamtasks-thread-replies .teamtasks-comment:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Collapse button */
.teamtasks-thread-collapse-btn {
  position: absolute;
  left: -1px;
  top: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  background: var(--bg-surface);
  border: 1px solid rgba(139, 148, 158, 0.3);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  z-index: 2;
  transition: all 0.15s ease;
}
.teamtasks-thread-collapse-btn:hover {
  background: rgba(47, 129, 247, 0.15);
  border-color: rgba(47, 129, 247, 0.5);
  color: var(--primary-color);
}
.teamtasks-thread-collapse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Collapsed thread placeholder */
.teamtasks-thread-collapsed {
  margin-left: 17px;
  padding-left: 16px;
  margin-top: 0.3rem;
}
.teamtasks-thread-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 0;
  width: auto;
  background: rgba(47, 129, 247, 0.1);
  border: 1px solid rgba(47, 129, 247, 0.3);
  border-radius: 6px;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.teamtasks-thread-expand-btn:hover {
  background: rgba(47, 129, 247, 0.2);
  border-color: rgba(47, 129, 247, 0.5);
}
.teamtasks-thread-expand-icon {
  font-size: 12px;
  font-weight: 700;
}
.teamtasks-thread-expand-text {
  font-size: 0.78rem;
}

.teamtasks-comment {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.65rem 0.7rem;
  position: relative;
}
.teamtasks-comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid var(--bg-main);
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  position: relative;
}
.teamtasks-comment-avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.teamtasks-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.teamtasks-comment-body {
  min-width: 0;
  flex: 1 1 auto;
}
.teamtasks-comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.teamtasks-comment-author {
  font-weight: 950;
}
.teamtasks-comment-time {
  color: var(--text-secondary);
  font-weight: 850;
  font-size: 0.8rem;
  white-space: nowrap;
}
.teamtasks-comment-text {
  margin-top: 0.35rem;
  color: var(--text-primary);
  line-height: 1.35;
  white-space: pre-wrap;
}
.teamtasks-comment-compose {
  margin-bottom: 0.75rem;
}
.teamtasks-comment-compose textarea {
  width: 100%;
  margin-top: 0;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  resize: vertical;
}
.teamtasks-comment-actions {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
}

/* Comment actions row with likes */
.teamtasks-comment-actions-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.teamtasks-comment-actions-row .btn-secondary {
  padding: 4px 10px;
  font-size: 0.78rem;
  margin: 0;
}

/* Like button */
.teamtasks-comment-like-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.teamtasks-comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  margin: 0;
  width: auto;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.teamtasks-comment-like-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(248, 81, 73, 0.4);
}
.teamtasks-comment-like-btn.liked {
  color: #f85149;
  border-color: rgba(248, 81, 73, 0.4);
}
.teamtasks-comment-like-btn.liked .teamtasks-comment-like-icon {
  color: #f85149;
}
.teamtasks-comment-like-icon {
  font-size: 0.85rem;
  line-height: 1;
}
.teamtasks-comment-like-count {
  font-weight: 700;
  font-size: 0.78rem;
}

/* Likes dropdown - use fixed positioning to escape overflow */
.teamtasks-comment-likes-dropdown {
  display: none;
  position: fixed;
  min-width: 160px;
  max-width: 220px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10000;
}
.teamtasks-comment-likes-user {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}
.teamtasks-comment-likes-user:last-child {
  border-bottom: none;
}

/* Mention highlighting in comments */
.teamtasks-comment-mention {
  color: #58a6ff;
  font-weight: 600;
  cursor: default;
}

/* Comment input wrapper for mention dropdown positioning */
.teamtasks-comment-input-wrapper {
  position: relative;
}

/* Comment compose actions - better alignment */
.teamtasks-comment-compose .teamtasks-comment-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.teamtasks-comment-compose .teamtasks-comment-actions button {
  margin: 0;
  width: auto;
}
.teamtasks-comment-compose .teamtasks-comment-actions #teamtasks-mention-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
}
.teamtasks-comment-compose .teamtasks-comment-actions #teamtasks-comment-submit {
  flex: 1;
}

/* Mention dropdown - fixed positioning to escape overflow */
.teamtasks-mention-dropdown {
  position: fixed;
  max-height: 280px;
  width: 320px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10000;
}
.teamtasks-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s ease;
}
.teamtasks-mention-item:last-child {
  border-bottom: none;
}
.teamtasks-mention-item:hover,
.teamtasks-mention-item.active {
  background: rgba(47, 129, 247, 0.15);
}
.teamtasks-mention-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.teamtasks-mention-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.teamtasks-mention-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.teamtasks-history-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.teamtasks-history-main {
  min-width: 0;
  flex: 1 1 auto;
}
.teamtasks-history-line {
  font-weight: 900;
}
.teamtasks-history-meta {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 850;
}

/* Worker Orders status pill (Team Tasks worker node) */
.teamtasks-order-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}
.teamtasks-order-pill.none {
  cursor: default;
  opacity: 0.8;
}
.teamtasks-order-pill .teamtasks-order-label { font-weight: 900; }
.teamtasks-order-pill .teamtasks-order-sep { opacity: 0.6; }
.teamtasks-order-pill .teamtasks-order-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 900;
}
.teamtasks-order-pill .teamtasks-order-sub {
  font-weight: 800;
  color: var(--text-secondary);
}
.teamtasks-order-pill:hover:not(.none) {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}
.teamtasks-order-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47,129,247,0.25);
  border-color: rgba(47,129,247,0.45);
}
.teamtasks-order-pill.pending { border-color: rgba(210,153,34,0.45); }
.teamtasks-order-pill.attended { border-color: rgba(163,113,247,0.45); }
.teamtasks-order-pill.active { border-color: rgba(46,160,67,0.45); }
.teamtasks-order-pill.rejected { border-color: rgba(248,81,73,0.55); }
.teamtasks-order-pill.completed { border-color: rgba(46,160,67,0.65); }
.teamtasks-order-pill.cancelled { border-color: rgba(139,148,158,0.55); opacity: 0.85; }
.teamtasks-order-pill.not_sent { border-color: rgba(139,148,158,0.45); opacity: 0.85; }
.teamtasks-muted {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .teamtasks-modal-grid {
    grid-template-columns: 1fr;
  }
  .teamtasks-select {
    min-width: 170px;
  }
}

/* ========== GLOBAL ANNOUNCEMENT BANNER ========== */
.global-announcement-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: #2f81f7;
  color: #ffffff;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  position: fixed;
  top: var(--dashboard-navbar-height, 70px);
  left: 0;
  right: 0;
  z-index: 90;
  min-height: 44px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.global-announcement-banner .announcement-text {
  flex: 1 1 auto;
  max-width: 1200px;
}

.global-announcement-banner .announcement-close-btn {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.global-announcement-banner .announcement-close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

/* ========== ANNOUNCEMENTS CONFIGURATION PAGE ========== */
.announcements-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.announcements-header {
  margin-bottom: 2rem;
}

.announcements-header .header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.announcements-header .header-icon {
  font-size: 2rem;
}

.announcements-header h2 {
  margin: 0;
  color: var(--text-primary);
}

.announcements-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.announcements-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.announcements-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.announcements-card h3 {
  margin: 0 0 1rem;
  color: var(--text-primary);
  font-size: 1.1rem;
}

/* Toggle Switch */
.announcement-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.toggle-info h3 {
  margin: 0 0 0.25rem;
}

.toggle-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  transition: 0.3s;
  border-radius: 30px;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.switch input:checked + .slider:before {
  transform: translateX(26px);
  background-color: #fff;
}

/* Preview Section */
.announcement-preview {
  border-radius: 8px;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.announcement-preview.preview-disabled {
  opacity: 0.5;
}

.announcement-banner-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  background-color: #2f81f7;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  position: relative;
}

.announcement-banner-preview .announcement-close-btn {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: default;
  padding: 0;
  margin: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  opacity: 0.7;
}

/* Form Styles */
.announcements-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.announcements-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.announcements-form .form-group label {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

.announcements-form .form-group small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.announcements-form textarea {
  resize: vertical;
  min-height: 80px;
}

.announcements-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Color Input Group */
.color-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.color-input-group input[type="color"] {
  width: 50px;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.color-input-group input[type="text"] {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
  margin: 0;
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
}

.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Color Presets */
.color-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  width: 40px;
  height: 40px;
  padding: 4px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-main);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  margin: 0;
}

.preset-btn:hover {
  transform: scale(1.1);
  border-color: var(--primary-color);
}

.preset-color {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
  flex: 1;
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.form-actions .btn-primary {
  background: var(--primary-color);
  color: #fff;
  border: none;
}

.form-actions .btn-primary:hover {
  background: var(--primary-hover);
}

.form-actions .btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.form-actions .btn-secondary:hover {
  background: var(--bg-main);
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .announcements-form .form-row {
    grid-template-columns: 1fr;
  }
  
  .announcement-toggle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
}

/* ==================== Store Embed Editor Styles ==================== */

/* Media tabs for embed editor */
.embed-media-tabs {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.embed-media-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.embed-media-tab:hover {
    background: var(--bg-tertiary);
}

.embed-media-tab.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-weight: 500;
}

.embed-media-panel {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 0.75rem;
    background: var(--bg-dark);
}

/* Upload dropzone for store */
.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
}

.upload-dropzone:hover {
    border-color: var(--accent-primary);
    background: rgba(74, 144, 226, 0.05);
}

.upload-dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(74, 144, 226, 0.1);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.dropzone-icon {
    font-size: 1.75rem;
}

.dropzone-text {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.dropzone-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.dropzone-uploading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-progress-bar {
    width: 100%;
    max-width: 180px;
    height: 5px;
    background: var(--bg-main);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.upload-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dropzone-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.success-icon {
    font-size: 1.1rem;
}

/* Embed preview styles */
.embed-preview-container {
    background: #36393f;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
}

.embed-preview-card {
    background: #2f3136;
    border-left: 4px solid var(--accent-primary);
    border-radius: 4px;
    overflow: hidden;
}

.embed-preview-content {
    padding: 0.75rem 1rem;
}

.embed-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.embed-preview-title {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    word-break: break-word;
}

.embed-preview-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.embed-preview-description {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #dcddde;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

.embed-preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

/* ========================================
   WIKI KNOWLEDGE BASE STYLES
   ======================================== */

.wiki-root {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.wiki-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 10px;
}

.wiki-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wiki-title-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    font-size: 1.5rem;
}

.wiki-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.wiki-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wiki-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.85rem;
    min-width: 70px;
    border-radius: 8px;
    font-size: 0.75rem;
    transition: background 0.15s, border-color 0.15s;
}

.wiki-action-tile:hover {
    background: rgba(255, 255, 255, 0.06);
}

.wiki-action-emoji {
    font-size: 1.1rem;
}

.wiki-action-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Toolbar */
.wiki-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 10px;
}

.wiki-search {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.wiki-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.wiki-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 0.25rem;
}

.wiki-view-btn {
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.wiki-view-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.wiki-view-btn.active {
    color: var(--text-primary);
    background: var(--primary-color);
}

/* Layout */
.wiki-layout {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

/* Sidebar */
.wiki-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s;
}

.wiki-sidebar.collapsed {
    width: 56px;
    min-width: 56px;
}

.wiki-sidebar.collapsed .wiki-topic-name,
.wiki-sidebar.collapsed .wiki-topic-edit-btn,
.wiki-sidebar.collapsed .wiki-drag-handle,
.wiki-sidebar.collapsed .wiki-sidebar-header span {
    display: none;
}

.wiki-sidebar.collapsed .wiki-sidebar-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.wiki-sidebar.collapsed .wiki-topic-item {
    justify-content: center;
    padding: 0.6rem;
}

.wiki-sidebar.collapsed .wiki-sidebar-toggle svg {
    transform: rotate(180deg);
}

.wiki-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.wiki-sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wiki-sidebar-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.wiki-sidebar-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.wiki-topics-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.wiki-topic-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 0;
    overflow: hidden;
}

.wiki-topic-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.wiki-topic-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.wiki-topic-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.wiki-topic-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-topic-edit-btn {
    opacity: 0;
    background: none;
    border: none;
    padding: 2px 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
    border-radius: 4px;
    flex-shrink: 0;
    flex-grow: 0;
    line-height: 1;
    width: auto;
    min-width: 0;
    max-width: 24px;
}

.wiki-topic-edit-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.wiki-topic-item:hover .wiki-topic-edit-btn {
    opacity: 1;
}

/* Main content */
.wiki-main {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow-y: auto;
    padding: 1rem;
}

/* Article list */
.wiki-article-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wiki-article-list.wiki-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Article card */
.wiki-article-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.wiki-article-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wiki-article-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.wiki-article-topic {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 4px;
    color: #a5b4fc;
}

.wiki-status-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.wiki-status-draft {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.wiki-pinned-badge {
    font-size: 0.85rem;
}

.wiki-article-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.wiki-article-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.wiki-article-card-author {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wiki-mini-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
}

.wiki-mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.wiki-article-card-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Drag and drop styles */
.wiki-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 1rem;
    width: 16px;
    padding: 0.25rem 0;
    flex-shrink: 0;
    user-select: none;
    transition: all 0.15s;
    border-radius: 3px;
}

.wiki-drag-handle:hover {
    opacity: 1;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.wiki-drag-handle:active {
    cursor: grabbing;
}

.wiki-topic-item.wiki-dragging,
.wiki-article-card.wiki-dragging {
    opacity: 0.4;
    background: var(--bg-tertiary);
}

.wiki-topic-item.wiki-drag-over-top {
    border-top: 2px solid var(--primary-color);
}

.wiki-topic-item.wiki-drag-over-bottom {
    border-bottom: 2px solid var(--primary-color);
}

.wiki-article-card.wiki-drag-over-top {
    border-top: 3px solid var(--primary-color);
    margin-top: -3px;
}

.wiki-article-card.wiki-drag-over-bottom {
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: -3px;
}

.wiki-article-drag-handle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--text-secondary);
    opacity: 0;
    font-size: 1rem;
    width: 20px;
    height: 20px;
    padding: 0.25rem;
    user-select: none;
    transition: all 0.15s;
    z-index: 2;
    border-radius: 4px;
}

.wiki-article-card:hover .wiki-article-drag-handle {
    opacity: 0.5;
}

.wiki-article-drag-handle:hover {
    opacity: 1 !important;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.wiki-article-drag-handle:active {
    cursor: grabbing;
}

.wiki-article-card[draggable="true"] {
    position: relative;
}

/* Content loading state */
.wiki-content-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Content fallback styles (basic markdown) */
.wiki-content-fallback {
    line-height: 1.7;
    color: var(--text-primary);
}

.wiki-content-fallback h1,
.wiki-content-fallback h2,
.wiki-content-fallback h3,
.wiki-content-fallback h4,
.wiki-content-fallback h5,
.wiki-content-fallback h6 {
    margin: 1.5em 0 0.5em 0;
    color: var(--text-primary);
    font-weight: 600;
}

.wiki-content-fallback h1 { font-size: 1.75rem; }
.wiki-content-fallback h2 { font-size: 1.5rem; }
.wiki-content-fallback h3 { font-size: 1.25rem; }
.wiki-content-fallback h4 { font-size: 1.1rem; }

.wiki-content-fallback strong {
    font-weight: 700;
    color: var(--text-primary);
}

.wiki-content-fallback em {
    font-style: italic;
}

.wiki-content-fallback code {
    background: var(--bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9em;
}

.wiki-content-fallback blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.wiki-content-fallback ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.wiki-content-fallback a {
    color: var(--primary-color);
    text-decoration: none;
}

.wiki-content-fallback a:hover {
    text-decoration: underline;
}

.wiki-content-fallback hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* Empty state */
.wiki-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.wiki-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.wiki-empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.wiki-empty-state p {
    margin: 0 0 1.5rem 0;
}

/* Article view */
.wiki-article-view {
    max-width: 900px;
    margin: 0 auto;
}

.wiki-article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.wiki-breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
}

.wiki-breadcrumb-link:hover {
    text-decoration: underline;
}

.wiki-breadcrumb-sep {
    color: var(--text-secondary);
    opacity: 0.5;
}

.wiki-breadcrumb-current {
    color: var(--text-primary);
}

.wiki-article-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wiki-article-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.wiki-article-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.wiki-like-btn,
.wiki-share-btn,
.wiki-edit-btn,
.wiki-back-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.wiki-like-btn:hover,
.wiki-share-btn:hover,
.wiki-edit-btn:hover,
.wiki-back-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.wiki-like-btn.liked {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.wiki-like-btn.liked .wiki-like-icon {
    fill: #f87171;
}

/* Article meta */
.wiki-article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.wiki-article-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wiki-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    overflow: hidden;
}

.wiki-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wiki-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.wiki-author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.wiki-article-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.wiki-article-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.wiki-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Article content */
.wiki-article-content {
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-primary);
}

.wiki-article-content h1,
.wiki-article-content h2,
.wiki-article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.wiki-article-content p {
    margin-bottom: 1rem;
}

.wiki-article-content code {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.wiki-article-content pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.wiki-content-fallback {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ToastUI Viewer styles for wiki content - ensure white text on dark background */
.wiki-article-content .toastui-editor-contents,
.wiki-article-content .toastui-editor-contents p,
.wiki-article-content .toastui-editor-contents li,
.wiki-article-content .toastui-editor-contents h1,
.wiki-article-content .toastui-editor-contents h2,
.wiki-article-content .toastui-editor-contents h3,
.wiki-article-content .toastui-editor-contents h4,
.wiki-article-content .toastui-editor-contents h5,
.wiki-article-content .toastui-editor-contents h6 {
    color: var(--text-primary) !important;
}

.wiki-article-content .toastui-editor-contents table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
}

.wiki-article-content .toastui-editor-contents th,
.wiki-article-content .toastui-editor-contents td {
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    vertical-align: top;
    color: var(--text-primary) !important;
}

.wiki-article-content .toastui-editor-contents th {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

.wiki-article-content .toastui-editor-contents tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.wiki-article-content .toastui-editor-contents code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.1em 0.35em;
    color: var(--text-primary) !important;
}

.wiki-article-content .toastui-editor-contents pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    overflow: auto;
}

.wiki-article-content .toastui-editor-contents pre code {
    background: none;
    border: none;
    padding: 0;
}

.wiki-article-content .toastui-editor-contents blockquote {
    margin: 0.6rem 0;
    padding: 0.6rem 0.9rem;
    border-left: 4px solid rgba(47, 129, 247, 0.55);
    background: rgba(47, 129, 247, 0.08);
    color: var(--text-primary) !important;
}

.wiki-article-content .toastui-editor-contents hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.9rem 0;
}

.wiki-article-content .toastui-editor-contents a {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wiki-article-content .toastui-editor-contents img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.wiki-article-content .toastui-editor-contents ul,
.wiki-article-content .toastui-editor-contents ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

/* Comments section */
.wiki-comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.wiki-comments-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.wiki-comments-count {
    font-weight: 400;
    color: var(--text-secondary);
}

.wiki-comment-compose {
    margin-bottom: 1.5rem;
}

.wiki-comment-compose textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}

.wiki-comment-compose textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.wiki-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wiki-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wiki-comment {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.wiki-comment-deleted {
    opacity: 0.5;
}

.wiki-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.wiki-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wiki-comment-body {
    flex: 1;
    min-width: 0;
}

.wiki-comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.wiki-comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.wiki-comment-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.wiki-comment-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.wiki-comment-actions-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.wiki-comment-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.wiki-comment-action:hover {
    color: var(--primary-color);
}

/* Modals */
.wiki-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.wiki-modal-status {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    text-align: center;
}

.wiki-modal-status.error {
    color: #f87171;
}

.wiki-modal-status.success {
    color: #4ade80;
}

.wiki-select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.wiki-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Article form */
.wiki-article-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .wiki-article-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Wiki Editor Custom Toolbar (Video/Attachment Upload) */
.wiki-editor-toolbar-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.wiki-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.wiki-upload-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.wiki-upload-btn:active {
    transform: scale(0.97);
}

.wiki-upload-btn span {
    font-size: 0.9rem;
}

.wiki-upload-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.wiki-upload-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.wiki-upload-progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, var(--primary-color), #4ade80);
    border-radius: 3px;
    transition: width 0.2s ease;
}

.wiki-upload-progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 80px;
}

/* Wiki File Attachment Card (displayed in editor and article view) */
.wiki-file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    margin: 0.5rem 0;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    max-width: 100%;
    cursor: pointer;
}

.wiki-file-attachment:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.wiki-file-attachment-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.wiki-file-attachment-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.wiki-file-attachment-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiki-file-attachment-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wiki-file-attachment-download {
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.wiki-file-attachment:hover .wiki-file-attachment-download {
    opacity: 1;
}

/* Video attachment specific styling */
.wiki-file-attachment.wiki-file-video {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 22, 0.1));
    border-color: rgba(239, 68, 68, 0.3);
}

.wiki-file-attachment.wiki-file-video:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Wiki inline video attachment preview */
.wiki-video-attachment {
    margin: 0.75rem 0;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.wiki-video-attachment-player {
    display: block;
    width: 100%;
    max-height: 560px;
    background: #000;
}

.wiki-video-attachment-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.12));
    border-top: 1px solid rgba(239, 68, 68, 0.25);
}

.wiki-video-attachment-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 180px;
}

.wiki-video-attachment-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.wiki-video-attachment-download {
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.wiki-video-attachment-download:hover {
    background: rgba(99, 102, 241, 0.15);
}

/* Production File Attachment Card (for Team Tasks, Quick Tasks, Bugs) */
.production-file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    margin: 0.5rem 0;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    max-width: 100%;
    cursor: pointer;
}

.production-file-attachment:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.production-file-attachment-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.production-file-attachment-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.production-file-attachment-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.production-file-attachment-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.production-file-attachment-download {
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.production-file-attachment:hover .production-file-attachment-download {
    opacity: 1;
}

.wiki-editor-container {
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.wiki-editor-toolbar-custom + .wiki-editor-container {
    border-top: none;
}

.wiki-article-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.wiki-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.wiki-toggle-label input:checked + .wiki-toggle-text {
    color: var(--text-primary);
}

/* Share modal */
.wiki-share-url {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.wiki-share-state {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1rem 0;
}

.wiki-share-state.active {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.wiki-share-state.inactive {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
}

/* Share modal input group */
.wiki-share-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.wiki-share-input-group .wiki-share-url {
    flex: 1;
}

.wiki-share-copy-btn {
    padding: 0.5rem 0.75rem;
    min-width: auto;
    font-size: 1rem;
}

.wiki-share-state-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.wiki-share-state-row .wiki-share-state {
    margin: 0;
}

.wiki-share-actions-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wiki-share-actions-inline .btn-secondary {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* History list */
.wiki-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wiki-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.wiki-muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .wiki-layout {
        flex-direction: column;
    }
    
    .wiki-sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .wiki-sidebar.collapsed {
        width: 100%;
        max-height: 48px;
    }
    
    .wiki-article-header {
        flex-direction: column;
    }
    
    .wiki-article-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .wiki-article-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================
   Expanded Description Overlay
   ========================================= */
.teamtasks-desc-expanded-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.teamtasks-desc-expanded-overlay.active {
  opacity: 1;
  visibility: visible;
}

.teamtasks-desc-expanded-container {
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 80px);
  max-height: 900px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.teamtasks-desc-expanded-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-main);
  flex-shrink: 0;
}

.teamtasks-desc-expanded-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.teamtasks-desc-expanded-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.teamtasks-desc-expanded-close {
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.teamtasks-desc-expanded-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.teamtasks-desc-expanded-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
}

/* Expanded preview */
.teamtasks-desc-expanded-preview {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-main);
  padding: 1rem;
  color: var(--text-primary);
}

/* Expanded editor wrapper */
.teamtasks-desc-expanded-editor {
  flex: 1;
  display: none;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-surface);
}

.teamtasks-desc-expanded-editor.active {
  display: flex;
  flex-direction: column;
}

/* When editing, hide preview */
.teamtasks-desc-expanded-body.editing .teamtasks-desc-expanded-preview {
  display: none;
}

.teamtasks-desc-expanded-body.editing .teamtasks-desc-expanded-editor {
  display: flex;
}

/* Toast UI in expanded mode - layout only (styling inherited from standard selectors) */
.teamtasks-desc-expanded-editor .toastui-editor-defaultUI {
  height: 100% !important;
}

.teamtasks-desc-expanded-editor .toastui-editor-main {
  height: calc(100% - 48px) !important;
}

.teamtasks-desc-expanded-editor .toastui-editor-md-container,
.teamtasks-desc-expanded-editor .toastui-editor-ww-container {
  height: 100% !important;
}

.teamtasks-desc-expanded-editor .toastui-editor-main-container {
  height: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .teamtasks-desc-expanded-overlay {
    padding: 12px;
  }
  
  .teamtasks-desc-expanded-container {
    max-height: none;
    height: calc(100vh - 24px);
    border-radius: 12px;
  }
}

/* ===== Maintenance Mode Screen ===== */
.maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0000 0%, #4a0e0e 25%, #7a1a1a 50%, #4a0e0e 75%, #1a0000 100%);
    background-size: 400% 400%;
    animation: maintenanceGradient 12s ease infinite;
}

@keyframes maintenanceGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.maintenance-card {
    text-align: center;
    max-width: 520px;
    width: 90%;
    padding: 3rem 2.5rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.maintenance-emoji {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 1.25rem;
    animation: maintenancePulse 2s ease-in-out infinite;
}

@keyframes maintenancePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.maintenance-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
}

.maintenance-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.maintenance-message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.6;
    white-space: pre-wrap;
}

.maintenance-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 1.5rem;
}

.maintenance-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(248, 81, 73, 0.6);
    animation: maintenanceDot 1.4s ease-in-out infinite;
}

.maintenance-dots span:nth-child(2) { animation-delay: 0.2s; }
.maintenance-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes maintenanceDot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* Whitelist Roblox account enrichment */
.roblox-account-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.avatar-thumb-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: var(--bg-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.avatar-thumb-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.avatar-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.roblox-account-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

a.roblox-username,
.roblox-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.76rem;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    display: block;
}

a.roblox-username:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.roblox-displayname {
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roblox-userid {
    font-size: 0.64rem;
    color: var(--text-secondary);
    font-family: monospace;
    line-height: 1.1;
    opacity: 0.7;
}

.roblox-id-only {
    font-family: monospace;
    font-size: 0.76rem;
    color: var(--text-primary);
    margin-right: 4px;
}

.roblox-loading,
.roblox-unavailable {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

/* Whitelist table: fixed layout + word-wrap for verticality without horizontal scroll */
.group-card .table-wrapper {
    overflow-x: hidden;
}

.group-card table {
    table-layout: fixed;
    width: 100%;
}

.group-card thead th:nth-child(1) { width: 32px; }
.group-card thead th:nth-child(3) { width: 22%; }
.group-card thead th:nth-child(4) { width: 14%; }
.group-card thead th:nth-child(5) { width: 95px; }

.group-card th {
    white-space: nowrap;
    vertical-align: middle;
    padding: 6px 5px;
    font-size: 0.76rem;
}

.group-card td {
    vertical-align: middle;
    padding: 6px 5px;
    font-size: 0.8rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.group-card td.actions {
    display: table-cell !important;
    white-space: nowrap;
    word-break: normal;
    overflow: visible;
}

.group-card td.actions button {
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
    padding: 3px 7px;
    font-size: 0.72rem;
}

.group-card td.actions button:last-child {
    margin-right: 0;
}

.group-card tr.editing td {
    overflow: visible;
    word-break: normal;
}

.edit-row-layout {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.edit-row-layout input,
.edit-row-layout select {
    margin-bottom: 0;
}

.edit-row-layout .edit-user-id {
    width: 130px;
    flex-shrink: 0;
}

.edit-row-layout .edit-name {
    flex: 1;
    min-width: 100px;
}

.edit-row-layout .duration-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.edit-row-layout .duration-group input {
    width: 80px;
}

.edit-row-layout .duration-group select {
    width: 70px;
}

.edit-row-layout .edit-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.edit-row-layout .edit-row-actions button {
    width: auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 0.82rem;
}

.cache-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cache-reset-btn {
    width: auto;
    margin: 0;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--warning-color);
    background: rgba(210, 153, 34, 0.12);
    color: var(--warning-color);
    white-space: nowrap;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.cache-reset-btn:hover {
    background: rgba(210, 153, 34, 0.2);
}

.cache-reset-title {
    line-height: 1.1;
}

.cache-scan-btn {
    width: auto;
    margin: 0;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--primary-color);
    background: rgba(47, 129, 247, 0.12);
    color: var(--primary-color);
    white-space: nowrap;
}

.cache-scan-btn:hover {
    background: rgba(47, 129, 247, 0.2);
}

.cache-status-text {
    color: var(--text-secondary);
    font-size: 0.72rem;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.private-group-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 10px;
    color: var(--warning-color);
    font-size: 0.9rem;
    cursor: pointer;
}

.private-group-option input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.private-group-option span {
    user-select: none;
}

/* Duplicate Scan Modal */
.duplicate-modal-content {
    max-width: 620px;
    width: min(94vw, 620px);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.duplicate-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.duplicate-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    border: none;
    padding: 0;
}

.duplicate-modal-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dup-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.dup-stat-chip.total {
    background: rgba(47, 129, 247, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(47, 129, 247, 0.3);
}

.dup-stat-chip.cross-group {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.dup-stat-chip.same-group {
    background: rgba(248, 81, 73, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.dup-stat-chip.clean {
    background: rgba(46, 160, 67, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(46, 160, 67, 0.3);
}

.duplicate-modal-body {
    overflow-y: auto;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dup-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--border-color);
}

.dup-card.cross-group {
    border-left-color: var(--warning-color);
}

.dup-card.same-group {
    border-left-color: var(--danger-color);
}

.dup-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.dup-card-id {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dup-card-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.dup-card-badge.cross {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning-color);
}

.dup-card-badge.same {
    background: rgba(248, 81, 73, 0.2);
    color: var(--danger-color);
}

.dup-card-groups {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 0.35rem;
}

.dup-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dup-group-name {
    color: var(--text-primary);
    font-weight: 600;
}

.dup-group-count {
    font-size: 0.78rem;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

.avatar-modal-content {
    max-width: 520px;
    width: min(94vw, 520px);
}

.avatar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.avatar-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.avatar-modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

#avatar-modal-image {
    width: min(88vw, 420px);
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
}

/* ===== Quick Tasks: Review action buttons in task modal (On revision) ===== */
.teamtasks-modal-review-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.teamtasks-review-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.12s ease, transform 0.1s ease;
}
.teamtasks-review-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}
.teamtasks-review-btn:active {
    transform: translateY(0);
}
.teamtasks-review-btn--approve {
    background: rgba(46, 160, 67, 0.85);
    color: #fff;
}
.teamtasks-review-btn--deny {
    background: rgba(218, 54, 51, 0.85);
    color: #fff;
}
.teamtasks-review-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ===== Review modal: confirm button variants ===== */
#teamtasks-review-confirm.review-approve {
    background: rgba(46, 160, 67, 0.9);
    border-color: rgba(46, 160, 67, 0.5);
}
#teamtasks-review-confirm.review-approve:hover {
    background: rgba(46, 160, 67, 1);
}
#teamtasks-review-confirm.review-deny {
    background: rgba(218, 54, 51, 0.9);
    border-color: rgba(218, 54, 51, 0.5);
}
#teamtasks-review-confirm.review-deny:hover {
    background: rgba(218, 54, 51, 1);
}

/* ===== Review comments: colored boxes in the comments list ===== */
.teamtasks-review-comment-box {
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    margin-top: 0.3rem;
    font-size: 0.88rem;
    line-height: 1.4;
    font-weight: 600;
}
.teamtasks-review-comment-box--approved {
    background: rgba(46, 160, 67, 0.12);
    border: 1px solid rgba(46, 160, 67, 0.35);
    color: #3fb950;
}
.teamtasks-review-comment-box--denied {
    background: rgba(218, 54, 51, 0.12);
    border: 1px solid rgba(218, 54, 51, 0.35);
    color: #f85149;
}
.teamtasks-review-comment-box .review-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
}
.teamtasks-review-comment-box .review-label svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.teamtasks-review-comment-box .review-body {
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.92;
}
