/* DSP v2 — Odoo-style Layout */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Main Navbar ─── */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    background: #212529;
    color: #fff;
    padding: 0 16px;
    flex-shrink: 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.client-selector select {
    padding: 4px 8px;
    border: 1px solid #495057;
    border-radius: 4px;
    font-size: 12px;
    background: #343a40;
    color: #fff;
    cursor: pointer;
}

.client-selector select:focus {
    outline: none;
    border-color: #7c3aed;
}

.nav-modules {
    display: flex;
    align-items: center;
    gap: 1px;
}

.nav-module {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    color: #adb5bd;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}

.nav-module:hover {
    background: #343a40;
    color: #fff;
}

.nav-module.active {
    background: #495057;
    color: #fff;
}

.nav-icon {
    font-size: 14px;
}

/* ─── Sub-navigation ─── */
.sub-nav {
    display: none;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0 20px;
    flex-shrink: 0;
}

.sub-nav-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
}

.sub-nav-tab {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 100%;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.sub-nav-tab:hover {
    color: #333;
    background: #f8f9fa;
}

.sub-nav-tab.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

/* Sub-nav dropdown */
.sub-nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.sub-nav-dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    padding: 0 16px;
    height: 100%;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.sub-nav-dropdown-btn:hover {
    color: #333;
    background: #f8f9fa;
}

.sub-nav-dropdown.active .sub-nav-dropdown-btn {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

.sub-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 100;
}

.sub-nav-dropdown-menu.open { display: block; }

.sub-nav-dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
}

.sub-nav-dropdown-item:hover { background: #f8f9fa; }

.sub-nav-dropdown-item.active {
    font-weight: 600;
    color: #7c3aed;
}

/* ─── Content ─── */
.main {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

/* ─── View header ─── */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.view-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.subtitle {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin: 16px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── List View ─── */
.list-view {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.list-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    gap: 8px;
}

.list-view-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-view-filters select {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
}

.list-view-filters select:focus {
    outline: none;
    border-color: #7c3aed;
}

.list-view-count {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.list-view table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.list-view th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 500;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.list-view th:hover {
    color: #333;
}

.list-view td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.list-view tr:last-child td {
    border-bottom: none;
}

.list-view tbody tr:hover {
    background: #f8f9fa;
}

.list-view .col-actions {
    width: 70px;
    text-align: right;
    white-space: nowrap;
}

.list-view .col-num {
    text-align: right;
}

/* Inline edit input in list view */
.list-view .inline-input {
    width: 60px;
    padding: 3px 6px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 13px;
    text-align: right;
    background: #fff;
}

.list-view .inline-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

/* Inline row editing */
.list-view table.editable tbody tr:not(.editing):not(.list-view-group-header) { cursor: pointer; }
.list-view tr.editing td { background: #eff6ff; }
.list-view .inline-edit {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.list-view .inline-edit:focus {
    border-color: #7c3aed;
    outline: none;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}
.list-view .lv-save-row { color: #059669; font-size: 16px; }
.list-view .lv-cancel-row { color: #dc2626; font-size: 14px; }
.inline-multiselect { display: flex; flex-wrap: wrap; gap: 4px; min-width: 120px; }
.inline-multi-opt { display: flex; align-items: center; gap: 3px; font-size: 12px; white-space: nowrap; cursor: pointer; padding: 2px 6px; border-radius: 3px; background: #f3f4f6; }
.inline-multi-opt:hover { background: #e5e7eb; }
.inline-multi-opt input { margin: 0; }

/* ─── Cards (kept for specific views) ─── */
.card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.card-body {
    padding: 10px 14px;
}

.card-description {
    padding: 6px 14px 0;
    font-size: 12px;
    color: #666;
}

.card-footer {
    padding: 6px 14px;
    border-top: 1px solid #eee;
    font-size: 12px;
}

/* ─── Badges ─── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #f0f0f0;
    color: #666;
}

.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-grey { background: #f0f0f0; color: #999; }

/* ─── Buttons ─── */
.btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.btn-primary {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.btn-primary:hover {
    background: #6d28d9;
}

.btn-sm {
    padding: 3px 8px;
    font-size: 12px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.btn-icon:hover { opacity: 1; }

.btn-danger {
    color: #dc2626;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 12px;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

.form-row {
    display: flex;
    gap: 12px;
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: #fff;
    border-radius: 8px;
    width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-wide { width: 640px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.modal-body {
    padding: 14px 18px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

/* ─── Participants ─── */
.participants-add {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.participants-add select { flex: 1; }
.participants-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.participant-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}
.participant-name { flex: 1; }
.participant-required {
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    background: #fff;
}
.participant-remove {
    color: #999;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background: none;
}
.participant-remove:hover { color: #dc3545; }

/* ─── Data Tables (legacy) ─── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    font-weight: 500;
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Calendar month grid ─── */
.month-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 8px;
}

.month-cell {
    text-align: center;
}

.month-label {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    margin-bottom: 4px;
}

.month-input {
    width: 50px !important;
    text-align: center;
    padding: 6px !important;
    font-size: 14px !important;
    font-weight: 500;
}

.month-total .month-value {
    font-size: 16px;
    font-weight: 700;
    color: #7c3aed;
    padding-top: 4px;
}

/* ─── Scenario bar ─── */
.scenario-bar {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.plan-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* ─── Timeline table ─── */
.grid-container {
    overflow-x: auto;
    margin-bottom: 12px;
}

.grid-container table {
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.grid-container th,
.grid-container td {
    padding: 6px 4px;
    text-align: center;
    border: 1px solid #e0e0e0;
    min-width: 34px;
}

.grid-container th {
    background: #f5f5f5;
    color: #333;
    font-weight: 500;
}

.quarter-header {
    background: #fff !important;
    color: #333;
    font-weight: bold;
    font-size: 13px;
    border-bottom: 2px solid #333 !important;
}

.month-header {
    background: #f9f9f9 !important;
    color: #7c3aed;
    font-weight: 600;
    font-size: 11px;
}

.week-header {
    font-size: 10px;
    color: #999;
}

th.resource,
td.resource {
    text-align: left;
    min-width: 120px;
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 12px;
}

th.resource { z-index: 3; background: #f5f5f5; }
td.resource.external { color: #7c3aed; }

/* Heatmap */
.days-0 { background: #fff; color: #ccc; }
.days-low { background: #f0f0f0; color: #666; }
.days-med { background: #d0d0d0; color: #333; }
.days-high { background: #a0a0a0; color: #fff; }
.days-full { background: #333; color: #fff; font-weight: bold; }
.days-over { background: #dc2626; color: #fff; font-weight: bold; }
.absence { background: #fef3c7 !important; color: #92400e !important; font-style: italic; }

tr.group-row td {
    background: #f5f5f5 !important;
    color: #333;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px;
    border-top: 2px solid #333;
    text-align: left;
}

/* ─── Legend ─── */
.legend {
    display: flex;
    gap: 15px;
    font-size: 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
}

.legend-box {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

/* ─── View toggle ─── */
.view-toggle {
    display: flex;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.view-toggle button {
    padding: 4px 10px;
    border: none;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    color: #666;
}

.view-toggle button:not(:last-child) {
    border-right: 1px solid #dee2e6;
}

.view-toggle button.active {
    background: #7c3aed;
    color: #fff;
}

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

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc2626;
}

.text-muted { color: #999; font-size: 12px; }

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    color: #fff;
    background: #333;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-error { background: #dc2626; }
.toast-info { background: #333; }

/* ─── Calendar Month Grid ─── */
.cal-month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.cal-month-label {
    font-size: 16px;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.cal-grid {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.cal-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.cal-dow {
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-day {
    min-height: 100px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 4px;
    cursor: pointer;
    transition: background 0.1s;
    overflow: hidden;
}

.cal-day:hover {
    background: #faf8ff;
}

.cal-day:nth-child(7n) {
    border-right: none;
}

.cal-day-empty {
    background: #fafafa;
    cursor: default;
}

.cal-day-empty:hover {
    background: #fafafa;
}

.cal-day-today {
    background: #f5f0ff;
}

.cal-day-today:hover {
    background: #ede5ff;
}

.cal-day-num {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
    padding: 2px 4px;
}

.today-num {
    display: inline-block;
    background: #7c3aed;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    padding: 0;
}

.cal-event {
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.1s;
}

.cal-event:hover {
    opacity: 0.8;
}

.cal-event-meeting {
    background: #ede9fe;
    color: #6d28d9;
    border-left: 3px solid #7c3aed;
}

.cal-event-task {
    background: #dbeafe;
    color: #1e40af;
    border-left: 3px solid #3b82f6;
}

.cal-event-timeoff-public {
    background: #fee2e2;
    color: #991b1b;
    border-left: 3px solid #ef4444;
}

.cal-event-timeoff-company {
    background: #fef3c7;
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

.cal-event-timeoff-resource {
    background: #ffedd5;
    color: #9a3412;
    border-left: 3px solid #f97316;
}

.cal-event-timeoff-public,
.cal-event-timeoff-company,
.cal-event-timeoff-resource {
    cursor: default;
}

.cal-event-time {
    font-weight: 600;
    font-size: 10px;
}

/* ─── Multi-day event spans ─── */
.cal-event-span-start {
    border-radius: 3px 0 0 3px;
    margin-right: -1px;
}

.cal-event-span-mid {
    border-radius: 0;
    border-left: none;
    min-height: 18px;
    opacity: 0.7;
}

.cal-event-span-end {
    border-radius: 0 3px 3px 0;
    border-left: none;
    min-height: 18px;
    opacity: 0.7;
}

/* ─── Calendar grouped view ─── */
.cal-group {
    margin-bottom: 16px;
}
.cal-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}
.cal-group-header:hover {
    background: #f0f0f5;
}
.cal-group-toggle {
    font-size: 10px;
    color: #666;
    width: 14px;
    text-align: center;
}
.cal-group-count {
    margin-left: auto;
    font-size: 12px;
    color: #888;
    font-weight: normal;
}
.cal-group-body {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}
.cal-group.collapsed .cal-group-body {
    display: none;
}
.cal-group.collapsed .cal-group-header {
    border-radius: 6px;
}

/* ─── Org Chart ─── */
/* ─── Org Chart ─── */
.org-chart {
    padding: 20px 24px;
    max-width: 800px;
}

/* Boss section */
.org-boss-section {
    display: flex;
    align-items: center;
    gap: 12px;
}
.org-boss-dept {
    font-size: 11px;
    padding: 2px 10px;
    background: #343a40;
    color: #fff;
    border-radius: 3px;
}
.org-divider {
    border: none;
    border-top: 2px solid #ede9fe;
    margin: 16px 0;
}

/* Card — horizontal inline style */
.org-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: box-shadow 0.15s;
}
.org-card:hover { box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.org-card-boss {
    padding: 10px 16px;
    border: 2px solid #c4b5fd;
    background: #faf5ff;
}
.org-card-ext { border-left: 3px solid #3b82f6; }

.org-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.org-card-boss .org-avatar { width: 42px; height: 42px; font-size: 18px; }
.org-card-body { min-width: 0; }
.org-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.2;
}
.org-card-boss .org-card-name { font-size: 15px; }
.org-card-job {
    font-size: 11px;
    color: #6b7280;
}
.org-badge-ext {
    font-size: 9px;
    padding: 1px 5px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

/* Split layout — internal left, external right */
.org-split-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.org-split-internal {
    flex: 1;
    min-width: 0;
}
.org-split-external {
    flex: 0 0 280px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 12px 16px;
}
.org-split-external-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 8px;
}

/* Department grid — top-level depts side by side */
.org-dept-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    align-items: flex-start;
}
.org-dept-grid > .org-dept-section {
    flex: 1;
    min-width: 240px;
    max-width: 420px;
}
/* Inside external panel, depts stack vertically */
.org-split-external .org-dept-grid {
    flex-direction: column;
}
.org-split-external .org-dept-grid > .org-dept-section {
    max-width: none;
}

/* Department sections */
.org-dept-section {
    margin-bottom: 4px;
}
/* Nested sub-departments indent */
.org-dept-body > .org-dept-section {
    margin-left: 16px;
    border-left: 2px solid #ede9fe;
    padding-left: 8px;
}
.org-dept-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
}
.org-dept-header:hover { background: #f8f9fa; }
.org-dept-toggle {
    font-size: 10px;
    color: #9ca3af;
    width: 14px;
    text-align: center;
}
.org-dept-name {
    font-size: 13px;
    font-weight: 600;
    color: #6b21a8;
}
.org-dept-count {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 0 6px;
    border-radius: 10px;
}
.org-dept-body {
    padding: 2px 0 8px;
}

/* Person row inside department */
.org-person {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px;
}

/* Fold button for person sub-reports */
.org-fold {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.org-fold:hover { background: #f3f4f6; border-color: #d1d5db; }

/* View toggle */
.org-view-toggle { display: flex; gap: 4px; }

/* Dept badge shown in hierarchy view */
.org-tree-dept {
    font-size: 10px;
    padding: 1px 8px;
    background: #343a40;
    color: #fff;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: center;
}

/* ─── Search Bar ─── */
.search-bar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 6px 20px;
    flex-shrink: 0;
}

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

.search-bar-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0 8px;
    max-width: 280px;
    flex: 1;
    background: #fff;
}

.search-bar-icon {
    font-size: 13px;
    margin-right: 4px;
    opacity: 0.5;
}

.search-bar-input {
    border: none;
    outline: none;
    font-size: 13px;
    padding: 5px 0;
    width: 100%;
    font-family: inherit;
    background: transparent;
}

.search-bar-input-wrap:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.search-bar-dropdown {
    position: relative;
}

.search-bar-dropdown-btn {
    white-space: nowrap;
}

.search-bar-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 8px;
    min-width: 200px;
    z-index: 50;
}

.search-bar-dropdown-menu.open {
    display: block;
}

.search-bar-dropdown-item {
    margin-bottom: 6px;
}

.search-bar-dropdown-item:last-child {
    margin-bottom: 0;
}

.search-bar-dropdown-item label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    margin-bottom: 2px;
}

.search-bar-dropdown-item select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
}

.search-bar-groupby-item {
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 2px;
}

.search-bar-groupby-item:hover {
    background: #f5f5f5;
}

.search-bar-groupby-item.active {
    background: #ede9fe;
    color: #7c3aed;
    font-weight: 500;
}

.search-bar-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.search-bar-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #ede9fe;
    color: #7c3aed;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.search-bar-pill-x {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #7c3aed;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.7;
}

.search-bar-pill-x:hover {
    opacity: 1;
}

.search-bar-clear-all {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #999;
    padding: 2px 4px;
}

.search-bar-clear-all:hover {
    color: #333;
}

/* ─── List View Group Headers ─── */
.list-view-group-header td {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 12px;
    color: #333;
    padding: 8px 12px;
    border-top: 2px solid #dee2e6;
    cursor: pointer;
    user-select: none;
}

.list-view-group-header td:hover {
    background: #eee;
}

.list-view-group-toggle {
    display: inline-block;
    width: 16px;
    font-size: 10px;
    transition: transform 0.15s;
}

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

.list-view-group-count {
    font-weight: 400;
    color: #999;
    font-size: 11px;
    margin-left: 6px;
}

/* ─── Gantt Grid ─── */
.gantt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.gantt-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gantt-container {
    display: flex;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.gantt-sidebar {
    flex-shrink: 0;
    border-right: 2px solid #dee2e6;
    background: #fff;
    z-index: 2;
    overflow: hidden;
}

.gantt-sidebar-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.gantt-sidebar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
}

.gantt-sidebar-label {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-sidebar-sublabel {
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

.gantt-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f5f5f5;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6;
}

.gantt-group-header:first-child {
    border-top: none;
}

.gantt-group-header:hover {
    background: #eee;
}

.gantt-group-toggle {
    font-size: 10px;
    color: #666;
    width: 14px;
    text-align: center;
}

.gantt-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
}

.gantt-grid {
    position: relative;
}

.gantt-header-row {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.gantt-scale-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #7c3aed;
    border-right: 1px solid #e0e0e0;
}

.gantt-scale-top {
    font-size: 12px;
    color: #333;
    border-bottom: 1px solid #dee2e6;
}

.gantt-day-labels {
    border-bottom: 1px solid #dee2e6;
}

.gantt-day-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #888;
    border-right: 1px solid #f0f0f0;
}

.gantt-today-col {
    background: #f5f0ff;
    font-weight: 600;
    color: #7c3aed;
}

.gantt-weekend-col {
    background: #f0f0f0;
    color: #bbb;
}

.gantt-weekend-cell {
    background: #f0f0f0;
}

.gantt-grid-group {
    background: #f5f5f5;
    border-bottom: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6;
}

.gantt-grid-row {
    border-bottom: 1px solid #f0f0f0;
}

.gantt-day-cell {
    position: absolute;
    top: 0;
    height: 100%;
    border-right: 1px solid #f5f5f5;
}

.gantt-timeoff-cell {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(249, 115, 22, 0.08) 3px,
        rgba(249, 115, 22, 0.08) 6px
    );
}

.gantt-bar {
    position: absolute;
    top: 4px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    cursor: pointer;
    z-index: 1;
    transition: opacity 0.1s;
    overflow: hidden;
    opacity: 0.9;
}

.gantt-bar:hover {
    opacity: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.gantt-bar-label {
    font-size: 10px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-meeting-dot {
    position: absolute;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7c3aed;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #7c3aed;
    cursor: pointer;
    z-index: 1;
}

.gantt-meeting-dot:hover {
    transform: scale(1.3);
}

.gantt-today-line {
    position: absolute;
    width: 2px;
    background: #dc2626;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
}

/* ─── Login Screen ─── */
.login-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 380px;
    width: 100%;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #7c3aed;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border-radius: 12px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 32px;
}

.login-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

/* ─── Navbar User ─── */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user-name {
    font-size: 12px;
    color: #adb5bd;
}

.nav-logout {
    color: #adb5bd;
    font-size: 14px;
    opacity: 0.7;
}

.nav-logout:hover {
    opacity: 1;
    color: #fff;
}
