/* ==========================================================================
   dev.saweb — custom design system on top of Bootstrap 5
   Tokens → base → bootstrap overrides → app components → animations
   ========================================================================== */

/* ----- Design tokens ----- */
:root {
    /* brand */
    --tm-primary: #00bfd8;
    --tm-secondary: #00a5c4;
    --tm-success: #10b981;
    --tm-warning: #f59e0b;
    --tm-danger: #ef4444;
    --tm-dark: #10121a;
    --tm-light: #f5f6fa;

    --accent-1: #00bfd8;
    --accent-2: #00a5c4;
    --accent-3: #00e5c0;
    --link: #008ba3;
    --link-hover: #006d84;
    --on-accent: #ffffff;

    /* surfaces — light */
    --bg: #f1f3fa;
    --bg-orb-1: rgba(0, 191, 216, .13);
    --bg-orb-2: rgba(0, 134, 201, .10);
    --bg-orb-3: rgba(0, 229, 192, .08);
    --surface: #ffffff;
    --surface-2: #f6f7fc;
    --field-bg: #ffffff;
    --column-bg: rgba(255, 255, 255, .72);
    --card-bg: #ffffff;
    --border: #e5e8f2;
    --border-strong: #d3d8e6;
    --text: #181b28;
    --muted: #697086;
    --ring: rgba(0, 191, 216, .20);
    --drop-bg: rgba(0, 191, 216, .07);
    --scroll: #c2c7d9;
    --shadow-sm: 0 1px 2px rgba(24, 27, 40, .04), 0 6px 18px rgba(24, 27, 40, .06);
    --shadow-md: 0 8px 28px rgba(24, 27, 40, .12);
    --shadow-lg: 0 18px 56px rgba(24, 27, 40, .18);
    --navbar-bg: rgba(16, 18, 26, .82);
    --navbar-border: rgba(255, 255, 255, .08);

    /* bootstrap wiring */
    --bs-body-font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--surface-2);
    --bs-secondary-bg: var(--surface-2);
    --bs-border-color: var(--border);
    --bs-link-color: var(--link);
    --bs-link-hover-color: var(--link-hover);
    --bs-primary: var(--accent-1);
    --bs-primary-rgb: 0, 191, 216;
}

[data-bs-theme="dark"] {
    --bg: #0d0f16;
    --bg-orb-1: rgba(0, 191, 216, .14);
    --bg-orb-2: rgba(0, 134, 201, .10);
    --bg-orb-3: rgba(0, 229, 192, .06);
    --surface: #151824;
    --surface-2: #1c2030;
    --field-bg: #111420;
    --column-bg: rgba(21, 24, 36, .66);
    --card-bg: #191d2b;
    --border: #262b3d;
    --border-strong: #343b52;
    --text: #e9ebf5;
    --muted: #8f96ad;
    --link: #35d3e8;
    --link-hover: #6fe2f2;
    --on-accent: #ffffff;
    --ring: rgba(0, 191, 216, .26);
    --drop-bg: rgba(0, 191, 216, .10);
    --scroll: #3b4258;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 22px rgba(0, 0, 0, .35);
    --shadow-md: 0 12px 34px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
    --navbar-bg: rgba(13, 15, 22, .78);
}

/* ----- Base ----- */
html {
    font-size: 17px;
    scroll-behavior: smooth;
    background: var(--bg);
}

@media (max-width: 576px) {
    html { font-size: 16px; }
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    background-image:
        radial-gradient(620px 440px at 6% -12%, var(--bg-orb-1), transparent 65%),
        radial-gradient(700px 500px at 98% 8%, var(--bg-orb-2), transparent 65%),
        radial-gradient(760px 560px at 50% 118%, var(--bg-orb-3), transparent 62%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--bs-body-font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

.container {
    max-width: 1640px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 2.05rem; }
h3 { font-size: 1.55rem; }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: 1.02rem; }

a { text-decoration: none; }

::selection { background: var(--ring); }

:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--scroll);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ----- Entrance animations ----- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

main.container > * {
    animation: fadeUp .5s cubic-bezier(.22, .9, .32, 1) both;
}

main.container > *:nth-child(2) { animation-delay: .06s; }
main.container > *:nth-child(3) { animation-delay: .12s; }
main.container > *:nth-child(4) { animation-delay: .18s; }
main.container > *:nth-child(5) { animation-delay: .24s; }

/* ----- Navbar: dark glass ----- */
.navbar.bg-dark {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
}

.navbar-brand {
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.navbar-brand svg {
    color: #67e8f9;
    filter: drop-shadow(0 0 10px rgba(0, 191, 216, .55));
}

.brand-version {
    display: inline-block;
    margin-left: .45rem;
    padding: .16rem .42rem;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .05em;
    line-height: 1;
    color: #67e8f9;
    background: rgba(0, 191, 216, .14);
    border: 1px solid rgba(0, 191, 216, .45);
    border-radius: .45rem;
    vertical-align: top;
    transform: translateY(-5px);
}

.navbar .nav-link {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .3rem .6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .72);
    transition: color .15s ease;
}

.navbar .nav-link svg { flex-shrink: 0; margin-right: 0 !important; }

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #ffffff;
}

#themeToggle svg { transition: transform .35s ease; }
#themeToggle:hover svg { transform: rotate(20deg) scale(1.08); }

.dropdown .badge.bg-danger {
    animation: pulse 2.2s ease-in-out infinite;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .8rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease,
                background-color .16s ease, border-color .16s ease, color .16s ease;
}

.btn:active { transform: scale(.97); }

.btn-sm { border-radius: .65rem; }
.btn-lg { border-radius: 1rem; padding: .8rem 1.5rem; }

/* Board-filter reset button: match the height of the (taller) sm form controls */
#boardFilters .btn {
    padding-top: .62rem;
    padding-bottom: .62rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: 0;
    color: var(--on-accent);
    box-shadow: 0 6px 18px rgba(0, 191, 216, .35);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #16d3e6, #00b0cc);
    color: var(--on-accent);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 191, 216, .45);
}

.btn-outline-primary {
    border-color: var(--accent-1);
    color: var(--link);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-color: transparent;
    color: var(--on-accent);
    box-shadow: 0 6px 18px rgba(0, 191, 216, .35);
}

.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-link { color: var(--link); font-weight: 600; }

/* ----- Cards & surfaces ----- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    box-shadow: var(--shadow-sm);
}

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ----- Forms ----- */
.form-control,
.form-select {
    background-color: var(--field-bg);
    border: 1px solid var(--border-strong);
    border-radius: .8rem;
    padding: .62rem .95rem;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.form-control::placeholder { color: var(--muted); opacity: .85; }

.form-control:focus,
.form-select:focus {
    background-color: var(--field-bg);
    border-color: var(--accent-1);
    box-shadow: 0 0 0 4px var(--ring);
    color: var(--text);
}

.form-control-plaintext { color: var(--text); }

.form-check-input {
    border-color: var(--border-strong);
    background-color: var(--field-bg);
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.form-check-input:checked {
    background-color: var(--accent-1);
    border-color: var(--accent-1);
}

.form-check-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 4px var(--ring);
}

/* ----- Badges ----- */
.badge {
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: .55rem;
    padding: .42em .68em;
}

.badge svg { vertical-align: -0.15em; }

.bg-primary { color: var(--on-accent); }

/* ----- Tables ----- */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border);
    color: var(--text);
}

.table > :not(caption) > * > * { padding: .8rem .9rem; }

/* ----- Dropdowns ----- */
.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: .5rem;
}

.dropdown-item {
    border-radius: .6rem;
    padding: .55rem .8rem;
    color: var(--text);
    font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface-2);
    color: var(--text);
}

.dropdown-header { font-weight: 800; }

.dropdown-divider { border-color: var(--border); }

/* ----- Modals ----- */
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.3rem;
    box-shadow: var(--shadow-lg);
}

/* ----- Alerts ----- */
.alert {
    border-radius: 1rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ----- Progress ----- */
.progress {
    background: var(--surface-2);
    border-radius: .6rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
    transition: width .6s cubic-bezier(.22, .9, .32, 1);
}

/* ----- Pagination ----- */
.page-link {
    border-radius: .6rem;
    margin: 0 .18rem;
    border-color: var(--border);
    background: var(--surface);
    color: var(--accent-1);
    font-weight: 600;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-color: transparent;
    color: var(--on-accent);
}

.page-item.disabled .page-link {
    background: var(--surface);
    color: var(--muted);
}

/* ----- Footer ----- */
footer {
    border-top: 1px solid var(--border);
}

footer small { font-size: .85rem; }

/* ==========================================================================
   Kanban board
   ========================================================================== */
.kanban-board {
    display: flex;
    gap: 1.1rem;
    min-height: 500px;
    overflow-x: auto;
    padding-bottom: .5rem;
}

.kanban-column {
    flex: 1 0 250px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    background: var(--column-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.kanban-column-header {
    padding: .95rem 1.1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.kanban-column-header > div:first-child { min-width: 0; }

.kanban-column-header > div:first-child > span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-column-header .badge { flex-shrink: 0; }

.kanban-column-header .badge {
    background: var(--surface-2) !important;
    color: var(--muted) !important;
    font-size: .78rem;
}

.kanban-column-body {
    padding: .6rem;
    min-height: 220px;
    /* Fill the whole column so the drop zone covers its full height */
    flex: 1 1 auto;
}

.kanban-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: .9rem;
    padding: .85rem .95rem;
    margin-bottom: .6rem;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
    animation: cardIn .4s ease both;
}

.kanban-column-body .kanban-card:nth-child(1) { animation-delay: .04s; }
.kanban-column-body .kanban-card:nth-child(2) { animation-delay: .08s; }
.kanban-column-body .kanban-card:nth-child(3) { animation-delay: .12s; }
.kanban-column-body .kanban-card:nth-child(4) { animation-delay: .16s; }
.kanban-column-body .kanban-card:nth-child(5) { animation-delay: .2s; }
.kanban-column-body .kanban-card:nth-child(6) { animation-delay: .24s; }
.kanban-column-body .kanban-card:nth-child(7) { animation-delay: .28s; }
.kanban-column-body .kanban-card:nth-child(n+8) { animation-delay: .32s; }

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.kanban-card:active { cursor: grabbing; }

.kanban-card-link { color: var(--text); }
.kanban-card-link:hover { color: var(--text); }

.kanban-card-link .align-items-start > span.fw-semibold {
    min-width: 0;
    overflow-wrap: break-word;
}

.kanban-card-link .align-items-start > .badge { flex-shrink: 0; }

.kanban-card.dragging {
    opacity: .55;
    transform: rotate(2deg) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.kanban-card-overdue {
    border-left: 3px solid var(--tm-danger);
    background: linear-gradient(0deg, rgba(239, 68, 68, .05), rgba(239, 68, 68, .05)), var(--card-bg);
}

.kanban-column-body.drag-over {
    background-color: var(--drop-bg);
    border: 2px dashed var(--accent-1);
    border-radius: .9rem;
}

/* Mobile: horizontal scroll for board */
@media (max-width: 768px) {
    .kanban-board {
        overflow-x: auto;
        padding-bottom: .5rem;
    }

    .kanban-column {
        flex: 0 0 270px;
        min-width: 270px;
    }
}

/* ----- Task card badges & priorities ----- */
.badge-bug { background-color: var(--tm-danger); }
.badge-feature { background-color: var(--tm-primary); }
.badge-task { background-color: #64748b; }

.priority-critical { color: #ef4444; font-weight: 800; }
.priority-high { color: #f97316; font-weight: 700; }
.priority-medium { color: #f59e0b; font-weight: 600; }
.priority-low { color: #10b981; font-weight: 600; }

/* ----- Status dots ----- */
.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px var(--column-bg), 0 0 10px rgba(0, 0, 0, .12);
}

/* ==========================================================================
   Task page components
   ========================================================================== */

/* ----- Comments ----- */
.comment-item {
    border-left: 3px solid var(--border-strong);
    padding-left: 1rem;
    margin-bottom: 1.1rem;
}

.comment-item.internal {
    border-left-color: var(--tm-warning);
    background-color: rgba(245, 158, 11, .08);
    padding: .8rem 1rem;
    border-radius: 0 .7rem .7rem 0;
}

.comment-body img {
    max-width: 100%;
    height: auto;
    border-radius: .7rem;
    margin: .25rem 0;
}

.comment-body h2 { font-size: 1.25rem; }
.comment-body h3 { font-size: 1.1rem; }

.comment-body ul,
.comment-body ol {
    padding-left: 1.5rem;
    margin-bottom: .5rem;
}

/* ----- Checklist ----- */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .6rem .5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: .6rem;
    transition: background-color .15s ease;
}

.checklist-item:hover { background-color: var(--surface-2); }

.checklist-item:last-child { border-bottom: none; }

.checklist-drag-handle {
    display: inline-flex;
    align-items: center;
    cursor: grab;
    color: var(--muted);
    opacity: .4;
    padding: .1rem .15rem;
    margin-top: .15rem;
    transition: opacity .15s ease, color .15s ease;
}

.checklist-item:hover .checklist-drag-handle { opacity: .85; }

.checklist-drag-handle:active { cursor: grabbing; }

.checklist-item.dragging {
    opacity: .45;
    background-color: var(--drop-bg);
    outline: 1px dashed var(--accent-1);
}

.checklist-item.done .checklist-text {
    text-decoration: line-through;
    color: var(--muted);
}

.checklist-item.paste-target {
    background-color: var(--drop-bg);
    outline: 2px dashed var(--accent-1);
}

/* ----- Checklist screenshots ----- */
.checklist-screenshot-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: .55rem;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: opacity .15s ease, box-shadow .15s ease, transform .15s ease;
}

.checklist-screenshot-thumb:hover,
.gallery-thumb:hover {
    opacity: .88;
    box-shadow: var(--shadow-md);
    transform: scale(1.04);
}

.checklist-screenshot-wrapper {
    position: relative;
    display: inline-block;
}

.checklist-screenshot-wrapper .btn-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    padding: 0;
    line-height: 1;
    border-radius: 50%;
    font-size: 12px;
    display: none;
}

.checklist-screenshot-wrapper:hover .btn-remove { display: block; }

.checklist-paste-hint {
    font-size: .8rem;
    color: var(--muted);
    margin-top: .25rem;
}

/* ----- Upload area ----- */
.upload-area {
    border: 2px dashed var(--border-strong);
    border-radius: 1rem;
    padding: 2.2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent-1);
    background-color: var(--drop-bg);
    transform: scale(1.01);
}

/* ----- Image preview / description ----- */
.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: .7rem;
    border: 1px solid var(--border);
}

/* ----- Lightbox gallery ----- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility .25s ease;
}

.lightbox.lightbox-open {
    visibility: visible;
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 16, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#lightboxImg {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 1500px);
    max-height: 84vh;
    width: auto;
    height: auto;
    border-radius: .9rem;
    box-shadow: var(--shadow-lg);
    transform: scale(.96);
    transition: transform .25s cubic-bezier(.22, .9, .32, 1), opacity .2s ease;
}

.lightbox.lightbox-open #lightboxImg {
    transform: scale(1);
}

#lightboxImg.lightbox-img-loading {
    opacity: .3;
}

.lightbox-counter {
    position: absolute;
    z-index: 2;
    top: 1.1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .88);
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: .08em;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    padding: .32rem .95rem;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lightbox-btn {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background-color .15s ease, transform .15s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, .2);
    transform: scale(1.07);
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.07);
}

.lightbox-prev { left: 1.2rem; }
.lightbox-next { right: 1.2rem; }

@media (max-width: 576px) {
    .lightbox-btn { width: 40px; height: 40px; }
    .lightbox-prev { left: .5rem; }
    .lightbox-next { right: .5rem; }
    #lightboxImg { max-width: 96vw; max-height: 78vh; border-radius: .6rem; }
}

.task-description img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: .7rem;
    margin: .5rem 0;
}

/* ----- Back to project link ----- */
.back-to-project {
    color: var(--muted);
    font-size: .92rem;
    font-weight: 600;
    transition: color .15s ease;
}

.back-to-project:hover {
    color: var(--link);
}

/* ----- History ----- */
.history-item {
    font-size: .92rem;
    color: var(--muted);
    padding: .45rem 0;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child { border-bottom: none; }

/* ----- Attachment delete button ----- */
.attachment-delete {
    opacity: 0;
    transition: opacity .15s ease;
}

.attachment-wrapper:hover .attachment-delete { opacity: 1; }

/* ----- WYSIWYG editor ----- */
.editor-content {
    min-height: 160px;
    background: var(--field-bg);
    color: var(--text);
}

.editor-content h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.editor-content h3 { font-size: 1.15rem; margin-bottom: .5rem; }

.editor-content ul,
.editor-content ol {
    margin-bottom: .5rem;
    padding-left: 1.5rem;
}

.editor-content a { color: var(--link); }

.editor-content:empty::before {
    content: attr(placeholder);
    color: var(--muted);
    pointer-events: none;
}

/* ----- Project description modal ----- */
.pd-overlay {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(8, 12, 22, .55);
    backdrop-filter: blur(3px);
}

.pd-overlay[hidden] { display: none; }

.pd-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 760px;
    max-height: 82vh;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: .9rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.pd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.pd-body {
    padding: 1rem 1.1rem;
    overflow-y: auto;
}

.pd-body img {
    max-width: 100%;
    width: auto;
    height: auto;
}

/* ----- Paste hint ----- */
.paste-hint {
    font-size: .82rem;
    color: var(--muted);
}

/* ----- Project cards ----- */
.project-card {
    border-radius: 1.2rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 191, 216, .45);
}

.project-card-link { color: var(--text); }
.project-card-link:hover { color: var(--text); }

/* Drag handle for manual project ordering (admin) */
.project-drag-handle {
    position: absolute;
    top: .55rem;
    right: .65rem;
    z-index: 2;
    line-height: 0;
    padding: .2rem;
    border-radius: 6px;
    color: var(--muted);
    opacity: .35;
    cursor: grab;
    transition: opacity .15s ease, background .15s ease;
}

.project-drag-handle:hover {
    opacity: .9;
    background: var(--surface-2);
}

.project-drag-handle:active {
    cursor: grabbing;
}

.project-col.dragging {
    opacity: .5;
}

.project-col.dragging .project-card {
    border: 1px dashed var(--accent-1);
    box-shadow: var(--shadow-md);
}

[data-bs-theme="dark"] .project-card .badge.bg-light {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
}

/* ----- Tariff billing ----- */
.tariff-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.tariff-total {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}

.tariff-metric {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.tariff-metric span {
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
}

.tariff-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-2);
}

.tariff-progress .progress-bar {
    background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
    border-radius: 999px;
}

.tariff-badge-roll {
    background: rgba(16, 185, 129, .14);
    color: #0f9d76;
    border: 1px solid rgba(16, 185, 129, .3);
    font-weight: 600;
}

.tariff-card-badge {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: var(--on-accent);
    font-weight: 700;
}

[data-bs-theme="dark"] .tariff-badge-roll {
    color: #4ade9f;
}

/* Tariff radio-card picker (forms) */
.tariff-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .75rem;
}

.tariff-option {
    position: relative;
    display: block;
    margin: 0;
}

.tariff-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tariff-option-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    height: 100%;
    border: 1px solid var(--border);
    background: var(--field-bg);
    border-radius: 12px;
    padding: .8rem .9rem;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.tariff-option-card:hover {
    border-color: var(--border-strong);
}

.tariff-radio:checked + .tariff-option-card {
    border-color: var(--accent-1);
    background: var(--drop-bg);
    box-shadow: 0 0 0 3px var(--ring);
}

.tariff-radio:focus-visible + .tariff-option-card {
    box-shadow: 0 0 0 3px var(--ring);
}

.tariff-option-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
}

.tariff-option-name {
    font-weight: 700;
    color: var(--text);
}

.tariff-option-roll {
    flex-shrink: 0;
    font-size: .68rem;
    font-weight: 600;
    background: rgba(16, 185, 129, .14);
    color: #0f9d76;
    border: 1px solid rgba(16, 185, 129, .3);
    border-radius: 999px;
    padding: .05rem .45rem;
}

.tariff-option-desc {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.35;
}

[data-bs-theme="dark"] .tariff-option-roll {
    color: #4ade9f;
}

/* ----- Online users ----- */
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
    animation: online-pulse 1.6s ease-out infinite;
}

@keyframes online-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
        opacity: 1;
    }
    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
        opacity: .65;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
        opacity: 1;
    }
}

/* Project member chips on cards */
.member-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .72rem;
    font-weight: 600;
    border-radius: 999px;
    padding: .16rem .55rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-chip svg {
    flex-shrink: 0;
    opacity: .55;
}

/* Notification dropdown: wider box, text wraps instead of clipping */
.notif-dropdown {
    width: 400px;
    max-width: calc(100vw - 2rem);
    max-height: 400px;
    overflow-y: auto;
}

/* On desktop the bell sits next to the logo, so the menu must open to the
   right instead of hugging the toggle's right edge (Popper inline styles). */
@media (min-width: 992px) {
    #notifDropdownList.dropdown-menu {
        left: 0 !important;
        right: auto !important;
        transform: none !important;
    }
}

/* On small screens the menu becomes a full-width sheet under the navbar
   so it never escapes the viewport. --notif-menu-top is set from JS. */
@media (max-width: 991.98px) {
    #notifDropdownList.notif-menu-full {
        position: fixed !important;
        top: var(--notif-menu-top, 3.5rem) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        transform: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
}

.notif-dropdown .dropdown-item {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Login page value proposition list */
.usp-list li {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .55rem;
}

.usp-list li:last-child {
    margin-bottom: 0;
}

.usp-list svg {
    flex-shrink: 0;
    margin-top: .18rem;
    color: var(--accent-1);
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
