@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --gold: #D4A853;
    --gold-light: #f5e6c4;
    --gold-dark: #b8922e;
    --teal: #5BBFBA;
    --teal-light: #d4f0ee;
    --coral: #E07A5F;
    --coral-light: #f8ddd5;
    --bg: #FAF9F7;
    --card: #FFFFFF;
    --text: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #888;
    --border: #F0EBE4;
    --sidebar-bg: #FFFFFF;
    --calendar-bg: #FFFFFF;
    --green: #2ecc71;
    --green-bg: #e8f8ef;
    --yellow: #f1c40f;
    --yellow-bg: #fef9e7;
    --blue: #3498db;
    --blue-bg: #ebf5fb;
    --red: #e74c3c;
    --red-bg: #fdecea;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg: #0d0d0d;
    --card: #1a1a1a;
    --text: #f0f0f0;
    --text-secondary: #aaa;
    --text-muted: #777;
    --border: #2a2a2a;
    --sidebar-bg: #141414;
    --calendar-bg: #141414;
    --green-bg: #1a2e1a;
    --yellow-bg: #2e2a1a;
    --blue-bg: #1a2233;
    --red-bg: #2e1a1a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* ===== LAYOUT ===== */
.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    height: 100vh;
}

.calendar-panel {
    width: 280px;
    min-width: 280px;
    background: var(--calendar-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    height: 100vh;
    padding: 24px 20px;
}

/* ===== SIDEBAR ===== */
.sidebar-logo {
    padding: 24px 20px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--gold);
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.sidebar-profile {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    padding: 3px;
    margin: 0 auto 12px;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--card);
}

.profile-avatar .online-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 14px;
    height: 14px;
    background: var(--green);
    border: 3px solid var(--sidebar-bg);
    border-radius: 50%;
}

.profile-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

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

.nav-section {
    padding: 16px 16px 4px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--border);
    color: var(--text);
}

.nav-item.active {
    color: var(--gold);
    background: var(--gold-light);
    font-weight: 700;
}

[data-theme="dark"] .nav-item.active {
    background: rgba(212, 168, 83, 0.12);
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: var(--bg);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition);
    border: none;
    width: 100%;
    font-family: inherit;
}

.theme-toggle:hover {
    background: var(--border);
}

/* ===== CALENDAR ===== */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.calendar-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.calendar-bell {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    position: relative;
}

.calendar-bell .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--coral);
    border-radius: 50%;
}

.calendar-date-group {
    margin-bottom: 20px;
}

.calendar-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.calendar-event {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    align-items: flex-start;
}

.event-bar {
    width: 3px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 2px;
}

.event-bar.gold {
    background: var(--gold);
}

.event-bar.teal {
    background: var(--teal);
}

.event-bar.coral {
    background: var(--coral);
}

.event-time {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 45px;
    padding-top: 2px;
}

.event-info {
    flex: 1;
}

.event-type {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.event-project {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== MAIN CONTENT COMMON ===== */
.tab-content {
    display: none;
}

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

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

.page-greeting h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 2px;
}

.page-greeting .date {
    font-size: 13px;
    color: var(--text-muted);
}

.page-title {
    font-size: 24px;
    font-weight: 800;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all var(--transition);
}

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

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

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

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

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

/* ===== STAT CARDS ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-change.up {
    color: var(--green);
}

.stat-change.down {
    color: var(--red);
}

/* ===== PROJECT CARDS (HOME) ===== */
.project-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.project-card {
    border-radius: var(--radius-xl);
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(40px);
}

.project-card.gold-card {
    background: linear-gradient(135deg, #D4A853, #b8922e);
}

.project-card.gold-card::after {
    background: #fff;
    top: -50px;
    left: -50px;
}

.project-card.teal-card {
    background: linear-gradient(135deg, #5BBFBA, #3d9e99);
}

.project-card.teal-card::after {
    background: #fff;
    bottom: -50px;
    right: -50px;
}

.project-card.coral-card {
    background: linear-gradient(135deg, #E07A5F, #c4604a);
}

.project-card.coral-card::after {
    background: #fff;
    top: -30px;
    right: -30px;
}

.project-card .card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.project-card .card-tasks {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 14px;
}

.project-card .card-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    margin-bottom: 6px;
    overflow: hidden;
}

.project-card .card-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.project-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-card .card-percent {
    font-size: 14px;
    font-weight: 700;
}

.team-avatars {
    display: flex;
    flex-direction: row-reverse;
}

.team-avatars .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-right: -8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
}

/* ===== TWO-COL GRID ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.section-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.section-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ===== TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody td {
    font-size: 14px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg);
}

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green {
    background: var(--green-bg);
    color: #27ae60;
}

.badge-yellow {
    background: var(--yellow-bg);
    color: #d4a017;
}

.badge-blue {
    background: var(--blue-bg);
    color: #2980b9;
}

.badge-red {
    background: var(--red-bg);
    color: #c0392b;
}

.badge-gray {
    background: var(--border);
    color: var(--text-muted);
}

/* ===== SEARCH/FILTER BAR ===== */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    outline: none;
    transition: border var(--transition);
}

.search-input:focus {
    border-color: var(--gold);
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 13px;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    outline: none;
}

/* ===== SUB-TABS ===== */
.sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border);
}

.sub-tab {
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
    border: none;
    background: none;
    font-family: inherit;
}

.sub-tab:hover {
    color: var(--text);
}

.sub-tab.active {
    background: var(--card);
    color: var(--gold);
    box-shadow: var(--shadow);
}

/* Sub-content visibility */
.sub-content {
    display: none;
}

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

/* ===== PROGRESS BAR (TABLE) ===== */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    width: 80px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--gold);
}

/* ===== CHECKLIST ===== */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.checklist-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.checklist-check.done {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
    font-size: 12px;
}

.checklist-info {
    flex: 1;
}

.checklist-task {
    font-size: 14px;
    font-weight: 500;
}

.checklist-project {
    font-size: 11px;
    color: var(--text-muted);
}

.checklist-day {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== STUDIO ===== */
.studio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.studio-booking {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}

.studio-booking .booking-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.studio-booking .booking-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.studio-booking .booking-project {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== RATING STARS ===== */
.stars {
    color: var(--gold);
    font-size: 13px;
    letter-spacing: 1px;
}

/* ===== ACTIONS ===== */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.action-btn:hover {
    background: var(--bg);
    border-color: var(--gold);
    color: var(--gold);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== CHART PLACEHOLDER ===== */
.chart-placeholder {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================
   NEW COMPONENT STYLES (Tabs 2-7 replacements)
   ============================================ */

/* --- Filters Section (2-row layout) --- */
.filters-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filters-top-row,
.filters-bottom-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-input {
    flex: 1;
    min-width: 140px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.filter-input:focus {
    border-color: var(--gold);
    outline: none;
}

.date-range-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* --- Status Chips --- */
.status-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-chip:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.status-chip.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 600;
}

.chip-count {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
}

.status-chip.active .chip-count {
    background: rgba(0, 0, 0, 0.2);
}

.action-buttons-group {
    display: flex;
    gap: 8px;
}

/* --- Client Cell (avatar + name) --- */
.client-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.client-name {
    font-weight: 600;
    font-size: 14px;
}

.client-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Action Menu (3-dot dropdown) --- */
.actions-cell {
    position: relative;
}

.action-menu {
    position: relative;
    display: inline-block;
}

.action-trigger {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-trigger:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.action-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 180px;
    padding: 6px 0;
    display: none;
}

.action-dropdown.show {
    display: block;
}

.action-item {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
    cursor: pointer;
}

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

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

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

/* --- Table Pagination --- */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

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

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.page-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
    font-weight: 600;
}

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

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

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

/* --- Vendor Portal Banner --- */
.vendor-portal-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.08) 0%, rgba(212, 168, 83, 0.02) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.vendor-portal-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.vendor-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Sub-tab Badge --- */
.sub-tab-badge {
    background: var(--red);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}

/* --- Summary Bar --- */
.summary-bar {
    display: flex;
    gap: 24px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.summary-item {
    font-size: 14px;
    color: var(--text);
}

/* --- Vendor Group (collapsible) --- */
.vendor-group {
    margin-bottom: 12px;
}

.vendor-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.vendor-toggle {
    transition: transform 0.2s;
}

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

.vendor-group.collapsed .vendor-toggle {
    transform: rotate(-90deg);
}

/* --- Distribution Bars --- */
.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dist-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dist-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text);
}

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

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

/* --- P&L Highlight Cards --- */
.pnl-highlight-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.pnl-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.pnl-card.profit {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.pnl-card.loss {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.pnl-card-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pnl-card-value {
    font-size: 24px;
    font-weight: 700;
}

.pnl-card.profit .pnl-card-value {
    color: var(--green);
}

.pnl-card.loss .pnl-card-value {
    color: var(--red);
}

/* --- Premium Segmented Filters --- */
.premium-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.date-range-segmented {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.seg-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.seg-btn:hover {
    color: var(--text);
}

.seg-btn.active {
    background: var(--gold);
    color: #000;
    font-weight: 600;
}

/* --- Summary Row with Icons --- */
.summary-row-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-icon-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.summary-box-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

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

.summary-box-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

/* --- Accordion Sections --- */
.accordion-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: var(--bg);
}

.accordion-arrow {
    transition: transform 0.2s;
    font-size: 12px;
}

.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-body {
    display: none;
    padding: 0 20px 16px;
}

.accordion-item.open .accordion-body {
    display: block;
}

/* --- Booking List (Studio) --- */
.booking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booking-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.booking-date-box {
    min-width: 50px;
    text-align: center;
    padding: 6px;
    background: rgba(212, 168, 83, 0.1);
    border-radius: var(--radius);
}

.booking-day {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
}

.booking-month {
    font-size: 11px;
    color: var(--text-muted);
}

.booking-info {
    flex: 1;
}

.booking-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.booking-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Features List (Studio Settings) --- */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.feature-item {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 13px;
}

/* --- Working Days (Studio Settings) --- */
.working-days {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.day-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.day-chip.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 600;
}

/* --- Stat Icon --- */
.stat-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* --- Dark Mode Overrides for New Components --- */
[data-theme="dark"] .filter-input {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .action-dropdown {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .action-item:hover {
    background: var(--bg);
}

[data-theme="dark"] .status-chip {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .vendor-portal-banner {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.06) 0%, rgba(212, 168, 83, 0.01) 100%);
}

[data-theme="dark"] .seg-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .booking-item {
    background: var(--bg-card);
}

[data-theme="dark"] .feature-item {
    background: var(--bg);
}

/* ============================================
   MODAL STYLES (New Opportunity Modal)
   ============================================ */

/* Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

/* Container */
.modal-container {
    background: #FFFFFF;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

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

/* Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title-icon {
    font-size: 22px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* Body (scrollable) */
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-hint {
    font-size: 12px;
    color: var(--text-muted);
}

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

.btn-save {
    padding: 10px 24px !important;
    font-weight: 600;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.required {
    color: var(--red);
}

.form-control {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--gold);
    outline: none;
}

/* Search Input with Icon */
.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper .form-control {
    padding-left: 36px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Input with Action Button */
.input-with-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-action .search-input-wrapper,
.input-with-action .form-control {
    flex: 1;
}

.btn-icon-add {
    width: 40px;
    min-width: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--gold);
    background: rgba(212, 168, 83, 0.1);
    color: var(--gold);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-add:hover {
    background: var(--gold);
    color: #000;
}

/* Section Title */
.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Currency Input */
.currency-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}

.currency-input .form-control {
    border: none;
    border-radius: 0;
    flex: 1;
}

.currency-badge {
    padding: 10px 14px;
    background: rgba(212, 168, 83, 0.1);
    color: var(--gold);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

/* Modal Status Chips */
.modal-chips {
    padding-top: 4px;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.file-upload-area:hover {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.04);
}

/* Link Rows */
.link-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.link-type-select {
    width: 120px;
    min-width: 120px;
}

.link-row .form-control:last-child {
    flex: 1;
}

.btn-icon-remove {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-remove:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-add-link {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}

.btn-add-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-container {
        max-height: 95vh;
    }
}

/* Dark Mode Modal Overrides */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-container {
    background: #1a1a1a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .form-control {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .file-upload-area {
    background: var(--bg);
}

[data-theme="dark"] .currency-badge {
    border-color: var(--border);
}

/* Larger Modal Variant */
.modal-lg {
    max-width: 900px;
}

/* Attachments Table */
.attachments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.attachments-table th {
    text-align: right;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.attachments-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.attachments-table td .form-control {
    padding: 8px 10px;
    font-size: 13px;
}

/* Form Textarea */
.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

/* Form Hint */
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Form Divider */
.form-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* Vendor Type Option Cards */
.type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.type-option {
    cursor: pointer;
}

.type-option input[type="radio"] {
    display: none;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.2s;
}

.type-card:hover {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.04);
}

.type-option input[type="radio"]:checked+.type-card {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.08);
    box-shadow: 0 0 0 1px var(--gold);
}

.type-icon {
    font-size: 28px;
}

.type-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.type-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Contact Stack (table cell) */
.contact-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.contact-stack .text-muted {
    color: var(--text-muted);
    font-size: 12px;
}

/* Contact Rows (modal) */
.contact-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.contact-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.contact-row .btn-icon-remove {
    flex-shrink: 0;
}

/* Text muted helper */
.text-muted {
    color: var(--text-muted);
}