/* ================================================================
   تسکولو - Main Stylesheet (RTL + Jalali)
   ================================================================ */

/* ── Vazirmatn FD (Farsi Digits) — local, offline ── */
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../vendor/vazirmatn/Vazirmatn-FD-Light.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../vendor/vazirmatn/Vazirmatn-FD-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../vendor/vazirmatn/Vazirmatn-FD-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../vendor/vazirmatn/Vazirmatn-FD-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../vendor/vazirmatn/Vazirmatn-FD-Bold.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../vendor/vazirmatn/Vazirmatn-FD-ExtraBold.woff2') format('woff2');
}

:root {
    --primary:       #0079bf;
    --primary-dark:  #0065a0;
    --primary-light: #e8f4fd;
    --success:       #61bd4f;
    --warning:       #f2d600;
    --danger:        #eb5a46;
    --purple:        #c377e0;
    --orange:        #ff9f1a;
    --teal:          #00c2e0;
    --green:         #51e898;
    --pink:          #ff78cb;
    --dark-blue:     #344563;

    --bg:            #f4f5f7;
    --bg-board:      #0079bf;
    --surface:       #ffffff;
    --surface-hover: #f4f5f7;
    --border:        #e0e0e0;
    --text:          #172b4d;
    --text-muted:    #5e6c84;
    --text-light:    #97a0af;
    --sidebar-bg:    #ffffff;
    --sidebar-width: 240px;
    --header-h:      56px;
    --card-shadow:   0 1px 3px rgba(9,30,66,.12), 0 0 0 1px rgba(9,30,66,.08);
    --card-shadow-hover: 0 4px 12px rgba(9,30,66,.2);
    --radius:        8px;
    --radius-sm:     4px;
    --transition:    0.2s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg:            #1d2125;
    --surface:       #282e33;
    --surface-hover: #323940;
    --border:        #3d4b5c;
    --text:          #c7d1db;
    --text-muted:    #8c9bab;
    --text-light:    #596f86;
    --sidebar-bg:    #22272b;
    --card-shadow:   0 1px 3px rgba(0,0,0,.4), 0 0 0 1px rgba(0,0,0,.3);
    --primary-light: #1a3550;
}

* { box-sizing: border-box; }

html, body {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Header ── */
.app-header {
    height: var(--header-h);
    background: rgba(0,0,0,.32);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    backdrop-filter: blur(4px);
}

.app-header.dashboard-header {
    background: var(--primary);
}

.header-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.header-logo:hover { background: rgba(255,255,255,.15); text-decoration: none; color: #fff; }

.header-search {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.header-search input {
    width: 100%;
    background: rgba(255,255,255,.2);
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 36px 6px 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: background var(--transition);
    direction: rtl;
}

.header-search input::placeholder { color: rgba(255,255,255,.7); }
.header-search input:focus { background: rgba(255,255,255,.3); }
.header-search .search-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.8); }

.header-search-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(9,30,66,.2);
    z-index: 200;
    display: none;
}

.search-result-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-result-item:hover { background: var(--surface-hover); }
.search-result-item:last-child { border-bottom: none; }
.search-section-title { padding: 8px 14px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.header-spacer { flex: 1; }

.header-btn {
    background: rgba(255,255,255,.15);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition);
    white-space: nowrap;
}

.header-btn:hover { background: rgba(255,255,255,.25); }
.header-btn .badge { background: #eb5a46; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,.4);
}

/* ── Sidebar ── */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border);
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    padding: 16px 0;
    transition: transform var(--transition);
}

.sidebar-section { margin-bottom: 8px; }
.sidebar-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 8px 16px 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--text);
    cursor: pointer;
    border-radius: 0;
    transition: background var(--transition);
    font-size: 0.875rem;
}

.sidebar-item:hover { background: var(--surface-hover); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-item .board-color { width: 24px; height: 24px; border-radius: var(--radius-sm); flex-shrink: 0; }

/* ── Main Content ── */
.app-main {
    margin-top: var(--header-h);
    margin-right: var(--sidebar-width);
    min-height: calc(100vh - var(--header-h));
    padding: 24px;
}

@media (max-width: 768px) {
    .app-sidebar { transform: translateX(100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-right: 0; padding: 16px; }
}

/* ── Dashboard Boards ── */
.boards-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.board-tile {
    height: 100px;
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
}

.board-tile:hover { box-shadow: 0 4px 16px rgba(9,30,66,.25); transform: translateY(-2px); text-decoration: none; }

.board-tile-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.board-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.1);
}

.board-tile-content {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.board-tile-title {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    word-break: break-word;
}

.board-tile-star {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.board-tile-star:hover, .board-tile-star.starred { color: #f2d600; }

.board-tile-new {
    background: rgba(9,30,66,.06);
    color: var(--text-muted);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: background var(--transition), border-color var(--transition);
}

.board-tile-new:hover {
    background: rgba(9,30,66,.1);
    border-color: var(--text-muted);
    color: var(--text);
}

/* ── Board View ── */
.board-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.board-header {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(0,0,0,.25);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
}

.board-title-btn {
    background: rgba(255,255,255,.2);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    padding: 4px 10px;
    cursor: pointer;
    transition: background var(--transition);
}

.board-title-btn:hover { background: rgba(255,255,255,.3); }

.board-content {
    margin-top: calc(var(--header-h) + 48px);
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-x: auto;
    min-height: calc(100vh - var(--header-h) - 48px);
    padding-bottom: 24px;
}

/* ── List ── */
.list-wrapper {
    flex-shrink: 0;
    width: 272px;
    max-height: calc(100vh - var(--header-h) - 80px);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(9,30,66,.12);
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    flex-shrink: 0;
}

.list-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.list-title:focus { outline: 2px solid var(--primary); background: var(--surface); }

.list-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.list-menu-btn:hover { background: var(--border); color: var(--text); }

.list-cards {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 4px;
    min-height: 4px;
}

.list-footer {
    padding: 6px 8px 8px;
    flex-shrink: 0;
}

/* ── Card ── */
.card-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

.card-item:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.card-item.dragging { opacity: 0.6; transform: rotate(3deg); }

.card-cover {
    height: 36px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

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

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.card-label {
    height: 8px;
    border-radius: 4px;
    min-width: 40px;
    cursor: pointer;
    transition: filter var(--transition);
}

.card-label:hover { filter: brightness(0.85); }
.card-labels.expanded .card-label { height: 16px; min-width: 40px; }

.card-title {
    font-size: 0.875rem;
    color: var(--text);
    word-break: break-word;
    margin-bottom: 6px;
}

.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.card-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.card-badge.due-passed { background: var(--danger); color: #fff; }
.card-badge.due-soon   { background: var(--warning); color: #172b4d; }

.card-members {
    display: flex;
    margin-right: auto;
    gap: -4px;
}

.card-member-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    object-fit: cover;
    margin-left: -4px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    font-weight: 700;
}

/* ── Add Card / List buttons ── */
.add-card-btn, .add-list-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: right;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    transition: background var(--transition), color var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-card-btn:hover { background: rgba(9,30,66,.08); color: var(--text); }

.add-card-form, .add-list-form { display: none; }

.add-card-input, .add-list-input {
    width: 100%;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    resize: vertical;
    min-height: 60px;
    outline: none;
}

.add-list-wrapper {
    flex-shrink: 0;
    width: 272px;
}

.add-list-wrapper .add-list-btn {
    background: rgba(255,255,255,.2);
    color: #fff;
    border-radius: var(--radius);
    padding: 10px 14px;
}

.add-list-wrapper .add-list-btn:hover { background: rgba(255,255,255,.3); }

.add-list-wrapper .add-list-form {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px;
}

.add-list-input {
    min-height: 36px;
    resize: none;
}

/* ── Card Modal ── */
.card-modal .modal-dialog {
    max-width: 768px;
    margin: 40px auto;
}

.card-modal .modal-content {
    border: none;
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 0 20px 60px rgba(9,30,66,.3);
}

.card-modal-cover {
    height: 160px;
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
}

.card-modal-cover .cover-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,.4);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.card-modal-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 168px;
    gap: 20px;
    align-items: start;
}

.card-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    color: var(--text);
    width: 100%;
    padding: 4px 8px;
    margin-bottom: 16px;
    resize: none;
    transition: background var(--transition);
    line-height: 1.4;
}

.card-modal-title:focus { outline: 2px solid var(--primary); background: var(--surface); }

.card-section { margin-bottom: 20px; }
.card-section-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

.card-desc {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    transition: border-color var(--transition);
}

.card-desc:focus { outline: none; border-color: var(--primary); }

/* Card sidebar buttons */
.card-sidebar { }
.card-sidebar-btn {
    width: 100%;
    background: var(--surface-hover);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    transition: background var(--transition);
}

.card-sidebar-btn:hover { background: var(--border); }

/* Labels in card */
.label-picker { }
.label-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.label-item:hover { background: var(--surface-hover); }

.label-dot {
    width: 32px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.label-check { margin-right: auto; color: var(--primary); display: none; }
.label-item.checked .label-check { display: block; }

/* Members */
.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Checklist */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
}

.checklist-item input[type=checkbox] { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.checklist-item label { flex: 1; font-size: 0.875rem; cursor: pointer; }
.checklist-item.checked label { text-decoration: line-through; color: var(--text-muted); }

.progress-bar-wrap { background: var(--border); border-radius: 4px; height: 8px; margin-bottom: 8px; overflow: hidden; }
.progress-bar-fill { background: var(--success); height: 100%; border-radius: 4px; transition: width 0.3s; }

/* Due date badge */
.due-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-hover);
    font-size: 0.875rem;
    cursor: pointer;
}

.due-date-badge.passed { background: var(--danger); color: #fff; }
.due-date-badge.soon   { background: var(--warning); color: #172b4d; }
.due-date-badge.done   { background: var(--success); color: #fff; }

/* Attachments */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.attachment-thumb {
    width: 80px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    overflow: hidden;
}

.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }

.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 0.875rem; font-weight: 600; truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.attachment-meta { font-size: 0.75rem; color: var(--text-muted); }

/* Comments */
.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.comment-body { flex: 1; }
.comment-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.875rem;
    word-break: break-word;
}

.comment-actions { margin-top: 4px; font-size: 0.75rem; color: var(--text-muted); }
.comment-actions button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 0; margin-left: 8px; }
.comment-actions button:hover { color: var(--text); text-decoration: underline; }

/* Activity */
.activity-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-text strong { color: var(--text); }

/* ── Popover / Dropdown ── */
.custom-dropdown {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(9,30,66,.2);
    z-index: 300;
    min-width: 240px;
    max-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--border);
}

.dropdown-title { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.dropdown-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0; font-size: 1.1rem; }
.dropdown-body { padding: 10px; }
.dropdown-item {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fff5f5; }
.dropdown-divider { border-bottom: 1px solid var(--border); margin: 6px 0; }

/* ── Notifications Dropdown ── */
.notif-dropdown {
    position: absolute;
    top: calc(var(--header-h) + 4px);
    left: 12px;
    width: 360px;
    max-height: 480px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(9,30,66,.2);
    z-index: 200;
    display: none;
}

.notif-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    cursor: pointer;
    transition: background var(--transition);
}

.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #d0e9f8; }
.notif-text { flex: 1; font-size: 0.8rem; line-height: 1.5; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.notif-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; margin-top: 6px; flex-shrink: 0; }

/* ── Calendar ── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cal-header { background: var(--surface-hover); font-weight: 700; text-align: center; padding: 10px 4px; font-size: 0.8rem; color: var(--text-muted); }
.cal-cell { background: var(--surface); min-height: 100px; padding: 6px; font-size: 0.8rem; }
.cal-cell.other-month { background: var(--bg); opacity: 0.6; }
.cal-cell.today { background: var(--primary-light); }
.cal-day { font-weight: 700; color: var(--text-muted); margin-bottom: 4px; font-size: 0.75rem; }
.cal-card-chip {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    margin-bottom: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    transition: opacity var(--transition);
}

.cal-card-chip:hover { opacity: 0.85; }
.cal-card-chip.passed { background: var(--danger); }
.cal-card-chip.soon   { background: var(--warning); color: #172b4d; }

/* ── Jalali Date Picker ── */
.jdp-wrapper {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(9,30,66,.2);
    z-index: 400;
    width: 280px;
    font-size: 0.875rem;
    padding: 12px;
    display: none;
}

.jdp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.jdp-nav { background: none; border: none; cursor: pointer; color: var(--text); padding: 4px 8px; border-radius: var(--radius-sm); font-size: 1rem; }
.jdp-nav:hover { background: var(--surface-hover); }
.jdp-month-year { font-weight: 700; font-size: 0.9rem; }

.jdp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.jdp-dow { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 4px; }
.jdp-day {
    padding: 6px 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 0.8rem;
}

.jdp-day:hover { background: var(--primary-light); }
.jdp-day.selected { background: var(--primary); color: #fff; }
.jdp-day.today { font-weight: 700; color: var(--primary); }
.jdp-day.other { color: var(--text-light); }
.jdp-day.empty { cursor: default; }

.jdp-time {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.jdp-time input {
    width: 60px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    text-align: center;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.toast-item {
    background: var(--text);
    color: var(--surface);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(9,30,66,.3);
    max-width: 320px;
    animation: slideUp 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-item.success { background: var(--success); }
.toast-item.error   { background: var(--danger); }
.toast-item.warning { background: var(--warning); color: var(--text); }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Utility ── */
.btn-sm-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}

.btn-sm-icon:hover { background: var(--surface-hover); color: var(--text); }

.form-control, .form-select {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    font-family: inherit;
}

.form-control:focus, .form-select:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,121,191,.2);
    color: var(--text);
}

.modal-content { background: var(--surface); color: var(--text); }
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }

.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Color Picker */
.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1.8;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
}

.color-swatch:hover, .color-swatch.selected { border-color: var(--text); transform: scale(1.05); }

/* Responsive Board */
@media (max-width: 600px) {
    .board-content { flex-direction: column; align-items: stretch; }
    .list-wrapper { width: 100%; max-height: none; }
    .card-modal .modal-dialog { margin: 0; max-width: 100%; min-height: 100vh; }
    .card-modal-body { grid-template-columns: 1fr; }
    .card-sidebar { display: flex; flex-wrap: wrap; gap: 6px; }
    .card-sidebar-btn { width: auto; }
}

/* Sortable ghost */
.sortable-ghost { opacity: 0.4; background: var(--primary-light); }
.sortable-chosen { cursor: grabbing; }
.sortable-drag { opacity: 1 !important; transform: rotate(2deg); box-shadow: 0 8px 24px rgba(9,30,66,.3) !important; }
