@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    --amber: #f29913;
    --amber-hover: #d6850c;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f0f0f0;
    --text-dark: #2c3e50;
    --text-grey: #666;
    --border-grey: #e0e0e0;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --primary-font: 'Montserrat', sans-serif;
    --topbar-bg: rgba(255, 255, 255, 0.8);
    --nav-text: #64748b;
    --nav-active-bg: #fff8e1;
    --nav-active-text: #f29913;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 68px;
}

.dark-mode {
    --bg-light: #0f172a;
    /* Slate 900 */
    --card-bg: #1e293b;
    /* Slate 800 */
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --text-dark: #f8fafc;
    /* Slate 50 */
    --text-grey: #94a3b8;
    /* Slate 400 */
    --border-grey: #334155;
    /* Slate 700 */
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --topbar-bg: rgba(15, 23, 42, 0.8);
    --nav-text: #94a3b8;
    --nav-active-bg: rgba(242, 153, 19, 0.15);
    --nav-active-text: #f29913;
}

body {
    font-family: var(--primary-font);
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   Login Page Styles (Split Layout)
   ========================================= */
.login-body {
    background-color: #f9f9f9;
    /* Light bg for grid */
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.07) 1px, transparent 1px), linear-gradient(to bottom, rgba(0, 0, 0, 0.07) 1px, transparent 1px);
    background-size: 69.38px 69.38px;
    z-index: -1;
}

.split-container {
    display: flex;
    height: 100%;
    width: 100%;
    /* max-width removed */
    margin: 0;
    align-items: center;
    justify-content: space-between;
    /* Push Card Left, Image Right */
}

/* Left Side - The Card */
.ai-chat-send-sticky {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10%;
    background: transparent;
    /* Removed white background */
    display: flex;
    align-items: center;
    gap: 15px;
    /* Space between trash and input */
}

/* Custom Styles for Standalone Trash Button at Bottom */
.clear-history-btn-standalone {
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    color: var(--text-grey);
    cursor: pointer;
    font-size: 18px;
    width: 48px;
    height: 48px;
    /* Fixed height */
    border-radius: 12px;
    /* Matching input radius */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Matching input shadow */
}

.clear-history-btn-standalone:hover {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.login-left {
    flex: 0 0 auto;
    width: 450px;
    padding: 40px;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    border-radius: 20px;
    margin-left: 10vw;
    /* Fixed distance from left */
    margin-right: 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

/* Center card on small screens */
@media (max-width: 900px) {
    .login-left {
        margin-right: 0;
        width: 90%;
        max-width: 400px;
    }

    .login-right {
        display: none;
    }
}

.login-content {
    width: 100%;
}

.logo-area {
    margin-bottom: 30px;
    text-align: left;
    /* Align logo left inside card */
}

.logo-area img {
    height: 60px;
    /* Increased size */
    width: auto;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-grey);
    font-size: 14px;
    margin-bottom: 30px;
}

/* Form Styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-grey);
    border-radius: var(--border-radius);
    text-align: left;
    /* Ensure inputs are still left-aligned inside */
    font-size: 14px;
    font-family: var(--primary-font);
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.login-form input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 1px var(--amber);
}

/* Checkbox & Links */
.form-actions {
    margin-bottom: 25px;
    font-size: 13px;
    display: none;
    /* Hidden as requested */
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: #555;
    font-weight: 500;
}

.checkbox-container input {
    margin-right: 8px;
    accent-color: var(--amber);
    /* Modern browser support */
    width: 16px;
    height: 16px;
}

.forgot-password {
    color: var(--amber);
    text-decoration: none;
    font-weight: 600;
}

/* Button */
.sign-in-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--amber);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: var(--primary-font);
}

.sign-in-btn:hover {
    background-color: var(--amber-hover);
}

.form-footer {
    margin-top: 20px;
    text-align: left;
    display: none;
    /* Hidden as requested */
}

.forgot-username {
    color: #0066cc;
    /* Example link color */
    font-size: 13px;
    text-decoration: none;
}

.copyright {
    position: absolute;
    bottom: 20px;
    left: 60px;
    font-size: 12px;
    color: #aaa;
}

/* Right Side Image */
.login-right {
    flex: 0 1 55%;
    /* Take up ~55% of width, allows shrinking */
    max-width: 1100px;
    /* Don't get too wide on huge screens */
    min-width: 600px;
    /* Don't get too narrow */
    height: 95vh;
    background-image: url('/images/login-background.png');
    background-size: cover;
    background-position: center;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    margin-right: 0;
    position: relative;
    overflow: hidden;
    /* Ensure it sticks to right even if content is small */
    margin-left: auto;
}

/* =========================================
   Dashboard Styles
   ========================================= */
.dashboard-body {
    background-color: var(--bg-light);
    height: 100vh;
    overflow: hidden;
}

/* ===== Fixed Top Bar ===== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 0;
    background-color: var(--sidebar-bg);
    z-index: 1040;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: var(--sidebar-width);
    transition: min-width 0.3s ease;
}

.sidebar-collapsed .topbar-left {
    min-width: var(--sidebar-width);
}

.topbar-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-left: 4px;
}

.topbar-logo-link img {
    height: 36px;
    width: auto;
}

/* Hamburger Button */
.hamburger-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    color: var(--nav-text);
    transition: background 0.15s;
    flex-shrink: 0;
    margin-left: 20px;
}

.hamburger-btn:hover {
    background: var(--sidebar-hover);
}

.hamburger-line {
    display: block;
    width: 18px;
    height: 2.2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.is-active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    margin-left: 24px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ===== Collapsible Sidebar ===== */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: width 0.3s ease, background-color 0.3s ease;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.nav-list li {
    margin-bottom: 4px;
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 18px;
    border-radius: 12px;
    color: var(--nav-text);
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--nav-active-text);
}

.nav-link.active {
    background-color: rgba(243, 156, 18, 0.12);
    border-color: transparent;
    color: var(--amber);
    font-weight: 600;
}

.nav-link.active .nav-icon {
    color: var(--amber);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Logout */
.sidebar-logout {
    padding: 8px 12px 14px;
    flex-shrink: 0;
}

.logout-link {
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nav-text);
    background: var(--sidebar-hover);
}

.logout-link:hover {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: transparent;
    color: #e42f23;
}

/* ===== Main Content Area ===== */
.main-content {
    position: fixed;
    top: var(--topbar-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    overflow-y: auto;
    transition: left 0.3s ease;
    background: var(--bg-light);
    border-top: 1px solid var(--border-grey);
    border-left: 1px solid var(--border-grey);
    border-top-left-radius: 24px;
}

.content-wrapper {
    width: 100%;
    max-width: 1800px;
    padding: 24px;
    padding-bottom: 80px;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Sidebar Collapsed State ===== */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .nav-text,
.sidebar-collapsed .sidebar-logout .nav-text {
    display: none;
}

.sidebar-collapsed .sidebar-nav {
    padding: 16px 0;
    align-items: center;
    scrollbar-width: none;
}

.sidebar-collapsed .nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-collapsed .nav-list li {
    width: auto;
}

.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0;
    gap: 0;
    width: 42px;
    height: 42px;
}

.sidebar-collapsed .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.sidebar-collapsed .nav-icon {
    font-size: 18px;
}

.sidebar-collapsed .sidebar-logout {
    padding: 8px 0 14px;
    display: flex;
    justify-content: center;
}

.sidebar-collapsed .sidebar-logout .logout-link {
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    gap: 0;
}

.sidebar-collapsed .main-content {
    left: var(--sidebar-collapsed-width);
}


/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
}

#theme-toggle {
    background: transparent;
    border: 1px solid var(--border-grey);
    color: var(--text-dark);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

#theme-toggle:hover {
    background: var(--bg-light);
    border-color: var(--amber);
    color: var(--amber);
}

.dark-mode #theme-toggle {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode #theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--sidebar-hover);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-grey);
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 cards matching request */
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-grey);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 14px;
    color: var(--text-grey);
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-trend {
    font-size: 12px;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 5px;
    display: inline-block;
    width: fit-content;
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

/* Filter Section */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid var(--border-grey);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-grey);
    background-color: var(--bg-light);
    color: var(--text-dark);
    border-radius: 8px;
    font-family: var(--primary-font);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(242, 153, 19, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-grey);
}

.filter-options {
    display: flex;
    gap: 15px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    font-family: var(--primary-font);
    font-size: 14px;
    outline: none;
    background-color: var(--bg-light);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.filter-select:hover {
    border-color: var(--amber);
}

.filter-select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(242, 153, 19, 0.1);
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    position: relative;
}

/* Custom Select Styles - Refined */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
    /* Take full width of parent filter-group */
    min-width: 200px;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    /* Exact match to amber-select */
    font-size: 14px;
    font-weight: 400;
    color: var(--text-dark);
    /* Match amber-select */
    height: 42px;
    /* Standard height */
    background: var(--bg-light);
    /* Match amber-select */
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--primary-font);
    box-sizing: border-box;
}

.custom-select-trigger:hover {
    border-color: var(--amber);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--amber);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    z-index: 101;
    /* Stay above options */
}

.custom-select-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--amber);
    border-top: 0;
    background: var(--card-bg);
    transition: all 0.2s ease-in-out;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: var(--card-shadow);
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.select-search {
    padding: 10px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-grey);
    position: relative;
    /* Context for clear button */
    display: flex;
    align-items: center;
}

.select-search input {
    width: 100%;
    padding: 8px 30px 8px 12px;
    /* Pad right for X button */
    border: 1px solid var(--border-grey);
    background: var(--card-bg);
    color: var(--text-dark);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.select-search input:focus {
    border-color: var(--amber);
}

#clear-group-search {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
}

#clear-group-search:hover {
    color: #555;
}

.options-list {
    max-height: 250px;
    overflow-y: auto;
}

.option {
    padding: 10px 15px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.option:hover {
    background-color: var(--sidebar-hover);
    color: var(--amber-hover);
}

.option.selected {
    background-color: var(--amber);
    color: white;
    font-weight: 600;
}

/* Ensure table container takes full width */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-grey);
}

.amber-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.sortable:hover {
    color: var(--amber);
    background-color: var(--bg-light);
}

.sortable i {
    margin-left: 5px;
    font-size: 10px;
    opacity: 0.5;
}

.sortable:hover i {
    opacity: 1;
}

/* Chart Section */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-grey);
    box-shadow: var(--card-shadow);
    min-height: 300px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* Timeline & Table */
.timeline-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-grey);
    box-shadow: var(--card-shadow);
}

.table-container {
    background: var(--card-bg);
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--border-grey);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    /* Ensure rounded corners clip children */
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th {
    text-align: left;
    padding: 20px 30px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-grey);
    font-weight: 700;
    border-bottom: 1px solid var(--border-grey);
}

.details-table td {
    padding: 20px 30px;
    font-size: 14px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-grey);
}

.details-table tr.user-row {
    cursor: pointer;
    transition: background-color 0.1s;
}

.details-table tr.user-row:hover {
    background-color: var(--bg-light);
}

/* Timeline Expansion */
.timeline-row {
    background-color: transparent;
    display: none;
}

.timeline-row.active {
    display: table-row;
}

.timeline-container {
    padding: 20px 30px;
    position: relative;
    border-left: 2px solid #eee;
    margin-left: 20px;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 30px;
}

.timeline-date {
    font-size: 12px;
    color: #999;
}

.timeline-message {
    font-size: 14px;
    font-weight: 600;
    margin: 4px 0;
}

.timeline-details {
    font-size: 12px;
    color: #555;
    background: #f1f2f6;
    padding: 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-sent {
    background-color: #e0f2f1;
    color: #00695c;
}

.badge-opened {
    background-color: var(--sidebar-hover);
    color: #ef6c00;
}

.badge-clicked {
    background-color: var(--sidebar-hover);
    color: #f57f17;
}

.badge-submitted {
    background-color: #ffebee;
    color: #c62828;
}

.badge-reported {
    background-color: #eceff1;
    color: #455a64;
}


/* --- Timeline Styles --- */
.timeline-wrapper {
    padding: 20px;
    background: var(--bg-light);
}

.timeline-entry {
    display: flex;
    padding-bottom: 0;
    position: relative;
    min-height: 70px;
    /* Ensure space for line */
}

.timeline-rid-header {
    margin-bottom: 20px;
    padding-left: 10px;
    font-size: 14px;
    color: var(--text-grey);
    border-bottom: 1px solid var(--border-grey);
    padding-bottom: 10px;
}

.timeline-entry:last-child {
    padding-bottom: 0;
}

.timeline-entry:last-child .timeline-line {
    display: none;
}

.timeline-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px;
    min-width: 40px;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--card-bg);
    /* Create gap for line passing through */
}

/* Timeline Colors */
.timeline-sent {
    background-color: #4CAF50;
}

/* Green */
.timeline-opened {
    background-color: #FF9800;
}

/* Orange */
.timeline-clicked {
    background-color: #F57C00;
}

/* Darker Orange */
.timeline-submitted {
    background-color: #F44336;
}

/* Red */
.timeline-reported {
    background-color: #607D8B;
}

/* Purple */
.timeline-created {
    background-color: #9c27b0;
}

/* Grey */
.timeline-default {
    background-color: #9E9E9E;
}

/* Vertical Line Logic */
.timeline-icon-container {
    position: relative;
    /* Ensure child absolute elements position relative to this */
}

.timeline-icon-container::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background-color: var(--border-grey);
    z-index: 1;
    top: 0;
    bottom: 0;
}

/* First item: start line from center of icon downwards */
.timeline-entry:first-of-type .timeline-icon-container::before {
    top: 16px;
}

/* Last item: end line at center of icon */
.timeline-entry:last-of-type .timeline-icon-container::before {
    bottom: auto;
    height: 16px;
}

/* Legacy class cleanup – ensure no conflicts if JS still emits it momentarily */
.timeline-line {
    display: none !important;
}

.timeline-content-wrapper {
    flex-grow: 1;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.timeline-message {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.timeline-time {
    font-size: 0.85rem;
    color: var(--text-grey);
    font-style: italic;
}

.timeline-meta {
    font-size: 0.85rem;
    color: var(--text-grey);
    margin-top: 5px;
}

.meta-row {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-replay {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-replay:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
    color: #333;
}

.caret {
    transition: transform 0.2s;
    display: inline-block;
    color: #ccc;
}

.user-row.expanded .caret {
    transform: rotate(90deg);
}

/* Timeline Visualization */
/* Timeline Visualization - Chartist Overrides */
.timeline-section-main {
    margin-bottom: 30px;
}

.timeline-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-grey);
    overflow: hidden;
}

#timeline-container {
    width: 100%;
    min-height: 200px;
    padding: 40px 20px;
}

/* Horizontal Timeline Styles */
.horizontal-timeline {
    position: relative;
    width: 100%;
    padding: 20px 0;
}

.timeline-line {
    position: absolute;
    top: 90px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #f29913 0%, #ff9800 25%, #f57c00 50%, #f44336 75%, #607d8b 100%);
    z-index: 1;
}

.timeline-milestones {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.timeline-milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 120px;
}

.milestone-circle {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    position: relative;
}

.circular-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: var(--border-grey);
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
}

@keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

/* Color variations for circles */
.milestone-circle.amber .circle {
    stroke: #f29913;
}

.milestone-circle.orange .circle {
    stroke: #ff9800;
}

.milestone-circle.dark-orange .circle {
    stroke: #f57c00;
}

.milestone-circle.red .circle {
    stroke: #f44336;
}

.milestone-circle.grey .circle {
    stroke: #607d8b;
}

.circular-chart .percentage {
    fill: var(--text-dark);
    font-family: var(--primary-font);
    font-size: 8px;
    font-weight: 700;
    text-anchor: middle;
}

.milestone-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 5px;
    line-height: 1.3;
}

.milestone-time {
    font-size: 11px;
    color: var(--text-grey);
    text-align: center;
}

/* Chartist Colors */
.ct-series-a .ct-line,
.ct-series-a .ct-point,
.ct-series-a .ct-slice-donut {
    stroke: #fea216;
    fill: #fea216;
}

/* Sent */
.ct-series-b .ct-line,
.ct-series-b .ct-point,
.ct-series-b .ct-slice-donut {
    stroke: #f39c12;
    fill: #f39c12;
}

/* Opened */
.ct-series-c .ct-line,
.ct-series-c .ct-point,
.ct-series-c .ct-slice-donut {
    stroke: #e67e22;
    fill: #e67e22;
}

/* Clicked */
.ct-series-d .ct-line,
.ct-series-d .ct-point,
.ct-series-d .ct-slice-donut {
    stroke: #d35400;
    fill: #d35400;
}

/* Submitted */
.ct-series-e .ct-line,
.ct-series-e .ct-point,
.ct-series-e .ct-slice-donut {
    stroke: #c0392b;
    fill: #c0392b;
}

/* Reported */

.ct-label {
    font-family: 'Montserrat', sans-serif;
    color: #999;
}

.ct-grid {
    stroke: #f0f0f0;
    stroke-dasharray: 2px;
}

/* Circular Charts - Donuts */
.stats-container {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: nowrap;
    margin-bottom: 30px;
}

.stat-card.circular-card {
    flex: 1;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    position: relative;
    max-width: 200px;
}

.chart-donut {
    height: 120px;
    width: 120px;
    position: relative;
    margin: 0 auto;
}

.donut-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.ct-slice-donut {
    stroke-width: 10px !important;
}


/* Chartist Wrapper Overrides for Single Value Donuts */
.ct-series-a-wrapper .ct-series-a .ct-slice-donut {
    stroke: #fea216 !important;
}

.ct-series-b-wrapper .ct-series-a .ct-slice-donut {
    stroke: #f39c12 !important;
}

.ct-series-c-wrapper .ct-series-a .ct-slice-donut {
    stroke: #e67e22 !important;
}

.ct-series-d-wrapper .ct-series-a .ct-slice-donut {
    stroke: #d35400 !important;
}

.ct-series-e-wrapper .ct-series-a .ct-slice-donut {
    stroke: #c0392b !important;
}

/* Background slices (series b in data) to light grey */
.ct-series-b .ct-slice-donut {
    stroke: #f0f0f0 !important;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 0;
}

.pagination-info {
    font-size: 13px;
    color: #666;
    margin: 0 15px;
}

.pagination-btn {
    background-color: var(--card-bg);
    color: var(--text-grey);
    border: 1px solid var(--border-grey);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--primary-font);
    min-width: 35px;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--bg-light);
    border-color: var(--amber);
    color: var(--amber);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: var(--amber);
    color: white;
    border-color: var(--amber);
}

.page-size-select {
    padding: 6px 10px;
    border: 1px solid var(--border-grey);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--primary-font);
    background-color: var(--card-bg);
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 30px;
}

.page-size-select:hover {
    border-color: var(--amber);
}

.page-size-select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(242, 153, 19, 0.1);
}

/* =========================================
   Custom Dropdown Styles
   ========================================= */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    min-width: 180px;
    display: inline-block;
}

.filter-options .custom-select-wrapper {
    width: auto;
}

.pagination-container .custom-select-wrapper {
    min-width: 120px;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select__trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    background: var(--card-bg);
    cursor: pointer;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    transition: all 0.2s;
    height: 40px;
    /* Fixed height consistency */
    box-sizing: border-box;
}

.custom-select__trigger:hover {
    border-color: var(--amber);
}

.custom-select.open .custom-select__trigger {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(242, 153, 19, 0.1);
}

.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    border: 1px solid var(--border-grey);
    background: var(--card-bg);
    transition: all 0.2s;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 5px 0;
    max-height: 300px;
    overflow-y: auto;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: block;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.1s;
}

.custom-option:hover {
    background-color: var(--sidebar-hover);
    color: var(--amber);
}

.custom-option.selected {
    color: var(--amber);
    background-color: var(--sidebar-hover);
    font-weight: 600;
}

.arrow {
    position: relative;
    height: 10px;
    width: 10px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow::after {
    content: '\f078';
    /* FontAwesome chevron-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.custom-select.open .arrow::after {
    transform: rotate(180deg);
    color: var(--amber);
}

/* =========================================
   Timeline Tooltip Styles
   ========================================= */
.timeline-milestone {
    position: relative;
    /* For tooltip positioning */
}

/* Tooltip container data attribute approach */
.milestone-circle[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    /* Above the circle */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-bg);
    color: var(--text-dark);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--amber);
    /* Light amber border */
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
}

/* Optional: Add a small arrow */
.milestone-circle[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    /* Just below tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #f9da9d transparent transparent transparent;
    z-index: 100;
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
    margin-bottom: -11px;
    /* Adjust based on border logic, simple overlap */
}

@keyframes tooltipFadeIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
}

/* =========================================
   Vertical Timeline Connector Styles
   ========================================= */
/* Card styling for the timeline area */
.timeline-wrapper {
    padding: 25px;
    border: 1px solid var(--border-grey);
    border-radius: 12px;
    background-color: var(--card-bg);
    margin: 10px 0;
    box-shadow: var(--card-shadow);
}

.timeline-entry {
    display: flex;
    position: relative;
    padding-bottom: 0;
    /* Let spacing be handled by min-height or gap */
    min-height: 60px;
    margin: 0;
    /* Ensure no gaps */
}

.timeline-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    /* CRITICAL: Ensure it stretches to full height of entry */
    margin-right: 20px;
    position: relative;
    min-width: 40px;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 5;
    /* High enough to sit over the line */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--card-bg);
    position: relative;
    /* Ensure z-index works */
    flex-shrink: 0;
}

/* Colors for vertical timeline icons matching dashboard.js classes */
.timeline-sent {
    background-color: #fea216;
}

.timeline-opened {
    background-color: #f39c12;
}

.timeline-clicked {
    background-color: #e67e22;
}

.timeline-submitted {
    background-color: #d35400;
}

.timeline-reported {
    background-color: #95a5a6;
}

.timeline-created {
    background-color: #8e44ad;
}

.timeline-default {
    background-color: #bdc3c7;
}

/* Continuous Vertical Line Logic */
.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    /* Thicker */
    background-color: #999;
    /* Solid Grey */
    z-index: 1;
    /* Behind icon */
    top: 0;
    bottom: 0;
}

/* First item: Line starts from center (16px approx) */
.timeline-entry:first-child .timeline-line {
    top: 16px;
}

/* Last item: Hide the line so it doesn't dangle */
.timeline-entry:last-child .timeline-line {
    display: none;
}

.timeline-content-wrapper {
    flex: 1;
    padding-bottom: 20px;
    /* Spacing between events */
}

.timeline-header {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    align-items: center;
    margin-bottom: 5px;
}

.timeline-message {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.timeline-time {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.timeline-meta {
    font-size: 12px;
    color: var(--text-grey);
    background: var(--bg-light);
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    border-left: 3px solid var(--border-grey);
}

.meta-row {
    margin-bottom: 2px;
}

.meta-row i {
    width: 16px;
    text-align: center;
    margin-right: 5px;
    color: var(--text-grey);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--card-bg);
    width: 400px;
    max-width: 90%;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--border-grey);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-grey);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--sidebar-hover);
    color: var(--amber);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    margin: 0 auto 15px;
}

.modal-message {
    font-size: 15px;
    color: var(--text-grey);
    line-height: 1.5;
    margin: 0;
}

.modal-footer {
    padding: 20px 25px;
    background-color: var(--bg-light);
    display: flex;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.modal-btn-primary {
    background-color: var(--amber);
    color: white;
}

.modal-btn-secondary {
    background-color: var(--sidebar-hover);
    color: var(--text-grey);
    margin-right: 10px;
}

.modal-btn-danger {
    background-color: #e57373;
    color: white;
}

.modal-icon-wrapper.warning {
    background-color: var(--sidebar-hover);
    color: #f29913;
}

.modal-btn-primary:hover {
    background-color: var(--amber-hover);
}

/* --- AI Assistant: Gemini Style UI --- */
.ai-hero-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: transparent;
    /* Ensure clean background */
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ai-hero-container::before {
    display: none;
    /* Removed grid "squares" */
}

/* Removed conditional grid */

.ai-greeting-wrapper,
.hero-input,
.suggestion-pills {
    position: relative;
    z-index: 1;
}

.ai-greeting-wrapper {
    margin-bottom: 40px;
    max-width: 800px;
}

.gemini-star {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
}

.gemini-star svg {
    width: 100%;
    height: 100%;
}

.ai-greeting {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.ai-greeting span#userNameGreeting {
    background: linear-gradient(90deg, #f29913, #e67e22, #f39c12);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Error State: Broken Connection */
.ai-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.ai-error-icon {
    font-size: 80px;
    color: #dadce0;
    margin-bottom: 25px;
}

.ai-error-title {
    font-size: 24px;
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 10px;
}

.ai-error-subtitle {
    font-size: 16px;
    color: #5f6368;
    max-width: 400px;
    margin: 0 auto;
}


.ai-subtitle {
    font-size: 1.2rem;
    color: #444746;
    font-weight: 500;
    line-height: 1.5;
}

.ai-chat-input-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.input-container-inner {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    padding: 0 20px;
    /* Vertical padding removed to use fixed height */
    height: 48px;
    /* Fixed height matching trash button */
    border-radius: 12px;
    /* Adjusted to match common dashboard radius */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-grey);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.input-container-inner:focus-within {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #c4c7c5;
}

.security-icon {
    font-size: 20px;
    color: #444746;
    margin-right: 15px;
}

.ai-chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-dark);
    background: transparent;
    padding: 5px 0;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-chat-send-btn {
    background: none;
    border: none;
    color: var(--text-grey);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.ai-chat-send-btn:hover {
    color: var(--amber);
}

.suggestion-pills {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 800px;
}

.suggestion-pill {
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-grey);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Suggestion Pills Refinement */
.suggestion-pill:hover {
    background-color: var(--bg-light);
    border-color: var(--amber);
    color: var(--amber-hover);
}

/* Timeline/Chat History Styles */
.ai-chat-timeline {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    background-color: var(--bg-light);
    overflow: hidden;
    padding: 20px;
}

/* Removing old header styles */

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px 10%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-grey);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
}

.message {
    display: flex;
    gap: 20px;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-bubble {
    font-size: 16px;
    line-height: 1.6;
    color: #1f1f1f;
    max-width: 85%;
}

.user-message .message-bubble {
    background-color: var(--sidebar-hover);
    /* Very light amber */
    padding: 15px 20px;
    border-radius: 18px;
    border: 1px solid #ffecb3;
}

.ai-message .message-bubble {
    background-color: #f8f9fa;
    /* Light grey box */
    padding: 15px 20px;
    border-radius: 18px;
    border: 1px solid #eef0f2;
    color: #333;
}

/* Markdown specific styles */
.message-bubble p {
    margin-top: 0;
    margin-bottom: 10px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
    margin-top: 0;
    margin-left: 20px;
    margin-bottom: 10px;
}

.message-bubble ul:last-child,
.message-bubble ol:last-child {
    margin-bottom: 0;
}

.message-bubble li {
    margin-bottom: 5px;
}

.message-bubble strong {
    font-weight: 700;
}

.gemini-star-small svg path {
    fill: var(--amber) !important;
}

.sticky-input {
    padding: 0;
    background: transparent;
}

.sticky-input .input-container-inner {
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: 28px;
    padding: 12px 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* AI Usage Bar Styles */
.ai-usage-container {
    max-width: 800px;
    margin: 10px auto 0;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
}

.ai-usage-bar-wrapper {
    width: 100%;
    height: 3px;
    background: var(--border-grey);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.ai-usage-bar-fill {
    height: 100%;
    width: 0%;
    background: #f5a623;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
    border-radius: 2px;
}

.ai-usage-tooltip {
    position: absolute;
    bottom: 20px;
    /* Positioned above the bar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 33, 33, 0.95);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

.ai-usage-bar-wrapper:hover .ai-usage-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 25px;
    /* Slight lift animation */
}

.message.loading .fa-fade {
    color: var(--amber);
}




/* Language Switcher Text and Style Update */
.lang-select {
    border: 1px solid #f5a623 !important;
    border-radius: 4px !important;
    padding: 8px 15px !important;
    padding-right: 32px !important;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"%23e67e22\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"%3E%3Cpolyline points=\"6 9 12 15 18 9\"%3E%3C/polyline%3E%3C/svg%3E') !important;
}

.lang-select:hover,
.lang-select:focus {
    border-color: #e67e22 !important;
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.15) !important;
}

/* Custom Language Dropdown */
/* Custom Language Dropdown */
.custom-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 15px;
    font-family: 'Montserrat', sans-serif;
    min-width: 110px;
}

.dropdown-trigger {
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-trigger:hover,
.dropdown-trigger:focus,
.custom-dropdown.open .dropdown-trigger {
    background-color: var(--bg-light);
    border-color: var(--amber);
}

.dropdown-trigger i {
    color: var(--text-grey);
    font-size: 12px;
    transition: color 0.2s;
}

.dropdown-trigger:hover i,
.custom-dropdown.open .dropdown-trigger i {
    color: #f5a623;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: var(--card-bg);
    border-radius: 6px;
    box-shadow: var(--card-shadow);
    width: 100%;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border-grey);
    box-sizing: border-box;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.1s ease-out;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background-color: var(--bg-light);
    color: var(--amber);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Analytics Dashboard Styles
   ========================================= */

.metric-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

/* Amber Input/Select Styles */
.amber-input,
.amber-select {
    padding: 10px 14px;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: all 0.2s;
    box-sizing: border-box;
}

.amber-input:focus,
.amber-select:focus {
    border-color: #f29913;
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(242, 153, 19, 0.1);
    outline: none;
}

.amber-select {
    cursor: pointer;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

/* =========================================
   Executive Dashboard Professional Styles
   ========================================= */

.sticky-filters {
    position: sticky;
    top: -40px;
    /* Offset some padding */
    z-index: 100;
    background: var(--bg-light);
    padding-bottom: 20px;
    margin-bottom: 10px;
}

.filters-panel {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    display: flex;
    gap: 20px;
    align-items: flex-end;
    border: 1px solid var(--border-grey);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filters-panel .filter-group {
    width: 240px;
    flex: 0 0 240px;
}

.filters-panel .amber-select {
    width: 100%;
    height: 42px;
}

.filters-panel .custom-select-wrapper {
    width: 100%;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-grey);
    letter-spacing: 1px;
    font-family: var(--primary-font);
}

.amber-select {
    font-family: var(--primary-font);
}

.dashboard-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-grey);
}

.dashboard-section.half {
    flex: 1;
    min-width: 480px;
}

.chart-container {
    height: 400px;
    position: relative;
    width: 100%;
}

.chart-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 20px 0;
}

.sub-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-grey);
    margin-bottom: 15px;
}

/* KPI Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-grey);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon.blue {
    background: rgba(255, 211, 102, 0.1);
    color: #ffd366;
}

.kpi-icon.yellow {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.kpi-icon.orange {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.kpi-icon.red {
    background: rgba(230, 81, 0, 0.1);
    color: #e65100;
}

.kpi-icon.navy {
    background: rgba(44, 62, 80, 0.1);
    color: var(--text-dark);
}

.kpi-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
}

.kpi-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.kpi-trend {
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.kpi-trend.up {
    color: #27ae60;
}

.kpi-trend.down {
    color: #e74c3c;
}

/* Heatmap Grid */


.heatmap-box:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    color: #999;
    justify-content: flex-end;
}

.legend-scale {
    width: 100px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #fff8e1, #ff9800, #bf360c);
}

/* Speed Meter */
.gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.speed-value {
    font-size: 64px;
    font-weight: 800;
    color: var(--amber);
    line-height: 1;
}

.speed-label {
    font-size: 14px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.speed-description {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Layout Helpers */
.charts-row {
    display: flex;
    gap: 25px;
    align-items: stretch;
    margin-bottom: 25px;
}

.chart-container-third {
    flex: 1;
}

.chart-container-twothirds {
    flex: 2;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.heatmap-box {
    aspect-ratio: 1;
    border-radius: 4px;
    background: #f8f9fa;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.heatmap-box:hover {
    transform: scale(1.1);
    z-index: 5;
}

.charts-row-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.split-col-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
}

.amber-table {
    width: 100%;
    border-collapse: collapse;
}

.amber-table th {
    text-align: left;
    font-size: 11px;
    color: var(--text-grey);
    text-transform: uppercase;
    padding: 12px;
    border-bottom: 1px solid var(--border-grey);
}

.amber-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-grey);
    font-size: 14px;
}

.risk-tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.risk-tag.low {
    background: rgba(251, 192, 45, 0.15);
    color: #fbc02d;
}

.risk-tag.medium {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.risk-tag.high {
    background: rgba(255, 87, 34, 0.15);
    color: #ff5722;
}

.risk-tag.critical {
    background: #bf360c;
    color: white;
}

/* Analytics Filter Actions */
.filter-actions {
    display: flex;
    align-items: flex-end;
    margin-bottom: 2px;
}

.amber-btn-outline {
    background: transparent;
    border: 1.5px solid var(--amber);
    color: var(--amber);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.amber-btn-outline:hover {
    background: var(--amber);
    color: white;
}



/* Report Print Header (Hidden on screen) */
.report-print-header,
.report-print-footer {
    display: none;
}

@media print {

    /* RESET TRUNCATION: Critical for multi-page printing */
    html,
    body {
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Critical: Force background colors and images */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        margin: 15mm;
        size: A4 portrait;
    }

    /* Show Print Header */
    .report-print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid var(--amber);
        padding-bottom: 20px;
        margin-bottom: 30px;
    }

    .report-header-left {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .report-logo {
        height: 50px;
        width: auto;
    }

    .report-title-group h1 {
        margin: 0;
        font-size: 24px;
        color: #1a1a1a;
    }

    .report-title-group p {
        margin: 5px 0 0;
        color: #666;
        font-size: 14px;
    }

    .report-header-right {
        text-align: right;
        font-size: 12px;
        color: #999;
    }

    /* Hide UI Elements */
    .top-bar,
    .sidebar,
    #analytics-sticky-header,
    .filter-actions,
    .ai-chat-send-sticky,
    .sticky-filters,
    .filters-panel {
        display: none !important;
    }

    .main-content {
        position: static !important;
        left: 0 !important;
        top: 0 !important;
    }

    .report-print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        font-size: 10px;
        color: #999;
        text-align: center;
        padding: 10px 0;
        border-top: 1px solid #eee;
        background: #ffffff;
    }

    /* Layout Adjustments */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        position: static !important;
        height: auto !important;
        overflow: visible !important;
    }

    .content-wrapper {
        padding: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Force full-width elements and avoid breaks inside sections */
    .dashboard-section {
        box-shadow: none !important;
        border: 1px solid #eee !important;
        margin-bottom: 30px !important;
        background: #ffffff !important;
        break-inside: avoid;
        page-break-inside: avoid;
        width: 100% !important;
    }

    .charts-row {
        display: flex !important;
        flex-direction: column !important;
        /* Stack columns for better print stability */
        gap: 20px !important;
    }

    .charts-row .half,
    .chart-container-third,
    .chart-container-twothirds {
        width: 100% !important;
        flex: none !important;
    }

    /* Ensure chart canvases are appropriately sized */
    canvas {
        max-width: 100% !important;
        height: 350px !important;
        /* Fixed height for consistency in print */
    }

    /* KPI Cards scaling */
    .metrics-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        /* 2x2 for better fit in A4 */
        gap: 20px !important;
    }

    .kpi-card {
        padding: 20px !important;
        border: 1px solid #f0f0f0 !important;
        background: #f8f9fa !important;
    }

    /* Specific fixes for heatmap visibility */
    .heatmap-box {
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
    }

    /* Force light backgrounds and dark text for all elements */
    body,
    html,
    .dashboard-body,
    .main-content,
    .content-wrapper,
    .dashboard-section,
    .kpi-card,
    .chart-card,
    .table-container,
    .amber-table,
    .request-form-container,
    .request-form-content,
    .request-form-sidebar {
        background: #ffffff !important;
        background-color: #ffffff !important;
        background-image: none !important;
        color: #1a1a1a !important;
        box-shadow: none !important;
    }

    /* Neutralize gradients specifically */
    .request-form-sidebar,
    .sidebar-header,
    .top-bar,
    .home-hero-container {
        background: #ffffff !important;
        background-image: none !important;
    }

    .kpi-label,
    .kpi-number,
    .kpi-value-row,
    .chart-title,
    .page-title,
    .stat-label,
    .stat-value,
    .form-label,
    .welcome-text,
    .hero-subtitle,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    span,
    div,
    td,
    th,
    b,
    i {
        color: #1a1a1a !important;
        -webkit-text-fill-color: #1a1a1a !important;
    }

    .kpi-icon {
        background: #f8f9fa !important;
    }

    /* Ensure chart containers have white backgrounds */
    .chart-container,
    .chart-container-third,
    .chart-container-twothirds {
        background: #ffffff !important;
    }

    /* Report footer text */
    #report-footer {
        color: #666 !important;
        background: #f8f9fa !important;
        padding: 15px !important;
        border-top: 1px solid #eee !important;
    }

    /* Campaign Impact Analysis Table - Landscape Orientation */
    .print-landscape {
        page-break-before: always !important;
        page-break-after: always !important;
    }

    @page landscape {
        size: A4 landscape;
    }

    .print-landscape {
        page: landscape;
    }

    .amber-table,
    .table-container {
        background: #ffffff !important;
        width: 100% !important;
        page-break-inside: auto !important;
    }

    .amber-table {
        border-collapse: collapse !important;
        font-size: 10px !important;
        table-layout: fixed !important;
        width: 100% !important;
    }

    .amber-table thead {
        background: #f8f9fa !important;
        border-bottom: 2px solid #2c3e50 !important;
    }

    .amber-table th {
        color: #2c3e50 !important;
        font-weight: 700 !important;
        padding: 10px 6px !important;
        text-align: left !important;
        border: 1px solid #e0e0e0 !important;
        font-size: 9px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .amber-table tbody tr {
        background: #ffffff !important;
        page-break-inside: avoid !important;
    }

    .amber-table tbody tr:nth-child(even) {
        background: #f8f9fa !important;
    }

    .amber-table td {
        color: #1a1a1a !important;
        border: 1px solid #e0e0e0 !important;
        padding: 8px 6px !important;
        font-size: 9px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* First column (Campaign name) gets more space */
    .amber-table th:first-child,
    .amber-table td:first-child {
        width: 25% !important;
        white-space: normal !important;
    }

    /* Ensure table section fits on page */
    .dashboard-section.print-landscape {
        page-break-inside: avoid !important;
        margin: 0 !important;
        padding: 20px !important;
    }

    .print-landscape .chart-title {
        color: #1a1a1a !important;
        margin-bottom: 15px !important;
    }
}

/* Analytics Headers & Filters */
.sticky-filters {
    margin-bottom: 20px;
}

.filters-panel {
    display: flex;
    align-items: center;
    /* Ensures vertical centering of all children */
    gap: 15px;
    width: 100%;
    /* Ensure it takes full width */
    padding: 15px 25px;
    /* Align with other cards */
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-grey);
    box-shadow: var(--card-shadow);
    box-sizing: border-box;
    /* Ensure padding doesn't overflow width */
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-actions {
    margin-left: auto;
    /* Pushes the button to the right */
    display: flex;
    align-items: center;
    /* Ensure button itself is centered if container has height */
}

/* Catalog Section */
.catalog-section {
    padding: 24px;
    padding-bottom: 80px;
    max-width: 1800px;
    margin: 0 auto;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-grey);
    padding-bottom: 15px;
}

.catalog-header p {
    font-size: 0.9em;
    color: var(--text-grey);
}

.catalog-tabs {
    display: flex;
    gap: 5px;
    background: var(--bg-light);
    padding: 5px;
    border-radius: 10px;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-weight: 600;
    background: transparent;
    color: var(--text-grey);
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--text-dark);
    box-shadow: var(--card-shadow);
}

/* Catalog Card */
.catalog-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-grey);
    position: relative;
}

.catalog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.catalog-card.selected {
    border-color: var(--amber);
}

.card-preview {
    height: 180px;
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-grey);
}

.card-info {
    padding: 15px;
    flex-grow: 1;
}

.card-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-id-badge {
    font-size: 11px;
    background: var(--bg-light);
    color: var(--text-grey);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.selection-circle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 1.5px solid rgba(200, 200, 200, 0.6);
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s ease;
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.dark-mode .selection-circle {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.catalog-card.selected .selection-circle {
    background: var(--amber);
    border-color: var(--amber);
    color: white;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: var(--text-grey);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 12px;
    border: 1px solid var(--border-grey);
    background: var(--card-bg);
    color: var(--text-dark);
    font-family: inherit;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(242, 153, 19, 0.1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    overflow: hidden;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-grey);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-grey);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ef4444;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-grey);
    background: var(--bg-light);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-btn {
    padding: 10px 25px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 14px;
    border: none;
}

.modal-btn-primary {
    background: var(--amber);
    color: white;
    box-shadow: 0 4px 12px rgba(242, 153, 19, 0.2);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(242, 153, 19, 0.3);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--text-grey);
    border: 1px solid var(--border-grey);
}

.modal-btn-secondary:hover {
    background: var(--bg-light);
}

/* Preview Content Specific */
.preview-container {
    text-align: center;
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-light);
}

.preview-meta {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: 5px;
    text-align: left;
}

.preview-meta div {
    color: var(--text-dark);
    font-size: 13px;
    margin-bottom: 4px;
}

.preview-meta b {
    color: var(--text-grey);
    font-weight: 600;
}

/* =========================================
   Home Dashboard Styles
   ========================================= */
.home-hero-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 60px 0;
    gap: 40px;
}

.home-hero-content {
    flex: 1;
    max-width: 600px;
}

.welcome-text {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 20px;
}

.welcome-text .highlight-text {
    color: var(--amber);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-grey);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 500px;
}

.home-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.home-action-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--border-grey);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.home-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: #e2e8f0;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.card-icon.blue {
    background-color: rgba(242, 153, 19, 0.1);
    color: var(--amber);
}

.card-icon.amber {
    background-color: rgba(242, 153, 19, 0.1);
    color: #f29913;
}

.dark-mode .card-icon.blue {
    background-color: rgba(242, 153, 19, 0.2);
}

.dark-mode .card-icon.amber {
    background-color: rgba(242, 153, 19, 0.2);
}

.card-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 5px 0;
}

.card-info p {
    font-size: 13px;
    color: var(--text-grey);
    margin: 0;
    line-height: 1.4;
}

.home-buttons-row {
    display: flex;
    gap: 20px;
}

.btn-primary-home,
.btn-secondary-home {
    flex: 1;
    justify-content: center;
    padding: 16px 20px;
    height: 56px;
    /* Consistent height */
    box-sizing: border-box;
}

.btn-primary-home {
    background-color: var(--amber);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(242, 153, 19, 0.3);
}

.btn-primary-home:hover {
    background-color: var(--amber-hover);
    transform: translateY(-2px);
}

.btn-secondary-home {
    background-color: var(--card-bg);
    color: var(--text-dark);
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.btn-secondary-home:hover {
    background-color: var(--sidebar-hover);
    border-color: var(--amber);
}

.home-hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.mockup-stack {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mockup-container {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--border-grey);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mockup-container.secondary {
    position: absolute;
    top: 0;
    left: 0;
    width: 85%;
    z-index: 1;
}

.mockup-container.primary {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 85%;
    z-index: 2;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
}

.mockup-container:hover {
    transform: translateY(-5px);
}

.mockup-header {
    background: var(--bg-light);
    padding: 12px 15px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-grey);
}

.mockup-header .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.mockup-content {
    padding: 0;
    /* Remove padding to let image fill */
    position: relative;
    height: 300px;
    /* Fixed height for consistency */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfdfd;
}

.mockup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chart-mockup {
    margin-bottom: 30px;
    height: 150px;
    display: flex;
    align-items: flex-end;
}

.bar-group {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.bar {
    flex: 1;
    max-width: 40px;
    background: var(--bg-light);
    border-radius: 6px;
    transition: height 1s ease;
}

.bar.active {
    background: var(--amber);
}

.stats-mini-cards {
    display: flex;
    gap: 15px;
}

.mini-card {
    flex: 1;
    background: var(--bg-light);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-value {
    font-size: 18px;
    font-weight: 700;
}

.amber-text {
    color: var(--amber);
}

.red-text {
    color: #ef4444;
}

.ai-toast-mockup {
    position: absolute;
    bottom: 40px;
    right: -20px;
    background: #1e293b;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    color: white;
    z-index: 10;
}

.ai-toast-mockup .ai-icon-mini {
    width: 32px;
    height: 32px;
    background: var(--amber);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.ai-toast-content {
    display: flex;
    flex-direction: column;
}

.ai-label {
    font-size: 10px;
    color: #94a3b8;
}

.ai-msg {
    font-size: 12px;
    font-weight: 600;
}

.home-bottom-stats-container {
    padding: 20px 0 60px 0;
}

.home-bottom-stats-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-grey);
    transition: all 0.3s ease;
}

.footer-stat {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Stat-specific colors matching risk funnel progression (5 distinct steps) */
.stat-sent .stat-icon-mini {
    background-color: rgba(251, 192, 45, 0.1);
    color: #fbc02d;
}

.stat-opened .stat-icon-mini {
    background-color: rgba(255, 160, 0, 0.1);
    color: #ffa000;
}

.stat-clicked .stat-icon-mini {
    background-color: rgba(245, 124, 0, 0.1);
    color: #f57c00;
}

.stat-submitted .stat-icon-mini {
    background-color: rgba(216, 67, 21, 0.1);
    color: #d84315;
}

.stat-reported .stat-icon-mini {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.dark-mode .stat-sent .stat-icon-mini {
    background-color: rgba(251, 192, 45, 0.2);
}

.dark-mode .stat-opened .stat-icon-mini {
    background-color: rgba(255, 160, 0, 0.2);
}

.dark-mode .stat-clicked .stat-icon-mini {
    background-color: rgba(245, 124, 0, 0.2);
}

.dark-mode .stat-submitted .stat-icon-mini {
    background-color: rgba(216, 67, 21, 0.2);
}

.dark-mode .stat-reported .stat-icon-mini {
    background-color: rgba(148, 163, 184, 0.2);
}

.stat-info-mini {
    display: flex;
    flex-direction: column;
}

.stat-icon-mini {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.amber-bg {
    background-color: var(--sidebar-hover);
    color: var(--amber);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-grey);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: capitalize;
}


@media (max-width: 1024px) {
    .home-hero-container {
        flex-direction: column;
        text-align: center;
    }

    .home-hero-content {
        max-width: 100%;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .home-buttons-row {
        justify-content: center;
    }

    .home-hero-visual {
        width: 100%;
    }

    .ai-toast-mockup {
        right: 20px;
    }

    .home-bottom-stats-card {
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .home-cards-grid {
        grid-template-columns: 1fr;
    }

    .home-bottom-stats-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 30px;
    }
}

/* --- Campaign Card Styles (Moved from inline) --- */
.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-grey);
    padding-bottom: 10px;
}

.campaign-title {
    margin: 0;
    font-size: 18px;
    color: var(--text-dark);
}

.campaign-id {
    font-size: 12px;
    color: var(--text-grey);
    white-space: nowrap;
    flex-shrink: 0;
}

.campaign-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.row-label {
    color: var(--text-grey);
    font-size: 14px;
}

.row-value {
    font-weight: 500;
    color: var(--text-dark);
}

.campaign-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.camp-stat-box {
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    background: var(--bg-light);
}

.camp-stat-value {
    font-size: 18px;
    font-weight: 700;
}

.camp-stat-label {
    font-size: 11px;
}

/* Stat Variants */
.camp-stat-sent {
    background: rgba(0, 105, 92, 0.1);
}

.camp-stat-sent .camp-stat-value {
    color: #00695c;
}

.dark-mode .camp-stat-sent .camp-stat-value {
    color: #4db6ac;
}

.camp-stat-sent .camp-stat-label {
    color: #004d40;
}

.dark-mode .camp-stat-sent .camp-stat-label {
    color: #80cbc4;
}

.camp-stat-opened {
    background: rgba(239, 108, 0, 0.1);
}

.camp-stat-opened .camp-stat-value {
    color: #ef6c00;
}

.dark-mode .camp-stat-opened .camp-stat-value {
    color: #ffb74d;
}

.camp-stat-opened .camp-stat-label {
    color: #e65100;
}

.dark-mode .camp-stat-opened .camp-stat-label {
    color: #ffe0b2;
}

.camp-stat-clicked {
    background: rgba(245, 127, 23, 0.1);
}

.camp-stat-clicked .camp-stat-value {
    color: #f57f17;
}

.dark-mode .camp-stat-clicked .camp-stat-value {
    color: #ffd54f;
}

.camp-stat-clicked .camp-stat-label {
    color: #bf360c;
}

.dark-mode .camp-stat-clicked .camp-stat-label {
    color: #ffccbc;
}

.camp-stat-submitted {
    background: rgba(198, 40, 40, 0.1);
}

.camp-stat-submitted .camp-stat-value {
    color: #c62828;
}

.dark-mode .camp-stat-submitted .camp-stat-value {
    color: #ef5350;
}

.camp-stat-submitted .camp-stat-label {
    color: #b71c1c;
}

.dark-mode .camp-stat-submitted .camp-stat-label {
    color: #ffcdd2;
}

/* --- Request Campaign & Timeline Styles (Extracted from request-campaign.html) --- */

/* Date Picker Overrides */
.flatpickr-calendar {
    font-family: var(--primary-font) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--border-grey) !important;
    background: var(--card-bg) !important;
}

.flatpickr-month {
    background: var(--amber) !important;
    color: white !important;
    fill: white !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--amber) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
    background: var(--card-bg) !important;
    color: var(--text-dark) !important;
}

.flatpickr-weekdays {
    background: var(--amber) !important;
}

.flatpickr-day {
    color: var(--text-dark) !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-grey) !important;
}

.flatpickr-day.selected,
.flatpickr-day:hover,
.flatpickr-day:focus {
    background: var(--amber) !important;
    border-color: var(--amber) !important;
    color: white !important;
}

/* Range Slider */
.range-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-light);
    padding: 8px 15px;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    flex: 1;
}

.amber-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 5px;
    outline: none;
}

.dark-mode .amber-range {
    background: #334155;
}

.amber-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--amber);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.number-input-mini {
    width: 70px;
    padding: 8px;
    border: 1px solid var(--border-grey);
    border-radius: 6px;
    text-align: center;
    font-family: var(--primary-font);
    font-size: 14px;
    background: var(--bg-light);
    color: var(--text-dark);
}

/* Requests Feed */
.requests-feed {
    margin-top: 40px;
    padding-bottom: 60px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.feed-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.btn-status-flow {
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-grey);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 15px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}
.btn-status-flow:hover {
    color: #f29913;
    border-color: #f29913;
    background: rgba(242,153,19,0.06);
}

/* ── Status Flow Diagram ── */
.modal-card-wide {
    width: 820px !important;
    max-width: 95% !important;
}
.modal-card-wide .modal-body {
    max-height: 75vh;
    overflow-y: auto;
}
.sf-diagram {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}
.sf-main-flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 48px;
    padding: 0 8px;
}
.sf-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    position: relative;
    z-index: 1;
}
.sf-num {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex-shrink: 0;
    background: #f3f4f6; color: #6b7280;
    border: 1px solid #d1d5db;
}
.sf-step-icon {
    font-size: 13px; color: #9ca3af; width: 16px; text-align: center; flex-shrink: 0;
}
.sf-label {
    font-size: 13px; font-weight: 500; color: var(--text-dark);
    white-space: nowrap;
}
.sf-alt-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 24px;
}
.sf-alt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}
@media (max-width: 700px) {
    .sf-alt-grid { grid-template-columns: 1fr; }
}
.sf-alt-title {
    font-size: 11px; font-weight: 700; color: #9ca3af;
    margin: 0 0 14px; display: flex; align-items: center; gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sf-alt-path {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid #f3f4f6;
}
.sf-alt-path:last-child { border-bottom: none; }
.sf-alt-from {
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}
.sf-alt-arrow { color: #d1d5db; font-size: 11px; text-align: center; }
.sf-alt-icon { font-size: 12px; color: #9ca3af; text-align: center; }
.sf-alt-label { font-weight: 600; font-size: 12px; white-space: nowrap; color: #6b7280; }

.request-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid var(--border-grey);
}

.request-card:hover {
    transform: translateY(-2px);
}

.request-main {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: var(--card-bg);
}

.request-card.expanded .request-main {
    background: var(--card-bg);
}

.request-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.request-id {
    background: var(--bg-light);
    color: var(--text-grey);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
}

.request-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

.request-date {
    color: var(--text-grey);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 16px;
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-validating {
    background: rgba(242, 153, 19, 0.15);
    color: #f29913;
}

.status-rejected {
    background: rgba(229, 115, 115, 0.15);
    color: #e57373;
}

.status-provisionando {
    background: rgba(239, 108, 0, 0.15);
    color: #ef6c00;
}

.status-provisioned,
.status-done,
.status-scheduled,
.status-connection-confirmed,
.status-approved {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.status-verifying-connectivity,
.status-final-verification {
    background: rgba(52, 152, 219, 0.15);
    color: #2980b9;
}

.status-in-progress {
    background: rgba(155, 89, 182, 0.15);
    color: #8e44ad;
}

.status-report-available {
    background: rgba(0, 166, 153, 0.15);
    color: #00a699;
}

.status-waiting-feedback,
.status-waiting-for-file,
.status-pending-revision {
    background: rgba(243, 156, 18, 0.15);
    color: #d35400;
}

.status-file-uploaded {
    background: rgba(26, 188, 156, 0.15);
    color: #16a085;
}

.status-file-rejected,
.status-connection-issue,
.status-final-verification-issue {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.status-archived {
    background: var(--bg-light);
    color: var(--text-grey);
}

/* --- Form Buttons --- */
.form-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 24px;
}

.btn-submit {
    background: linear-gradient(135deg, #f5a623 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(230, 126, 34, 0.35);
    filter: brightness(1.05);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.btn-reset {
    background: var(--bg-light);
    color: var(--text-grey);
    border: 1px solid var(--border-grey);
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-reset:hover {
    border-color: var(--amber);
    color: var(--amber);
    background: rgba(242, 153, 19, 0.05);
}

/* Request Details */
.request-details {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease-out;
    background: var(--bg-light);
    border-top: 1px solid transparent;
}

.request-card.expanded .request-details {
    padding: 24px;
    border-top: 1px solid var(--border-grey);
    max-height: none;
    overflow: visible;
}

/* Timeline */
.timeline {
    position: relative;
    margin-left: 20px;
    padding-left: 30px;
    border-left: 2px solid var(--border-grey);
    padding-bottom: 20px;
}

.timeline-content {
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-grey);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.timeline-user {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-dark);
}

.timeline-time {
    font-size: 11px;
    color: var(--text-grey);
}

.timeline-status {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.timeline-comment {
    font-size: 13px;
    color: var(--text-grey);
    line-height: 1.5;
    font-style: italic;
}

.request-card img[data-rc-thumb]:hover { opacity: 0.85; }
.request-card img:hover { opacity: 0.82; }


/* Timeline admin actions */
.timeline-admin-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    opacity: 0.45;
    transition: opacity 0.15s;
}

.timeline-item:hover .timeline-admin-actions {
    opacity: 1;
}

.timeline-action-btn {
    background: none;
    border: 1px solid var(--border-grey);
    border-radius: 5px;
    padding: 2px 5px;
    font-size: 11px;
    color: var(--text-grey);
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.1s, color 0.1s;
}

.timeline-action-btn:hover {
    background: var(--bg-light, #f5f5f5);
    color: var(--text-dark);
}

.timeline-action-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Timeline edit modal */
.timeline-edit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-edit-modal {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 24px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-edit-modal h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--text-dark);
}

.timeline-edit-modal label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-grey);
    margin-bottom: -4px;
}

.timeline-edit-modal select,
.timeline-edit-modal textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-grey);
    border-radius: 7px;
    font-size: 13px;
    background: var(--input-bg, #fff);
    color: var(--text-dark);
    box-sizing: border-box;
    font-family: inherit;
}

.timeline-edit-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.timeline-modal-btn {
    padding: 7px 18px;
    border-radius: 7px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s;
}

.timeline-modal-btn-primary {
    background: var(--accent, #f29913);
    color: #fff;
}

.timeline-modal-btn-primary:hover {
    opacity: 0.88;
}

.timeline-modal-btn-secondary {
    background: var(--bg-light, #f0f0f0);
    color: var(--text-dark, #333);
    border: 1px solid var(--border-grey, #ddd);
}

.timeline-modal-btn-secondary:hover {
    background: var(--border-grey, #e0e0e0);
}

.timeline-edit-modal input[type="datetime-local"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-grey);
    border-radius: 7px;
    font-size: 13px;
    background: var(--input-bg, #fff);
    color: var(--text-dark);
    font-family: inherit;
}

.timeline-dot {
    position: absolute;
    left: -48px;
    top: 2px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 2;
}

/* Actions */
.action-row {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-grey);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
    background: var(--card-bg);
    color: var(--text-dark);
    resize: none;
}

.comment-rich-editor {
    width: 100%;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
    background: var(--card-bg);
    color: var(--text-dark);
    min-height: 70px;
}
.comment-rich-editor .tiptap {
    padding: 10px 14px;
    outline: none;
    min-height: 48px;
}
.comment-rich-editor .tiptap img {
    max-width: 900px;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.10);
    display: block;
    margin: 4px 0;
}
.comment-rich-editor .rich-editor-toolbar {
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--border-grey);
    padding: 4px 8px;
}

/* Image zoom lightbox */
.img-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeInOverlay 0.15s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.img-zoom-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    cursor: default;
}

.btn-action {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: var(--primary-font);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-approve,
.btn-modify {
    background: var(--amber);
    color: white;
}

.btn-reject {
    background: #e57373;
    color: white;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-secondary {
    background: var(--sidebar-hover);
    color: var(--text-grey);
    border-color: var(--border-grey);
}

/* New Specific Button Styles */
.template-btn,
.icon-btn {
    background: var(--bg-light);
    color: var(--text-grey);
    border: 1px solid var(--border-grey);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.template-btn:hover,
.icon-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
    background: rgba(242, 153, 19, 0.08);
    transform: translateY(-1px);
}

.template-btn i,
.icon-btn i {
    pointer-events: none;
}

.btn-delete:hover {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.btn-archive:hover {
    color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.08) !important;
}

.dark-mode .template-btn,
.dark-mode .icon-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.dark-mode .template-btn:hover,
.dark-mode .icon-btn:hover {
    background: rgba(242, 153, 19, 0.15);
    border-color: var(--amber);
    color: var(--amber);
}

/* Main Request Form Container specific classes */
.request-form-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.request-form-sidebar {
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e6 100%);
    padding: 50px 35px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.dark-mode .request-form-sidebar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.request-form-sidebar h2 {
    color: var(--text-dark) !important;
    margin: 0 0 20px 0;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
}

.request-form-sidebar p {
    color: var(--text-grey) !important;
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
}

.request-form-content {
    padding: 50px 45px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 13px;
}

/* ===================================================
   REPORTS SECTION - Adapted from Portal-Clients rv-*
   =================================================== */

/* Page subtitle */
.rv-page-subtitle {
    font-size: 15px;
    color: var(--text-grey);
    margin: -8px 0 24px;
}

/* Report Type Selector Cards */
.rv-report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.rv-report-card {
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: var(--border-radius);
    padding: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rv-report-card:hover {
    border-color: var(--amber);
    box-shadow: 0 8px 24px rgba(242, 153, 19, 0.12);
    transform: translateY(-2px);
}

.rv-report-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.rv-report-card-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.rv-report-card-icon.orange { background: linear-gradient(135deg, #f97316, #ea580c); }

.rv-report-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.rv-report-card p {
    font-size: 14px;
    color: var(--text-grey);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.rv-report-card-action {
    font-size: 14px;
    font-weight: 600;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.rv-report-card-action i {
    transition: transform 0.2s;
}

.rv-report-card:hover .rv-report-card-action i {
    transform: translateX(4px);
}

/* Report Toolbar */
.rv-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: var(--border-radius);
    margin-bottom: 0;
}

.rv-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rv-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rv-toolbar-back {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-grey);
    background: var(--card-bg);
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}

.rv-toolbar-back:hover {
    background: var(--amber);
    color: #fff;
    border-color: var(--amber);
}

.rv-report-type-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rv-report-type-badge.blue { background: #3b82f6; }
.rv-report-type-badge.orange { background: #f97316; }

/* Selector Panel */
.rv-selector-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 720px;
}

.rv-selector-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rv-selector-row .amber-select {
    flex: 1;
    min-width: 240px;
}

.rv-selector-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

/* Toolbar Campaign Select */
.rv-toolbar-select {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    background: var(--card-bg);
    font-family: inherit;
    cursor: pointer;
    max-width: 320px;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666E80'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.rv-toolbar-select:hover,
.rv-toolbar-select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(242, 153, 19, 0.15);
    outline: none;
}

/* Format Dropdown (portal-clients style) */
.rv-report-type-dropdown {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    position: relative;
    user-select: none;
}

.rv-report-type-dropdown:hover {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(242, 153, 19, 0.15);
}

.rv-dropdown-chevron {
    font-size: 10px;
    color: var(--text-grey);
    transition: transform 0.2s;
}

.rv-dropdown-menu.open ~ .rv-dropdown-chevron,
.rv-report-type-dropdown:has(.rv-dropdown-menu.open) .rv-dropdown-chevron {
    transform: rotate(180deg);
}

.rv-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.rv-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rv-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.1s;
}

.rv-dropdown-item:hover {
    background: var(--bg-light);
}

.rv-dropdown-item i:first-child {
    width: 16px;
    text-align: center;
    color: var(--text-grey);
    font-size: 13px;
}

.rv-dropdown-check {
    margin-left: auto;
    font-size: 12px;
    color: var(--amber);
    opacity: 0;
    transition: opacity 0.15s;
}

.rv-dropdown-item.selected .rv-dropdown-check {
    opacity: 1;
}

.rv-dropdown-item.selected {
    color: var(--amber);
    font-weight: 600;
}

.rv-dropdown-item.selected i:first-child {
    color: var(--amber);
}

.rv-dropdown-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.rv-dropdown-soon {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-grey);
    font-style: italic;
}

/* btn-modern (portal-clients style) */
.btn-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-grey);
    background-color: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-dark);
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-modern:hover {
    background-color: var(--bg-light);
}

.btn-modern.btn-primary {
    background-color: var(--amber);
    color: #fff;
    border: none;
}

.btn-modern.btn-primary:hover {
    background-color: #e6890d;
}

.btn-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Report Layout */
.rv-layout {
    display: flex;
    gap: 0;
    min-height: 600px;
    background: var(--card-bg);
    border: 1px solid var(--border-grey);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Sidebar */
.rv-sidebar {
    flex: 0 0 280px;
    border-right: 1px solid var(--border-grey);
    padding: 24px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.rv-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-dark);
}

.rv-section-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rv-section-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
    font-family: var(--primary-font);
}

.rv-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 20px;
}

.rv-step-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-grey);
    background: var(--card-bg);
    flex-shrink: 0;
    transition: all 0.2s;
}

.rv-section-btn.active .rv-step-circle {
    border-color: var(--amber);
    background: var(--amber);
    box-shadow: 0 0 0 3px rgba(242, 153, 19, 0.2);
}

.rv-step-line {
    width: 2px;
    height: 24px;
    background: var(--border-grey);
    flex-shrink: 0;
}

.rv-step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    padding: 0 0 10px;
    line-height: 14px;
    transition: all 0.15s;
}

.rv-section-btn.active .rv-step-label {
    background: var(--amber);
    color: #fff;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    margin: -4px 0 6px;
}

.rv-section-btn:not(.disabled):hover .rv-step-label {
    color: var(--amber);
}

/* Edit mode: disabled sidebar sections */
.rv-section-btn.disabled {
    cursor: not-allowed;
    opacity: 0.4;
    pointer-events: none;
}

.rv-section-btn.disabled .rv-step-circle {
    border-color: var(--border-grey);
    background: var(--bg-light);
}

.rv-section-btn.disabled .rv-step-label {
    color: var(--text-grey);
}

/* Edit mode: editable sidebar sections get a subtle highlight */
.rv-section-btn.editable .rv-step-circle {
    border-color: var(--amber);
}

.rv-section-btn.editable .rv-step-label {
    color: var(--amber);
    font-weight: 600;
}

/* Active + editable: keep white text on amber background */
.rv-section-btn.active.editable .rv-step-label {
    color: #fff;
}

/* Edit mode: dim non-editable content sections */
.rv-section-disabled {
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}

/* Content Area */
.rv-content {
    flex: 1;
    padding: 32px 40px 80px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.rv-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-grey);
    gap: 16px;
    font-size: 16px;
}

.rv-loading-state i {
    font-size: 32px;
    color: var(--amber);
}

/* Cover Page */
.rv-cover-page {
    position: relative;
    width: 100%;
    min-height: 500px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 48px;
    scroll-margin-top: 24px;
}

.rv-cover-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rv-cover-bg-gradient.generic {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #f29913 100%);
}

.rv-cover-bg-gradient.spear {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #e94560 100%);
}

.rv-cover-bg-gradient.consolidated {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 40%, #1e1b4b 100%);
}

.rv-cover-bg-gradient.dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.rv-cover-bg-gradient.teal {
    background: linear-gradient(135deg, #0f172a 0%, #134e4a 40%, #14b8a6 100%);
}

/* ── Cover Background Toolbar (edit mode) ── */
.rv-cover-bg-toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 6px 10px;
}

.rv-cover-bg-swatches {
    display: flex;
    gap: 6px;
    align-items: center;
}

.rv-cover-bg-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    padding: 0;
}

.rv-cover-bg-swatch:hover {
    transform: scale(1.15);
}

.rv-cover-bg-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.rv-cover-bg-separator {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.25);
}

.rv-cover-bg-custom {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rv-cover-bg-color-input {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: none;
    -webkit-appearance: none;
    appearance: none;
}

.rv-cover-bg-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.rv-cover-bg-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.rv-cover-bg-color-input::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

.rv-cover-bg-custom-preview {
    width: 32px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
}

.rv-cover-bg-action-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.15s;
}

.rv-cover-bg-action-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ── Consolidated Report Card ── */
.rv-consolidated-card {
    border: 2px dashed rgba(242, 153, 19, 0.35);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(242, 153, 19, 0.05), rgba(217, 119, 6, 0.10));
    transition: all 0.3s ease;
}
.rv-consolidated-card:hover {
    border-color: rgba(242, 153, 19, 0.65);
    background: linear-gradient(135deg, rgba(242, 153, 19, 0.08), rgba(217, 119, 6, 0.14));
}

/* ── Trend Indicators ── */
.rv-trend-improving { color: #22c55e; font-weight: 600; }
.rv-trend-worsening { color: #ef4444; font-weight: 600; }
.rv-trend-stable { color: #94a3b8; font-weight: 600; }

.rv-cover-overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 500px;
    padding: 40px 48px;
}

.rv-cover-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.rv-cover-logo {
    height: 64px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.rv-cover-logo-right {
    height: 56px;
    max-width: 200px;
}

.rv-cover-confidential {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.6) !important;
    text-transform: uppercase;
    margin-top: 8px;
}

.rv-cover-center {
    text-align: left;
    padding: 32px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rv-cover-title {
    font-size: 36px;
    font-weight: 800;
    color: #fff !important;
    margin: 0 0 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.rv-cover-subtitle {
    font-size: 22px;
    font-weight: 600;
    color: #fff !important;
    margin: 0 0 6px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.rv-cover-assessment {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.rv-cover-bottom {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rv-cover-info-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.rv-cover-info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.rv-cover-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rv-cover-info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.7) !important;
}

.rv-cover-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
}

.rv-cover-targets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rv-cover-target {
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.15);
    padding: 3px 10px;
    border-radius: 4px;
    font-family: monospace;
}

.dark-mode .rv-cover-target {
    background: rgba(255, 255, 255, 0.1);
}

/* Sections */
.rv-section {
    margin-bottom: 48px;
    scroll-margin-top: 24px;
}

.rv-section-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--amber);
}

.rv-subsection-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 24px 0 12px;
}

.rv-paragraph {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dark);
    margin: 0 0 12px;
    text-align: justify;
}

/* Table of Contents */
.rv-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rv-toc-list li {
    margin: 0;
    padding: 0;
}

.rv-toc-link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    transition: color 0.15s;
}

.rv-toc-link:hover {
    color: var(--amber);
}

.rv-toc-number {
    font-weight: 600;
    color: var(--amber);
    flex-shrink: 0;
}

.rv-toc-label {
    flex-shrink: 0;
}

.rv-toc-dots {
    flex: 1;
    border-bottom: 2px dotted var(--border-grey);
    margin: 0 4px;
    position: relative;
    top: -3px;
}

/* Title Meta Box */
.rv-title-meta {
    background: rgba(242, 153, 19, 0.06);
    border: 1px solid rgba(242, 153, 19, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dark-mode .rv-title-meta {
    background: rgba(242, 153, 19, 0.08);
    border-color: rgba(242, 153, 19, 0.15);
}

.rv-meta-row {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
}

.rv-meta-block strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-grey);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rv-meta-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

/* Objectives List */
.rv-objectives-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.rv-objective-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-dark);
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 8px;
}

.rv-objective-item i {
    color: var(--amber);
    font-size: 16px;
    flex-shrink: 0;
}

/* Methodology Phases */
.rv-methodology-phases {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 24px 0;
}

.rv-phase-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-grey);
}

.rv-phase-item:last-child {
    border-bottom: none;
}

.rv-phase-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--amber);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rv-phase-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px;
}

.rv-phase-content h4 i {
    margin-right: 6px;
    color: var(--amber);
}

.rv-phase-content p {
    font-size: 13px;
    color: var(--text-grey);
    margin: 0;
    line-height: 1.5;
}

/* Deliverables */
.rv-deliverables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.rv-deliverable-card {
    background: var(--bg-light);
    border: 1px solid var(--border-grey);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.rv-deliverable-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(242, 153, 19, 0.1);
    color: var(--amber);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.rv-deliverable-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.rv-deliverable-card p {
    font-size: 13px;
    color: var(--text-grey);
    margin: 0;
    line-height: 1.5;
}

/* Executive Summary Grid */
.rv-executive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.rv-executive-card {
    background: var(--bg-light);
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
}

.rv-executive-stat {
    font-size: 20px;
    font-weight: 800;
    color: var(--amber);
    margin-bottom: 2px;
}

.rv-executive-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Risk Indicator */
.rv-risk-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    border: 1px solid var(--border-grey);
}

.rv-risk-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Severity Badges */
.rv-sev-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rv-sev-badge.sev-critical { background: #dc3545; }
.rv-sev-badge.sev-high { background: #fd7e14; }
.rv-sev-badge.sev-medium { background: #ffc107; color: #fff; }
.rv-sev-badge.sev-low { background: #6f42c1; }
.rv-sev-badge.sev-info { background: #adb5bd; color: #fff; }

/* Charts */
.rv-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 16px 0;
}

.rv-chart-card {
    border: 1px solid var(--border-grey);
    border-radius: 12px;
    padding: 20px;
    background: var(--card-bg);
}

.rv-chart-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-dark);
}

.rv-chart-container {
    position: relative;
    height: 260px;
}

.rv-chart-container.rv-chart-wide {
    height: 300px;
}

/* Tables */
.rv-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
}

.rv-table th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-grey);
    border-bottom: 2px solid var(--border-grey);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rv-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-grey);
    color: var(--text-dark);
    vertical-align: middle;
}

.rv-table tbody tr:last-child td {
    border-bottom: none;
}

.rv-table tbody tr:hover {
    background: rgba(242, 153, 19, 0.04);
}

.rv-kpi-detail-table {
    margin-top: 24px;
}

/* Finding Detail Cards (for Spear target analysis) */
.rv-targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.rv-finding-detail {
    border: 1px solid var(--border-grey);
    border-radius: 12px;
    padding: 20px 24px;
    background: var(--card-bg);
}

.rv-finding-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.rv-finding-detail-header h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
}

.rv-finding-field {
    margin-bottom: 8px;
}

.rv-finding-field strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-grey);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rv-finding-field p {
    font-size: 13px;
    color: var(--text-dark);
    margin: 0;
}

/* Recommendations */
.rv-recommendations-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rv-recommendation-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border-grey);
    border-radius: 10px;
    background: var(--card-bg);
    transition: border-color 0.15s;
}

.rv-recommendation-card.priority-high {
    border-color: rgba(253, 126, 20, 0.35);
}

.rv-recommendation-card.priority-medium {
    border-color: rgba(255, 193, 7, 0.35);
}

.rv-recommendation-card.priority-low {
    border-color: rgba(111, 66, 193, 0.35);
}

.rv-rec-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(242, 153, 19, 0.1);
    color: var(--amber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.rv-rec-content {
    flex: 1;
}

.rv-rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.rv-rec-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.rv-rec-content p {
    font-size: 13px;
    color: var(--text-grey);
    margin: 0;
    line-height: 1.6;
}

/* Conclusions Summary */
.rv-conclusion-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.rv-conclusion-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-light);
    border: 1px solid var(--border-grey);
    border-radius: 10px;
}

.rv-conclusion-item.risk-critical { border-color: #dc3545; background: rgba(220, 53, 69, 0.06); }
.rv-conclusion-item.risk-high { border-color: #fd7e14; background: rgba(253, 126, 20, 0.06); }
.rv-conclusion-item.risk-medium { border-color: #ffc107; background: rgba(255, 193, 7, 0.06); }
.rv-conclusion-item.risk-low { border-color: #22c55e; background: rgba(34, 197, 94, 0.06); }

.rv-conclusion-number {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.rv-conclusion-text {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rv-conclusion-detail {
    display: block;
    font-size: 11px;
    color: var(--text-grey);
    margin-top: 4px;
    font-weight: 400;
}

/* ── Effectiveness Funnel ── */
.rv-funnel {
    margin-top: 24px;
}
.rv-funnel h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 16px;
}
.rv-funnel-row {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}
.rv-funnel-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-grey);
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rv-funnel-track {
    height: 24px;
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-grey);
}
.rv-funnel-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    min-width: 2px;
}
.rv-funnel-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Responsive */
@media (max-width: 900px) {
    .rv-layout {
        flex-direction: column;
    }

    .rv-sidebar {
        flex: none;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-grey);
    }

    .rv-content {
        max-height: none;
    }

    .rv-charts-row {
        grid-template-columns: 1fr;
    }

    .rv-executive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rv-conclusion-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .rv-deliverables-grid {
        grid-template-columns: 1fr;
    }

    .rv-report-cards {
        grid-template-columns: 1fr;
    }
}

/* ===== Report Edit Mode ===== */

/* ── Tiptap Rich Editor ── */
.rv-editor-wrapper {
    border: 1px solid var(--border-grey);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg, #fff);
}

.rv-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-grey);
    background: var(--bg-light, #f9f9f9);
    flex-wrap: wrap;
}

.rv-toolbar-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-grey);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    font-family: 'Montserrat', sans-serif;
}

.rv-toolbar-btn-text {
    font-size: 12px;
    font-weight: 700;
}

.rv-toolbar-btn:hover {
    background: var(--border-grey);
    color: var(--text-dark);
}

.rv-toolbar-btn.active {
    background: var(--amber);
    color: #fff;
}

.rv-toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border-grey);
    margin: 0 4px;
}

.rv-editor-content {
    padding: 16px 20px;
    min-height: 140px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dark);
}

.rv-editor-content .tiptap {
    outline: none;
}

.rv-editor-content .tiptap p { margin: 0 0 8px; }
.rv-editor-content .tiptap ul,
.rv-editor-content .tiptap ol { padding-left: 24px; margin: 0 0 8px; }
.rv-editor-content .tiptap li { margin-bottom: 4px; }

.rv-editor-content .tiptap h1 { font-size: 22px; font-weight: 700; margin: 20px 0 10px; line-height: 1.3; }
.rv-editor-content .tiptap h2 { font-size: 18px; font-weight: 700; margin: 18px 0 8px; line-height: 1.3; }
.rv-editor-content .tiptap h3 { font-size: 16px; font-weight: 700; margin: 16px 0 8px; }

.rv-editor-content .tiptap blockquote {
    border-left: 3px solid var(--amber);
    margin: 8px 0;
    padding: 4px 16px;
    color: var(--text-grey);
    background: rgba(0, 0, 0, 0.02);
}

.rv-editor-content .tiptap code {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    padding: 2px 5px;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.rv-editor-content .tiptap pre {
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 8px 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.rv-editor-content .tiptap pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.rv-editor-content .tiptap a,
.rv-editor-link {
    color: var(--amber);
    text-decoration: underline;
    cursor: pointer;
}

.rv-editor-content .tiptap s { text-decoration: line-through; }

.rv-editor-content .tiptap img {
    max-width: 480px;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
}

.rv-editor-content .tiptap p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: var(--text-grey);
    opacity: 0.5;
    pointer-events: none;
    height: 0;
}

.rv-editor-content .tiptap strong { font-weight: 700; }

/* ── Fallback textarea (when Tiptap not loaded) ── */
.rv-edit-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid var(--amber);
    border-radius: 8px;
    padding: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: var(--card-bg);
    color: var(--text-dark);
    box-sizing: border-box;
}

.rv-edit-textarea:focus {
    outline: none;
    border-color: #e08a10;
    box-shadow: 0 0 0 3px rgba(242, 153, 19, 0.15);
}

.rv-edit-select {
    padding: 6px 12px;
    border: 2px solid var(--amber);
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    background: var(--card-bg);
    color: var(--text-dark);
    cursor: pointer;
}

.rv-edit-select:focus {
    outline: none;
    border-color: #e08a10;
    box-shadow: 0 0 0 3px rgba(242, 153, 19, 0.15);
}

/* Cover title: when displaying saved rich HTML on the gradient cover */
.rv-editable-cover-title {
    color: #fff !important;
}

.rv-editable-cover-title h1,
.rv-editable-cover-title h1 * { color: #fff !important; }
.rv-editable-cover-title p,
.rv-editable-cover-title p * { color: rgba(255,255,255,0.85) !important; }

/* Cover title editor wrapper: sits on gradient background */
.rv-edit-cover-title-wrapper .rv-editor-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Cover risk level dropdown on gradient */
.rv-edit-cover-risk-select {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: var(--text-dark) !important;
    font-size: 13px !important;
    padding: 4px 12px !important;
}

.rv-rec-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background 0.15s;
    z-index: 2;
}

.rv-rec-remove:hover {
    background: #dc2626;
}

.rv-rec-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 2px dashed var(--border-grey);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-grey);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
}

.rv-rec-add-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
    background: rgba(242, 153, 19, 0.04);
}

.rv-icon-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 4px 0;
}

.rv-icon-picker-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-grey);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-grey);
    transition: all 0.15s;
}

.rv-icon-picker-item:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.rv-icon-picker-item.selected {
    border-color: var(--amber);
    background: rgba(242, 153, 19, 0.12);
    color: var(--amber);
}

.rv-rec-add-form {
    border: 2px solid var(--amber);
    border-radius: 12px;
    padding: 20px;
    margin-top: 8px;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===== Print Styles for Report PDF Export ===== */
@media print {
    /* Hide all UI chrome */
    .top-bar,
    .sidebar,
    .rv-toolbar,
    .rv-sidebar,
    #report-selector-view,
    #toast {
        display: none !important;
    }

    /* Remove layout constraints */
    .main-content,
    .content-wrapper {
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        left: 0 !important;
        top: 0 !important;
    }
    .rv-layout { display: block !important; }
    .rv-content {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    /* ── Page setup ── */
    @page {
        size: A4;
        margin: 20mm 18mm;
    }
    @page :first {
        margin: 0;
    }
    html, body {
        background: white !important;
        color: #2c3e50 !important;
        font-family: 'Montserrat', sans-serif !important;
        font-size: 10pt !important;
        line-height: 1.55 !important;
    }

    /* ── Cover Page ── */
    .rv-cover-page {
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        page-break-after: always;
        break-after: page;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-bg-gradient {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-overlay {
        min-height: 100vh !important;
        padding: 50px 60px !important;
    }
    .rv-cover-top {
        justify-content: space-between !important;
    }
    .rv-cover-logo {
        height: 52px !important;
        filter: brightness(0) invert(1) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-center {
        text-align: left !important;
    }
    .rv-cover-title {
        font-size: 26pt !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-subtitle {
        font-size: 14pt !important;
        color: rgba(255,255,255,0.9) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-assessment {
        font-size: 11pt !important;
        color: rgba(255,255,255,0.75) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-info-grid {
        justify-content: flex-start !important;
    }
    .rv-cover-info-label {
        color: rgba(255,255,255,0.6) !important;
        font-size: 8pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-info-value {
        color: #fff !important;
        font-size: 11pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-cover-target,
    .rv-cover-confidential {
        color: rgba(255,255,255,0.5) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Table of Contents ── */
    #rv-section-toc {
        break-after: page;
        page-break-after: always;
    }
    .rv-toc-list { margin-top: 8px !important; }
    .rv-toc-link {
        font-size: 11pt !important;
        color: #2c3e50 !important;
        text-decoration: none !important;
    }
    .rv-toc-number { color: #f29913 !important; }

    /* ── Section Headings ── */
    .rv-section {
        margin-bottom: 20px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .rv-section-heading {
        font-size: 15pt !important;
        font-weight: 700 !important;
        color: #1a1a2e !important;
        border-bottom: 2.5px solid #f29913 !important;
        padding-bottom: 6px !important;
        margin-bottom: 14px !important;
        break-after: avoid;
        page-break-after: avoid;
    }
    .rv-subsection-heading {
        font-size: 11pt !important;
        font-weight: 700 !important;
        color: #2c3e50 !important;
        break-after: avoid;
        page-break-after: avoid;
    }

    /* ── Typography ── */
    .rv-paragraph,
    .rv-rich-content {
        font-size: 10pt !important;
        line-height: 1.65 !important;
        text-align: justify !important;
        color: #333 !important;
    }
    .rv-rich-content p {
        margin-bottom: 6px !important;
    }

    /* ── Tables ── */
    .rv-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
        break-inside: auto;
    }
    .rv-table th {
        background: #f8f9fa !important;
        font-weight: 600 !important;
        color: #2c3e50 !important;
        border: 1px solid #dee2e6 !important;
        padding: 8px 10px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-table td {
        border: 1px solid #dee2e6 !important;
        padding: 6px 10px !important;
        color: #333 !important;
    }
    .rv-table thead {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* ── Badges — preserve colors ── */
    .rv-sev-badge,
    .sev-critical, .sev-high, .sev-medium, .sev-low, .sev-info {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 8pt !important;
    }

    /* ── Charts & Cards ── */
    .rv-charts-row,
    .rv-chart-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .rv-chart-container,
    .rv-chart-wide {
        max-width: 100% !important;
    }

    /* ── Executive Grid ── */
    .rv-executive-grid {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .rv-executive-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
    }

    /* ── Risk Indicator ── */
    .rv-risk-indicator {
        break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Recommendations ── */
    .rv-recommendation-card {
        break-inside: avoid;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border: 1px solid #f29913 !important;
        border-radius: 10px !important;
        margin-bottom: 12px !important;
    }
    .rv-rec-icon {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Conclusions ── */
    .rv-conclusion-summary {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .rv-conclusion-item {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Methodology ── */
    .rv-phase-number {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rv-methodology-phases {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* ── Deliverables ── */
    .rv-deliverables-grid {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .rv-deliverable-icon {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Objective Items ── */
    .rv-objective-item {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 10pt !important;
    }

    /* ── KPI Cards ── */
    .rv-kpi-grid {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .rv-kpi-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
    }
    .rv-kpi-value {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Department charts ── */
    .rv-dept-chart-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* ── Links ── */
    a[href] {
        color: #2c3e50 !important;
        text-decoration: none !important;
    }

    /* ── Global print color adjust ── */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}