/* ===========================
   Sidebar
   =========================== */
.sidebar-expanded {
    width: 260px;
    min-width: 260px;
}

.sidebar-collapsed {
    width: 64px;
    min-width: 64px;
}

.sidebar-collapsed .sidebar-text {
    display: none;
}

.sidebar-collapsed .menu-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.menu-item.active {
    background: rgba(99,102,241,0.2);
    color: #fff;
    font-weight: 600;
}

/* ===========================
   Status Badges
   =========================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-new { background: #dbeafe; color: #1e40af; }
.badge-assigned { background: #f3e8ff; color: #6b21a8; }
.badge-in-progress { background: #fef9c3; color: #854d0e; }
.badge-on-hold { background: #ffedd5; color: #9a3412; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-closed { background: #f3f4f6; color: #374151; }

/* ===========================
   Cards
   =========================== */
.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===========================
   Tables
   =========================== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}
.data-table tr:hover td {
    background: #f8fafc;
}

/* ===========================
   Timeline
   =========================== */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}
.timeline-item:last-child::before {
    display: none;
}
.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e2e8f0;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1024px) {
    .sidebar-expanded {
        position: fixed;
        left: -260px;
    }
    .sidebar-expanded.show-mobile {
        left: 0;
    }
}

/* ===========================
   Form styles
   =========================== */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* ===========================
   Pagination
   =========================== */
.pagination {
    display: flex;
    gap: 0.25rem;
}
.pagination a, .pagination span {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.15s;
}
.pagination a:hover {
    background: #f1f5f9;
}
.pagination .active {
    background: #4f46e5;
    color: #fff;
}
.pagination .disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

/* ===========================
   Select2 Overrides
   =========================== */
.select2-container .select2-selection {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.select2-container.select2-container--focus .select2-selection,
.select2-container.select2-container--open .select2-selection {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.select2-container .select2-selection--single {
    height: auto;
    min-height: 42px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    color: #374151;
}

.select2-container .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 40px;
    top: 1px;
    right: 1px;
}

.select2-container .select2-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.select2-container .select2-results__options {
    max-height: 200px;
}

.select2-container .select2-results__option {
    padding: 0.5rem 0.75rem;
}

.select2-container .select2-results__option--selected,
.select2-container .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #4f46e5;
    color: #fff;
}

.select2-container .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #6366f1;
}

/* ===========================
   Print Styles (Global)
   =========================== */
@media print {
    .sidebar-expanded, .sidebar-collapsed,
    #sidebar-overlay,
    header,
    .print-controls,
    button, form,
    nav[aria-label="breadcrumb"] {
        display: none !important;
    }
    main {
        padding: 0 !important;
        margin: 0 !important;
    }
    body {
        background: white !important;
    }
}
