/**
 * Admin layout: sidebar, cards, polish for office use.
 */

:root {
    --sidebar-width: 260px;
    --brand-dark: #1a1d24;
    --brand-accent: #0d6efd;
}

.admin-body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f4f6f9;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    flex-shrink: 0;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-link.active {
    background: var(--brand-accent);
    color: #fff;
}

.sidebar-nav-heading {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
}

.sidebar-sublink {
    padding-left: 1.35rem !important;
    font-size: 0.95rem;
}

.sidebar-scroll {
    overflow-y: auto;
}

.main-content {
    min-width: 0;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.content-area {
    background: linear-gradient(180deg, #eef1f6 0%, #f4f6f9 120px);
}

.card-stat {
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-stat-primary {
    background: linear-gradient(135deg, #3b5bdb 0%, #364fc7 100%);
}

.card-stat-warning {
    background: linear-gradient(135deg, #f59f00 0%, #e67700 100%);
}

.card-stat-success {
    background: linear-gradient(135deg, #2b8a3e 0%, #2f9e44 100%);
}

.card-stat-muted {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

.text-preview {
    display: inline-block;
    max-width: 280px;
    vertical-align: top;
}

@media (max-width: 991.98px) {
    .sidebar {
        display: none !important;
    }
}

.table.dataTable tbody td {
    vertical-align: middle;
}

/* Deadline date field — add / edit forms */
.deadline-date-block {
    padding: 1.25rem 1.35rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(13, 110, 253, 0.2);
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.06) 0%, rgba(255, 255, 255, 0.9) 55%, #fff 100%);
    box-shadow: 0 0.125rem 0.5rem rgba(13, 110, 253, 0.06);
}

.deadline-date-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 0.25rem 0.65rem rgba(13, 110, 253, 0.35);
}

.deadline-date-input-group .input-group-text {
    cursor: pointer;
    user-select: none;
}

.deadline-date-input-group .form-control:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

.deadline-date-input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.2);
    border-radius: 0.5rem;
}

.deadline-date-input-group:focus-within .input-group-text,
.deadline-date-input-group:focus-within .form-control {
    border-color: #86b7fe;
}

.letter-spacing-1 {
    letter-spacing: 0.06em;
}

/* Flatpickr — popover calendar aligned with Bootstrap */
.flatpickr-calendar {
    z-index: 1060;
    border-radius: 0.5rem;
    box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(13, 110, 253, 0.2);
    font-family: inherit;
}

.flatpickr-months {
    padding: 0.35rem 0.25rem 0;
}

.flatpickr-months .flatpickr-month {
    height: 2.5rem;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month .numInputWrapper {
    font-weight: 600;
    border-radius: 0.35rem;
}

.flatpickr-weekdays {
    padding: 0.35rem 0 0.25rem;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

.flatpickr-day.today {
    border-color: #0d6efd;
}

.flatpickr-day:hover:not(.selected) {
    background: rgba(13, 110, 253, 0.12);
    border-color: rgba(13, 110, 253, 0.35);
}

.deadline-flatpickr-wrap .deadline-flatpickr-alt {
    flex: 1 1 auto;
    min-width: 0;
}

.deadline-flatpickr-wrap.input-group {
    flex-wrap: nowrap;
}

/* Deadline assignees — Select2 multi-select */
.deadline-assignees-card {
    background: linear-gradient(145deg, rgba(25, 135, 84, 0.07) 0%, rgba(255, 255, 255, 0.96) 55%, #fff 100%);
    border: 1px solid rgba(25, 135, 84, 0.18) !important;
    box-shadow: 0 0.125rem 0.45rem rgba(25, 135, 84, 0.06);
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 3rem;
    padding-bottom: 0.25rem;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.select2-container--open {
    z-index: 1055;
}

@media (max-width: 575.98px) {
    .deadline-date-block .d-flex.align-items-start {
        flex-direction: column;
    }

    .deadline-date-icon {
        width: 2.75rem;
        height: 2.75rem;
    }
}
