:root {
    --desk-sidebar-width: 260px;
}

body {
    background: #f5f7fb;
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    text-align: right;
}

.desk-shell {
    min-height: 100vh;
}

.desk-sidebar {
    width: var(--desk-sidebar-width);
    min-height: 100vh;
    background: #172033;
    flex: 0 0 var(--desk-sidebar-width);
}

.desk-sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 6px;
}

.desk-sidebar .nav-link:hover,
.desk-sidebar .nav-link.active {
    color: #ffffff;
    background: #253149;
}

.desk-content {
    min-width: 0;
}

.desk-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.table td,
.table th {
    vertical-align: middle;
}

input,
textarea,
select {
    text-align: right;
}

input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
[data-jalali-datepicker] {
    direction: ltr;
    text-align: left;
}

.jalali-datepicker {
    position: relative;
    z-index: 1050;
    width: 280px;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    padding: 10px;
    margin-top: 6px;
    direction: rtl;
    text-align: right;
}

.jalali-datepicker__header,
.jalali-datepicker__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.jalali-datepicker__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.jalali-datepicker button {
    border: 0;
    background: transparent;
    border-radius: 6px;
    min-height: 32px;
}

.jalali-datepicker button:hover {
    background: #eef2ff;
}

.jalali-datepicker__day-name {
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

.jalali-datepicker__day {
    color: #111827;
}

.jalali-datepicker__day.is-selected {
    background: #0d6efd;
    color: #ffffff;
}

.project-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(260px, 1fr));
    gap: 16px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 8px;
}

.project-column {
    min-width: 260px;
    background: #eef2f7;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
}

.project-column__header {
    padding: 12px;
    border-bottom: 1px solid #dbe2ea;
}

.project-column__body {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.project-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    cursor: grab;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.project-card__status-line {
    height: 3px;
    margin: 10px -10px -10px;
    border-radius: 0 0 8px 8px;
    background: #cbd5e1;
}

.project-card[data-status="planning"] .project-card__status-line {
    background: #0dcaf0;
}

.project-card[data-status="active"] .project-card__status-line {
    background: #198754;
}

.project-card[data-status="paused"] .project-card__status-line {
    background: #ffc107;
}

.project-card[data-status="completed"] .project-card__status-line {
    background: #6c757d;
}

.project-card:active {
    cursor: grabbing;
}

.project-card.is-dragging {
    opacity: 0.55;
    border-color: #0d6efd;
}

.project-column.is-drag-over {
    border-color: #0d6efd;
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.16);
}

.project-card__meta {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    color: #475569;
    font-size: 13px;
}

.project-card__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}

.project-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.project-card__title-wrap {
    min-width: 0;
}

.project-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    margin: 0;
    overflow-wrap: anywhere;
}

.project-card__code {
    display: inline-flex;
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
}

.project-card__actions {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
}

.project-card__actions .btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.project-card__actions [data-project-toggle] i {
    transition: transform 0.15s ease;
}

.project-card.is-open .project-card__actions [data-project-toggle] i {
    transform: rotate(180deg);
}

.project-card__details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #edf2f7;
}

.project-card__dates {
    display: grid;
    gap: 6px;
}

.project-card__dates span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.project-card__dates bdi {
    direction: ltr;
    unicode-bidi: isolate;
}

.project-card__departments {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.project-card__departments span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card__description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
    margin: 10px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card__progress {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #edf2f7;
}

.desk-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.desk-check {
    min-height: 42px;
    margin: 0;
    padding: 9px 36px 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.desk-check .form-check-input {
    float: none;
    margin-right: -24px;
    margin-left: 8px;
}

.desk-check .form-check-label {
    font-weight: 600;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    padding: 6px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    background: #f8fafc;
}

.attachment-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-item:hover {
    color: #0d6efd;
    border-color: #b6d4fe;
}

.project-column__empty {
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    font-size: 13px;
}

.project-progress {
    height: 16px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.project-progress .progress-bar {
    min-width: 28px;
    font-size: 11px;
    line-height: 16px;
}

@media (max-width: 1200px) {
    .project-board {
        grid-template-columns: repeat(4, 280px);
    }
}
