/* ========================================
   Elegance Events - Staff Portal Styles
   Professional Admin Dashboard Theme
   ======================================== */

:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --brand-primary: #3b82f6;
    --brand-success: #10b981;
    --brand-warning: #f59e0b;
    --brand-danger: #ef4444;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ========== Global ========== */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    margin: 0;
    padding: 0;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-subtitle,
.sidebar.collapsed .sidebar-link span {
    display: none;
}

.sidebar.collapsed .sidebar-link {
    text-align: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar-brand {
    padding: 20px 20px 5px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.sidebar-brand i {
    color: var(--brand-primary);
}

.sidebar-subtitle {
    padding: 0 20px 15px;
    font-size: 0.75rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #334155;
    margin-bottom: 10px;
}

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

.sidebar-item {
    margin: 2px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    margin-right: 12px;
    font-size: 1rem;
}

.sidebar-item.active .sidebar-link {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 500;
}

.sidebar-divider {
    height: 1px;
    background-color: #334155;
    margin: 10px 16px;
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* ========== Top Header ========== */
.top-header {
    height: var(--header-height);
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar-toggle {
    color: #64748b;
    font-size: 1.2rem;
    text-decoration: none;
    padding: 4px 8px;
}

.sidebar-toggle:hover {
    color: #334155;
}

.header-search .input-group {
    width: 300px;
}

.header-search .form-control {
    border-left: 0;
    background-color: #f8fafc;
}

.header-search .input-group-text {
    background-color: #f8fafc;
    border-right: 0;
    color: #94a3b8;
}

.header-notifications .btn-link {
    color: #64748b;
    font-size: 1.1rem;
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.65rem;
    padding: 2px 5px;
}

.user-dropdown {
    color: #334155;
    text-decoration: none;
    font-weight: 500;
}

/* ========== Content Wrapper ========== */
.content-wrapper {
    padding: 24px;
}

/* ========== Page Title ========== */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* ========== Stat Cards ========== */
.stat-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.stat-card-blue {
    border-top: 4px solid var(--brand-primary);
}

.stat-card-green {
    border-top: 4px solid var(--brand-success);
}

.stat-card-orange {
    border-top: 4px solid var(--brand-warning);
}

.stat-card-red {
    border-top: 4px solid var(--brand-danger);
}

.stat-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 4px;
}

.stat-icon {
    font-size: 2rem;
    color: #cbd5e1;
}

/* ========== Dashboard Cards ========== */
.dashboard-card {
    background: #ffffff;
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.dashboard-card .card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px;
    font-weight: 600;
}

.dashboard-card .card-body {
    padding: 20px;
}

.dashboard-card .card-footer {
    background-color: #fafbfc;
    border-top: 1px solid #f1f5f9;
    padding: 12px 20px;
}

/* ========== Data Tables ========== */
.data-table thead th {
    background-color: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 16px;
    cursor: pointer;
    white-space: nowrap;
}

.data-table thead th:hover {
    background-color: #f1f5f9;
}

.data-table thead th.sort-asc::after {
    content: ' \25B2';
    font-size: 0.7rem;
}

.data-table thead th.sort-desc::after {
    content: ' \25BC';
    font-size: 0.7rem;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfc;
}

/* ========== Status Badges ========== */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.status-draft {
    background-color: #e2e8f0;
    color: #475569;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-inprogress {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-paid {
    background-color: #d1fae5;
    color: #065f46;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-sent {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-accepted {
    background-color: #d1fae5;
    color: #065f46;
}

.status-expired {
    background-color: #fef3c7;
    color: #92400e;
}

/* ========== Forms ========== */
.form-label {
    font-weight: 500;
    color: #475569;
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* ========== Schedule Grid ========== */
.schedule-grid {
    table-layout: fixed;
}

.schedule-grid th {
    padding: 12px 8px;
    font-size: 0.85rem;
}

.schedule-staff-col {
    width: 180px;
    min-width: 180px;
}

.schedule-cell {
    vertical-align: top;
    padding: 8px !important;
    min-height: 100px;
    height: 120px;
}

.schedule-item {
    background-color: #eff6ff;
    border-left: 3px solid var(--brand-primary);
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.schedule-item strong {
    font-size: 0.8rem;
    display: block;
    margin-bottom: 2px;
}

/* ========== Notes ========== */
.note-item {
    border-left: 3px solid var(--brand-primary);
}

.notes-list {
    scrollbar-width: thin;
}

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

.notes-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.notes-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ========== Buttons ========== */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-success {
    background-color: var(--brand-success);
    border-color: var(--brand-success);
}

.btn-group-sm .btn {
    padding: 4px 10px;
}

/* ========== Alerts ========== */
.alert {
    border: none;
    border-radius: 8px;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 16px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}

/* ========== Sidebar Submenu ========== */
.has-submenu .sidebar-link {
    position: relative;
}

.submenu-arrow {
    font-size: 0.65rem;
    transition: transform 0.25s ease;
}

.sidebar-toggle-sub[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
}

.sidebar-subitem {
    margin: 0;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 48px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-sublink:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-sublink i {
    width: 18px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.8rem;
}

.sidebar-subitem.active .sidebar-sublink {
    color: var(--sidebar-text-active);
    background-color: rgba(59, 130, 246, 0.3);
    font-weight: 500;
}

.sidebar.collapsed .sidebar-submenu {
    display: none !important;
}

.sidebar.collapsed .submenu-arrow {
    display: none;
}

/* ========== Event Timeline Modal ========== */
.event-tree {
    position: relative;
    padding-left: 0;
}

.event-tree-node {
    position: relative;
    margin-bottom: 0;
}

.event-tree-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    transition: box-shadow 0.2s;
}

.event-tree-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.event-tree-card.root-event {
    border-left: 4px solid var(--brand-primary);
    background: #f0f7ff;
}

.event-tree-card.sub-event {
    border-left: 4px solid var(--brand-success);
}

.event-tree-card.limo-event {
    border-left: 4px solid var(--brand-warning);
    background: #fffbeb;
}

.event-tree-children {
    margin-left: 24px;
    padding-left: 20px;
    border-left: 2px dashed #cbd5e1;
}

.event-tree-children .event-tree-node {
    padding-top: 12px;
}

.event-tree-children .event-tree-node::before {
    content: '';
    position: absolute;
    top: 26px;
    left: -20px;
    width: 20px;
    height: 2px;
    background: #cbd5e1;
}

.event-tree-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.event-tree-staff .badge {
    font-size: 0.7rem;
    font-weight: 500;
}

.event-tree-time {
    font-size: 0.8rem;
    color: #64748b;
}

.modal-body .event-tree {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.schedule-item.clickable {
    cursor: pointer;
    transition: all 0.15s ease;
}

.schedule-item.clickable:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* ========== Utility ========== */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================== Venue Calendar ===================== */

.venue-calendar-grid {
    table-layout: fixed;
}

.venue-calendar-grid .time-col {
    width: 90px;
    min-width: 90px;
    font-size: 0.8rem;
}

.venue-slot {
    height: 38px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
    padding: 2px 4px !important;
    vertical-align: middle;
    position: relative;
}

.venue-slot:hover {
    opacity: 0.85;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.12);
}

.venue-slot.status-available {
    background: #ffffff;
}

.venue-slot.status-booked {
    background: #dbeafe;
    border-left: 3px solid #3b82f6 !important;
}

.venue-slot.status-hold {
    background: #fef3c7;
    border-left: 3px solid #f59e0b !important;
}

.venue-slot.status-notavailable {
    background: #f1f5f9;
    border-left: 3px solid #94a3b8 !important;
}

.venue-slot.today-col {
    background-color: inherit;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.venue-slot-content {
    display: flex;
    align-items: center;
    height: 100%;
    overflow: hidden;
    white-space: nowrap;
    color: #1e40af;
    font-weight: 600;
    font-size: 0.7rem;
}

.venue-slot-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.venue-slot-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    font-size: 0.75rem;
    padding: 0;
}

.venue-slot-btn:hover {
    opacity: 0.7;
}

.venue-slot.status-hold .venue-slot-btn {
    color: #b45309;
}

.venue-slot.status-notavailable .venue-slot-btn {
    color: #64748b;
}

/* Legend swatches */
.venue-legend-swatch {
    display: inline-block;
    width: 18px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
}

.venue-legend-swatch.status-available {
    background: #ffffff;
}

.venue-legend-swatch.status-booked {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.venue-legend-swatch.status-hold {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.venue-legend-swatch.status-notavailable {
    background: #f1f5f9;
    border-left: 3px solid #94a3b8;
}

/* ===================== Quote Timeline ===================== */
.quote-timeline {
    position: relative;
    padding-left: 30px;
}

.quote-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, #4e73df, #1cc88a);
    border-radius: 1px;
}

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

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

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #4e73df;
    z-index: 1;
}

.timeline-content {
    background: #f8f9fc;
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid #e3e6f0;
    transition: box-shadow 0.2s;
}

.timeline-content:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timeline-time {
    color: #4e73df;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Sub-event timeline */
.timeline-sub-events {
    position: relative;
    padding-left: 24px;
    margin-left: 8px;
}

.timeline-sub-events::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #d1d3e2;
    border-radius: 1px;
}

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

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

.timeline-sub-dot {
    position: absolute;
    left: -24px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d3e2;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d1d3e2;
}

.timeline-sub-content {
    background: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid #e3e6f0;
}
