/* BS Project Desk Frontend - Full Width Portal */
.bspd-front {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 24px;
    margin-bottom: 40px;
    padding: 32px clamp(18px, 4vw, 58px);
    font-family: inherit;
    color: #111827;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, .13), transparent 34%),
        radial-gradient(circle at top right, rgba(14, 165, 233, .12), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 58%);
    box-sizing: border-box;
}
.bspd-front *,
.bspd-front *::before,
.bspd-front *::after { box-sizing: border-box; }
.bspd-portal-hero {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
    padding: 26px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(30, 41, 59, .92)), #111827;
    color: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
    overflow: hidden;
    position: relative;
}
.bspd-portal-hero::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(99, 102, 241, .28);
    right: -70px;
    top: -90px;
}
.bspd-portal-hero > * { position: relative; z-index: 1; }
.bspd-kicker {
    display: inline-flex;
    color: #c7d2fe;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}
.bspd-portal-hero h2 {
    color: #fff;
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.1;
    font-weight: 850;
}
.bspd-portal-hero p {
    color: rgba(255,255,255,.72);
    margin: 10px 0 0;
    max-width: 720px;
    font-size: 16px;
}
.bspd-quick-stats {
    min-width: 320px;
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
}
.bspd-quick-stats div {
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    padding: 18px;
    backdrop-filter: blur(10px);
}
.bspd-quick-stats strong,
.bspd-quick-stats span { display: block; }
.bspd-quick-stats strong { color: #fff; font-size: 34px; line-height: 1; }
.bspd-quick-stats span { color: rgba(255,255,255,.74); margin-top: 7px; font-size: 13px; font-weight: 700; }
.bspd-portal-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: 100%;
}
.bspd-portal-sidebar,
.bspd-front-card,
.bspd-project-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}
.bspd-portal-sidebar { padding: 18px; position: sticky; top: 22px; }
.bspd-portal-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 16px;
}
.bspd-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #111827, #4f46e5);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 20px;
    text-transform: uppercase;
    box-shadow: 0 12px 24px rgba(79, 70, 229, .24);
}
.bspd-portal-user strong,
.bspd-portal-user span { display: block; }
.bspd-portal-user strong { font-size: 17px; }
.bspd-portal-user span { color: #64748b; font-size: 13px; margin-top: 2px; }
.bspd-portal-nav { display: grid; gap: 8px; }
.bspd-tab-btn {
    width: 100%;
    border: 0;
    background: transparent;
    color: #334155;
    border-radius: 14px;
    padding: 13px 14px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    transition: .2s ease;
}
.bspd-tab-btn:hover,
.bspd-tab-btn.active {
    background: linear-gradient(135deg, #111827, #1e293b);
    color: #fff;
    transform: translateX(2px);
}
.bspd-tab-btn .dashicons { width: 18px; height: 18px; font-size: 18px; }
.bspd-tab-btn em {
    margin-left: auto;
    font-style: normal;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
}
.bspd-tab-btn.active em { background: rgba(255,255,255,.16); color: #fff; }
.bspd-sidebar-help {
    margin-top: 18px;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
}
.bspd-sidebar-help strong { display: block; font-size: 18px; line-height: 1.25; }
.bspd-sidebar-help p { margin: 8px 0 0; color: #64748b; font-size: 13px; line-height: 1.55; }
.bspd-portal-content,
.bspd-tab-panel { min-width: 0; width: 100%; }
.bspd-tab-panel { display: none; }
.bspd-tab-panel.active { display: block; }
.bspd-front-card {
    padding: clamp(22px, 3vw, 34px);
    margin-bottom: 22px;
    width: 100%;
}
.bspd-section-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eef2f7;
}
.bspd-section-head h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.08;
    letter-spacing: -.03em;
    color: #0f172a;
}
.bspd-note { color: #64748b; margin: 0; font-size: 16px; max-width: 720px; }
.bspd-front-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 18px;
    max-width: 980px;
}
.bspd-grid-full { grid-column: 1 / -1; }
.bspd-front label { display: block; font-weight: 800; margin-bottom: 10px; color: #0f172a; }
.bspd-front input,
.bspd-front textarea,
.bspd-front select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    padding: 13px 14px;
    margin-top: 7px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: #0f172a;
    box-shadow: 0 1px 0 rgba(15,23,42,.03);
    transition: .18s ease;
}
.bspd-front input:focus,
.bspd-front textarea:focus,
.bspd-front select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.bspd-front textarea { resize: vertical; }
.bspd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 13px 20px;
    background: linear-gradient(135deg, #111827, #1e293b);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    margin-top: 14px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}
.bspd-btn:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.bspd-btn-secondary { background: linear-gradient(135deg, #4f46e5, #2563eb); }
.bspd-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bspd-projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 18px;
}
.bspd-project-card { padding: 20px; position: relative; overflow: hidden; }
.bspd-project-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #06b6d4);
}
.bspd-project-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 16px;
}
.bspd-project-head h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; color: #0f172a; }
.bspd-project-head p { margin: 0; color: #64748b; }
.bspd-project-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bspd-project-badges span {
    background: #eef2ff;
    color: #3730a3;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.bspd-project-badges .bspd-priority { background: #fff7ed; color: #9a3412; }
.bspd-project-details {
    margin: 14px 0;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px 16px;
    background: #f8fafc;
}
.bspd-project-details summary { cursor: pointer; font-weight: 850; color: #0f172a; }
.bspd-client-timeline { display: grid; gap: 12px; margin: 18px 0; }
.bspd-client-timeline h4 { margin: 0; font-size: 18px; color: #0f172a; }
.bspd-client-comment { border: 1px solid #e5e7eb; border-radius: 18px; padding: 16px; }
.bspd-comment-client { background: #f8fafc; }
.bspd-comment-admin { background: #f0fdf4; border-color: #bbf7d0; }
.bspd-client-comment-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.bspd-client-comment-head strong { background: #111827; color: #fff; padding: 5px 10px; border-radius: 999px; font-weight: 850; }
.bspd-client-comment-head span { font-weight: 850; }
.bspd-client-comment-head small,
.bspd-client-comment-head em { color: #64748b; font-size: 13px; }
.bspd-comment-message p:last-child { margin-bottom: 0; }
.bspd-comment-form { margin-top: 18px; border-top: 1px solid #eef2f7; padding-top: 18px; }
.bspd-alert { padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; }
.bspd-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.bspd-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.bspd-attachments ul { margin: 6px 0 0 18px; }
.bspd-empty {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    padding: 28px;
    border-radius: 18px;
    text-align: center;
}
.bspd-empty p { margin-bottom: 0; color: #64748b; }
.bspd-notification-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px;
}
.bspd-notification-item {
    display: flex;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 18px;
    transition: .18s ease;
}
.bspd-notification-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15,23,42,.08);
    background: #fff;
}
.bspd-notification-item.is-unread {
    background: #ffffff;
    border-color: #c7d2fe;
    box-shadow: 0 14px 34px rgba(79,70,229,.10);
}
.bspd-notification-item.is-read { opacity: .88; }
.bspd-notification-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #111827, #4f46e5);
    color: #fff;
    border-radius: 14px;
    font-weight: 850;
}
.bspd-notification-body { min-width: 0; flex: 1; }
.bspd-notification-top { display: flex; justify-content: space-between; gap: 12px; }
.bspd-notification-top strong { font-size: 17px; color: #0f172a; }
.bspd-notification-top span {
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 850;
}
.bspd-notification-body p { margin: 8px 0; color: #334155; font-size: 15px; }
.bspd-notification-body small { color: #64748b; }
.bspd-notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.bspd-notification-action-form { display: inline-flex; margin: 0; }
.bspd-mini-btn,
.bspd-link-btn {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 850;
}
.bspd-mini-btn { background: #111827; color: #fff; }
.bspd-link-btn { background: #eef2ff; color: #3730a3; }
.bspd-danger-link { background: #fee2e2; color: #991b1b; }
@media (max-width: 1024px) {
    .bspd-portal-hero { flex-direction: column; }
    .bspd-quick-stats { min-width: 0; }
    .bspd-portal-shell { grid-template-columns: 1fr; }
    .bspd-portal-sidebar { position: static; }
}
@media (max-width: 768px) {
    .bspd-front { padding: 20px 14px; }
    .bspd-quick-stats,
    .bspd-front-grid,
    .bspd-projects-list,
    .bspd-notification-list { grid-template-columns: 1fr; }
    .bspd-project-head,
    .bspd-section-head { align-items: flex-start; flex-direction: column; }
    .bspd-project-badges { justify-content: flex-start; }
    .bspd-form-actions,
    .bspd-btn { width: 100%; }
    .bspd-btn { text-align: center; }
}

.bspd-request-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 12px;
}
.bspd-ticket-meta,
.bspd-priority-meta {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3 !important;
    font-weight: 800;
    font-size: 12px !important;
}
.bspd-priority-meta { background: #f8fafc; color: #334155 !important; }
.bspd-priority-urgent { background: #fee2e2 !important; color: #991b1b !important; }
.bspd-priority-high { background: #ffedd5 !important; color: #9a3412 !important; }
.bspd-priority-normal { background: #dcfce7 !important; color: #166534 !important; }
@media (max-width: 768px) {
    .bspd-request-options { grid-template-columns: 1fr; }
}

.bspd-field-hint {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}
.bspd-telegram-help {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 18px;
}
.bspd-telegram-help h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #0f172a;
}
.bspd-telegram-help p {
    margin: 8px 0;
    color: #334155;
}
.bspd-telegram-help ol {
    margin: 10px 0 0 20px;
    color: #334155;
}
.bspd-telegram-help a {
    color: #2563eb;
    font-weight: 800;
}

.bspd-send-telegram-form {
    margin-top: 12px;
}
.bspd-mini-telegram-btn {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 850;
    color: #fff;
    background: linear-gradient(135deg, #229ed9, #2563eb);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.bspd-mini-telegram-btn:hover {
    filter: brightness(1.06);
}

.bspd-fetch-telegram-form {
    margin-top: 12px;
}

/* v1.4.0 - Client portal colors controlled from admin settings */
.bspd-front {
    color: var(--bspd-text, #111827);
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--bspd-secondary, #4f46e5) 14%, transparent), transparent 34%),
        radial-gradient(circle at top right, color-mix(in srgb, var(--bspd-accent, #2563eb) 12%, transparent), transparent 30%),
        linear-gradient(180deg, var(--bspd-page-bg, #f8fafc) 0%, #ffffff 58%);
}
.bspd-portal-sidebar,
.bspd-front-card,
.bspd-project-card {
    background: color-mix(in srgb, var(--bspd-surface, #ffffff) 92%, transparent);
}
.bspd-portal-hero {
    background: linear-gradient(135deg, var(--bspd-primary, #111827), color-mix(in srgb, var(--bspd-primary, #111827) 78%, var(--bspd-secondary, #4f46e5))), var(--bspd-primary, #111827);
}
.bspd-portal-hero::after {
    background: color-mix(in srgb, var(--bspd-secondary, #4f46e5) 35%, transparent);
}
.bspd-kicker { color: color-mix(in srgb, var(--bspd-secondary, #4f46e5) 26%, #ffffff); }
.bspd-note,
.bspd-project-head p,
.bspd-sidebar-help p,
.bspd-client-comment-head small,
.bspd-client-comment-head em,
.bspd-notification-body small,
.bspd-portal-user span,
.bspd-field-hint { color: var(--bspd-muted, #64748b); }
.bspd-section-head h2,
.bspd-project-head h3,
.bspd-front label,
.bspd-client-timeline h4,
.bspd-sidebar-help strong,
.bspd-notification-top strong { color: var(--bspd-text, #111827); }
.bspd-avatar,
.bspd-notification-icon {
    background: linear-gradient(135deg, var(--bspd-primary, #111827), var(--bspd-secondary, #4f46e5));
}
.bspd-tab-btn:hover,
.bspd-tab-btn.active,
.bspd-btn,
.bspd-mini-btn,
.bspd-client-comment-head strong {
    background: linear-gradient(135deg, var(--bspd-primary, #111827), color-mix(in srgb, var(--bspd-primary, #111827) 76%, var(--bspd-secondary, #4f46e5)));
}
.bspd-btn-secondary,
.bspd-mini-telegram-btn {
    background: linear-gradient(135deg, var(--bspd-secondary, #4f46e5), var(--bspd-accent, #2563eb));
}
.bspd-front input:focus,
.bspd-front textarea:focus,
.bspd-front select:focus {
    border-color: var(--bspd-accent, #2563eb);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bspd-accent, #2563eb) 16%, transparent);
}
.bspd-project-card::before { background: linear-gradient(90deg, var(--bspd-secondary, #4f46e5), var(--bspd-accent, #2563eb)); }
.bspd-project-badges span,
.bspd-tab-btn em,
.bspd-link-btn,
.bspd-ticket-meta,
.bspd-notification-top span {
    background: color-mix(in srgb, var(--bspd-secondary, #4f46e5) 12%, #ffffff);
    color: color-mix(in srgb, var(--bspd-secondary, #4f46e5) 72%, #111827);
}
.bspd-comment-admin {
    background: color-mix(in srgb, var(--bspd-success, #16a34a) 10%, #ffffff);
    border-color: color-mix(in srgb, var(--bspd-success, #16a34a) 28%, #ffffff);
}
.bspd-notification-item.is-unread {
    border-color: color-mix(in srgb, var(--bspd-secondary, #4f46e5) 35%, #ffffff);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--bspd-secondary, #4f46e5) 12%, transparent);
}


/* v1.4.1 - Client Dashboard + Threaded Ticket UI */
.bspd-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 14px;
}
.bspd-dashboard-stats div {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.bspd-dashboard-stats span,
.bspd-dashboard-stats strong {
    display: block;
}
.bspd-dashboard-stats span {
    color: var(--bspd-muted, #64748b);
    font-size: 13px;
    font-weight: 850;
}
.bspd-dashboard-stats strong {
    margin-top: 8px;
    color: var(--bspd-text, #111827);
    font-size: 32px;
    line-height: 1;
}
.bspd-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 22px;
}
.bspd-compact-head {
    margin-bottom: 16px;
    padding-bottom: 14px;
}
.bspd-compact-head h2 {
    font-size: 28px;
}
.bspd-snapshot-list,
.bspd-dashboard-activity {
    display: grid;
    gap: 12px;
}
.bspd-snapshot-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}
.bspd-snapshot-item strong,
.bspd-snapshot-item small {
    display: block;
}
.bspd-snapshot-item strong {
    color: var(--bspd-text, #111827);
    font-size: 16px;
}
.bspd-snapshot-item small {
    margin-top: 4px;
    color: var(--bspd-muted, #64748b);
}
.bspd-snapshot-item span {
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    background: color-mix(in srgb, var(--bspd-secondary, #4f46e5) 12%, #ffffff);
    color: color-mix(in srgb, var(--bspd-secondary, #4f46e5) 72%, #111827);
}
.bspd-dashboard-activity article {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
}
.bspd-dashboard-activity article > span {
    align-self: start;
    text-align: center;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    background: color-mix(in srgb, var(--bspd-accent, #2563eb) 12%, #ffffff);
    color: color-mix(in srgb, var(--bspd-accent, #2563eb) 76%, #111827);
}
.bspd-dashboard-activity strong {
    display: block;
    color: var(--bspd-text, #111827);
}
.bspd-dashboard-activity p {
    margin: 5px 0;
    color: #334155;
}
.bspd-dashboard-activity small {
    color: var(--bspd-muted, #64748b);
}
.bspd-thread-replies {
    display: grid;
    gap: 10px;
    margin: -4px 0 14px 30px;
    padding-left: 18px;
    border-left: 3px solid color-mix(in srgb, var(--bspd-secondary, #4f46e5) 18%, #e5e7eb);
}
.bspd-client-comment.bspd-is-reply {
    border-radius: 16px;
    box-shadow: none;
}
.bspd-status-meta {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3 !important;
    font-weight: 800;
    font-size: 12px !important;
}
.bspd-status-new { background: #fee2e2 !important; color: #991b1b !important; }
.bspd-status-in_progress { background: #ffedd5 !important; color: #9a3412 !important; }
.bspd-status-need_more_info { background: #e0f2fe !important; color: #075985 !important; }
.bspd-status-done { background: #dcfce7 !important; color: #166534 !important; }
.bspd-status-rejected { background: #f1f5f9 !important; color: #475569 !important; }
@media (max-width: 1200px) {
    .bspd-dashboard-stats { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
    .bspd-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .bspd-dashboard-stats { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .bspd-dashboard-activity article { grid-template-columns: 1fr; }
    .bspd-thread-replies { margin-left: 10px; padding-left: 12px; }
}


/* v1.4.2 Milestones + File Center */
.bspd-client-milestones {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(255,255,255,.95));
}
.bspd-milestone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.bspd-milestone-head h4 {
    margin: 0;
    font-size: 18px;
}
.bspd-milestone-head strong {
    color: var(--bspd-accent);
}
.bspd-milestone-progress {
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0 14px;
}
.bspd-milestone-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--bspd-secondary), var(--bspd-accent));
}
.bspd-milestone-list {
    display: grid;
    gap: 10px;
}
.bspd-client-milestone {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eef2f7;
}
.bspd-client-milestone strong,
.bspd-client-milestone small {
    display: block;
}
.bspd-client-milestone p {
    margin: 5px 0;
    color: var(--bspd-muted);
}
.bspd-client-milestone small {
    color: var(--bspd-muted);
    font-weight: 700;
}
.bspd-milestone-dot {
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 999px;
    background: #cbd5e1;
}
.bspd-milestone-completed .bspd-milestone-dot { background: #16a34a; }
.bspd-milestone-in_progress .bspd-milestone-dot { background: #2563eb; }
.bspd-milestone-blocked .bspd-milestone-dot { background: #dc2626; }

.bspd-file-center-list {
    display: grid;
    gap: 12px;
}
.bspd-file-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    background: #fff;
}
.bspd-file-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--bspd-accent);
}
.bspd-file-body strong,
.bspd-file-body small {
    display: block;
}
.bspd-file-body small {
    margin-top: 4px;
    color: var(--bspd-muted);
    line-height: 1.5;
}
.bspd-file-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 10px 14px;
    text-decoration: none;
    background: linear-gradient(135deg, var(--bspd-primary), var(--bspd-accent));
    color: #fff;
    font-weight: 800;
}
.bspd-file-download:hover { color: #fff; filter: brightness(1.08); }
@media (max-width: 700px) {
    .bspd-file-card {
        grid-template-columns: 42px 1fr;
    }
    .bspd-file-download {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* v1.4.4 - Mobile polish + password settings */
.bspd-password-box {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.bspd-password-box h4 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--bspd-text, #111827);
}
.bspd-password-grid {
    margin-top: 14px;
    max-width: none;
}
@media (max-width: 900px) {
    .bspd-front {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 16px 12px 28px;
        overflow-x: hidden;
    }
    .bspd-portal-hero {
        padding: 20px;
        border-radius: 20px;
    }
    .bspd-portal-hero h2 {
        font-size: 30px;
    }
    .bspd-portal-hero p {
        font-size: 14px;
    }
    .bspd-quick-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .bspd-quick-stats div {
        padding: 14px;
    }
    .bspd-quick-stats strong {
        font-size: 28px;
    }
    .bspd-portal-sidebar {
        padding: 14px;
        border-radius: 20px;
    }
    .bspd-portal-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 6px;
        scroll-snap-type: x proximity;
    }
    .bspd-tab-btn {
        min-width: max-content;
        width: auto;
        scroll-snap-align: start;
        padding: 11px 12px;
        white-space: nowrap;
    }
    .bspd-tab-btn:hover,
    .bspd-tab-btn.active {
        transform: none;
    }
    .bspd-sidebar-help {
        display: none;
    }
    .bspd-front-card {
        padding: 18px;
        border-radius: 20px;
    }
    .bspd-section-head h2 {
        font-size: 30px;
    }
    .bspd-note {
        font-size: 14px;
    }
    .bspd-dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .bspd-dashboard-stats div {
        padding: 14px;
    }
    .bspd-dashboard-stats strong {
        font-size: 27px;
    }
    .bspd-project-card {
        padding: 16px;
        border-radius: 20px;
    }
    .bspd-client-comment-head {
        gap: 7px;
    }
    .bspd-client-comment-head strong,
    .bspd-client-comment-head small,
    .bspd-client-comment-head em {
        font-size: 12px !important;
    }
    .bspd-thread-replies {
        margin-left: 0;
        padding-left: 10px;
    }
    .bspd-client-milestones {
        padding: 14px;
    }
    .bspd-client-milestone {
        grid-template-columns: 14px 1fr;
        padding: 11px;
    }
    .bspd-notification-item {
        padding: 14px;
        gap: 11px;
    }
    .bspd-notification-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
@media (max-width: 520px) {
    .bspd-front {
        padding-inline: 10px;
    }
    .bspd-portal-hero,
    .bspd-front-card,
    .bspd-project-card,
    .bspd-portal-sidebar {
        border-radius: 16px;
    }
    .bspd-quick-stats,
    .bspd-dashboard-stats {
        grid-template-columns: 1fr;
    }
    .bspd-front-grid,
    .bspd-password-grid,
    .bspd-request-options {
        grid-template-columns: 1fr;
    }
    .bspd-file-card {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .bspd-file-icon {
        width: 42px;
        height: 42px;
    }
    .bspd-form-actions button,
    .bspd-notification-actions button,
    .bspd-file-download {
        width: 100%;
    }
}

/* v1.4.5 - Mobile menu restore + password form fix */
.bspd-hidden-form {
    display: none !important;
}
@media (max-width: 900px) {
    .bspd-portal-shell {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .bspd-portal-sidebar {
        width: 100%;
        max-width: 100%;
    }
    .bspd-portal-nav {
        display: grid;
        grid-template-columns: 1fr;
        overflow: visible;
        gap: 10px;
        padding-bottom: 0;
        scroll-snap-type: none;
    }
    .bspd-tab-btn {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        white-space: normal;
        padding: 14px 16px;
    }
    .bspd-tab-btn em {
        margin-left: auto;
        flex: 0 0 auto;
    }
    .bspd-portal-content,
    .bspd-front-card,
    .bspd-project-card,
    .bspd-notification-item,
    .bspd-file-card {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}
@media (max-width: 520px) {
    .bspd-portal-user {
        align-items: center;
    }
    .bspd-sidebar-help {
        display: block;
    }
    .bspd-section-head h2 {
        font-size: 28px;
        line-height: 1.15;
    }
}

/* v1.4.8 - Branding options */
.bspd-hero-branding {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}
.bspd-portal-logo {
    display: block;
    object-fit: contain;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(148,163,184,.35);
    box-shadow: 0 12px 28px rgba(15,23,42,.12);
}
.bspd-portal-hero-logo {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    padding: 10px;
    flex: 0 0 auto;
}
.bspd-sidebar-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    padding: 7px;
    flex: 0 0 auto;
}
.bspd-portal-hero.bspd-hero-dark {
    background: var(--bspd-primary);
}
.bspd-portal-hero.bspd-hero-light {
    background: var(--bspd-surface);
    color: var(--bspd-text);
    border: 1px solid rgba(148,163,184,.28);
}
.bspd-portal-hero.bspd-hero-light .bspd-kicker,
.bspd-portal-hero.bspd-hero-light p,
.bspd-portal-hero.bspd-hero-light .bspd-quick-stats span {
    color: var(--bspd-muted);
}
.bspd-portal-hero.bspd-hero-light .bspd-quick-stats > div {
    background: rgba(248,250,252,.9);
    border-color: rgba(148,163,184,.35);
    color: var(--bspd-text);
}
.bspd-portal-footer {
    max-width: 1248px;
    margin: 18px auto 0;
    color: var(--bspd-muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
}
@media (max-width: 700px) {
    .bspd-hero-branding {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .bspd-portal-hero-logo {
        width: 62px;
        height: 62px;
    }
}


/* v1.4.9 - Frontend login screen */
.bspd-login-front {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
}
.bspd-login-card {
    width: min(100%, 520px);
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(226, 232, 240, .96);
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
    padding: clamp(24px, 4vw, 42px);
}
.bspd-login-intro {
    margin-bottom: 22px;
}
.bspd-login-intro .bspd-kicker {
    color: var(--bspd-primary);
}
.bspd-login-intro h2 {
    margin: 0;
    color: var(--bspd-text);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -.03em;
}
.bspd-login-intro p {
    margin: 10px 0 0;
    color: var(--bspd-muted);
    line-height: 1.65;
}
.bspd-login-alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-weight: 700;
}
.bspd-login-form label {
    margin-bottom: 16px;
}
.bspd-login-remember {
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    width: auto;
    font-weight: 700 !important;
    color: var(--bspd-muted) !important;
}
.bspd-login-remember input {
    width: auto;
    margin: 0;
}
.bspd-login-submit {
    width: 100%;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--bspd-primary), var(--bspd-secondary));
}
.bspd-login-lost {
    display: inline-block;
    margin-top: 16px;
    color: var(--bspd-primary);
    text-decoration: none;
    font-weight: 800;
}
.bspd-login-lost:hover {
    text-decoration: underline;
}
