:root {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-header: #1a1d23;
    --bg-input: #f5f5f5;
    --text: #1a1d23;
    --text-secondary: #6b7280;
    --text-header: #ffffff;
    --border: #e5e7eb;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --khamsat: #f3ad2d;
    --khamsat-bg: #fef3c7;
    --mostaql: #2caae2;
    --mostaql-bg: #e0f2fe;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 10px;
    --radius-sm: 6px;
}

[data-theme="dark"] {
    --bg: #111318;
    --bg-card: #1a1d23;
    --bg-header: #0d0f12;
    --bg-input: #252830;
    --text: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-header: #ffffff;
    --border: #2d3039;
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --khamsat-bg: #2d2510;
    --mostaql-bg: #0c1f2e;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
}

.header {
    background: linear-gradient(135deg, #1a1d23 0%, #2d1b69 50%, #1a1d23 100%);
    color: var(--text-header);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 24px;
    color: var(--primary);
}

/* ═══ Header Logo Slot ═══ */
.logo-img-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 2px 8px rgba(59,130,246,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.25s;

}

.logo-img-wrap:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.3),
        0 0 0 3px rgba(59,130,246,0.18),
        0 4px 16px rgba(59,130,246,0.4);
    transform: translateY(-1px);
}

.logo-img-wrap .logo-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
    transition: transform 0.25s, filter 0.25s;
}

.logo-img-wrap:hover .logo-img {
    transform: scale(1.08);
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.45));
}

.logo-img--missing {
    display: none;
}

.logo-img-wrap .logo-img--big {
    width: 200px;
    height: auto;
    padding: 4px;
}

.logo-img-wrap:has(.logo-img--big) {
    width: auto;
    height: auto;
    overflow: visible;
    border: none;
    background: none;
    box-shadow: none;
}

.logo-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,0.55);
    font-size: 9px;
    line-height: 1;
    pointer-events: none;
    transition: color 0.25s;
}

.logo-img-wrap:hover .logo-placeholder {
    color: rgba(255,255,255,0.85);
}

.logo-placeholder i {
    font-size: 18px;
    margin: 0;
    animation: logo-pulse 2.4s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.12); opacity: 1; }
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-tag {
    font-size: 12px;
    color: #9ca3af;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-header);
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
}

/* ═══ Header Toggle & Reload Icons (big, glass) ═══ */
.header-actions .btn-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.header-actions .btn-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -70%;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.header-actions .btn-icon:hover::after {
    left: 130%;
}

.header-actions .btn-icon i {
    font-size: 22px;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.header-actions .btn-icon:hover {
    transform: translateY(-3px);
}

.header-actions .btn-icon:active {
    transform: scale(0.92);
}

/* Refresh button — blue accent */
.header-actions #refresh-btn {
    color: #60a5fa;
    background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(59,130,246,0.08));
    border-color: rgba(96,165,250,0.4);
}

.header-actions #refresh-btn:hover {
    background: linear-gradient(135deg, rgba(59,130,246,0.32), rgba(59,130,246,0.14));
    box-shadow: 0 8px 24px rgba(59,130,246,0.45);
    color: #93c5fd;
}

.header-actions #refresh-btn:hover i {
    transform: rotate(180deg) scale(1.05);
}

.header-actions #refresh-btn i.fa-spin {
    color: #93c5fd;
    filter: drop-shadow(0 0 8px rgba(96,165,250,0.8));
}

/* Theme toggle — amber accent */
.header-actions #theme-toggle {
    color: #fbbf24;
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.08));
    border-color: rgba(251,191,36,0.4);
}

.header-actions #theme-toggle:hover {
    background: linear-gradient(135deg, rgba(245,158,11,0.32), rgba(245,158,11,0.14));
    box-shadow: 0 8px 24px rgba(245,158,11,0.4);
    color: #fcd34d;
}

.header-actions #theme-toggle:hover i {
    transform: rotate(20deg) scale(1.1);
}

/* Modal close icons keep compact size */
.modal-close.btn-icon {
    width: 34px;
    height: 34px;
    color: var(--text-secondary);
    background: var(--bg-input);
    transition: all 0.2s;
}

.modal-close.btn-icon:hover {
    background: var(--danger);
    color: #fff;
    transform: rotate(90deg);
}

.main {
    min-width: 0;
    padding: 24px 0;
}

/* ═══ Layout (AdSense side columns only when enabled) ═══ */
.layout {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) minmax(160px, 240px);
    gap: 20px;
    align-items: start;
}

/* ═══ Ad Slots ═══ */
.ad-slot {
    position: sticky;
    top: 90px;
    min-height: 600px;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-slot .ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 13px;
}

.ad-placeholder i {
    font-size: 28px;
}

.ad-slot ins {
    display: block;
    width: 100%;
}

/* ═══ Motivational quote banner ═══ */
.quote-banner {
    background: linear-gradient(90deg, #2d1b69 0%, #3b82f6 50%, #2d1b69 100%);
    padding: 18px 24px;
    text-align: center;
}

.quote-inner {
    max-width: 900px;
    margin: 0 auto;
    color: #fff;
    position: relative;
}

.quote-icon {
    font-size: 20px;
    opacity: 0.6;
    margin-inline-end: 10px;
    vertical-align: middle;
}

.quote-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    display: inline;
}

.quote-fade {
    animation: quoteFade 1s ease;
}

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

.quote-author {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.85;
}

/* ═══ About / SEO Content ═══ */
.about-seo {
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.about-seo-inner {
    max-width: 900px;
    margin: 0 auto;
}

.about-seo-title {
    display: inline;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.about-seo-text {
    display: inline;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.stat-total-card::before { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.stat-khamsat-card::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.stat-mostaql-card::before { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.stat-bids-card::before { background: linear-gradient(90deg, #22c55e, #10b981); }

.stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    font-size: 16px;
}

.stat-total-card .stat-icon { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stat-khamsat-card .stat-icon { background: rgba(245,158,11,0.1); color: #f59e0b; }
.stat-mostaql-card .stat-icon { background: rgba(6,182,212,0.1); color: #06b6d4; }
.stat-bids-card .stat-icon { background: rgba(34,197,94,0.1); color: #22c55e; }

[data-theme="dark"] .stat-total-card .stat-icon { background: rgba(96,165,250,0.15); color: #60a5fa; }
[data-theme="dark"] .stat-khamsat-card .stat-icon { background: rgba(251,191,36,0.15); color: #fbbf24; }
[data-theme="dark"] .stat-mostaql-card .stat-icon { background: rgba(34,211,238,0.15); color: #22d3ee; }
[data-theme="dark"] .stat-bids-card .stat-icon { background: rgba(74,222,128,0.15); color: #4ade80; }

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-total-card .stat-value { color: #3b82f6; }
.stat-khamsat-card .stat-value { color: #f59e0b; }
.stat-mostaql-card .stat-value { color: #06b6d4; }
.stat-bids-card .stat-value { color: #22c55e; }

[data-theme="dark"] .stat-total-card .stat-value { color: #60a5fa; }
[data-theme="dark"] .stat-khamsat-card .stat-value { color: #fbbf24; }
[data-theme="dark"] .stat-mostaql-card .stat-value { color: #22d3ee; }
[data-theme="dark"] .stat-bids-card .stat-value { color: #4ade80; }

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: inherit;
}

.tab:hover {
    background: var(--bg-input);
    color: var(--text);
}

.tab.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

.tab-icon {
    border-radius: 3px;
}

.filters-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.search-box {
    position: relative;
    margin-bottom: 12px;
}

.search-box i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg-input);
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

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

.search-box #search-clear {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    padding: 4px 8px;
}

.filters-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ═══ Category Pills ═══ */
.category-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.cat-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59,130,246,0.05);
}

.cat-pill.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

.cat-pill.active:hover {
    box-shadow: 0 4px 12px rgba(59,130,246,0.4);
    transform: translateY(-1px);
}

.cat-pill i {
    font-size: 12px;
}

/* ═══ Today Switch ═══ */
.today-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    transition: all 0.2s;
    white-space: nowrap;
}

.today-switch:hover {
    border-color: var(--primary);
}

.today-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 10px;
    background: var(--border);
    transition: background 0.25s;
    flex-shrink: 0;
}

.switch-thumb {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.25s;
}

.today-switch input:checked + .switch-track {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.today-switch input:checked + .switch-track .switch-thumb {
    transform: translateX(-16px);
}

.switch-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.today-switch input:checked ~ .switch-label {
    color: var(--primary);
}

/* ═══ Reset Filters ═══ */
.reset-filters-btn {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.reset-filters-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239,68,68,0.05);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 20px;
}

[data-theme="dark"] .error-msg {
    background: #2d1215;
    border-color: #4a1c1f;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.3s, transform 0.25s, border-color 0.3s;
    position: relative;
    animation: cardSlideIn 0.3s ease-out;
    cursor: pointer;
}

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

.card:hover {
    border-color: #8b5cf6;
    box-shadow: 0 8px 30px rgba(139,92,246,0.18), 0 0 0 1px rgba(139,92,246,0.08);
    transform: translateY(-3px);
}

.open-link-btn {
    color: #8b5cf6 !important;
    text-decoration: none;
}

.open-link-btn:hover {
    color: #6366f1 !important;
    background: rgba(139,92,246,0.1);
}

.proposal-btn {
    color: #10b981 !important;
    text-decoration: none;
}

.proposal-btn:hover {
    color: #34d399 !important;
    background: rgba(16,185,129,0.1);
}

.card:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    flex: 1;
}

.card-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--primary);
}

.card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.card-actions .btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 13px;
}

.card-actions .btn:hover {
    background: var(--bg-input);
    color: var(--text);
}

.card-actions .btn.bookmarked {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245,158,11,0.3);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.source-badge.khamsat {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid rgba(245,158,11,0.3);
}

.source-badge.mostaql {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #075985;
    border: 1px solid rgba(6,182,212,0.3);
}

[data-theme="dark"] .source-badge.khamsat {
    color: var(--khamsat);
}

[data-theme="dark"] .source-badge.mostaql {
    color: var(--mostaql);
}

.offers-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.offers-badge.low {
    background: #dcfce7;
    color: #15803d;
}

.offers-badge.medium {
    background: #fef3c7;
    color: #b45309;
}

.offers-badge.high {
    background: #fee2e2;
    color: #b91c1c;
}

[data-theme="dark"] .offers-badge.low {
    background: #14312a;
    color: #4ade80;
}

[data-theme="dark"] .offers-badge.medium {
    background: #2d2510;
    color: var(--khamsat);
}

[data-theme="dark"] .offers-badge.high {
    background: #2d1215;
    color: #f87171;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state p {
    font-size: 16px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    margin-top: 20px;
}

.btn-page {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#page-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-inner p {
    margin: 0;
}

.footer-muted {
    opacity: 0.75;
    font-size: 12px;
}

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

.card {
    animation: fadeIn 0.3s ease;
}

@media (max-width: 1200px) {
    .layout {
        grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) minmax(140px, 200px);
    }
}

@media (max-width: 992px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-slot {
        display: none;
    }
}

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card-header {
        flex-direction: column;
    }

    .card-meta {
        gap: 10px;
    }

    .logo h1 {
        font-size: 16px;
    }

    .logo-img-wrap .logo-img--big {
        width: 150px;
    }

    .stat-value {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-item {
        padding: 14px;
    }

    .main {
        padding: 16px 10px;
    }
}

/* ═══ View Tabs (main navigation) ═══ */

.view-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.view-tab {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
}

.view-tab:hover {
    background: var(--bg-input);
    color: var(--text);
    transform: translateY(-1px);
}

.view-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
    transform: translateY(-1px);
}

.view-tab:active {
    transform: translateY(0) scale(0.97);
}

/* ═══ Kanban Board ═══ */

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

.kanban-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kanban-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 20px;
    min-height: 500px;
    align-items: flex-start;
    scroll-behavior: smooth;
}

.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.kanban-column {
    min-width: 310px;
    max-width: 320px;
    width: 310px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, transform 0.3s;
    overflow: hidden;
    animation: columnIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
}

.kanban-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.kanban-column:hover::before {
    opacity: 1;
}

.kanban-column.drag-over {
    box-shadow: 0 0 0 2px var(--primary), 0 8px 30px rgba(99,102,241,0.2);
    border-color: var(--primary);
    transform: scale(1.01);
}

.kanban-column.drag-over::before {
    opacity: 1;
    animation: columnPulse 1s ease infinite;
}

@keyframes columnIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes columnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.kanban-column:nth-child(1) { animation-delay: 0ms; }
.kanban-column:nth-child(2) { animation-delay: 80ms; }
.kanban-column:nth-child(3) { animation-delay: 160ms; }
.kanban-column:nth-child(4) { animation-delay: 240ms; }
.kanban-column:nth-child(5) { animation-delay: 320ms; }
.kanban-column:nth-child(6) { animation-delay: 400ms; }

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    background: linear-gradient(180deg, rgba(99,102,241,0.03), transparent);
}

.kanban-column-name {
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: none;
    color: var(--text);
    font-family: inherit;
    flex: 1;
    min-width: 0;
    text-align: right;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.kanban-column-name:hover {
    background: var(--bg-input);
}

.kanban-column-name:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.kanban-column-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(59,130,246,0.1);
    padding: 3px 10px;
    border-radius: 12px;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
    transition: all 0.2s;
}

.kanban-column:hover .kanban-column-count {
    background: rgba(59,130,246,0.15);
    transform: scale(1.05);
}

.kanban-column-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.kanban-column:hover .kanban-column-actions {
    opacity: 1;
}

.kanban-column-actions .btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kanban-column-actions .btn:hover {
    background: var(--bg-input);
    color: var(--text);
    transform: scale(1.1);
}

.kanban-column-actions .btn.delete-col:hover {
    color: var(--danger);
    background: rgba(239,68,68,0.1);
}

.kanban-task-list {
    padding: 8px;
    flex: 1;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.2s;
    border-radius: 0 0 var(--radius) var(--radius);
}

.kanban-column.drag-over .kanban-task-list {
    background: rgba(99,102,241,0.03);
}

.kanban-task-list:empty::after {
    content: 'اسحب المهام هنا';
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    opacity: 0.6;
    margin: 4px;
}

.kanban-task {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 12px 12px;
    cursor: grab;
    border: 1px solid var(--border);
    transition: box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
    position: relative;
    animation: taskIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes taskIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.kanban-task:nth-child(1) { animation-delay: 20ms; }
.kanban-task:nth-child(2) { animation-delay: 50ms; }
.kanban-task:nth-child(3) { animation-delay: 80ms; }
.kanban-task:nth-child(4) { animation-delay: 110ms; }
.kanban-task:nth-child(5) { animation-delay: 140ms; }
.kanban-task:nth-child(6) { animation-delay: 170ms; }
.kanban-task:nth-child(7) { animation-delay: 200ms; }
.kanban-task:nth-child(8) { animation-delay: 230ms; }

.kanban-task:hover {
    box-shadow: 0 4px 16px rgba(139,92,246,0.12), 0 1px 4px rgba(0,0,0,0.06);
    border-color: rgba(139,92,246,0.3);
    transform: translateY(-2px);
}

.kanban-task:active {
    cursor: grabbing;
    transform: scale(1.02) rotate(1deg);
    box-shadow: 0 8px 24px rgba(139,92,246,0.2);
    z-index: 10;
}

.kanban-task.dragging {
    opacity: 0.4;
    transform: rotate(3deg) scale(1.02);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.kanban-task-color-bar {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: width 0.2s;
}

.kanban-task:hover .kanban-task-color-bar {
    width: 5px;
}

.kanban-task-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.5;
    padding-right: 8px;
    color: var(--text);
}

.kanban-task-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 8px;
    margin-bottom: 8px;
}

.kanban-task-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 8px;
}

.kanban-task-platform {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.kanban-task-platform.khamsat {
    background: var(--khamsat-bg);
    color: #b45309;
}

.kanban-task-platform.mostaql {
    background: var(--mostaql-bg);
    color: #0369a1;
}

[data-theme="dark"] .kanban-task-platform.khamsat { color: var(--khamsat); }
[data-theme="dark"] .kanban-task-platform.mostaql { color: var(--mostaql); }

.kanban-task-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.kanban-task:hover .kanban-task-actions {
    opacity: 1;
}

.kanban-task-actions .btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 11px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kanban-task-actions .btn:hover {
    background: var(--bg-input);
    color: var(--text);
    transform: scale(1.1);
}

.kanban-task-actions .btn.delete-task:hover {
    color: var(--danger);
    background: rgba(239,68,68,0.1);
}

.kanban-task-actions .btn.timer-btn.active {
    color: var(--success);
    background: rgba(34,197,94,0.1);
    animation: pulse 1.5s infinite;
}

.kanban-add-task-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 16px);
    padding: 10px;
    margin: 0 8px 8px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kanban-add-task-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59,130,246,0.05);
    transform: scale(1.01);
}

.kanban-add-task-btn:active {
    transform: scale(0.98);
}

.kanban-add-column {
    min-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    height: fit-content;
    margin-top: 0;
    animation: columnIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 300ms;
}

.kanban-add-column:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59,130,246,0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59,130,246,0.1);
}

.kanban-add-column:active {
    transform: translateY(0) scale(0.98);
}

.kanban-add-column i {
    font-size: 18px;
    transition: transform 0.3s;
}

.kanban-add-column:hover i {
    transform: rotate(90deg);
}

/* ═══ Portfolio ═══ */

.portfolio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.portfolio-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portfolio-actions {
    display: flex;
    gap: 8px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.portfolio-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease both;
}

.portfolio-card:hover {
    box-shadow: 0 8px 30px rgba(139,92,246,0.15);
    transform: translateY(-3px);
}

.portfolio-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.portfolio-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.portfolio-card-title a {
    color: var(--text);
    text-decoration: none;
}

.portfolio-card-title a:hover {
    color: var(--primary);
}

.portfolio-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.portfolio-card-actions .btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.portfolio-card-actions .btn:hover {
    background: var(--bg-input);
    color: var(--text);
}

.portfolio-card-actions .btn.delete-port:hover {
    color: var(--danger);
}

.portfolio-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.portfolio-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.portfolio-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.portfolio-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.portfolio-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.portfolio-stars {
    color: #f59e0b;
    font-size: 14px;
    letter-spacing: 2px;
}

.portfolio-stars .empty {
    color: var(--border);
}

/* ═══ Buttons ═══ */

.btn-primary {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-primary:hover::after {
    left: 120%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 6px 20px rgba(59,130,246,0.45);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 4px rgba(59,130,246,0.3);
}

.btn-secondary {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.97);
}

.btn-danger {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: var(--danger);
    color: white;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 14px rgba(239,68,68,0.35);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0) scale(0.97);
}

/* ═══ Modals ═══ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: overlayIn 0.25s ease;
}

@keyframes overlayIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(4px); }
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-sm {
    max-width: 380px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* ═══ Forms ═══ */

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

/* ═══ Color Picker ═══ */

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: var(--text);
    transform: scale(1.15);
}

/* ═══ Star Rating ═══ */

.star-rating {
    display: flex;
    gap: 6px;
    font-size: 22px;
    cursor: pointer;
}

.star-rating i {
    color: var(--border);
    transition: color 0.15s;
}

.star-rating i.active {
    color: #f59e0b;
}

.star-rating i:hover {
    color: #f59e0b;
}

/* ═══ Import Modal ═══ */

.import-items-list {
    max-height: 400px;
    overflow-y: auto;
}

.import-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.import-item:hover {
    background: var(--bg-input);
}

.import-item.selected {
    background: var(--bg);
    border-color: var(--primary);
}

.import-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.import-item-info {
    flex: 1;
    min-width: 0;
}

.import-item-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.import-item-source {
    font-size: 12px;
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

/* ═══ Kanban responsive ═══ */

@media (max-width: 768px) {
    .view-tabs {
        flex-direction: column;
    }

    .kanban-column {
        min-width: 260px;
        width: 260px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-header {
        flex-direction: column;
        align-items: stretch;
    }

    .portfolio-actions {
        flex-direction: column;
    }

    .kanban-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* ═══ Notification Bell ═══ */
.notification-bell { position: relative; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-header); transition: background 0.2s; }
.notification-bell:hover { background: rgba(255,255,255,0.1); }
.notification-bell i { font-size: 18px; }
.notification-badge { position: absolute; top: 2px; left: 2px; background: var(--danger); color: white; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ═══ Notifications Dropdown ═══ */
.notifications-dropdown { position: fixed; top: 60px; left: 24px; width: 360px; max-height: 400px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden; }
.notifications-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notifications-header h4 { font-size: 14px; font-weight: 600; }
.notifications-list { max-height: 340px; overflow-y: auto; }
.notification-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.notification-item:hover { background: var(--bg-input); }
.notification-item:last-child { border-bottom: none; }
.notification-item .n-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notification-item .n-message { font-size: 12px; color: var(--text-secondary); }
.notification-item .n-time { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.notification-item.unread { background: var(--bg-input); }

/* ═══ Timer Widget ═══ */
.timer-widget { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 20px; font-size: 13px; color: var(--text-header); }
.timer-widget i { color: var(--success); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.timer-widget #timer-display { font-family: monospace; font-weight: 600; direction: ltr; }
.timer-widget #timer-task-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.8; font-size: 12px; }
.timer-widget #timer-stop-btn { width: 24px; height: 24px; border-radius: 50%; background: var(--danger); color: white; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.timer-widget #timer-stop-btn:hover { background: #dc2626; }

/* ═══ Analytics View ═══ */
.analytics-header { margin-bottom: 20px; }
.analytics-header h2 { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.analytics-stat-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border); }
.analytics-stat-card .a-stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.analytics-stat-card .a-stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.analytics-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.chart-container { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.chart-container h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.chart-container canvas { max-height: 250px; }

/* ═══ Clients View ═══ */
.clients-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.clients-header h2 { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.clients-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.client-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); transition: box-shadow 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); animation: fadeIn 0.4s ease both; }
.client-card:hover { box-shadow: 0 8px 30px rgba(139,92,246,0.15); transform: translateY(-3px); }
.client-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.client-card-name { font-size: 16px; font-weight: 600; }
.client-card-actions { display: flex; gap: 4px; }
.client-card-actions .btn { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 12px; }
.client-card-actions .btn:hover { background: var(--bg-input); color: var(--text); }
.client-card-actions .btn.delete-client:hover { color: var(--danger); }
.client-card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.client-card-meta span { display: flex; align-items: center; gap: 5px; }
.client-card-stats { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.client-card-stats span { display: flex; align-items: center; gap: 4px; }

/* ═══ Task Extras (deadline, priority, notes btn) ═══ */
.kanban-task-deadline { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; margin-bottom: 4px; padding-right: 8px; }
.kanban-task-deadline.overdue { color: var(--danger); font-weight: 600; }
.kanban-task-priority { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.kanban-task-priority.p-0 { display: none; }
.kanban-task-priority.p-1 { background: #e0f2fe; color: #0369a1; }
.kanban-task-priority.p-2 { background: #dcfce7; color: #15803d; }
.kanban-task-priority.p-3 { background: #fef3c7; color: #b45309; }
.kanban-task-priority.p-4 { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .kanban-task-priority.p-1 { background: #0c1f2e; color: #60a5fa; }
[data-theme="dark"] .kanban-task-priority.p-2 { background: #14312a; color: #4ade80; }
[data-theme="dark"] .kanban-task-priority.p-3 { background: #2d2510; color: #fbbf24; }
[data-theme="dark"] .kanban-task-priority.p-4 { background: #2d1215; color: #f87171; }
.kanban-task-notes-badge { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; }

/* ═══ Scoring Badge ═══ */
.score-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.score-badge.high { background: #dcfce7; color: #15803d; }
.score-badge.medium { background: #fef3c7; color: #b45309; }
.score-badge.low { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .score-badge.high { background: #14312a; color: #4ade80; }
[data-theme="dark"] .score-badge.medium { background: #2d2510; color: #fbbf24; }
[data-theme="dark"] .score-badge.low { background: #2d1215; color: #f87171; }

/* ═══ Templates List ═══ */
.template-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; }
.template-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.template-card-name { font-weight: 600; font-size: 14px; }
.template-card-actions { display: flex; gap: 4px; }
.template-card-actions .btn { width: 24px; height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 11px; }
.template-card-actions .btn:hover { background: var(--bg-card); color: var(--text); }
.template-card-actions .btn.delete-tmpl:hover { color: var(--danger); }
.template-card-preview { font-size: 12px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.template-selector { margin-top: 8px; }
.template-selector .form-input { font-size: 12px; padding: 6px 10px; }

/* ═══ Task Modal Section Toggles ═══ */
.task-section-toggle {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-top: 12px;
    border-radius: var(--radius); cursor: pointer;
    background: var(--bg-input); border: 1px solid var(--border);
    font-size: 13px; font-weight: 600; color: var(--text);
    transition: all 0.15s;
}
.task-section-toggle:hover { border-color: var(--primary); color: var(--primary); }
.task-section-toggle.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.task-section-hint { font-weight: 400; font-size: 11px; color: var(--text-secondary); margin-right: auto; }
.task-section-toggle.active .task-section-hint { color: rgba(255,255,255,0.7); }
.task-section-body { padding: 8px 0 0 0; border-top: 1px dashed var(--border); margin-top: 8px; }

/* ═══ Skills Grid ═══ */
.skills-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 400px; overflow-y: auto; padding: 4px; }
.skill-chip { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-secondary); cursor: pointer; font-size: 13px; transition: all 0.15s; user-select: none; }
.skill-chip:hover { border-color: var(--primary); color: var(--primary); }
.skill-chip.selected { background: var(--primary); color: white; border-color: var(--primary); }

/* ═══ Notes ═══ */
.notes-list { margin-bottom: 16px; }
.note-item { background: var(--bg-input); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.note-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.note-item-date { font-size: 11px; color: var(--text-secondary); }
.note-item-delete { color: var(--text-secondary); font-size: 11px; cursor: pointer; background: none; border: none; }
.note-item-delete:hover { color: var(--danger); }
.note-item-content { font-size: 13px; line-height: 1.5; }

/* ═══ Shortcuts List ═══ */
.shortcuts-list { display: flex; flex-direction: column; gap: 8px; }
.shortcut-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.shortcut-item kbd { background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; font-size: 13px; font-family: monospace; min-width: 40px; text-align: center; }
.shortcut-item span { font-size: 14px; color: var(--text-secondary); }

/* ═══ Export/Import ═══ */
.export-import-actions { text-align: center; }

/* ═══ Earnings Table ═══ */
.earnings-list { display: flex; flex-direction: column; gap: 8px; }
.earning-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; }
.earning-row-info { flex: 1; }
.earning-row-title { font-weight: 600; font-size: 14px; }
.earning-row-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.earning-row-amount { font-size: 16px; font-weight: 700; color: var(--success); white-space: nowrap; margin-left: 12px; }
.earning-row-actions { display: flex; gap: 4px; margin-left: 12px; }
.earning-row-actions .btn { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 12px; }
.earning-row-actions .btn:hover { background: var(--bg-input); color: var(--text); }
.earning-row-actions .btn.delete-earning:hover { color: var(--danger); }

/* ═══ Earnings Button (in portfolio view) ═══ */
.portfolio-extra-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══ Responsive additions ═══ */
@media (max-width: 768px) {
    .analytics-grid { grid-template-columns: repeat(2, 1fr); }
    .analytics-charts { grid-template-columns: 1fr; }
    .clients-grid { grid-template-columns: 1fr; }
    .notifications-dropdown { left: 10px; right: 10px; width: auto; }
    .timer-widget #timer-task-name { display: none; }
}
@media (max-width: 480px) {
    .analytics-grid { grid-template-columns: 1fr 1fr; }
    .header-actions { gap: 4px; }
}

/* ═══ Missing CSS fixes ═══ */

/* btn-sm utility */
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-sm:hover { opacity: 0.8; }

/* Kanban task meta (deadline, priority, client, time row) */
.kanban-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-bottom: 8px;
    padding-right: 8px;
}

/* Priority badges (matching HTML class names) */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.priority-badge.priority-1 { background: #e0f2fe; color: #0369a1; }
.priority-badge.priority-2 { background: #dcfce7; color: #15803d; }
.priority-badge.priority-3 { background: #fef3c7; color: #b45309; }
.priority-badge.priority-4 { background: #fee2e2; color: #b91c1c; animation: urgentPulse 2s infinite; }
[data-theme="dark"] .priority-badge.priority-1 { background: #0c1f2e; color: #60a5fa; }
[data-theme="dark"] .priority-badge.priority-2 { background: #14312a; color: #4ade80; }
[data-theme="dark"] .priority-badge.priority-3 { background: #2d2510; color: #fbbf24; }
[data-theme="dark"] .priority-badge.priority-4 { background: #2d1215; color: #f87171; animation: urgentPulse 2s infinite; }

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.2); }
    50% { box-shadow: 0 0 6px 2px rgba(239,68,68,0.15); }
}

/* Due date badges */
.due-date-badge {
    font-size: 11px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-input);
}
.due-date-badge.overdue { color: var(--danger); font-weight: 700; background: rgba(239,68,68,0.08); animation: urgentPulse 2s infinite; }

/* Kanban task client */
.kanban-task-client {
    font-size: 11px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-input);
}

/* Kanban task time */
.kanban-task-time {
    font-size: 11px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-input);
}

/* Timer play/pause button on kanban tasks */
.timer-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 11px;
    transition: all 0.2s;
}
.timer-btn:hover { background: var(--bg-card); color: var(--success); }
.timer-btn.active { color: var(--danger); }
.timer-btn.active:hover { color: #dc2626; }

/* Client card notes */
.client-card-notes {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
}

/* Earning row inner structure */
.earning-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}
.earning-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}
.earning-desc {
    font-size: 13px;
    color: var(--text);
}
.earning-date {
    font-size: 12px;
    color: var(--text-secondary);
}
.earning-source {
    font-size: 12px;
    color: var(--text-secondary);
}
.earning-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.earning-actions .btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
}
.earning-actions .btn:hover { background: var(--bg-input); color: var(--text); }
.earning-actions .btn.delete-earning:hover { color: var(--danger); }

/* Note items - matching JS class names */
.note-content {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 6px;
}
.note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}
.note-meta .btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-secondary);
}
.note-meta .btn:hover { color: var(--danger); }

/* Notification dropdown items */
.notification-text {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}
.notification-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Notification bell hover in dark mode */
[data-theme="dark"] .notification-bell:hover { background: rgba(255,255,255,0.1); }

/* Score badge fix (override inline style approach) */
.score-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.score-badge.high { background: #dcfce7; color: #15803d; }
.score-badge.medium { background: #fef3c7; color: #b45309; }
.score-badge.low { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .score-badge.high { background: #14312a; color: #4ade80; }
[data-theme="dark"] .score-badge.medium { background: #2d2510; color: #fbbf24; }
[data-theme="dark"] .score-badge.low { background: #2d1215; color: #f87171; }

/* ═══ Responsive: Category Pills ═══ */
@media (max-width: 768px) {
    .category-pills { gap: 4px; }
    .cat-pill { padding: 5px 10px; font-size: 12px; }
    .filters-controls { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-item { padding: 14px 10px; }
    .stat-value { font-size: 22px; }
    .category-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .cat-pill { flex-shrink: 0; }
}

/* ═══════════════════════════════════════ */
/* ═══ Profile View ═══ */
/* ═══════════════════════════════════════ */

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

.profile-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-header h2 i {
    color: #8b5cf6;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}

.profile-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.profile-card h3 i {
    color: #8b5cf6;
    font-size: 15px;
}

.profile-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: -8px 0 16px 0;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.skills-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.skills-search-wrap i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 13px;
}

.skills-search-wrap .form-input {
    padding-right: 36px;
}

.add-skill-wrap {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.add-skill-wrap .form-input {
    flex: 1;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}

.skill-chip {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.skill-chip:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.skill-chip.selected {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border-color: transparent;
}

.selected-skills-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.selected-skills-section h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.selected-skills-section h4 span {
    color: #8b5cf6;
}

.selected-skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.selected-tag .remove-skill {
    cursor: pointer;
    opacity: 0.8;
    font-size: 10px;
}

.selected-tag .remove-skill:hover {
    opacity: 1;
}

.profile-preview {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    border: 1px solid var(--border);
}

.profile-preview h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-preview h3 i {
    color: #8b5cf6;
}

.profile-preview pre {
    margin: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
    direction: rtl;
    font-family: inherit;
    max-height: 200px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .profile-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .profile-header { flex-direction: column; gap: 12px; align-items: stretch; }
}

/* ═══ AI Chat ═══ */
/* ═══════════════════════════════════════ */

.ai-chat-bubble {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1, #3b82f6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    animation: aiPulse 2s infinite;
}

@keyframes aiPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
    50% { box-shadow: 0 4px 35px rgba(99,102,241,0.7), 0 0 0 4px rgba(99,102,241,0.1); }
}

.ai-chat-bubble:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 28px rgba(99,102,241,0.5);
}

.ai-chat-bubble:active {
    transform: scale(0.95);
}

.ai-chat-panel {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 380px;
    height: 560px;
    min-width: 300px;
    min-height: 300px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25), 0 0 0 1px var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    animation: aiPanelIn 0.3s ease-out;
    resize: none;
}

@keyframes aiPanelIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.ai-chat-header-info i {
    font-size: 18px;
}

.ai-chat-header-actions {
    display: flex;
    gap: 4px;
}

.ai-chat-header-actions .btn-icon {
    color: #fff;
    width: 32px;
    height: 32px;
}

.ai-chat-header-actions .btn-icon:hover {
    background: rgba(255,255,255,0.2);
}

.ai-chat-quick-actions {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}

.ai-quick-btn {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: all 0.2s;
}

.ai-quick-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139,92,246,0.05);
}

.ai-quick-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border-color: transparent;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-msg {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: aiMsgIn 0.3s ease-out;
}

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

.ai-msg-bot {
    align-self: flex-start;
}

.ai-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.ai-msg-bot .ai-msg-avatar {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
}

.ai-msg-user .ai-msg-avatar {
    background: var(--primary);
    color: #fff;
}

.ai-msg-content {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ai-msg-bot .ai-msg-content {
    background: var(--bg-input);
    color: var(--text);
    border-bottom-right-radius: 4px;
}

.ai-msg-user .ai-msg-content {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.ai-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: 14px;
    border-bottom-right-radius: 4px;
    width: fit-content;
}

.ai-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: aiTyping 1.2s infinite;
}

.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiTyping {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1.1); }
}

.ai-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.ai-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-input:focus {
    border-color: #8b5cf6;
}

.ai-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}

.ai-key-status {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
}

.ai-key-status.configured {
    background: rgba(34,197,94,0.1);
    color: #16a34a;
    border: 1px solid rgba(34,197,94,0.3);
}

.ai-key-status.not-configured {
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    border: 1px solid rgba(239,68,68,0.3);
}

.ai-key-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

.ai-key-hint a {
    color: #8b5cf6;
    text-decoration: none;
}

.ai-key-hint a:hover {
    text-decoration: underline;
}

.ai-settings-btn {
    font-size: 14px;
}

/* ═══ Resize Handle ═══ */
.ai-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nw-resize;
    z-index: 10;
}

.ai-resize-handle::before {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.ai-resize-handle:hover::before {
    opacity: 1;
    border-color: #8b5cf6;
}

/* ═══ Proposal Creator ═══ */
.proposal-header {
    margin-bottom: 24px;
}

.proposal-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.proposal-header h2 i {
    color: #8b5cf6;
}

.proposal-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.proposal-input-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.proposal-url-row {
    display: flex;
    gap: 10px;
}

.proposal-url-row .form-input {
    flex: 1;
    direction: ltr;
    text-align: left;
}

.proposal-lang-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.proposal-lang-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.proposal-lang-label i { margin-left: 4px; }

.proposal-lang-options {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: 8px;
    padding: 3px;
}

.proposal-lang-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.proposal-lang-option input[type="radio"] { display: none; }

.proposal-lang-option.active,
.proposal-lang-option:has(input:checked) {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(59,130,246,0.3);
}

.proposal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
}

.proposal-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.proposal-error {
    padding: 14px 18px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 20px;
}

.proposal-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.proposal-result-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.proposal-result-header h3 i {
    color: #8b5cf6;
}

.proposal-result-actions {
    display: flex;
    gap: 8px;
}

.proposal-request-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.proposal-request-info .source-badge {
    font-size: 11px;
}

.proposal-output {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    font-size: 15px;
    line-height: 2;
    color: var(--text);
    white-space: pre-wrap;
    direction: rtl;
    font-family: inherit;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

.proposal-output .copied-toast {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #22c55e;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    animation: fadeIn 0.2s;
}

.proposal-meta {
    display: none;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    align-items: center;
}

.proposal-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.proposal-meta-item i {
    color: var(--accent);
    font-size: 13px;
}

.proposal-meta-label {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.proposal-meta-input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.proposal-meta-input:focus {
    border-color: var(--accent);
}

.proposal-meta-unit {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.proposal-warnings {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.proposal-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #eab308;
}

.proposal-warning i {
    font-size: 13px;
    flex-shrink: 0;
}

/* ═══ Proposal Analysis Panel ═══ */
.proposal-analysis {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

.proposal-analysis-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(99,102,241,0.03), transparent);
}

.proposal-analysis-header h3 {
    margin: 0;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.proposal-analysis-header h3 i {
    color: #8b5cf6;
}

.proposal-analysis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
}

.analysis-card {
    background: var(--bg-card);
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.analysis-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 4px;
}

.analysis-card:nth-child(1) .analysis-icon { background: rgba(59,130,246,0.1); color: #3b82f6; }
.analysis-card:nth-child(2) .analysis-icon { background: rgba(239,68,68,0.1); color: #ef4444; }
.analysis-card:nth-child(3) .analysis-icon { background: rgba(139,92,246,0.1); color: #8b5cf6; }

.analysis-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.analysis-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.analysis-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.analysis-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.analysis-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 700;
    margin-top: 2px;
}

.comp-low { background: rgba(34,197,94,0.1); color: #16a34a; }
.comp-medium { background: rgba(234,179,8,0.1); color: #ca8a04; }
.comp-high { background: rgba(239,68,68,0.1); color: #dc2626; }

.analysis-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
    max-height: 40px;
    overflow: hidden;
}

.analysis-skill-match {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(34,197,94,0.1);
    color: #16a34a;
    border-radius: 6px;
    font-weight: 600;
}

.analysis-skill-miss {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 6px;
    font-weight: 500;
}

/* ═══ Proposal History ═══ */
.proposal-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 16px;
}

.proposal-history-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.proposal-history-header h3 i {
    color: var(--text-secondary);
}

.proposal-history-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(59,130,246,0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.proposal-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proposal-history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.proposal-history-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.proposal-history-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.proposal-history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 12px;
}

.proposal-status-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 700;
    flex-shrink: 0;
}

.status-draft { background: var(--bg-input); color: var(--text-secondary); }
.status-sent { background: rgba(59,130,246,0.1); color: #2563eb; }
.status-accepted { background: rgba(34,197,94,0.1); color: #16a34a; }
.status-rejected { background: rgba(239,68,68,0.1); color: #dc2626; }

[data-theme="dark"] .status-sent { color: #60a5fa; }
[data-theme="dark"] .status-accepted { color: #4ade80; }
[data-theme="dark"] .status-rejected { color: #f87171; }

.proposal-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.proposal-history-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quality-score {
    color: #eab308;
    font-weight: 600;
}

.proposal-history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.proposal-status-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.proposal-status-select:focus {
    border-color: var(--primary);
}

.proposal-delete-btn:hover {
    color: var(--danger) !important;
}

@media (max-width: 600px) {
    .proposal-url-row { flex-direction: column; }
    .proposal-result-header { flex-direction: column; gap: 10px; align-items: stretch; }
    .proposal-analysis-grid { grid-template-columns: 1fr; }
}

/* ═══ Item Detail Modal ═══ */
.detail-field {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.6;
}

.detail-field:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--text);
    word-break: break-word;
}

.detail-description {
    padding: 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    max-height: 250px;
    overflow-y: auto;
}

.detail-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

/* ═══ Provider Cards ═══ */
.provider-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-input);
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
}

.provider-card:hover {
    border-color: #8b5cf6;
    background: rgba(139,92,246,0.05);
}

.provider-card.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.1));
    box-shadow: 0 0 0 1px #8b5cf6;
}

.provider-card[data-provider="gemini"].active {
    border-color: #4285f4;
    background: linear-gradient(135deg, rgba(66,133,244,0.1), rgba(52,168,83,0.1));
    box-shadow: 0 0 0 1px #4285f4;
}

.provider-card[data-provider="openrouter"].active {
    border-color: #e67e22;
    background: linear-gradient(135deg, rgba(230,126,34,0.1), rgba(231,76,60,0.1));
    box-shadow: 0 0 0 1px #e67e22;
}

.provider-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.provider-card[data-provider="gemini"] .provider-icon {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.provider-card[data-provider="openrouter"] .provider-icon {
    background: linear-gradient(135deg, #e67e22, #e74c3c);
}

.provider-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.provider-model {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ═══ AI Key Sections ═══ */
.ai-key-sections {
    margin-top: 16px;
}

.ai-key-section {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
}

.ai-key-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ai-key-row label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin: 0;
}

.ai-key-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.ai-key-badge.configured {
    background: rgba(34,197,94,0.15);
    color: #16a34a;
}

.ai-key-badge.not-configured {
    background: rgba(239,68,68,0.12);
    color: #dc2626;
}

/* ═══ Responsive: AI Chat ═══ */
@media (max-width: 480px) {
    .ai-chat-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        bottom: 8px;
        left: 8px;
        border-radius: 12px;
    }
    .ai-chat-bubble {
        bottom: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* ═══════════════════════════════════════ */
/* ═══ ENHANCED UI/UX ANIMATIONS ═══ */
/* ═══════════════════════════════════════ */

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    pointer-events: auto;
    max-width: 400px;
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast i {
    font-size: 16px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--primary); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* Staggered card entrance */
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 30ms; }
.card:nth-child(3) { animation-delay: 60ms; }
.card:nth-child(4) { animation-delay: 90ms; }
.card:nth-child(5) { animation-delay: 120ms; }
.card:nth-child(6) { animation-delay: 150ms; }
.card:nth-child(7) { animation-delay: 180ms; }
.card:nth-child(8) { animation-delay: 210ms; }
.card:nth-child(9) { animation-delay: 240ms; }
.card:nth-child(10) { animation-delay: 270ms; }

/* Skeleton loading shimmer */
.skeleton {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: shimmer 1.5s infinite;
}

[data-theme="dark"] .skeleton::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* View content transition */
.view-content {
    animation: viewFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Search box focus glow */
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    outline: none;
}

/* Form input focus glow */
.form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    outline: none;
}

/* Category pill bounce */
.cat-pill:active {
    transform: scale(0.95);
}

/* Stat item number animation */
.stat-value, .stat-item .stat-value {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item:hover .stat-value {
    transform: scale(1.05);
}

/* Kanban task enhanced */
.kanban-task {
    transition: box-shadow 0.2s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kanban-task:active {
    transform: scale(0.98) rotate(1deg);
}

/* Notification bell bounce */
@keyframes bellBounce {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(5deg); }
}

.notification-bell.has-new i {
    animation: bellBounce 0.6s ease;
}

/* Score badge pulse for high scores */
@keyframes scoreGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.3); }
    50% { box-shadow: 0 0 8px 2px rgba(34,197,94,0.15); }
}

/* Bookmark button heart-pop */
.bookmark-btn.bookmarked {
    animation: heartPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Proposal generate button pulse */
.proposal-loading .proposal-spinner {
    animation: spin 0.8s linear infinite;
}

/* AI message entrance */
.ai-message {
    animation: aiMsgIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Tab indicator slide */
.view-tab.active {
    position: relative;
}

.view-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: white;
    border-radius: 2px;
    animation: tabIndicator 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabIndicator {
    from { left: 50%; right: 50%; opacity: 0; }
    to { left: 20%; right: 20%; opacity: 1; }
}

/* Import item hover slide */
.import-item:hover {
    transform: translateX(4px);
}

/* Provider card selection bounce */
.provider-card.selected {
    animation: selectBounce 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes selectBounce {
    0% { transform: scale(1); }
    40% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

/* Profile card reveal */
.profile-card {
    animation: profileReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* Skill chip entrance */
.skill-chip {
    animation: chipIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes chipIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Page loading fade */
main {
    animation: mainReveal 0.4s ease both;
}

@keyframes mainReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: rgba(99,102,241,0.3);
    color: inherit;
}

/* Scrollbar styling */
::-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-secondary);
}

/* Disabled button shimmer */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Error shake */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.error-msg {
    animation: errorShake 0.4s ease;
}

/* Success flash */
@keyframes successFlash {
    0% { background-color: var(--bg-card); }
    30% { background-color: rgba(34,197,94,0.1); }
    100% { background-color: var(--bg-card); }
}

/* Kanban column drop highlight */
.kanban-column.drag-over {
    background: rgba(99,102,241,0.05);
    border-color: var(--primary);
    transition: all 0.2s ease;
}

/* Loading bar */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    z-index: 10000;
    animation: loadingBar 1.5s ease-in-out infinite;
    border-radius: 0 2px 2px 0;
}

@keyframes loadingBar {
    0% { width: 0%; left: 0; }
    50% { width: 60%; }
    100% { width: 0%; left: 100%; }
}

/* Dark mode transition */
[data-theme] * {
    transition: background-color 0.3s ease, color 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
