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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a1628;
    min-height: 100vh;
    color: #333;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ========================================
   LOGIN SCREEN
   ======================================== */

#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a1628 0%, #0f2035 50%, #0a1628 100%);
    z-index: 9999;
}

#login-screen.active {
    display: flex;
}

.login-container {
    background: rgba(255, 255, 255, 0.03);
    padding: 48px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(23, 156, 216, 0.08);
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(23, 156, 216, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header img {
    max-width: 220px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h1 {
    color: #179CD8;
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 600;
}

.login-header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Google Sign-In Button */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    margin-bottom: 20px;
    cursor: pointer;
}

.google-btn:hover {
    background: rgba(23, 156, 216, 0.15);
    border-color: rgba(23, 156, 216, 0.4);
    box-shadow: 0 4px 20px rgba(23, 156, 216, 0.15);
    color: #fff;
}

.google-btn svg {
    flex-shrink: 0;
}

.login-domain-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    margin-top: 16px;
}

/* ========================================
   HUB TOPBAR (shared across hub screens)
   ======================================== */

.hub-topbar,
.module-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(23, 156, 216, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hub-topbar-left,
.module-topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hub-topbar-right,
.module-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-logo {
    height: 36px;
    width: auto;
}

.topbar-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s;
}

.topbar-back-btn:hover {
    background: rgba(23, 156, 216, 0.2);
    border-color: rgba(23, 156, 216, 0.4);
    color: #fff;
}

.topbar-breadcrumb {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 400;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #179CD8, #1489BF);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.topbar-username {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.topbar-settings-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.topbar-settings-btn:hover {
    background: rgba(23, 156, 216, 0.2);
    border-color: rgba(23, 156, 216, 0.4);
    color: #fff;
}

.topbar-logout-btn {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
}

.topbar-logout-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
}

/* ========================================
   HUB SCREEN - Main & Department Hub
   ======================================== */

#dept-screen,
#under-construction-screen {
    background: linear-gradient(160deg, #0a1628 0%, #0d1f38 40%, #091422 100%);
    min-height: 100vh;
}

#dept-screen.active,
#under-construction-screen.active {
    display: flex;
    flex-direction: column;
}

.hub-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    min-height: calc(100vh - 68px);
}

.hub-hero {
    text-align: center;
    margin-bottom: 60px;
}

.hub-title {
    font-size: 42px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    text-shadow: 0 0 40px rgba(23, 156, 216, 0.2);
}

.hub-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Hub Grid */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1100px;
    width: 100%;
}

/* Hub Cards - Glassmorphism */
.hub-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 48px 36px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(23, 156, 216, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.hub-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(23, 156, 216, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.hub-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(23, 156, 216, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(23, 156, 216, 0.12), 0 0 40px rgba(23, 156, 216, 0.06);
}

.hub-card:hover::before {
    opacity: 1;
}

.hub-card:hover .hub-card-glow {
    opacity: 1;
}

.hub-card:hover .hub-card-icon {
    transform: scale(1.08);
}

.hub-card:hover .hub-card-icon svg {
    stroke: #179CD8;
    filter: drop-shadow(0 0 12px rgba(23, 156, 216, 0.4));
}

.hub-card-icon {
    margin-bottom: 24px;
    transition: transform 0.4s;
}

.hub-card-icon svg {
    stroke: rgba(255, 255, 255, 0.5);
    transition: all 0.4s;
}

.hub-card-title {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.hub-card-desc {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    line-height: 1.5;
}

/* ========================================
   UNDER CONSTRUCTION SCREEN
   ======================================== */

.uc-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    min-height: calc(100vh - 68px);
    text-align: center;
}

.uc-icon {
    margin-bottom: 32px;
    opacity: 0.3;
}

.uc-icon svg {
    stroke: #179CD8;
}

.uc-title {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.uc-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 40px;
}

.uc-back-btn {
    background: rgba(23, 156, 216, 0.15);
    border: 1px solid rgba(23, 156, 216, 0.3);
    color: #179CD8;
    padding: 12px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.uc-back-btn:hover {
    background: rgba(23, 156, 216, 0.25);
    border-color: rgba(23, 156, 216, 0.5);
    box-shadow: 0 0 20px rgba(23, 156, 216, 0.15);
}

/* ========================================
   MODULE SCREEN (full-width content area)
   ======================================== */

#module-screen {
    background: #f5f7fa;
    min-height: 100vh;
}

#module-screen.active {
    display: flex;
    flex-direction: column;
}

.module-topbar {
    background: rgba(10, 22, 40, 0.95);
}

.module-main-content {
    flex: 1;
    padding: 0;
    background: #f5f7fa;
    overflow-y: auto;
}

/* Module Content */
.module-content {
    display: none;
    padding: 32px;
}

.module-content.active {
    display: block;
}

/* ========================================
   EXISTING STYLES (Preserved)
   ======================================== */

/* Navbar (legacy - kept for compatibility) */
.navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-logo {
    height: 40px;
    width: auto;
}

.navbar-brand h2 {
    color: #179CD8;
    font-size: 24px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user span {
    font-weight: 500;
    color: #179CD8;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(23, 156, 216, 0.15);
}

.tab-btn {
    background: transparent;
    border: none;
    color: #179CD8;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(23, 156, 216, 0.1);
}

.tab-btn.active {
    border-bottom-color: #179CD8;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Balance Cards */
.balance-period-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

.balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.balance-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.balance-card h3 {
    color: #179CD8;
    margin-bottom: 15px;
    font-size: 18px;
}

.balance-display {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.balance-remaining {
    color: #179CD8;
}

.balance-total {
    color: #999;
    font-size: 24px;
}

.balance-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.balance-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #179CD8, #1489BF);
    transition: width 0.3s;
}

.balance-used {
    color: #666;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #179CD8;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #179CD8;
    color: white;
}

.btn-primary:hover {
    background: #1489BF;
}

.btn-block {
    width: 100%;
    padding: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    background: #f0f0f0;
    color: #333;
}

.btn-sm:hover {
    background: #e0e0e0;
}

/* Badge */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #179CD8;
    color: white;
}

/* Messages */
.error-message {
    display: none;
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c33;
    margin-top: 15px;
}

.error-message.show {
    display: block;
}

.success-message {
    display: none;
    padding: 12px;
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 6px;
    color: #3c3;
    margin-top: 15px;
}

.success-message.show {
    display: block;
}

/* Info Section */
.info-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
    color: #179CD8;
    margin-bottom: 15px;
}

.holiday-list {
    list-style: none;
}

.holiday-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.holiday-list li:last-child {
    border-bottom: none;
}

/* Request Form Container */
.request-form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.request-form-container h2 {
    color: #179CD8;
    margin-bottom: 25px;
}

.calculation-display {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
}

.info-box {
    margin-top: 25px;
    padding: 20px;
    background: #f0f4ff;
    border-left: 4px solid #179CD8;
    border-radius: 6px;
}

.info-box h4 {
    color: #179CD8;
    margin-bottom: 10px;
}

.info-box ul {
    list-style-position: inside;
}

.info-box li {
    padding: 5px 0;
    color: #555;
}

/* Request List */
.request-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.request-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.request-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.request-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.request-status.approved {
    background: #d4edda;
    color: #155724;
}

.request-status.pending {
    background: #fff3cd;
    color: #856404;
}

.request-status.denied {
    background: #f8d7da;
    color: #721c24;
}

.request-status.cancelled {
    background: #e2e3e5;
    color: #383d41;
}

/* Calendar Controls */
.calendar-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.view-toggle, .calendar-period-toggle {
    display: flex;
    gap: 5px;
    background: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.view-btn, .period-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.view-btn:hover, .period-btn:hover {
    background: #f0f4ff;
    color: #179CD8;
}

.view-btn.active, .period-btn.active {
    background: #179CD8;
    color: white;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: #179CD8;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #1489BF;
}

#current-period-label {
    font-weight: 600;
    color: #179CD8;
    min-width: 200px;
    text-align: center;
}

/* Calendar List View */
.calendar-view {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-item {
    padding: 15px;
    border-left: 4px solid #179CD8;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.calendar-item strong {
    color: #179CD8;
}

/* Calendar Grid View */
.calendar-grid-view {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.calendar-grid-view::-webkit-scrollbar {
    height: 12px;
}

.calendar-grid-view::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.calendar-grid-view::-webkit-scrollbar-thumb {
    background: #179CD8;
    border-radius: 6px;
}

.calendar-grid-view::-webkit-scrollbar-thumb:hover {
    background: #1489BF;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: max-content;
    min-width: 100%;
}

.calendar-header {
    background: #179CD8;
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 10px;
    position: relative;
}

.calendar-day.other-month {
    background: #f5f5f5;
    color: #999;
}

.calendar-day.today {
    background: #f0f4ff;
}

.calendar-day.weekend {
    background: #e8e8e8;
    opacity: 0.6;
}

.calendar-day.weekend.other-month {
    background: #ebebeb;
    opacity: 0.45;
}

.calendar-day-number {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.calendar-day.other-month .calendar-day-number {
    color: #999;
}

.calendar-day.today .calendar-day-number {
    background: #179CD8;
    color: white;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.calendar-pto-item {
    background: #179CD8;
    color: white;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-pto-item:hover {
    background: #1489BF;
}

/* Week View */
.week-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.week-day {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e0e0e0;
}

.week-day.today {
    border-color: #179CD8;
    background: #f0f4ff;
}

.week-day.weekend {
    background: #e8e8e8;
    opacity: 0.6;
    border-color: #ccc;
}

.weekend-label {
    font-size: 11px;
    color: #999;
    font-style: italic;
    text-align: center;
}

.week-day-header {
    font-weight: 600;
    color: #179CD8;
    margin-bottom: 10px;
    text-align: center;
}

.week-pto-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-pto-item {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #179CD8;
}

.week-pto-item strong {
    color: #179CD8;
    display: block;
    margin-bottom: 3px;
}

/* Today View */
.today-view {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.today-header {
    font-size: 24px;
    font-weight: 600;
    color: #179CD8;
    margin-bottom: 20px;
}

.today-pto-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 20px;
}

.filter-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

/* Table */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table th {
    background: #179CD8;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

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

table tr:hover {
    background: #f8f9fa;
}

.subtitle {
    color: #179CD8;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ========================================
   SUPPORT TOOLS STYLES
   ======================================== */

.tools-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.section-title {
    color: #179CD8;
    font-size: 20px;
    margin-bottom: 16px;
    font-weight: 600;
}

.section-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.tool-card {
    background: white;
    padding: 16px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #179CD8 0%, #1489BF 100%);
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(23, 156, 216, 0.2);
    border-color: #179CD8;
}

.tool-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.tool-card h3 {
    color: #333;
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 600;
}

.tool-card p {
    color: #666;
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 8px;
    min-height: 32px;
}

.tool-status {
    display: inline-block;
    padding: 3px 10px;
    background: #27ae60;
    color: white;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #179CD8;
    font-size: 22px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.modal-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.modal-section h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 10px;
}

.modal-section code {
    background: white;
    padding: 3px 8px;
    border-radius: 4px;
    color: #179CD8;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.example-url {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #179CD8;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    color: #333;
}

.step-list {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
}

.step-list li {
    counter-increment: step-counter;
    margin-bottom: 15px;
    padding-left: 40px;
    position: relative;
    color: #666;
    line-height: 1.6;
}

.step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #179CD8 0%, #1489BF 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.open-tool-btn {
    background: linear-gradient(135deg, #179CD8 0%, #1489BF 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    display: inline-block;
    margin-top: 10px;
}

.open-tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 156, 216, 0.3);
}

/* Intercom Tickets Section */
.intercom-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #179CD8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-refresh:hover {
    background: #1489BF;
}

.refresh-icon {
    display: inline-block;
    transition: transform 0.3s;
}

.btn-refresh:active .refresh-icon {
    transform: rotate(180deg);
}

.ticket-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-filters label {
    font-weight: 600;
    color: #333;
}

.ticket-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.ticket-count {
    margin-left: auto;
    font-weight: 600;
    color: #179CD8;
}

/* Filter Builder */
.filter-builder {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-header-title {
    font-weight: 700;
    font-size: 15px;
    color: #333;
}

.filter-logic-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.logic-btn {
    padding: 5px 14px;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.logic-btn.active {
    background: #179CD8;
    color: white;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-add-filter {
    padding: 6px 14px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-add-filter:hover {
    background: #219a52;
}

.btn-clear-filters {
    padding: 6px 14px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-clear-filters:hover {
    background: #e0e0e0;
}

.filter-condition-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    flex-wrap: wrap;
}

.filter-condition-row select,
.filter-condition-row input {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    background: white;
}

.filter-condition-row select.filter-field-select {
    min-width: 140px;
}

.filter-condition-row select.filter-operator-select {
    min-width: 120px;
}

.filter-condition-row input.filter-value-input {
    min-width: 150px;
    flex: 1;
}

.filter-condition-row select.filter-value-select {
    min-width: 150px;
    flex: 1;
}

.btn-remove-filter {
    padding: 5px 10px;
    background: none;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
}

.btn-remove-filter:hover {
    background: #e74c3c;
    color: white;
}

.filter-apply-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.btn-apply-filters {
    padding: 8px 20px;
    background: #179CD8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-apply-filters:hover {
    background: #1489BF;
}

.filter-result-count {
    font-size: 13px;
    color: #666;
}

/* Summary Bar */
.summary-bar {
    background: white;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.summary-badge.total {
    background: #179CD8;
    color: white;
}

/* Tickets Container */
.tickets-container {
    display: grid;
    gap: 20px;
}

/* Group Header */
.ticket-group {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ticket-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 2px solid #eee;
}

.ticket-group-header:hover {
    background: #eef1f5;
}

.ticket-group-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-group-count {
    background: #179CD8;
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.ticket-group-body {
    padding: 12px;
}

.ticket-group-body.collapsed {
    display: none;
}

/* Ticket Row (table-like) */
.ticket-row {
    display: grid;
    grid-template-columns: 1fr 140px 130px 90px 80px 100px;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}

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

.ticket-row:hover {
    background: #f5f8ff;
}

.ticket-row-title {
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-row-company {
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-row-assignee {
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-row-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
}

.ticket-row-status.open {
    background: #e8f5e9;
    color: #2e7d32;
}

.ticket-row-status.snoozed {
    background: #fff3e0;
    color: #e65100;
}

.ticket-row-status.closed {
    background: #f5f5f5;
    color: #757575;
}

.ticket-row-priority {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-row-priority.urgent {
    color: #c0392b;
}

.ticket-row-priority.priority {
    color: #e74c3c;
}

.ticket-row-priority.normal {
    color: #666;
}

.ticket-row-date {
    font-size: 12px;
    color: #888;
}

/* Table header for tickets */
.ticket-table-header {
    display: grid;
    grid-template-columns: 1fr 140px 130px 90px 80px 100px;
    gap: 10px;
    padding: 8px 15px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eee;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #179CD8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    margin-top: 15px;
    color: #666;
}

.no-tickets {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    color: #666;
}

.error-message-box {
    background: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
    .hub-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .hub-title {
        font-size: 28px;
    }

    .hub-card {
        padding: 36px 28px;
    }

    .hub-topbar,
    .module-topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .topbar-breadcrumb {
        display: none;
    }

    .ticket-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .ticket-table-header {
        display: none;
    }

    .filter-condition-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-condition-row select,
    .filter-condition-row input {
        width: 100%;
    }

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

    .balance-cards {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }

    .module-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hub-title {
        font-size: 22px;
    }

    .hub-hero {
        margin-bottom: 32px;
    }

    .hub-card-icon svg {
        width: 48px;
        height: 48px;
    }

    .hub-card-title {
        font-size: 18px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .topbar-username {
        display: none;
    }
}

/* ========================================
   DARK FUTURISTIC THEME — MODULE SCREENS
   Scoped under #module-screen so hub screens
   remain unaffected.
   ======================================== */

/* 1. Module Container & Main Content */
#module-screen {
    background: linear-gradient(160deg, #0a1628 0%, #0d1f38 40%, #091422 100%);
}

#module-screen .module-main-content {
    background: transparent;
}

#module-screen .module-content {
    color: rgba(255, 255, 255, 0.85);
}

/* 2. Tabs */
#module-screen .tabs {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

#module-screen .tab-btn {
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .tab-btn:hover {
    background: rgba(23, 156, 216, 0.12);
    color: rgba(255, 255, 255, 0.8);
}

#module-screen .tab-btn.active {
    color: #179CD8;
    border-bottom-color: #179CD8;
}

/* 3. Balance Cards */
#module-screen .balance-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen .balance-card h3 {
    color: #179CD8;
}

#module-screen .balance-display {
    color: rgba(255, 255, 255, 0.95);
}

#module-screen .balance-total {
    color: rgba(255, 255, 255, 0.35);
}

#module-screen .balance-bar {
    background: rgba(255, 255, 255, 0.08);
}

#module-screen .balance-used {
    color: rgba(255, 255, 255, 0.5);
}

/* 4. Forms */
#module-screen .request-form-container {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen .request-form-container h2 {
    color: #179CD8;
}

#module-screen .form-group label {
    color: rgba(255, 255, 255, 0.8);
}

#module-screen .form-group input,
#module-screen .form-group select,
#module-screen .form-group textarea {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .form-group input:focus,
#module-screen .form-group select:focus,
#module-screen .form-group textarea:focus {
    border-color: #179CD8;
    box-shadow: 0 0 0 2px rgba(23, 156, 216, 0.15);
}

#module-screen .form-group input::placeholder,
#module-screen .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#module-screen .form-group small {
    color: rgba(255, 255, 255, 0.4);
}

#module-screen .form-group option {
    background: #0d1f38;
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .calculation-display {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#module-screen .info-box {
    background: rgba(23, 156, 216, 0.08);
    border-left: 4px solid #179CD8;
}

#module-screen .info-box h4 {
    color: #179CD8;
}

#module-screen .info-box li {
    color: rgba(255, 255, 255, 0.6);
}

/* 5. Info Sections */
#module-screen .info-section {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen .info-section h3 {
    color: #179CD8;
}

#module-screen .holiday-list li {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
}

/* 6. Request Items */
#module-screen .request-item {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

#module-screen .request-item-header {
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .request-status.approved {
    background: rgba(21, 87, 36, 0.35);
    color: #6fcf7f;
}

#module-screen .request-status.pending {
    background: rgba(133, 100, 4, 0.35);
    color: #f0d060;
}

#module-screen .request-status.denied {
    background: rgba(114, 28, 36, 0.35);
    color: #f08090;
}

#module-screen .request-status.cancelled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

/* 7. Calendar */
#module-screen .calendar-controls .view-toggle,
#module-screen .calendar-controls .calendar-period-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#module-screen .view-btn,
#module-screen .period-btn {
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .view-btn:hover,
#module-screen .period-btn:hover {
    background: rgba(23, 156, 216, 0.12);
    color: #179CD8;
}

#module-screen .view-btn.active,
#module-screen .period-btn.active {
    background: #179CD8;
    color: white;
}

#module-screen .calendar-navigation {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#module-screen #current-period-label {
    color: #179CD8;
}

#module-screen .calendar-view {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen .calendar-item {
    background: rgba(255, 255, 255, 0.04);
    border-left: 4px solid #179CD8;
    color: rgba(255, 255, 255, 0.8);
}

#module-screen .calendar-item strong {
    color: #179CD8;
}

#module-screen .calendar-grid-view {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen .calendar-grid {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.06);
}

#module-screen .calendar-day {
    background: rgba(10, 22, 40, 0.6);
}

#module-screen .calendar-day.other-month {
    background: rgba(10, 22, 40, 0.85);
}

#module-screen .calendar-day.today {
    background: rgba(23, 156, 216, 0.08);
}

#module-screen .calendar-day.weekend {
    background: rgba(10, 22, 40, 0.85);
    opacity: 0.45;
}

#module-screen .calendar-day.weekend.other-month {
    background: rgba(10, 22, 40, 0.9);
    opacity: 0.35;
}

#module-screen .calendar-day-number {
    color: rgba(255, 255, 255, 0.8);
}

#module-screen .calendar-day.other-month .calendar-day-number {
    color: rgba(255, 255, 255, 0.25);
}

#module-screen .calendar-grid-view::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

/* Week View */
#module-screen .week-day {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

#module-screen .week-day.today {
    border-color: #179CD8;
    background: rgba(23, 156, 216, 0.06);
}

#module-screen .week-day.weekend {
    background: rgba(10, 22, 40, 0.7);
    opacity: 0.45;
    border-color: rgba(255, 255, 255, 0.04);
}

#module-screen .weekend-label {
    color: rgba(255, 255, 255, 0.3);
}

#module-screen .week-day-header {
    color: #179CD8;
}

#module-screen .week-pto-item {
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid #179CD8;
    color: rgba(255, 255, 255, 0.8);
}

#module-screen .week-pto-item strong {
    color: #179CD8;
}

/* Today View */
#module-screen .today-view {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen .today-header {
    color: #179CD8;
}

/* 8. Tables */
#module-screen table {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen table td {
    color: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

#module-screen table tr:hover {
    background: rgba(23, 156, 216, 0.06);
}

/* 9. Support Tools */
#module-screen .tools-section {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#module-screen .section-title {
    color: #179CD8;
}

#module-screen .section-description {
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .tool-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

#module-screen .tool-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(23, 156, 216, 0.3);
    box-shadow: 0 4px 20px rgba(23, 156, 216, 0.15);
}

#module-screen .tool-card h3 {
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .tool-card p {
    color: rgba(255, 255, 255, 0.45);
}

/* 10. Modals */
#module-screen .modal-content,
.modal-content {
    background: linear-gradient(160deg, #0f1e35 0%, #132843 50%, #0d1a2e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.85);
}

.modal-header h2 {
    color: #179CD8;
}

.close-btn {
    color: rgba(255, 255, 255, 0.5);
}

.close-btn:hover {
    color: #fff;
}

.modal-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-section h3 {
    color: rgba(255, 255, 255, 0.9);
}

.modal-section p {
    color: rgba(255, 255, 255, 0.65);
}

.modal-section code {
    background: rgba(23, 156, 216, 0.12);
    color: #179CD8;
}

.example-url {
    background: rgba(0, 0, 0, 0.3);
    border-left: 4px solid #179CD8;
    color: rgba(255, 255, 255, 0.8);
}

.step-list li {
    color: rgba(255, 255, 255, 0.65);
}

/* 11. Intercom Tickets */
#module-screen .intercom-controls {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

#module-screen .ticket-filters label {
    color: rgba(255, 255, 255, 0.7);
}

#module-screen .ticket-filters select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .ticket-filters select option {
    background: #0d1f38;
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .ticket-count {
    color: #179CD8;
}

#module-screen .filter-builder {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

#module-screen .filter-header-title {
    color: rgba(255, 255, 255, 0.85);
}

#module-screen .filter-logic-toggle {
    border-color: rgba(255, 255, 255, 0.12);
}

#module-screen .logic-btn {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .logic-btn.active {
    background: #179CD8;
    color: white;
}

#module-screen .btn-clear-filters {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
}

#module-screen .btn-clear-filters:hover {
    background: rgba(255, 255, 255, 0.1);
}

#module-screen .filter-condition-row {
    background: rgba(255, 255, 255, 0.04);
}

#module-screen .filter-condition-row select,
#module-screen .filter-condition-row input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .filter-condition-row select option {
    background: #0d1f38;
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .filter-apply-row {
    border-top-color: rgba(255, 255, 255, 0.06);
}

#module-screen .filter-result-count {
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .summary-bar {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

#module-screen .summary-badge {
    background: rgba(23, 156, 216, 0.15);
    color: #179CD8;
}

#module-screen .summary-badge.total {
    background: #179CD8;
    color: white;
}

#module-screen .ticket-group {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

#module-screen .ticket-group-header {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

#module-screen .ticket-group-header:hover {
    background: rgba(23, 156, 216, 0.06);
}

#module-screen .ticket-group-name {
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .ticket-table-header {
    color: rgba(255, 255, 255, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

#module-screen .ticket-row {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

#module-screen .ticket-row:hover {
    background: rgba(23, 156, 216, 0.06);
}

#module-screen .ticket-row-title {
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .ticket-row-company,
#module-screen .ticket-row-assignee {
    color: rgba(255, 255, 255, 0.55);
}

#module-screen .ticket-row-status.open {
    background: rgba(46, 125, 50, 0.2);
    color: #6fcf7f;
}

#module-screen .ticket-row-status.snoozed {
    background: rgba(230, 81, 0, 0.2);
    color: #f0a050;
}

#module-screen .ticket-row-status.closed {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
}

#module-screen .ticket-row-date {
    color: rgba(255, 255, 255, 0.35);
}

#module-screen .loading-spinner {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#module-screen .loading-spinner p {
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .spinner {
    border-color: rgba(255, 255, 255, 0.08);
    border-top-color: #179CD8;
}

#module-screen .no-tickets {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .error-message-box {
    background: rgba(198, 40, 40, 0.15);
    border-color: rgba(239, 83, 80, 0.3);
    color: #f08080;
}

/* 12. Filter Bar & Selects */
#module-screen .filter-bar select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

#module-screen .filter-bar select option {
    background: #0d1f38;
    color: rgba(255, 255, 255, 0.9);
}

/* 13. Messages & Misc */
#module-screen .error-message {
    background: rgba(198, 40, 40, 0.15);
    border-color: rgba(239, 83, 80, 0.3);
    color: #f08080;
}

#module-screen .success-message {
    background: rgba(46, 125, 50, 0.15);
    border-color: rgba(102, 187, 106, 0.3);
    color: #6fcf7f;
}

#module-screen .loading {
    color: rgba(255, 255, 255, 0.5);
}

#module-screen .subtitle {
    color: #179CD8;
}

#module-screen .btn-sm {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#module-screen .btn-sm:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Container override for dark theme */
#module-screen .container {
    color: rgba(255, 255, 255, 0.85);
}

/* Navbar override (if used inside module) */
#module-screen .navbar {
    background: rgba(10, 22, 40, 0.9);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

#module-screen .navbar-brand h2 {
    color: #179CD8;
}

#module-screen .navbar-user span {
    color: #179CD8;
}

/* ========================================
   SOP WIDGETS (Google Drive SOPs)
   ======================================== */

.sop-categories {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sop-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.sop-category-header h3 {
    color: #179CD8;
    font-size: 16px;
    font-weight: 600;
}

.sop-count {
    background: #179CD8;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.sop-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.sop-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.sop-widget:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(23, 156, 216, 0.3);
    box-shadow: 0 4px 16px rgba(23, 156, 216, 0.12);
    transform: translateY(-2px);
}

.sop-widget-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.sop-widget-info {
    overflow: hidden;
}

.sop-widget-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sop-widget-date {
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    margin-top: 3px;
}

@media (max-width: 900px) {
    .sop-widgets {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SOP PLAYBOOK NAVIGATION
   ======================================== */

/* Landing: 2-column playbook cards */
.sop-playbook-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 4px;
}

.sop-playbook-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 4px solid var(--pb-accent, #179CD8);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    user-select: none;
}

.sop-playbook-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--pb-accent, #179CD8);
    border-top-color: var(--pb-accent, #179CD8);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.sop-playbook-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--pb-accent, #179CD8);
}

.sop-playbook-card-body {
    flex: 1;
    overflow: hidden;
}

.sop-playbook-card-body h3 {
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.sop-playbook-card-body p {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
}

.sop-playbook-card-arrow {
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.sop-playbook-card:hover .sop-playbook-card-arrow {
    transform: translateX(4px);
    color: var(--pb-accent, #179CD8);
}

/* Breadcrumb */
.sop-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sop-bc-btn {
    background: none;
    border: none;
    color: #179CD8;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.sop-bc-btn:hover {
    background: rgba(23, 156, 216, 0.12);
}

.sop-bc-sep {
    color: rgba(255, 255, 255, 0.25);
    font-size: 13px;
}

.sop-bc-current {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    padding: 4px 6px;
}

/* Subfolder cards */
.sop-subfolder-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.sop-subfolder-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sop-subfolder-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(23, 156, 216, 0.3);
    box-shadow: 0 4px 16px rgba(23, 156, 216, 0.1);
    transform: translateX(3px);
}

.sop-sf-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #179CD8;
}

.sop-sf-name {
    flex: 1;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    font-weight: 500;
}

.sop-sf-arrow {
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.2s;
}

.sop-subfolder-card:hover .sop-sf-arrow {
    transform: translateX(3px);
    color: #179CD8;
}

@media (max-width: 700px) {
    .sop-playbook-grid {
        grid-template-columns: 1fr;
    }
}

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

/* Admin filter bar */
.admin-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.admin-filter-bar label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.admin-filter-bar select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* Action buttons in tables */
.action-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn.edit-btn {
    background: rgba(23, 156, 216, 0.2);
    color: #179CD8;
    border: 1px solid rgba(23, 156, 216, 0.3);
}

.action-btn.edit-btn:hover {
    background: rgba(23, 156, 216, 0.35);
}

.action-btn.deactivate-btn {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.action-btn.deactivate-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

.action-btn.activate-btn {
    background: rgba(81, 207, 102, 0.15);
    color: #51cf66;
    border: 1px solid rgba(81, 207, 102, 0.25);
}

.action-btn.activate-btn:hover {
    background: rgba(81, 207, 102, 0.3);
}

.action-btn.approve-btn {
    background: rgba(81, 207, 102, 0.15);
    color: #51cf66;
    border: 1px solid rgba(81, 207, 102, 0.25);
}

.action-btn.approve-btn:hover {
    background: rgba(81, 207, 102, 0.3);
}

.action-btn.deny-btn {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.action-btn.deny-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

/* Pending request alert banner */
.pending-alert {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffc107;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

/* Pending row highlight in admin table */
.pending-row {
    background: rgba(255, 193, 7, 0.06) !important;
    border-left: 3px solid #ffc107;
}

/* Overlap note text */
.overlap-note {
    font-size: 11px;
    color: #ffc107;
    margin-top: 4px;
    font-style: italic;
    line-height: 1.3;
}

/* Denial reason text */
.denial-reason {
    font-size: 11px;
    color: #ff6b6b;
    margin-top: 4px;
    font-style: italic;
}

/* Pending highlight on request history item */
.request-item.pending-highlight {
    border-left: 3px solid #ffc107;
    background: rgba(255, 193, 7, 0.06);
}

/* Request item footer with cancel button */
.request-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* Status badges */
.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(81, 207, 102, 0.15);
    color: #51cf66;
}

.status-badge.inactive {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

/* Inactive row styling */
.inactive-row {
    opacity: 0.5;
}

/* Edit user modal & deny modal (dark glassmorphism) */
#edit-user-modal,
#deny-reason-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#edit-user-modal .modal-content,
#deny-reason-modal .modal-content {
    background: linear-gradient(145deg, rgba(15, 30, 55, 0.98), rgba(10, 22, 40, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#edit-user-modal .modal-header,
#deny-reason-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#edit-user-modal .modal-header h2,
#deny-reason-modal .modal-header h2 {
    color: #179CD8;
    font-size: 18px;
    margin: 0;
}

#edit-user-modal .close-btn,
#deny-reason-modal .close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
}

#edit-user-modal .close-btn:hover,
#deny-reason-modal .close-btn:hover {
    color: #fff;
}

#edit-user-modal .form-row,
#deny-reason-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

#edit-user-modal .form-group,
#deny-reason-modal .form-group {
    margin-bottom: 10px;
}

#edit-user-modal label,
#deny-reason-modal label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 5px;
}

#edit-user-modal input,
#edit-user-modal select,
#deny-reason-modal input,
#deny-reason-modal select,
#deny-reason-modal textarea {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    box-sizing: border-box;
}

#edit-user-modal input:focus,
#edit-user-modal select:focus,
#deny-reason-modal input:focus,
#deny-reason-modal select:focus,
#deny-reason-modal textarea:focus {
    outline: none;
    border-color: rgba(23, 156, 216, 0.5);
    box-shadow: 0 0 0 2px rgba(23, 156, 216, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #e63946);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* Calendar team filter dropdown */
.calendar-team-filter {
    margin-left: auto;
}

.calendar-team-filter select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.calendar-team-filter select:focus {
    outline: none;
    border-color: rgba(23, 156, 216, 0.5);
}

/* ========================================
   FIX: Dropdown option text in dark theme
   Blanket rule so ALL selects in module-screen
   have readable option text (white on dark bg)
   ======================================== */

#module-screen select option {
    background: #0d1f38;
    color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   INTERCOM — COMPANY SUMMARY VIEW
   ======================================== */

.company-summary-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.company-summary-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
}

.company-summary-row:hover {
    background: rgba(23, 156, 216, 0.08);
    border-color: rgba(23, 156, 216, 0.25);
    transform: translateX(4px);
}

.company-summary-info {
    flex: 1;
    min-width: 0;
}

.company-summary-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-summary-count {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.company-ticket-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 10px;
    background: #179CD8;
    color: white;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
}

.company-ticket-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    white-space: nowrap;
}

.company-summary-arrow {
    color: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: color 0.25s;
}

.company-summary-row:hover .company-summary-arrow {
    color: #179CD8;
}

/* ========================================
   INTERCOM — DRILL-DOWN VIEW
   ======================================== */

.company-drill-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 12px;
}

.company-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
    white-space: nowrap;
}

.company-back-btn:hover {
    background: rgba(23, 156, 216, 0.2);
    border-color: rgba(23, 156, 216, 0.4);
    color: #fff;
}

.company-drill-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.company-drill-title h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-drill-count {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.company-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.company-ticket-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
}

.company-ticket-row:hover {
    background: rgba(23, 156, 216, 0.06);
    border-color: rgba(23, 156, 216, 0.2);
}

.company-ticket-id {
    color: #179CD8;
    font-size: 13px;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    flex-shrink: 0;
    min-width: 90px;
}

.company-ticket-details {
    flex: 1;
    min-width: 0;
}

.company-ticket-subject {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.company-ticket-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

.company-ticket-separator {
    color: rgba(255, 255, 255, 0.15);
}

.company-ticket-priority {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 60px;
    text-align: center;
}

.company-ticket-priority.urgent {
    color: #ff6b6b;
}

.company-ticket-priority.priority {
    color: #f0a050;
}

.company-ticket-priority.normal {
    color: rgba(255, 255, 255, 0.3);
}

.company-ticket-open-icon {
    color: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: color 0.25s;
}

.company-ticket-row:hover .company-ticket-open-icon {
    color: #179CD8;
}

/* ========================================
   OFFICE CHECK-IN BANNER
   ======================================== */

.checkin-banner {
    max-width: 600px;
    width: 100%;
    margin-bottom: 40px;
}

.checkin-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(23, 156, 216, 0.2);
    border-radius: 14px;
    transition: all 0.3s;
}

.checkin-banner-content:hover {
    border-color: rgba(23, 156, 216, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

.checkin-banner-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 156, 216, 0.12);
    border-radius: 10px;
    font-size: 22px;
}

.checkin-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkin-banner-text span:first-child {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 15px;
}

.checkin-sublabel {
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
}

.checkin-btn {
    flex-shrink: 0;
    padding: 10px 24px;
    background: #179CD8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.checkin-btn:hover:not(:disabled) {
    background: #1489BF;
    transform: translateY(-1px);
}

.checkin-btn-done {
    background: #27ae60 !important;
    cursor: default;
}

.checkin-btn-disabled {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.35) !important;
    cursor: default;
}

/* Admin Check-In Summary Cards */
.checkin-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.checkin-summary-card {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkin-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #179CD8;
}

.checkin-summary-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

.checkin-ip-settings {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 24px;
}

.checkin-ip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #179CD8;
}

.checkin-ip-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.checkin-ip-form input:focus {
    outline: none;
    border-color: #179CD8;
}

.office-ip-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.office-ip-row .office-ip-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.office-ip-row .office-ip-input:focus {
    outline: none;
    border-color: #179CD8;
}

.office-ip-row .office-ip-remove {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
}

/* Check-in dates table */
.checkin-dates-table .ip-col {
    white-space: nowrap;
    font-size: 12px;
}

.ip-badge {
    background: rgba(23, 156, 216, 0.15);
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* User My Check-Ins tab */
.my-checkin-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.my-checkin-filters select {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.my-checkin-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.my-checkin-card {
    flex: 1;
    max-width: 250px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.my-checkin-card.accent {
    border-color: rgba(23, 156, 216, 0.3);
    background: rgba(23, 156, 216, 0.08);
}

.my-checkin-value {
    font-size: 28px;
    font-weight: 700;
    color: #179CD8;
}

.my-checkin-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.checkin-dates-table .date-col {
    text-align: center;
    min-width: 38px;
    max-width: 50px;
    font-size: 12px;
    padding: 6px 4px;
}

.checkin-dates-table thead .date-col {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.checkin-dates-table .checked-in {
    color: #10B981;
    font-weight: 700;
}

.checkin-remove-btn {
    display: inline-block;
    cursor: pointer;
    border-radius: 4px;
    padding: 1px 5px;
    transition: background 0.15s, color 0.15s;
}

.checkin-remove-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.checkin-remove-btn:hover::after {
    content: ' ×';
    font-size: 11px;
}

/* Responsive adjustments for company views */
@media (max-width: 768px) {
    .checkin-banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }

    .checkin-banner-content {
        flex-direction: column;
        gap: 8px;
    }

    .checkin-btn, .checkin-btn-done, .checkin-btn-disabled {
        width: 100%;
        justify-content: center;
    }

    .checkin-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .company-drill-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .company-ticket-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .company-ticket-id {
        min-width: auto;
    }

    .company-ticket-meta {
        flex-wrap: wrap;
    }

    .company-ticket-priority {
        min-width: auto;
    }
}

/* ========================================
   SOP WIDGET — CLEANER ICONS (SVG-based)
   ======================================== */

.sop-widget-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 18px;
}

.sop-widget-icon.doc-icon {
    background: rgba(66, 133, 244, 0.15);
    color: #4285F4;
}

.sop-widget-icon.sheet-icon {
    background: rgba(52, 168, 83, 0.15);
    color: #34A853;
}

.sop-widget-icon.slide-icon {
    background: rgba(251, 188, 5, 0.15);
    color: #FBBC05;
}

.sop-widget-icon.pdf-icon {
    background: rgba(234, 67, 53, 0.15);
    color: #EA4335;
}

.sop-widget-icon.folder-icon {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.sop-widget-icon.file-icon {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   FLATPICKR DARK FUTURISTIC THEME
   ========================================== */

.flatpickr-calendar {
    background: #0d1f38 !important;
    border: 1px solid rgba(23, 156, 216, 0.3) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(23, 156, 216, 0.1) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    overflow: hidden;
    width: 320px !important;
}

/* Center the calendar dropdown under its input */
.form-group .flatpickr-calendar {
    left: 50% !important;
    transform: translateX(-50%);
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
    border-bottom-color: #0d1f38 !important;
}

.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after {
    border-top-color: #0d1f38 !important;
}

.flatpickr-months {
    background: rgba(23, 156, 216, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 0;
}

.flatpickr-months .flatpickr-month {
    color: rgba(255, 255, 255, 0.95) !important;
    fill: rgba(255, 255, 255, 0.7) !important;
}

.flatpickr-current-month {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600;
    font-size: 15px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600;
    -webkit-appearance: none;
    appearance: none;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: #0d1f38;
    color: rgba(255, 255, 255, 0.9);
}

.flatpickr-current-month input.cur-year {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: rgba(255, 255, 255, 0.6) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all 0.2s ease;
    border-radius: 8px;
    padding: 6px !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    fill: #179CD8 !important;
    color: #179CD8 !important;
    background: rgba(23, 156, 216, 0.1);
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: inherit !important;
}

span.flatpickr-weekday {
    color: rgba(23, 156, 216, 0.7) !important;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flatpickr-day {
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease !important;
    font-weight: 500;
    flex-basis: 14.2857143% !important;
    max-width: 39px !important;
    height: 39px;
    line-height: 37px;
    box-sizing: border-box !important;
}

.flatpickr-day:hover {
    background: rgba(23, 156, 216, 0.15) !important;
    color: #179CD8 !important;
    border: 1px solid transparent !important;
}

.flatpickr-day.today {
    background: rgba(23, 156, 216, 0.12) !important;
    color: #179CD8 !important;
    border: 1px solid rgba(23, 156, 216, 0.4) !important;
    font-weight: 700;
}

.flatpickr-day.today:hover {
    background: rgba(23, 156, 216, 0.25) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #179CD8 !important;
    color: #ffffff !important;
    border: 1px solid #179CD8 !important;
    box-shadow: 0 4px 12px rgba(23, 156, 216, 0.35) !important;
    font-weight: 700;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #1aadee !important;
}

.flatpickr-day.inRange {
    background: rgba(23, 156, 216, 0.15) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: rgba(255, 255, 255, 0.2) !important;
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: rgba(255, 255, 255, 0.1) !important;
    background: transparent !important;
}

.flatpickr-innerContainer {
    border-bottom: none !important;
}

.flatpickr-rContainer {
    padding: 4px 0 8px;
}

/* Flatpickr alt input styling (the visible input) */
#module-screen .form-group input.flatpickr-input,
#module-screen .form-group input.flatpickr-alt-input,
.form-group input.flatpickr-input + input {
    cursor: pointer !important;
}

.flatpickr-input[readonly] {
    cursor: pointer;
}

/* Animated open effect */
.flatpickr-calendar.open {
    animation: fpFadeIn 0.2s ease-out;
}

@keyframes fpFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   TRAINING MODULE
   ======================================== */

/* Hub Grid - 3 columns */
.hub-grid.hub-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1050px;
    gap: 24px;
}

@media (max-width: 900px) {
    .hub-grid.hub-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 760px;
    }
}

@media (max-width: 600px) {
    .hub-grid.hub-grid-3 {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

/* Quiz Category Groups */
.quiz-category-group {
    margin-bottom: 32px;
}

.quiz-category-title {
    color: #179CD8;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(23, 156, 216, 0.15);
}

/* Quiz Cards Grid */
.quiz-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.quiz-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 24px;
    transition: all 0.3s;
}

.quiz-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(23, 156, 216, 0.25);
    box-shadow: 0 8px 32px rgba(23, 156, 216, 0.08);
    transform: translateY(-2px);
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.quiz-card-header h4 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    margin-right: 12px;
}

.quiz-card-sop {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quiz-card-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 16px;
}

.quiz-card-actions {
    display: flex;
    gap: 10px;
}

.quiz-card-actions .btn {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

/* Best Score Badge */
.quiz-best-score {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.quiz-best-score.passed {
    background: rgba(21, 87, 36, 0.35);
    color: #6fcf7f;
}

.quiz-best-score.attempted {
    background: rgba(133, 100, 4, 0.35);
    color: #f0d060;
}

/* ========================================
   QUIZ OVERLAY (Full-screen quiz modal)
   ======================================== */

.quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 20, 0.92);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: quizFadeIn 0.3s ease-out;
}

@keyframes quizFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.quiz-container {
    background: rgba(15, 25, 50, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(23, 156, 216, 0.2);
    border-radius: 20px;
    padding: 36px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(23, 156, 216, 0.06);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quiz-header h2 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    font-weight: 600;
    flex: 1;
    margin-right: 16px;
}

.quiz-header .close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.quiz-header .close-btn:hover {
    background: rgba(230, 57, 70, 0.25);
    border-color: rgba(230, 57, 70, 0.5);
    color: #ff6b6b;
}

/* Quiz Progress Bar */
.quiz-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #179CD8, #20b2e8);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.quiz-progress-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    margin-bottom: 24px;
}

/* Quiz Question */
.quiz-question {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Quiz Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.quiz-option {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s;
}

.quiz-option:hover {
    background: rgba(23, 156, 216, 0.1);
    border-color: rgba(23, 156, 216, 0.3);
    color: #fff;
}

.quiz-option.selected {
    background: rgba(23, 156, 216, 0.18);
    border-color: #179CD8;
    color: #fff;
    box-shadow: 0 0 16px rgba(23, 156, 216, 0.12);
}

/* Quiz Navigation */
.quiz-nav {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.quiz-nav .btn {
    min-width: 120px;
}

/* ========================================
   QUIZ RESULTS (shown after submit)
   ======================================== */

.quiz-result-score {
    text-align: center;
    font-size: 72px;
    font-weight: 700;
    margin: 24px 0 8px;
}

.quiz-result-score.passed {
    color: #6fcf7f;
    text-shadow: 0 0 40px rgba(111, 207, 127, 0.3);
}

.quiz-result-score.failed {
    color: #f08090;
    text-shadow: 0 0 40px rgba(240, 128, 144, 0.3);
}

.quiz-result-status {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 32px;
}

.quiz-result-status.passed {
    color: #6fcf7f;
}

.quiz-result-status.failed {
    color: #f08090;
}

/* Quiz Review (question-by-question breakdown) */
.quiz-review-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
}

.quiz-review-item.correct {
    border-left: 3px solid #6fcf7f;
}

.quiz-review-item.incorrect {
    border-left: 3px solid #f08090;
}

.quiz-review-q {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.quiz-review-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-review-opt {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.quiz-review-opt.correct-answer {
    background: rgba(21, 87, 36, 0.3);
    border-color: rgba(111, 207, 127, 0.3);
    color: #6fcf7f;
}

.quiz-review-opt.wrong-answer {
    background: rgba(114, 28, 36, 0.3);
    border-color: rgba(240, 128, 144, 0.3);
    color: #f08090;
}

/* ========================================
   QUIZ BUILDER (Admin panel)
   ======================================== */

.quiz-builder-question {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.quiz-builder-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quiz-builder-q-header strong {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.quiz-builder-question textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 12px;
    font-family: inherit;
}

.quiz-builder-question textarea:focus {
    outline: none;
    border-color: #179CD8;
    box-shadow: 0 0 0 2px rgba(23, 156, 216, 0.15);
}

.quiz-builder-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-builder-opt {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-builder-opt input[type="text"] {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.quiz-builder-opt input[type="text"]:focus {
    outline: none;
    border-color: #179CD8;
    box-shadow: 0 0 0 2px rgba(23, 156, 216, 0.15);
}

.quiz-builder-opt input[type="radio"] {
    accent-color: #179CD8;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.quiz-builder-opt label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

/* ========================================
   GENERATING SPINNER (AI loading)
   ======================================== */

.generating-spinner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    margin-top: 16px;
    background: rgba(23, 156, 216, 0.06);
    border: 1px solid rgba(23, 156, 216, 0.15);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(23, 156, 216, 0.2);
    border-top-color: #179CD8;
    border-radius: 50%;
    animation: spinRotate 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* Source Toggle (SOP / Knowledge Base) */
.source-toggle {
    display: flex;
    gap: 20px;
    margin-top: 6px;
}

.source-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 14px;
}

.source-radio input[type="radio"] {
    accent-color: #179CD8;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Brainstorm Quick Link Card */
.training-quick-links {
    margin-bottom: 24px;
}

.training-link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
    cursor: pointer;
}

.training-link-card:hover {
    background: rgba(23, 156, 216, 0.12);
    border-color: rgba(23, 156, 216, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(23, 156, 216, 0.15);
}

.training-link-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(23, 156, 216, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #179CD8;
}

.training-link-info {
    flex: 1;
}

.training-link-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.training-link-info p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.training-link-arrow {
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: color 0.3s;
}

.training-link-card:hover .training-link-arrow {
    color: #179CD8;
}

/* Banner Notifications */
.banner-notification {
    margin-bottom: 20px;
}

.banner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
}

.banner-item:last-child {
    margin-bottom: 0;
}

.banner-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
}

/* Banner types */
.banner-info {
    background: rgba(23, 156, 216, 0.15);
    border: 1px solid rgba(23, 156, 216, 0.3);
}

.banner-info .banner-icon {
    background: rgba(23, 156, 216, 0.3);
    color: #179CD8;
}

.banner-warning {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.banner-warning .banner-icon {
    background: rgba(243, 156, 18, 0.3);
    color: #f39c12;
}

.banner-success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.banner-success .banner-icon {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.banner-urgent {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.banner-urgent .banner-icon {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* Banner type badge in admin table */
.banner-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.banner-type-badge.banner-info {
    background: rgba(23, 156, 216, 0.2);
    color: #179CD8;
}

.banner-type-badge.banner-warning {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.banner-type-badge.banner-success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.banner-type-badge.banner-urgent {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* ========================================
   MULTI-SELECT CHECKBOX LISTS
   ======================================== */

.multi-select-search-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(10, 22, 40, 0.8);
    border: 1px solid rgba(23, 156, 216, 0.3);
    border-radius: 6px 6px 0 0;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.multi-select-search-input:focus {
    border-color: #179CD8;
}

.multi-select-search-input::placeholder {
    color: #556;
}

.multi-select-list {
    max-height: 240px;
    overflow-y: auto;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(23, 156, 216, 0.2);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 4px 0;
}

.multi-select-list::-webkit-scrollbar {
    width: 6px;
}

.multi-select-list::-webkit-scrollbar-track {
    background: rgba(10, 22, 40, 0.4);
}

.multi-select-list::-webkit-scrollbar-thumb {
    background: rgba(23, 156, 216, 0.4);
    border-radius: 3px;
}

.multi-select-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #179CD8;
    padding: 8px 12px 4px;
    border-top: 1px solid rgba(23, 156, 216, 0.1);
}

.multi-select-group-label:first-child {
    border-top: none;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.multi-select-item:hover {
    background: rgba(23, 156, 216, 0.1);
}

.multi-select-item input[type="checkbox"] {
    accent-color: #179CD8;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.multi-select-item label {
    font-size: 13px;
    color: #c0c8d8;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-select-item:has(input:checked) label {
    color: #fff;
}

.multi-select-empty {
    padding: 16px 12px;
    text-align: center;
    color: #556;
    font-size: 13px;
    font-style: italic;
}

.source-count {
    font-size: 12px;
    color: #179CD8;
    font-weight: 600;
    margin-left: 4px;
}

/* ========================================
   QUIZ DUE DATE BADGES
   ======================================== */

.quiz-card-due-row {
    margin-bottom: 6px;
}

.quiz-card-due {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(23, 156, 216, 0.15);
    color: #7eb8d8;
    letter-spacing: 0.3px;
}

.quiz-card-due.due-soon {
    background: rgba(255, 165, 0, 0.15);
    color: #ffb347;
}

.quiz-card-due.due-today {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    animation: pulse-due 2s infinite;
}

.quiz-card-due.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

@keyframes pulse-due {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   REVIEW SOURCES MODAL
   ======================================== */

.sources-list {
    padding: 8px 20px 20px;
}

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

.sources-link-list li {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sources-link-list li:last-child {
    border-bottom: none;
}

.sources-link-list a {
    color: #179CD8;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    display: block;
    word-break: break-word;
}

.sources-link-list a:hover {
    color: #3ab8f0;
    text-decoration: underline;
}

.source-no-link {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* ========================================
   SF ACCOUNT HEALTH REPORT
   ======================================== */

.sf-report-loading,
.sf-report-error,
.sf-report-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
}

.sf-report-error {
    color: #ff4757;
}

.sf-report-meta {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 12px;
    text-align: right;
}

.sf-report-table-wrap {
    overflow-x: auto;
    max-height: 65vh;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sf-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.sf-report-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.sf-report-table th {
    background: rgba(23, 156, 216, 0.2);
    color: #179CD8;
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(23, 156, 216, 0.3);
    white-space: nowrap;
}

.sf-report-table td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    color: #1a1a2e;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-report-table tr:hover td {
    background: rgba(23, 156, 216, 0.06);
}

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

.sf-report-link {
    color: #179CD8;
    text-decoration: none;
    font-size: 12px;
}

.sf-report-link:hover {
    text-decoration: underline;
}

/* ========================================
   TRAINING RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .hub-grid.hub-grid-3 {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .quiz-cards-grid {
        grid-template-columns: 1fr;
    }

    .quiz-container {
        padding: 24px;
        border-radius: 16px;
    }

    .quiz-question {
        font-size: 16px;
    }

    .quiz-result-score {
        font-size: 56px;
    }

    .quiz-nav {
        flex-direction: column;
    }

    .quiz-nav .btn {
        width: 100%;
    }
}

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

/* Hamburger menu button — hidden on desktop */
.topbar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.topbar-hamburger:active {
    background: rgba(23, 156, 216, 0.25);
}

/* Mobile dropdown menu — hidden by default */
.topbar-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(23, 156, 216, 0.2);
    flex-direction: column;
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.topbar-mobile-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 48px;
    width: 100%;
}

.topbar-mobile-menu button:active {
    background: rgba(23, 156, 216, 0.15);
}

.topbar-mobile-menu button:last-child {
    border-bottom: none;
    color: #e74c3c;
}

/* Table scroll wrapper for mobile */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.table-scroll-wrapper table {
    min-width: 600px;
}

/* ==========================================
   MOBILE BREAKPOINT (600px)
   ========================================== */

@media (max-width: 600px) {
    /* --- Hamburger menu --- */
    .topbar-hamburger {
        display: flex;
    }

    .topbar-settings-btn,
    .topbar-logout-btn {
        display: none !important;
    }

    .topbar-username {
        display: none;
    }

    .hub-topbar.menu-open .topbar-mobile-menu,
    .module-topbar.menu-open .topbar-mobile-menu {
        display: flex;
    }

    /* --- Topbar compact --- */
    .hub-topbar,
    .module-topbar {
        padding: 10px 16px;
    }

    .topbar-back-btn {
        padding: 6px 12px;
        font-size: 13px;
        gap: 6px;
    }

    .topbar-back-btn svg {
        width: 16px;
        height: 16px;
    }

    .topbar-avatar {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .topbar-logo {
        height: 28px;
    }

    .module-topbar-left,
    .hub-topbar-left {
        gap: 12px;
    }

    .module-topbar-right,
    .hub-topbar-right {
        gap: 10px;
    }

    /* --- Login screen --- */
    .login-container {
        padding: 32px 24px;
        margin: 0 16px;
        max-width: none;
        border-radius: 16px;
    }

    .login-header img {
        max-width: 160px;
    }

    .login-header h1 {
        font-size: 18px;
    }

    .google-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 48px;
    }

    /* --- Module content --- */
    .module-content {
        padding: 16px;
    }

    /* --- Modals nearly full-screen --- */
    .modal-content {
        width: 94% !important;
        max-width: none !important;
        max-height: 90vh;
        padding: 20px;
        border-radius: 12px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .close-btn {
        font-size: 32px;
        padding: 0 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* --- Tabs scrollable --- */
    .tabs {
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn,
    #module-screen .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* --- Section headings --- */
    .section-title {
        font-size: 18px;
    }

    #module-screen h2 {
        font-size: 20px;
    }

    #module-screen h3 {
        font-size: 16px;
    }

    /* --- Balance cards --- */
    .balance-card {
        padding: 16px;
    }

    .balance-display {
        font-size: 32px;
    }

    /* --- Forms --- */
    .request-form-container {
        padding: 20px;
    }

    .form-group label {
        font-size: 13px;
    }

    /* --- Prevent iOS zoom on input focus --- */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* --- Touch targets (min 44px) --- */
    .btn,
    .action-btn,
    .topbar-back-btn {
        min-height: 44px;
    }

    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        min-height: 44px;
    }

    /* --- Tables --- */
    table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: 10px 12px;
    }

    #module-screen table th {
        padding: 10px 12px;
    }

    .table-scroll-wrapper table {
        min-width: 560px;
    }

    /* --- Action buttons compact --- */
    .action-cell {
        gap: 4px;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 36px;
    }

    /* --- Quiz cards --- */
    .quiz-card {
        padding: 16px;
    }

    .quiz-card h3 {
        font-size: 15px;
    }

    /* --- Quiz overlay --- */
    .quiz-overlay {
        padding: 12px;
    }

    .quiz-container {
        padding: 20px;
        max-width: 100%;
        border-radius: 12px;
    }

    .quiz-question {
        font-size: 15px;
    }

    .quiz-option {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
    }

    .quiz-option label {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    /* --- Multi-select lists --- */
    .multi-select-list {
        max-height: 200px;
    }

    .multi-select-item {
        min-height: 44px;
    }

    .multi-select-item label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* --- Tool cards --- */
    .tool-card {
        padding: 16px;
    }

    .tool-card h3 {
        font-size: 14px;
    }

    .tool-card p {
        font-size: 12px;
        display: none;
    }

    .tool-icon {
        font-size: 24px;
    }

    /* --- Training quick links --- */
    .training-link-card {
        padding: 14px;
    }

    /* --- SOP browser --- */
    .sop-search-input {
        font-size: 16px;
    }

    /* --- Banner notifications --- */
    .banner-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* --- Admin filter bar --- */
    .admin-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .admin-filter-bar select {
        width: 100%;
    }

    /* --- Hub screen --- */
    .hub-container {
        padding: 20px 16px;
    }

    .hub-hero {
        margin-bottom: 24px;
    }

    .hub-title {
        font-size: 24px;
    }

    .hub-subtitle {
        font-size: 14px;
    }

    .hub-card {
        padding: 28px 20px;
    }

    .hub-card-title {
        font-size: 17px;
    }

    .hub-card-description {
        font-size: 13px;
    }

    /* --- Calendar --- */
    .calendar-grid-view {
        padding: 12px;
    }

    /* --- KIPU checker --- */
    .kipu-form {
        flex-direction: column;
    }

    .kipu-form input,
    .kipu-form button {
        width: 100%;
    }
}

/* ==========================================
   EXTRA SMALL DEVICES (380px)
   ========================================== */

@media (max-width: 380px) {
    .hub-title {
        font-size: 20px;
    }

    .hub-card {
        padding: 24px 16px;
    }

    .hub-card-title {
        font-size: 15px;
    }

    .login-container {
        padding: 24px 16px;
    }

    .module-content {
        padding: 12px;
    }

    .tab-btn,
    #module-screen .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .topbar-back-btn span,
    .topbar-back-btn {
        font-size: 12px;
    }
}

/* ==========================================
   PERMISSION GRID (Roles & Teams tab)
   ========================================== */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.permission-category {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 14px;
}

/* ==========================================
   HUB GRID — 4 COLUMNS (dept hub)
   ========================================== */

.hub-grid.hub-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1300px;
    gap: 24px;
}

@media (max-width: 1100px) {
    .hub-grid.hub-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 760px;
    }
}

@media (max-width: 600px) {
    .hub-grid.hub-grid-4 {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

/* ==========================================
   CROSS-DEPT SOP SEARCH BAR
   ========================================== */

.sop-search-bar {
    margin-bottom: 20px;
}

.sop-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(23, 156, 216, 0.3);
    border-radius: 10px;
    padding: 0 16px 0 14px;
    transition: border-color 0.2s;
}

.sop-search-input-wrap:focus-within {
    border-color: rgba(23, 156, 216, 0.7);
    background: rgba(255, 255, 255, 0.07);
}

.sop-search-icon {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    margin-right: 10px;
}

.sop-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    padding: 13px 0;
    font-family: inherit;
}

.sop-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.sop-search-btn {
    background: rgba(23, 156, 216, 0.2);
    border: 1px solid rgba(23, 156, 216, 0.4);
    border-radius: 6px;
    color: #179CD8;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.sop-search-btn:hover {
    background: rgba(23, 156, 216, 0.35);
    border-color: #179CD8;
}

.sop-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.sop-source-badge {
    color: #179CD8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   SOP SEARCH — CONVERSATIONAL THREAD
   ========================================== */

.sop-convo-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.sop-convo-user {
    align-self: flex-end;
    background: rgba(23, 156, 216, 0.18);
    border: 1px solid rgba(23, 156, 216, 0.3);
    border-radius: 14px 14px 3px 14px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    max-width: 72%;
    padding: 10px 14px;
}

.sop-convo-assistant {
    align-self: flex-start;
    max-width: 86%;
}

.sop-convo-assistant-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px 14px 14px 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.5;
    padding: 10px 14px;
}

.sop-convo-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding-left: 4px;
}

.sop-convo-chip {
    background: rgba(23, 156, 216, 0.1);
    border: 1px solid rgba(23, 156, 216, 0.35);
    border-radius: 20px;
    color: #179CD8;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    transition: all 0.18s;
    font-family: inherit;
}

.sop-convo-chip:hover {
    background: rgba(23, 156, 216, 0.25);
    border-color: #179CD8;
    color: #fff;
}

/* Thinking animation (3 bouncing dots) */
.sop-convo-thinking {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px 14px 14px 14px;
}

.sop-convo-thinking span {
    width: 7px;
    height: 7px;
    background: rgba(23, 156, 216, 0.7);
    border-radius: 50%;
    display: inline-block;
    animation: sopThinkBounce 1.1s infinite ease-in-out;
}

.sop-convo-thinking span:nth-child(2) { animation-delay: 0.18s; }
.sop-convo-thinking span:nth-child(3) { animation-delay: 0.36s; }

@keyframes sopThinkBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%            { transform: translateY(-6px); opacity: 1; }
}

.sop-search-result-grid {
    margin-top: 4px;
}

/* ==========================================
   SOP READER OVERLAY
   ========================================== */

#sop-reader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #0a1628;
    z-index: 500;
    flex-direction: column;
    overflow: hidden;
}

.sop-reader-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(23, 156, 216, 0.15);
    flex-shrink: 0;
}

.sop-reader-back-btn {
    flex-shrink: 0;
}

.sop-reader-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sop-reader-drive-link {
    color: rgba(23, 156, 216, 0.8);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s;
}

.sop-reader-drive-link:hover {
    color: #179CD8;
    text-decoration: underline;
}

.sop-reader-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
}

.sop-reader-rich {
    max-width: 960px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.85);
}
.sop-reader-rich > * { max-width: 100%; }
.sop-reader-rich h1,
.sop-reader-rich h2,
.sop-reader-rich h3,
.sop-reader-rich h4 {
    color: rgba(255, 255, 255, 0.95);
    margin: 20px 0 8px;
    font-weight: 700;
}
.sop-reader-rich p {
    color: rgba(255, 255, 255, 0.82);
    margin: 6px 0 10px;
}
.sop-reader-rich a { color: #179CD8; text-decoration: none; }
.sop-reader-rich a:hover { text-decoration: underline; }
.sop-reader-rich ul,
.sop-reader-rich ol {
    color: rgba(255, 255, 255, 0.82);
    padding-left: 24px;
    margin: 8px 0;
}
.sop-reader-rich li { margin: 4px 0; }
.sop-reader-rich table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13px;
}
.sop-reader-rich th {
    background: #1a2f5e;
    color: #fff;
    padding: 9px 12px;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.12);
    font-weight: 600;
}
.sop-reader-rich td {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.82);
    vertical-align: top;
    background: rgba(255,255,255,0.02);
}
.sop-reader-rich tr:nth-child(even) td {
    background: rgba(255,255,255,0.05);
}
/* Force Google Docs inline font/size overrides to inherit */
.sop-reader-rich span { font-size: inherit !important; font-family: inherit !important; }

/* SOP AI Formatting Loader */
.sop-format-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 80px 40px;
    max-width: 480px;
    margin: 0 auto;
}
.sop-format-loader-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1a2f5e, #179CD8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(23,156,216,0.3);
    animation: sop-loader-pulse 2s ease-in-out infinite;
}
@keyframes sop-loader-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(23,156,216,0.2); transform: scale(1); }
    50%       { box-shadow: 0 0 40px rgba(23,156,216,0.5); transform: scale(1.05); }
}
.sop-format-loader-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin: 0 0 6px;
    text-align: center;
}
.sop-format-loader-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin: 0;
    text-align: center;
}
.sop-format-loader-bar {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}
.sop-format-loader-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #179CD8, #4fc3f7);
    border-radius: 99px;
    animation: sop-bar-sweep 2.4s ease-in-out infinite;
}
@keyframes sop-bar-sweep {
    0%   { width: 0%;  margin-left: 0%; }
    40%  { width: 60%; margin-left: 0%; }
    60%  { width: 60%; margin-left: 40%; }
    100% { width: 0%;  margin-left: 100%; }
}
.sop-format-loader-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.sop-format-loader-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    transition: color 0.5s;
}
.sop-format-loader-step.active { color: rgba(255,255,255,0.85); }
.sop-format-loader-step.done   { color: #179CD8; }
.sop-format-step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.sop-reader-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 900px;
    margin: 0 auto;
}

.sop-reader-iframe {
    width: 100%;
    height: calc(100vh - 80px);
    border: none;
    border-radius: 8px;
}

/* ==========================================
   CE DRIVE — CATEGORIZED SECTIONS
   ========================================== */

.sop-category-section {
    margin-bottom: 32px;
}

.sop-category-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(23, 156, 216, 0.8);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(23, 156, 216, 0.15);
}

.sop-widgets-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

/* Mobile: SOP reader */
@media (max-width: 600px) {
    .sop-reader-content {
        padding: 16px;
    }

    .sop-reader-text {
        padding: 16px;
        font-size: 13px;
    }

    .sop-reader-title {
        font-size: 15px;
    }
}

.permission-category h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #179CD8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permission-checkbox {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
}

.permission-checkbox:last-child {
    border-bottom: none;
}

.permission-checkbox input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #179CD8;
    float: left;
    margin-top: 2px;
}

.permission-checkbox .perm-label {
    font-size: 13px;
    color: #e1e8f0;
    margin-left: 24px;
    display: block;
    margin-top: -18px;
}

.permission-checkbox .perm-desc {
    font-size: 11px;
    color: #6b7f95;
    margin-left: 24px;
    margin-top: 2px;
}

/* ==========================================
   CUSTOMER EXPERIENCE MODULE
   ========================================== */

/* ============================================================
   CRM IMPORTER MODULE
   ============================================================ */

#crm-importer-module { max-width: 1100px; margin: 0 auto; }
#crm-importer-module > h2 { color: #fff; font-size: 1.6rem; margin-bottom: 18px; }

.crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 700px) {
    .crm-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.crm-stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 18px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}
.crm-stat-number { font-size: 1.8rem; font-weight: 700; color: #fff; line-height: 1.2; }
.crm-stat-card-label { font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.crm-stat-active   { border-color: rgba(99,179,237,0.4); }
.crm-stat-active   .crm-stat-number { color: #63b3ed; }
.crm-stat-running  { border-color: rgba(255,183,77,0.4); }
.crm-stat-running  .crm-stat-number { color: #ffb74d; }
.crm-stat-success  { border-color: rgba(72,187,120,0.4); }
.crm-stat-success  .crm-stat-number { color: #48bb78; }
.crm-stat-failed   { border-color: rgba(252,129,129,0.4); }
.crm-stat-failed   .crm-stat-number { color: #fc8181; }

.crm-list-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.crm-list-header h3 { color: rgba(255,255,255,0.9); font-size: 1.05rem; }

.crm-job-list { display: flex; flex-direction: column; gap: 0; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden; }
.crm-job-row { display: grid; grid-template-columns: 1.2fr 0.9fr 0.7fr 1.2fr 1.1fr 1.4fr 1.4fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); align-items: center; font-size: 13px; }
.crm-job-row:last-child { border-bottom: none; }
.crm-job-row:hover:not(.crm-job-header) { background: rgba(255,255,255,0.03); }
.crm-job-header { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.03); }
.crm-job-cell { color: rgba(255,255,255,0.75); overflow: hidden; text-overflow: ellipsis; }
.crm-job-customer { font-weight: 600; color: rgba(255,255,255,0.9); }
.crm-job-meta { font-size: 12px; color: rgba(255,255,255,0.45); }
.crm-job-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.crm-counts { font-size: 12px; color: rgba(255,255,255,0.6); white-space: nowrap; }

.crm-status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.crm-status-draft { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }
.crm-status-analyzing { background: rgba(99,179,237,0.15); color: #63b3ed; }
.crm-status-awaiting_plan_review { background: rgba(246,173,85,0.18); color: #f6ad55; }
.crm-status-plan_approved { background: rgba(72,187,120,0.18); color: #48bb78; }
.crm-status-ready_to_run { background: rgba(72,187,120,0.18); color: #48bb78; }
.crm-status-running { background: rgba(99,179,237,0.18); color: #63b3ed; }
.crm-status-completed { background: rgba(72,187,120,0.18); color: #48bb78; }
.crm-status-completed_with_errors { background: rgba(246,173,85,0.18); color: #f6ad55; }
.crm-status-failed { background: rgba(245,101,101,0.2); color: #fc8181; }
.crm-status-cancelled { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

.crm-row-btn { font-size: 12px; padding: 4px 10px; border-radius: 6px; background: rgba(99,179,237,0.15); color: #63b3ed; border: 1px solid rgba(99,179,237,0.3); cursor: pointer; text-decoration: none; display: inline-block; }
.crm-row-btn:hover { background: rgba(99,179,237,0.25); }
.crm-row-btn-warn { background: rgba(246,173,85,0.15); color: #f6ad55; border-color: rgba(246,173,85,0.3); }
.crm-row-btn-danger { background: rgba(245,101,101,0.15); color: #fc8181; border-color: rgba(245,101,101,0.3); }

/* ─── Wizard ─────────────────────────────────────────── */
.crm-wizard-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.crm-wizard-progress { font-size: 13px; color: rgba(255,255,255,0.5); }

.crm-step h3 { font-size: 18px; color: rgba(255,255,255,0.9); margin-bottom: 8px; }
.crm-step h4 { font-size: 14px; color: rgba(255,255,255,0.7); margin: 24px 0 10px; font-weight: 600; }
.crm-step-desc { font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.6; margin-bottom: 24px; }
.crm-hint { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 6px; }

.crm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.crm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crm-field-wide { grid-column: 1 / -1; }
.crm-field-label { font-size: 0.78rem; color: rgba(255,255,255,0.7); font-weight: 500; letter-spacing: 0.02em; }
.crm-field-optional { font-size: 0.72rem; color: rgba(255,255,255,0.4); font-weight: 400; }
.crm-required { color: #fc8181; }
.crm-field input,
.crm-field select {
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.95);
    font-size: 0.88rem;
    transition: border-color 0.15s, background 0.15s;
}
.crm-field input:focus,
.crm-field select:focus {
    outline: none;
    border-color: rgba(99,179,237,0.7);
    background: rgba(99,179,237,0.06);
}

/* ─── Instance URL (prefix/input/suffix) ─── */
.crm-url-input {
    display: flex;
    align-items: stretch;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}
.crm-url-input:focus-within {
    border-color: rgba(99,179,237,0.7);
    background: rgba(99,179,237,0.04);
}
.crm-url-input .crm-url-prefix,
.crm-url-input .crm-url-suffix {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
    padding: 9px 12px;
    font-size: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    display: flex;
    align-items: center;
    user-select: none;
}
.crm-url-input input {
    flex: 1;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 9px 8px !important;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88rem;
    outline: none;
    min-width: 0;
}

/* ─── Searchable select ─── */
.crm-select { position: relative; min-width: 0; }
.crm-select-trigger {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.92);
    padding: 7px 10px 7px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s;
    min-width: 0;
}
.crm-select-trigger:hover { background: rgba(255,255,255,0.08); }
.crm-select-trigger.is-open { border-color: rgba(99,179,237,0.7); background: rgba(99,179,237,0.08); }
.crm-select-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crm-select-display.is-empty { color: rgba(255,255,255,0.35); font-style: italic; }
.crm-select-caret { font-size: 0.6rem; color: rgba(255,255,255,0.4); flex-shrink: 0; }
.crm-select-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    background: #1a2434;
    border: 1px solid rgba(99,179,237,0.4);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 320px;
    min-width: 240px;
}
.crm-select-popover[hidden] { display: none !important; }
.crm-select-search {
    background: rgba(255,255,255,0.05);
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    padding: 10px 14px;
    font-size: 0.82rem;
    outline: none;
}
.crm-select-options {
    overflow-y: auto;
    max-height: 280px;
    padding: 4px 0;
}
.crm-select-option {
    padding: 7px 14px;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.crm-select-option:hover,
.crm-select-option.is-active {
    background: rgba(99,179,237,0.18);
    color: #fff;
}
.crm-select-option.is-selected {
    color: #63b3ed;
    font-weight: 500;
}
.crm-select-option.is-empty-result {
    color: rgba(255,255,255,0.4);
    font-style: italic;
    cursor: default;
    text-align: center;
    padding: 14px;
}
.crm-select-option.is-empty-result:hover { background: transparent; }

.crm-step-actions { margin-top: 24px; text-align: center; }

/* ─── Upload zone ─── */
.crm-upload-zone {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.03);
}
.crm-upload-zone:hover { border-color: rgba(99,179,237,0.6); background: rgba(99,179,237,0.06); }
.crm-upload-zone.crm-drag-over { border-color: #63b3ed; background: rgba(99,179,237,0.12); }
.crm-upload-zone.crm-upload-zone-loaded { border-color: rgba(72,187,120,0.6); background: rgba(72,187,120,0.06); }
.crm-upload-icon { font-size: 36px; margin-bottom: 10px; }
.crm-upload-label { font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.9); margin-bottom: 6px; }
.crm-upload-hint { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 8px; }
.crm-upload-filename { font-size: 13px; color: #48bb78; font-weight: 600; min-height: 18px; margin-top: 8px; }

/* ─── Plan review ─── */
.crm-plan-summary {
    background: rgba(99,179,237,0.06);
    border: 1px solid rgba(99,179,237,0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.crm-summary-line { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.crm-summary-line strong { color: rgba(255,255,255,0.9); margin-right: 6px; }
.crm-summary-text { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.6; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(99,179,237,0.15); }

.crm-plan-section { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; margin-bottom: 12px; }
.crm-plan-section > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: rgba(255,255,255,0.85); display: flex; align-items: center; gap: 10px; }
.crm-plan-section > summary::-webkit-details-marker { display: none; }
.crm-plan-section > summary::before { content: '▶'; font-size: 10px; color: rgba(255,255,255,0.4); transition: transform 0.2s; }
.crm-plan-section[open] > summary::before { transform: rotate(90deg); }
.crm-plan-section[open] > summary { border-bottom: 1px solid rgba(255,255,255,0.06); }
.crm-plan-section > div { padding: 16px 20px; }
.crm-section-title { flex: 1; }
.crm-section-count { background: rgba(255,255,255,0.06); padding: 2px 10px; border-radius: 10px; font-size: 12px; color: rgba(255,255,255,0.6); font-weight: 500; }

.crm-empty-section { font-size: 13px; color: rgba(255,255,255,0.4); padding: 8px 0; }

/* ─── Multi-file upload list ─── */
.crm-uploaded-files { margin-top: 16px; }
.crm-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.crm-file-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}
.crm-file-list-name { flex: 1; color: rgba(255,255,255,0.9); font-size: 0.9rem; }
.crm-file-list-meta { color: rgba(255,255,255,0.5); font-size: 0.8rem; }

/* ─── Detection review grid ─── */
.crm-detection-grid { display: flex; flex-direction: column; gap: 12px; }
.crm-detection-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 18px;
}
.crm-detection-card.is-ignored { opacity: 0.45; }
.crm-detection-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
}
@media (max-width: 800px) {
    .crm-detection-row { grid-template-columns: 1fr; }
}
.crm-detection-filename { font-size: 0.95rem; color: #fff; margin-bottom: 4px; }
.crm-detection-meta { font-size: 0.82rem; color: rgba(255,255,255,0.65); }
.crm-detection-reason { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-top: 4px; font-style: italic; }
.crm-detection-actions { margin-top: 10px; }

.crm-chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.crm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    background: rgba(99,179,237,0.15);
    color: #63b3ed;
    border: 1px solid rgba(99,179,237,0.3);
    border-radius: 14px;
    font-size: 0.82rem;
}
.crm-chip-remove {
    background: none;
    border: 0;
    color: rgba(99,179,237,0.8);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.crm-chip-remove:hover { color: #fff; }
.crm-chip-add {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px dashed rgba(255,255,255,0.25);
    border-radius: 14px;
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    cursor: pointer;
}
.crm-chip-add:hover { background: rgba(255,255,255,0.05); color: #fff; }
.crm-detection-add-inline {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(99,179,237,0.06);
    border: 1px solid rgba(99,179,237,0.2);
    border-radius: 8px;
}
.crm-detection-add-inline .crm-select { flex: 1; min-width: 0; }
.crm-btn-secondary {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    color: rgba(255,255,255,0.8) !important;
}

/* ─── Per-pass progress rows (bundle mode Running screen) ─── */
.crm-pass-list { display: flex; flex-direction: column; gap: 10px; }
.crm-pass-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 10px 14px;
}
.crm-pass-row-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
}
.crm-pass-num { color: rgba(255,255,255,0.4); font-family: ui-monospace, monospace; font-size: 0.78rem; }
.crm-pass-file { color: rgba(255,255,255,0.9); }
.crm-pass-arrow { color: rgba(255,255,255,0.35); }
.crm-pass-entity { color: #63b3ed; }
.crm-pass-status {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.crm-pass-status-queued    { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
.crm-pass-status-running   { background: rgba(255,183,77,0.18); color: #ffb74d; }
.crm-pass-status-completed { background: rgba(72,187,120,0.18); color: #48bb78; }
.crm-pass-status-failed    { background: rgba(252,129,129,0.18); color: #fc8181; }
.crm-pass-status-cancelled { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.crm-pass-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.crm-pass-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #63b3ed, #48bb78);
    transition: width 0.3s ease;
}
.crm-pass-stats {
    margin-top: 6px;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.55);
}

/* ─── Sub-plan tab strip (bundle mode plan review) ─── */
.crm-subplan-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.crm-subplan-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.78);
    border-radius: 8px;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s;
}
.crm-subplan-tab:hover { background: rgba(255,255,255,0.08); color: #fff; }
.crm-subplan-tab.is-active {
    background: rgba(99,179,237,0.18);
    border-color: rgba(99,179,237,0.5);
    color: #fff;
}
.crm-subplan-tab.has-uncert {
    border-color: rgba(255,183,77,0.35);
}
.crm-subplan-tab-file { font-weight: 500; }
.crm-subplan-tab-arrow { color: rgba(255,255,255,0.4); }
.crm-subplan-tab-entity { color: #63b3ed; }
.crm-subplan-tab.is-active .crm-subplan-tab-entity { color: #fff; }

/* ─── Lookup cards ─── */
.crm-lookup-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(99,179,237,0.18);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.crm-lookup-card-header { font-size: 0.95rem; color: rgba(255,255,255,0.92); margin-bottom: 10px; }
.crm-lookup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 700px) {
    .crm-lookup-grid { grid-template-columns: 1fr; }
}
.crm-lookup-matchkey {
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.95);
    font-size: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.crm-lookup-typemap {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255,255,255,0.08);
}

.crm-uncert-card { background: rgba(246,173,85,0.05); border: 1px solid rgba(246,173,85,0.2); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.crm-uncert-header { font-size: 12px; color: rgba(246,173,85,0.85); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.crm-uncert-body { font-size: 13px; color: rgba(255,255,255,0.75); margin-bottom: 10px; line-height: 1.5; }
.crm-uncert-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crm-uncert-form select, .crm-uncert-form input { padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); font-size: 12px; flex: 1; min-width: 180px; }
.crm-uncert-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12px; flex-basis: 100%; }
.crm-uncert-row code { background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 4px; }
.crm-uncert-choice { display: flex; gap: 8px; align-items: center; flex-basis: 100%; }

.crm-table { display: flex; flex-direction: column; gap: 4px; }
.crm-table-row { display: grid; grid-template-columns: 50px 1fr 2fr; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.crm-table-key { color: rgba(255,255,255,0.85); font-weight: 500; }
.crm-table-val { color: rgba(255,255,255,0.6); }

.crm-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; text-align: center; }
.crm-pill-ok { background: rgba(72,187,120,0.18); color: #48bb78; }
.crm-pill-warn { background: rgba(246,173,85,0.18); color: #f6ad55; }
.crm-pill-bad { background: rgba(245,101,101,0.2); color: #fc8181; }

.crm-subsection { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; margin-bottom: 8px; }
.crm-subsection > summary { cursor: pointer; padding: 8px 12px; font-size: 13px; color: rgba(255,255,255,0.75); }
.crm-subsection > div, .crm-subsection > pre { padding: 0 12px 12px; }
.crm-rule-json { background: rgba(0,0,0,0.3); border-radius: 6px; padding: 12px; font-size: 11px; color: rgba(255,255,255,0.7); overflow-x: auto; white-space: pre; }

.crm-warn { background: rgba(246,173,85,0.1); color: #f6ad55; padding: 6px 10px; border-radius: 6px; font-size: 12px; margin-top: 8px; }
.crm-error { background: rgba(245,101,101,0.1); color: #fc8181; padding: 12px 16px; border-radius: 8px; font-size: 13px; }

/* ─── Mode picker ─── */
.crm-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.crm-mode-option { display: block; cursor: pointer; padding: 18px 20px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.08); transition: all 0.2s; }
.crm-mode-option:has(input:checked) { border-color: rgba(99,179,237,0.6); background: rgba(99,179,237,0.06); }
.crm-mode-option input { margin-right: 8px; }
.crm-mode-label { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.9); margin-bottom: 6px; }
.crm-mode-desc { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* ─── Progress ─── */
.crm-progress-bar { height: 12px; background: rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; margin: 20px 0; }
.crm-progress-fill { height: 100%; background: linear-gradient(90deg, #48bb78, #38a169); transition: width 0.5s ease; }
.crm-progress-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.crm-stat { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px 14px; font-size: 13px; color: rgba(255,255,255,0.7); }
.crm-stat strong { color: #63b3ed; font-size: 16px; margin-right: 4px; }
.crm-progress-tail { margin-top: 18px; }

.crm-loading-spinner {
    margin: 30px auto;
    width: 40px; height: 40px;
    border: 3px solid rgba(99,179,237,0.2);
    border-top-color: #63b3ed;
    border-radius: 50%;
    animation: crmSpin 1s linear infinite;
}
@keyframes crmSpin { to { transform: rotate(360deg); } }

.action-btn-success {
    background: linear-gradient(135deg, #38a169, #276749) !important;
}

/* ==========================================
   KB GAP ASSISTANT
   ========================================== */

/* Hub grid 4 columns */
.hub-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
@media (max-width: 900px) {
    .hub-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .hub-grid-4 { grid-template-columns: 1fr; }
}

/* Dashboard stat cards */
.kb-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 700px) {
    .kb-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.kb-stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}
.kb-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.kb-stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin-top: 4px;
}
.kb-stat-new { border-color: rgba(23,156,216,0.4); }
.kb-stat-new .kb-stat-number { color: #179CD8; }
.kb-stat-reviewing { border-color: rgba(255,183,77,0.4); }
.kb-stat-reviewing .kb-stat-number { color: #ffb74d; }
.kb-stat-articles { border-color: rgba(0,212,170,0.4); }
.kb-stat-articles .kb-stat-number { color: #00d4aa; }

/* Last scan info */
.kb-last-scan-info {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

/* Recent gaps list */
.kb-recent-gap-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.kb-recent-gap-row:hover { background: rgba(255,255,255,0.06); }
.kb-recent-gap-topic {
    flex: 1;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kb-recent-gap-source {
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Severity badges */
.gap-severity-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.gap-severity-critical { background: rgba(255,71,87,0.2); color: #ff4757; border: 1px solid rgba(255,71,87,0.3); }
.gap-severity-high { background: rgba(255,107,53,0.2); color: #ff6b35; border: 1px solid rgba(255,107,53,0.3); }
.gap-severity-medium { background: rgba(255,183,77,0.2); color: #ffb74d; border: 1px solid rgba(255,183,77,0.3); }
.gap-severity-low { background: rgba(0,212,170,0.15); color: #00d4aa; border: 1px solid rgba(0,212,170,0.25); }

/* Status badges */
.gap-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.gap-status-new { background: rgba(23,156,216,0.2); color: #179CD8; }
.gap-status-reviewing { background: rgba(255,183,77,0.2); color: #ffb74d; }
.gap-status-approved { background: rgba(0,212,170,0.2); color: #00d4aa; }
.gap-status-article_created { background: rgba(23,156,216,0.2); color: #81d4fa; }
.gap-status-dismissed { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); }
.gap-status-completed { background: rgba(0,212,170,0.2); color: #00d4aa; }
.gap-status-failed { background: rgba(255,71,87,0.2); color: #ff4757; }
.gap-status-running { background: rgba(255,183,77,0.2); color: #ffb74d; }
.gap-status-pending { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); }

/* Table controls (filters, search, sort) */
.kb-table-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.kb-table-controls select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.kb-search-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    min-width: 200px;
    flex: 1;
    max-width: 350px;
}
.kb-search-input:focus {
    border-color: rgba(23,156,216,0.5);
    outline: none;
}
.kb-search-input::placeholder { color: rgba(255,255,255,0.3); }

/* Pagination */
.kb-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.kb-page-info {
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
}
.kb-page-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}
.kb-page-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}
.kb-page-btn:hover:not(:disabled) { background: rgba(23,156,216,0.2); color: #fff; }
.kb-page-btn.active { background: rgba(23,156,216,0.3); color: #179CD8; border-color: rgba(23,156,216,0.4); }
.kb-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.kb-page-ellipsis { color: rgba(255,255,255,0.3); padding: 0 4px; }

/* Legacy compat */
.kb-filters { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kb-filters select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Gap actions */
.kb-gap-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    transition: background 0.2s;
}
.btn-sm:hover { background: rgba(255,255,255,0.2); }
.btn-sm.btn-primary { background: rgba(23,156,216,0.3); color: #179CD8; }
.btn-sm.btn-primary:hover { background: rgba(23,156,216,0.5); }
.btn-sm.btn-danger { background: rgba(255,71,87,0.2); color: #ff4757; }
.btn-sm.btn-danger:hover { background: rgba(255,71,87,0.4); }

/* Gap detail modal */
.kb-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}
.kb-detail-section {
    margin-bottom: 16px;
}
.kb-detail-section h3 {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kb-detail-section p {
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
}
.kb-conversation-pre {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}
.kb-article-title-preview {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}
.kb-article-body-preview {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}
.kb-article-body-preview h2 { font-size: 1.1rem; color: #179CD8; margin: 16px 0 8px; }
.kb-article-body-preview p { margin-bottom: 8px; }
.kb-article-body-preview ul, .kb-article-body-preview ol { margin: 8px 0; padding-left: 20px; }
.kb-article-body-preview li { margin-bottom: 4px; }


/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 26px;
    transition: 0.3s;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: #179CD8; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

/* Manual Refiner — wider layout */
#manual-refiner-module .request-form-container {
    max-width: 100%;
}

/* KB Gap module — wider layout */
#kb-gaps-module .request-form-container {
    max-width: 100%;
}
#kb-gaps-module .tab-content {
    max-width: 100%;
}

/* Template badge and selector */
.kb-template-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}
.kb-template-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.kb-template-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Additional context textarea */
.kb-additional-context {
    margin-bottom: 12px;
}
.kb-extra-context-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 12px;
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    margin-top: 6px;
}
.kb-extra-context-input:focus {
    border-color: rgba(23,156,216,0.5);
    outline: none;
}
.kb-extra-context-input::placeholder {
    color: rgba(255,255,255,0.25);
}

/* Subtle dismiss link */
.kb-dismiss-link {
    background: none !important;
    border: none !important;
    color: rgba(255,255,255,0.35) !important;
    font-size: 0.75rem !important;
    text-decoration: underline;
    padding: 2px 6px !important;
    margin-left: auto;
}
.kb-dismiss-link:hover {
    color: rgba(255,255,255,0.55) !important;
    background: none !important;
}

/* Rich text editor */
.kb-editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}
.kb-editor-toolbar button {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s;
}
.kb-editor-toolbar button:hover {
    background: rgba(23,156,216,0.3);
}
.kb-editor-content {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0 0 8px 8px;
    padding: 16px;
    min-height: 250px;
    max-height: 450px;
    overflow-y: auto;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    line-height: 1.6;
    outline: none;
}
.kb-editor-content:focus {
    border-color: rgba(23,156,216,0.5);
}
.kb-editor-content h2 { font-size: 1.1rem; color: #179CD8; margin: 16px 0 8px; }
.kb-editor-content p { margin-bottom: 8px; }
.kb-editor-content ul, .kb-editor-content ol { margin: 8px 0; padding-left: 20px; }
.kb-editor-content li { margin-bottom: 4px; }
.kb-editor-content a { color: #179CD8; text-decoration: underline; }
.kb-editor-content img.kb-editor-img { cursor: pointer; display: block; margin: 8px 0; max-width: 100%; height: auto; }
.kb-editor-content img.kb-editor-img:hover { outline: 2px solid rgba(23,156,216,0.5); }

#kb-img-resizer {
    position: fixed;
    border: 2px solid #179CD8;
    pointer-events: none;
    z-index: 9999;
    box-sizing: border-box;
}
.kb-img-resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #179CD8;
    border: 2px solid #fff;
    border-radius: 2px;
    pointer-events: all;
    cursor: nwse-resize;
}
.kb-img-resize-handle[data-corner="ne"],
.kb-img-resize-handle[data-corner="sw"] { cursor: nesw-resize; }
#kb-img-resize-label {
    position: absolute;
    top: -22px;
    left: 0;
    background: #179CD8;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
}

/* Live scan log */
.kb-live-log-output {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #00d4aa;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.5;
}

/* ============================================================
   SOP CREATOR — Rich Text Editor
   ============================================================ */
.sop-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.sop-tb-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    padding: 4px 9px;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.sop-tb-btn:hover {
    background: var(--hover-bg, rgba(255,255,255,0.07));
    border-color: var(--border);
}

.sop-tb-btn:active {
    background: var(--accent);
    color: #fff;
}

.sop-tb-sep {
    width: 1px;
    background: var(--border);
    margin: 2px 4px;
    align-self: stretch;
}

.sop-tb-clear {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 12px;
}

.sop-editor-body {
    min-height: 420px;
    max-height: 620px;
    overflow-y: auto;
    padding: 18px 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.75;
    outline: none;
}

.sop-editor-body:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(23, 156, 216, 0.12);
}

.sop-editor-body h1 { font-size: 1.5rem; margin: 1em 0 0.4em; }
.sop-editor-body h2 { font-size: 1.2rem; margin: 0.9em 0 0.35em; }
.sop-editor-body h3 { font-size: 1.05rem; margin: 0.8em 0 0.3em; }
.sop-editor-body p  { margin: 0 0 0.7em; }
.sop-editor-body ul,
.sop-editor-body ol { margin: 0 0 0.7em 1.4em; padding: 0; }
.sop-editor-body li { margin-bottom: 0.3em; }
.sop-editor-body a  { color: var(--accent); text-decoration: underline; }

/* Force readable colors for AI-generated SOP content with inline light styles */
.sop-editor-body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.sop-editor-body td,
.sop-editor-body th { padding: 8px 12px; border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.9) !important; }
.sop-editor-body thead tr,
.sop-editor-body tr[style*="background:#1a"] { color: #fff !important; }
.sop-editor-body tr:not([style]) td { background: rgba(255,255,255,0.04); }
/* Warning/note callouts — restyle for dark bg */
.sop-editor-body div[style*="background:#fff3cd"],
.sop-editor-body div[style*="background: #fff3cd"] {
    background: rgba(232, 160, 0, 0.15) !important;
    border-left: 4px solid #e8a000 !important;
    color: rgba(255,255,255,0.9) !important;
}
/* Any div with a very light/white background from inline styles */
.sop-editor-body div[style*="background:#fff"],
.sop-editor-body div[style*="background: #fff"],
.sop-editor-body div[style*="background:white"],
.sop-editor-body div[style*="background: white"] {
    background: rgba(255,255,255,0.06) !important;
    color: rgba(255,255,255,0.9) !important;
}
/* ============================================================
   GUIDE BUTTONS ON HUB CARDS
   ============================================================ */
.guide-btn {
    margin-top: 10px;
    padding: 5px 16px;
    font-size: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    position: relative;
    z-index: 2;
    font-family: inherit;
}

.guide-btn:hover {
    background: rgba(23, 156, 216, 0.2);
    border-color: rgba(23, 156, 216, 0.5);
    color: #fff;
}

/* Guide Modal Body */
.guide-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.75;
    font-size: 14px;
    color: rgba(255,255,255,0.92);
}

.guide-modal-body h2 {
    font-size: 1.1rem;
    margin: 1.2em 0 0.5em;
    color: #4dc8f0;
}

.guide-modal-body h3 {
    font-size: 0.95rem;
    margin: 1em 0 0.4em;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
}

.guide-modal-body p { margin: 0 0 0.75em; color: rgba(255,255,255,0.85); }
.guide-modal-body ul, .guide-modal-body ol { margin: 0 0 0.75em 1.4em; }
.guide-modal-body li { margin-bottom: 0.3em; color: rgba(255,255,255,0.85); }
.guide-modal-body strong { color: #fff; }

.guide-modal-body .guide-whats-new {
    background: rgba(23, 156, 216, 0.07);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
}

/* What's New Section on Hub */
.whats-new-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.whats-new-badge {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 20px;
    background: rgba(23,156,216,0.15);
    color: var(--accent);
    white-space: nowrap;
    font-weight: 500;
}

.whats-new-title {
    flex: 1;
    font-weight: 500;
}

.whats-new-date {
    font-size: 11px;
    opacity: 0.4;
    white-space: nowrap;
}

/* SOP Revision Bar */
.sop-revision-bar {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(23, 156, 216, 0.06);
    border: 1px solid rgba(23, 156, 216, 0.2);
    border-radius: 8px;
}

.sop-revision-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sop-revision-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.sop-revision-textarea {
    flex: 1;
    background: var(--input-bg, var(--card-bg));
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    padding: 8px 12px;
    resize: vertical;
    min-height: 54px;
}

.sop-revision-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.sop-revision-btn {
    white-space: nowrap;
    align-self: flex-end;
}

.sop-editor-body table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13px; }
.sop-editor-body th, .sop-editor-body td { padding: 8px 12px; border: 1px solid #3a4a6a; text-align: left; }
.sop-editor-body div[style*="background:#1a2f5e"],
.sop-editor-body div[style*="background:#1a5e5a"],
.sop-editor-body div[style*="background:#2a4a8a"] { border-radius: 4px; }

/* KB Gap Reviewer Lock */
.kb-reviewer-chip {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
}
.kb-reviewer-chip.kb-reviewer-mine {
    color: #00d4aa;
}
.kb-locked-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    cursor: default;
}
.kb-reviewer-notice {
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
}
.kb-reviewer-notice-locked {
    background: rgba(255, 107, 53, 0.12);
    border: 1px solid rgba(255, 107, 53, 0.3);
    color: #ff6b35;
}
.kb-reviewer-notice-mine {
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

/* Rep leaderboard widget */
.kb-rep-leaderboard-section { margin: 24px 0 8px; }
.kb-rep-leaderboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kb-rep-leaderboard-header select { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); border-radius: 6px; padding: 4px 8px; font-size: 0.85rem; cursor: pointer; }
.kb-rep-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.kb-rep-row:last-child { border-bottom: none; }
.kb-rep-rank { width: 20px; text-align: right; color: rgba(255,255,255,0.35); font-size: 0.8rem; flex-shrink: 0; }
.kb-rep-name { width: 200px; flex-shrink: 0; font-size: 0.9rem; color: rgba(255,255,255,0.85); }
.kb-rep-bar-wrap { flex: 1; background: rgba(255,255,255,0.06); border-radius: 4px; height: 8px; overflow: hidden; min-width: 60px; }
.kb-rep-bar { height: 100%; background: #179CD8; border-radius: 4px; transition: width 0.4s ease; }
.kb-rep-count { width: 36px; text-align: right; font-weight: 600; color: #179CD8; font-size: 0.9rem; flex-shrink: 0; }

