:root {
    /* Theme Variables - Default Light (Matches dashboard.html) */
    --bg-main: #FAF9F7;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-hover: #FAF6F0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border-color: #F0EBE4;
    --border-light: #F5F5F2;
    /* Added for tables */

    /* Brand Colors */
    --primary: #D4A853;
    --primary-gold: #D4A853;
    /* Alias */
    --primary-dark: #B8923F;
    --teal: #5BBFBA;
    --coral: #E07A5F;

    /* Status Colors */
    --status-new: #5BBFBA;
    --status-approved: #22C55E;
    --status-rejected: #E07A5F;
    --status-wfa: #D4A853;
    /* Waiting for approval */
    --status-hold: #6B7280;

    /* Legacy/Map fixes */
    --bg-tertiary: #F5F5F2;
    /* Was used in details */
}

[data-theme="dark"] {
    --bg-main: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-sidebar: #141414;
    --bg-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --border-color: #2a2a2a;
    --border-light: #222222;

    --bg-tertiary: #2a2a2a;
}

/* Global Reset & Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
    /* Prevent horizontal scroll from sidebar */
}

/* === SIDEBAR STYLES (From dashboard.html) === */
.container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    padding: 24px 20px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    /* Prevent shrinking */
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.user-profile {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.logo {
    margin-bottom: 20px;
}

.logo img {
    height: 45px;
}

/* Logo Toggling */
/* Logo Toggling */
.logo-dark {
    display: block;
    margin: 0 auto;
}

.logo-light {
    display: none;
    margin: 0 auto;
}

[data-theme="dark"] .logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: block;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.user-avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background: linear-gradient(135deg, var(--primary), #E8C97A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    font-weight: 700;
}

.status-badge-avatar {
    position: absolute;
    bottom: 5px;
    right: -5px;
    background: #22C55E;
    color: white;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-email {
    font-size: 13px;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item .icon {
    font-size: 18px;
}

.nav-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 16px 8px;
    margin-top: 8px;
}

/* === MAIN LAYOUT === */
.main-content {
    flex: 1;
    padding: 28px 40px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* === HEADER ICONS (Ported from Step 2) === */
.header-actions-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icons {
    display: flex;
    gap: 12px;
}

.header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.header-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.header-icon .badge {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    background: var(--coral);
    border-radius: 50%;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === EXISTING PROJECT STYLES (Refined) === */

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

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    position: relative;
    padding-right: 16px;
}

.page-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.stat-card-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 2;
    min-width: 200px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

.btn-danger-ghost {
    background: transparent;
    border: none;
    color: var(--status-rejected);
    cursor: pointer;
}

/* Table */
.table-container {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 40px;
}

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

.projects-table th {
    background: var(--bg-hover);
    color: var(--text-muted);
    font-weight: 600;
    padding: 16px;
    text-align: right;
    font-size: 13px;
}

.projects-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
}

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

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

.badge-new {
    background: rgba(91, 191, 186, 0.15);
    color: var(--status-new);
}

.badge-approved {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-approved);
}

.badge-pitching {
    background: rgba(91, 64, 186, 0.15);
    color: #8B5CF6;
}

.badge-wfa {
    background: rgba(212, 168, 83, 0.15);
    color: var(--status-wfa);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === DETAILS & FORMS === */
.form-section {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-label.required::after {
    content: '*';
    color: var(--status-rejected);
    margin-right: 4px;
}

/* Project Header Card */
.project-header-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.project-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--teal));
}

.ph-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.ph-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.ph-meta {
    color: var(--text-secondary);
    font-size: 14px;
}

.ph-stats-row {
    display: flex;
    gap: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.ph-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ph-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.ph-stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-body {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Theme Toggle Button (Specific - Hidden in Sidebar now) */
.theme-toggle-sidebar {
    display: none;
    /* User requested move to header */
}

/* Modal Overlay */

/* === NEW ENHANCEMENTS (Action Menu, Filters, Pagination, States) === */

/* 1. Action Menu */
.action-menu {
    position: relative;
}

.action-trigger {
    padding: 8px;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-trigger:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 160px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 50;
    padding: 8px 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s;
    text-align: right;
}

.action-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s;
}

.action-item:hover {
    background: var(--bg-hover);
}

.action-item.action-danger {
    color: var(--status-rejected);
}

.action-item.action-danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

.action-divider {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.action-icon {
    font-size: 16px;
}

/* 2. Filters Bar Enhancements (Redesigned - Grid System) */
.filters-bar-enhanced {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* 12-column grid */
    gap: 16px;
    /* consistent gap */
    align-items: end;
    /* align bottom for labels */
    padding: 24px;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Row 1 Assignment */
.searchable-dropdown:first-child {
    grid-column: span 4;
}

/* Search */
.date-range-filter {
    grid-column: span 4;
}

#statusFilter {
    grid-column: span 2;
}

#typeFilter {
    grid-column: span 2;
}

/* Row 2 Assignment */
#clientFilter {
    grid-column: span 3;
}

#producerFilter {
    grid-column: span 3;
}

#sourceFilter {
    grid-column: span 2;
}

/* Spacer takes remaining space implicitly or via alignment */
.btn-reset-filters {
    grid-column: span 2;
    grid-column-start: 10;
    /* Force to right side */
}

.btn-export-filters {
    /* Export button class */
    grid-column: span 2;
}


/* Common Input Styles for Premium Look */
.filter-select,
.dropdown-input,
.date-range-filter {
    height: 48px;
    /* Taller touch targets */
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-select:hover,
.dropdown-input:hover,
.date-range-filter:hover {
    border-color: var(--text-muted);
}

.filter-select:focus,
.dropdown-input:focus,
.date-range-filter:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
    outline: none;
}

/* Date Specifics */
.date-range-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
}

.date-input-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.date-input-wrapper label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.date-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 0;
}

.date-input:focus {
    outline: none;
}

/* Buttons */
.btn-reset-filters {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-reset-filters:hover {
    background: var(--bg-hover);
    color: var(--status-rejected);
    border-color: var(--status-rejected);
}

/* Ensure Searchable Dropdown takes full width of its grid cell */
.searchable-dropdown {
    min-width: 0;
    width: 100%;
}

.dropdown-input {
    padding: 0 40px 0 16px;
    /* Space for icon if added pseudo-element later */
}

.searchable-dropdown {
    position: relative;
    min-width: 180px;
}

.dropdown-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
}

.dropdown-input:focus {
    border-color: var(--primary);
    outline: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

/* 3. Form Notes & Textarea */
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Tajawal', sans-serif;
    resize: vertical;
    min-height: 100px;
    background: var(--bg-main);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* 4. Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
    margin-top: -24px;
    /* Connect to table card */
}

.pagination-info {
    font-size: 14px;
    color: var(--text-muted);
}


/* Modal Layout for Scrolling */
.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    /* Constraint height */
    display: flex;
    flex-direction: column;
    /* Stack header, body, footer */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    /* Enable scrolling */
    flex: 1;
    /* Take remaining height */
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.modal-header {
    flex-shrink: 0;
    /* Prevent shrinking */
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}


.page-btn {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-num {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-num:hover {
    border-color: var(--primary);
}

.page-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-size-selector label {
    font-size: 14px;
    color: var(--text-muted);
}

.page-size-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    font-size: 14px;
    color: var(--text-primary);
}

/* 5. Loading Skeleton */
.table-loading {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-color) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-row {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.skeleton-cell {
    width: 80px;
    height: 20px;
}

.skeleton-cell-lg {
    width: 150px;
    height: 20px;
    flex: 1;
}

.skeleton-cell-sm {
    width: 40px;
    height: 20px;
}

.skeleton-badge {
    width: 70px;
    height: 28px;
    border-radius: 14px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* 6. Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.empty-icon {
    color: var(--primary);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 300px;
}

/* 7. Table Hover Effect */
.projects-table tbody tr {
    transition: background 0.2s;
}


/* 8. Timeline (Activity Log) */
.timeline {
    position: relative;
    padding-right: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-dot {
    position: absolute;
    right: -25px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 1px var(--border-color);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    background: var(--bg-main);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

/* 9. Role Badges */
.role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.role-account-manager {
    background: rgba(29, 78, 216, 0.1);
    color: #1D4ED8;
}

.role-producer {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.role-business-developer {
    background: rgba(217, 119, 6, 0.1);
    color: #D97706;
}

.role-creative-writer {
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
}

.role-video-editor {
    background: rgba(219, 39, 119, 0.1);
    color: #DB2777;
}

.role-creative-director {
    background: rgba(67, 56, 202, 0.1);
    color: #4338CA;
}

/* 10. Financial Progress Bars */
.financial-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.financial-card {
    background: var(--bg-main);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.financial-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.financial-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.financial-sub {
    font-size: 12px;
    color: var(--status-success);
}

.financial-sub.negative {
    color: var(--status-rejected);
}

.progress-bar-container {
    background: var(--bg-main);
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    display: flex;
}

.progress-bar-fill {
    height: 100%;
    background: var(--status-success);
    transition: width 0.5s ease;
}

.progress-bar-remaining {
    height: 100%;
    background: transparent;
}

/* 11. Vendor Groups */
.vendor-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-hover);
    border-radius: 8px;
    margin-top: 24px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.vendor-group-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.vendor-group-total {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: monospace;
}

/* 12. Star Rating (Interactive) */
.star-rating {
    display: flex;
    gap: 8px;
    font-size: 28px;
    direction: ltr;
    /* Stars LTR */
    justify-content: flex-end;
    /* Align right for RTL context */
}

.star {
    cursor: pointer;
    color: var(--border-color);
    transition: color 0.2s, transform 0.2s;
}

.star:hover {
    transform: scale(1.1);
}

.star.active {
    color: #FCD34D;
}

/* 13. Progress Modal Specifics */
.progress-slider-container {
    padding: 24px 0;
    text-align: center;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 5px;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary);
}

/* Modal Close Button */
.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s;
}

background: rgba(0, 0, 0, 0.05);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--danger);
}

padding: 0;
width: 32px;
height: 32px;
border-radius: 50%;
transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--danger);
}

/* 14. Project Close Flow Modals */

/* Warning Hero Section (In Body) */
.warning-hero {
    text-align: center;
    margin-bottom: 24px;
}

.warning-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #FEF3C7;
    color: #D97706;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    font-size: 40px;
    box-shadow: 0 0 0 8px #FFFBEB;
}

.warning-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 8px;
}

.confirm-question {
    font-size: 16px;
    color: #6B7280;
    font-weight: 500;
    text-align: center;
    margin-bottom: 24px;
}

.project-summary-card {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid #E5E7EB;
}

.summary-icon {
    font-size: 20px;
}

.summary-text {
    font-size: 14px;
    color: #374151;
}

.after-close-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 16px;
}

.info-title {
    font-size: 14px;
    font-weight: 600;
    color: #1E40AF;
    margin-bottom: 12px;
}

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

.info-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: #374151;
}

.list-icon {
    font-size: 16px;
}

/* Gold Modal Theme (Rating) - Clean Header Override */
.modal-header-gold {
    border-bottom: 1px solid #E5E7EB;
    background: #fff;
    padding: 16px 24px;
}

.gold-hero {
    text-align: center;
    margin-bottom: 24px;
}

.gold-icon-wrapper {
    width: 64px;
    height: 64px;
    background: #FEF9C3;
    color: #CA8A04;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    font-size: 32px;
}


.client-info {
    text-align: center;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
    margin-bottom: 20px;
}

.client-label {
    font-size: 14px;
    color: #6B7280;
}

.client-name {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-right: 8px;
}

.rating-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 24px 0;
}

.rating-section {
    text-align: center;
}

.rating-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}

/* Star Rating Large */
.star-rating-lg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.star-rating-lg .stars-container {
    display: flex;
    gap: 16px;
    direction: ltr;
    /* Ensure visual LTR for stars */
}

.star-rating-lg .star {
    font-size: 40px;
    cursor: pointer;
    color: #D1D5DB;
    transition: all 0.2s;
}

.star-rating-lg .star:hover,
.star-rating-lg .star.active {
    color: #FCD34D;
    transform: scale(1.1);
}

.stars-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 320px;
    font-size: 11px;
    color: #9CA3AF;
    direction: ltr;
    /* Match stars direction */
}

/* Detailed Ratings */
.detailed-ratings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 8px;
}

.rating-item-label {
    font-size: 14px;
    color: #374151;
}

/* Star Rating Small */
.star-rating-sm {
    display: flex;
    gap: 4px;
    direction: ltr;
}

.star-rating-sm .star {
    font-size: 20px;
    cursor: pointer;
    color: #D1D5DB;
    transition: all 0.2s;
}

.star-rating-sm .star:hover,
.star-rating-sm .star.active {
    color: #FCD34D;
}

/* Recommendation Options */
.recommendation-options {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
}

.recommendation-option {
    cursor: pointer;
}

.recommendation-option input {
    display: none;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 32px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    transition: all 0.2s;
    background: #fff;
}

.option-icon {
    font-size: 32px;
}

.option-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.recommendation-option input:checked+.option-card.option-yes {
    border-color: #10B981;
    background: #D1FAE5;
}

.recommendation-option input:checked+.option-card.option-no {
    border-color: #EF4444;
    background: #FEE2E2;
}

.recommendation-option input:checked+.option-card.option-maybe {
    border-color: #F59E0B;
    background: #FEF3C7;
}

.option-card:hover {
    border-color: #D4A853;
    transform: translateY(-2px);
}

/* Form Hint */
.form-hint {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 8px;
    text-align: left;
    direction: ltr;
}

.form-hint.error {
    color: #EF4444;
}

.form-hint.success {
    color: #10B981;
}

/* Success Modal */
.success-body {
    text-align: center;
    padding: 32px 24px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.success-title {
    font-size: 20px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 24px;
}

.success-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 24px 0;
}

.success-project-name {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 20px;
}

.success-actions-list {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
    padding: 16px;
    text-align: right;
}

.actions-title {
    font-size: 14px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 12px;
}

.success-actions-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.success-actions-list li {
    padding: 8px 0;
    font-size: 13px;
    color: #166534;
}

.modal-footer-center {
    justify-content: center;
}

/* Warning Button specific override */
.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
}

/* === Import Project Modal Styles === */

/* Import Type Info */
.import-type-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
    margin-bottom: 24px;
}

.import-type-info.archive {
    background: #FEF3C7;
    border-color: #FCD34D;
}

.import-type-info .type-icon {
    font-size: 40px;
}

.import-type-info .type-title {
    font-size: 16px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 4px;
}

.import-type-info.archive .type-title {
    color: #92400E;
}

.import-type-info .type-desc {
    font-size: 13px;
    color: #15803D;
}

.import-type-info.archive .type-desc {
    color: #A16207;
}

/* Import Note */
.import-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    margin-top: 16px;
}

.import-note .note-icon {
    font-size: 16px;
    color: #2563EB;
}

.import-note .note-text {
    font-size: 13px;
    color: #1E40AF;
}

/* Profit/Loss Column */
.profit-positive {
    color: #059669;
    font-weight: 600;
}

.profit-negative {
    color: #DC2626;
    font-weight: 600;
}

/* Archive Badge */
.archive-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}