:root{
    --primary:#ff6a00;
    --bg:#0f1012;
    --panel:#17191d;
    --border:#2d3137;
    --text:#f3f3f3;
    --muted:#9b9fa7;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
body{background:var(--bg)}
a{color:inherit}
.topbar{min-height:78px;padding:14px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:20px;background:#111317}
.brand{display:flex;align-items:center;gap:14px}
.brand img{max-width:110px;max-height:46px;object-fit:contain}
.brand strong{font-size:18px}
.brand span{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.nav{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:11px 14px;border-radius:10px;border:1px solid var(--border);background:#1a1d22;color:#fff;text-decoration:none;font-weight:800;font-size:12px;cursor:pointer}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#111}
.page{max-width:1100px;margin:0 auto;padding:34px 22px 60px}
.panel{background:var(--panel);border:1px solid var(--border);border-radius:15px;padding:22px}
h1{margin:0 0 7px;font-size:30px}
.subtitle{margin:0 0 24px;color:var(--muted);font-size:14px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.full{grid-column:1/-1}
label{display:block;font-size:12px;font-weight:800;margin-bottom:7px}
input,select,textarea{width:100%;padding:12px 13px;border-radius:10px;border:1px solid var(--border);background:#101216;color:#fff;font:inherit}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--primary)}
.note{font-size:11px;color:var(--muted);margin-top:6px;line-height:1.45}
.alert{padding:12px 14px;border-radius:10px;margin-bottom:18px;font-size:13px}
.alert-ok{background:#173322;border:1px solid #315d42;color:#a8e6bd}
.alert-error{background:#39191c;border:1px solid #74343a;color:#ffc1c4}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:18px}
.card strong{display:block;font-size:15px;margin-bottom:5px}
.card span{font-size:12px;color:var(--muted)}
@media(max-width:760px){.grid,.cards{grid-template-columns:1fr}.full{grid-column:auto}.topbar{align-items:flex-start;flex-direction:column}}

.table-wrap{overflow-x:auto}
.data-table{width:100%;border-collapse:collapse}
.data-table th,.data-table td{padding:13px 12px;border-bottom:1px solid var(--border);text-align:left;font-size:13px;vertical-align:middle}
.data-table th{color:var(--muted);font-size:10px;letter-spacing:.07em;text-transform:uppercase}
.badge{display:inline-flex;align-items:center;padding:6px 8px;border-radius:999px;border:1px solid var(--border);font-size:10px;font-weight:800}
.badge-admin{color:#ffbf87;border-color:rgba(255,106,0,.45)}
.badge-user{color:#b9c0ca}
.badge-active{color:#9ee0b8;border-color:#315d42;background:#173322}
.badge-inactive{color:#ffb4b7;border-color:#74343a;background:#39191c}
.row-actions{display:flex;gap:7px;flex-wrap:wrap}
.btn-small{padding:7px 9px;font-size:10px}
.btn-danger{border-color:#6f3034;background:#321719;color:#ffb5b8}
.btn-success{border-color:#356d55;background:#163327;color:#a4dfbf}
.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px}
.user-summary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.summary-pill{padding:8px 10px;border-radius:999px;background:#15171b;border:1px solid var(--border);font-size:11px;color:var(--muted)}
.summary-pill strong{color:#fff}

.color-dot{width:16px;height:16px;border-radius:50%;display:inline-block;border:1px solid rgba(255,255,255,.18);vertical-align:middle;margin-right:7px}
.order-actions{display:flex;gap:5px}
.order-btn{width:30px;height:30px;padding:0;border-radius:8px}


/* SMART TASK 0.4 - Task board */
.board-wrap{overflow-x:auto;padding-bottom:8px}
.board{
    display:grid;
    grid-auto-flow:column;
    grid-auto-columns:minmax(270px,1fr);
    gap:16px;
    align-items:start;
    min-width:max-content;
}
.board-column{
    width:290px;
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:15px;
    min-height:500px;
    padding:0 12px 14px;
}
.column-head{
    margin:0 -12px 14px;
    padding:16px 14px 13px;
    border-bottom:1px solid var(--border);
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
}
.column-name{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:900;letter-spacing:.06em}
.column-count{
    min-width:26px;height:26px;padding:0 7px;border-radius:999px;
    display:inline-flex;align-items:center;justify-content:center;
    background:#101216;border:1px solid var(--border);color:var(--muted);font-size:11px
}
.task-list{min-height:60px}
.task-card{
    position:relative;
    background:#22252a;
    border:1px solid var(--border);
    border-radius:12px;
    padding:14px;
    margin-bottom:10px;
    cursor:grab;
    transition:.15s ease;
}
.task-card:hover{background:#282c32;border-color:#3c4149}
.task-card.dragging{opacity:.45;transform:scale(.985)}
.board-column.drag-over{border-color:var(--primary)}
.task-link{position:absolute;inset:0;z-index:1}
.task-content{position:relative;z-index:2;pointer-events:none}
.task-project{font-size:10px;color:var(--primary);font-weight:800;text-transform:uppercase;letter-spacing:.05em;margin-bottom:7px}
.task-title{margin:0 0 8px;font-size:15px;line-height:1.3}
.task-description{
    margin:0 0 11px;color:#c4c8ce;font-size:12px;line-height:1.4;
    display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden
}
.task-meta{display:flex;gap:6px;flex-wrap:wrap}
.task-tag{
    padding:5px 7px;border-radius:7px;border:1px solid #343941;
    background:#15171b;color:#c5c9cf;font-size:9px;font-weight:800
}
.priority-high{color:#ffb3b7;border-color:#6e3438}
.priority-normal{color:#f0d27b}
.priority-low{color:#9bdcb8}
.board-empty{padding:18px 10px;text-align:center;color:#666b73;font-size:12px;border:1px dashed #30343a;border-radius:10px}
.toast{
    position:fixed;right:22px;bottom:22px;z-index:999;
    background:#181b20;border:1px solid var(--border);padding:11px 13px;border-radius:9px;
    opacity:0;transform:translateY(8px);transition:.2s ease;pointer-events:none
}
.toast.show{opacity:1;transform:translateY(0)}
.toast.error{border-color:#74343a;color:#ffb4b7}
.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:22px}
.history{margin-top:18px}
.history-item{padding:10px 0;border-bottom:1px solid var(--border);font-size:12px}
.history-item:last-child{border-bottom:0}
.history-meta{color:var(--muted);font-size:10px;margin-top:4px}


/* SMART TASK 0.4.4 - visual consistency */
.topbar{
    min-height:82px;
    padding:14px 24px;
    border-bottom:1px solid #c8ccd1;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    background:#e7e9ec;
    color:#17191d;
}
.brand{
    display:flex;
    align-items:center;
    gap:14px;
}
.brand-logo{
    display:block;
    width:auto;
    max-width:118px;
    height:50px;
    max-height:50px;
    object-fit:contain;
}
.brand-mark{
    width:48px;
    height:48px;
    border-radius:10px;
    background:var(--primary);
    color:#111;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:17px;
    font-weight:900;
}
.brand-copy strong,
.brand strong{
    display:block;
    color:#17191d;
    font-size:18px;
}
.brand-copy span,
.brand span{
    display:block;
    color:#626871;
    font-size:11px;
    margin-top:3px;
}

/* Standard buttons use the configured primary color */
.btn{
    background:var(--primary);
    border-color:var(--primary);
    color:#111;
}
.btn:hover{
    opacity:.92;
    background:var(--primary);
    border-color:var(--primary);
    color:#111;
}

/* Keep semantic status buttons distinct */
.btn-danger{
    border-color:#6f3034;
    background:#321719;
    color:#ffb5b8;
}
.btn-danger:hover{
    border-color:#a7474d;
    background:#401b1e;
    color:#ffd0d2;
}
.btn-success{
    border-color:#356d55;
    background:#163327;
    color:#a4dfbf;
}
.btn-success:hover{
    border-color:#4a8b6c;
    background:#1e4634;
    color:#c3efd4;
}
@media(max-width:760px){
    .brand-logo{max-width:96px;height:44px;max-height:44px}
}


/* SMART TASK 0.4.5 - fixed system logo */
.brand-logo{
    width:auto;
    max-width:64px;
    height:54px;
    max-height:54px;
    object-fit:contain;
}
.login-brand-logo{
    width:auto;
    max-width:110px;
    height:auto;
    max-height:90px;
    object-fit:contain;
}


/* SMART TASK 0.4.7 - Global button color */
:root{
    --primary:rgb(17, 197, 176);
}

.btn,
.btn-primary,
.topbar .nav .btn,
.topbar .nav .btn-primary{
    background:rgb(17, 197, 176);
    border-color:rgb(17, 197, 176);
    color:#111;
}

.btn:hover,
.btn-primary:hover,
.topbar .nav .btn:hover,
.topbar .nav .btn-primary:hover{
    background:rgb(17, 197, 176);
    border-color:rgb(17, 197, 176);
    color:#111;
    opacity:.9;
}

/* Keep destructive/status actions semantically distinct */
.btn-danger{
    border-color:#6f3034;
    background:#321719;
    color:#ffb5b8;
}
.btn-success{
    border-color:#356d55;
    background:#163327;
    color:#a4dfbf;
}


/* SMART TASK 0.5 - comments, attachments, archive, trash */
.task-card{padding-right:48px}
.task-trash{
    position:absolute;
    top:10px;
    right:10px;
    z-index:5;
    width:28px;
    height:28px;
    border:1px solid #6f3034;
    border-radius:8px;
    background:#321719;
    color:#ffb5b8;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    pointer-events:auto;
}
.task-trash:hover{background:#401b1e;border-color:#a7474d;color:#ffd0d2}
.task-trash svg{width:14px;height:14px;fill:currentColor}

.comments-panel{
    border:2px solid rgb(17,197,176);
    box-shadow:0 0 0 1px rgba(17,197,176,.08);
}
.section-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}
.section-title-row h2{margin:0;font-size:16px}
.count-badge{
    min-width:28px;height:28px;padding:0 8px;border-radius:999px;
    display:inline-flex;align-items:center;justify-content:center;
    background:rgb(17,197,176);color:#111;font-size:11px;font-weight:900
}
.comment-item{
    padding:13px 0;
    border-bottom:1px solid var(--border);
}
.comment-item:last-child{border-bottom:0}
.comment-author{font-size:11px;font-weight:900;color:rgb(17,197,176);margin-bottom:5px}
.comment-text{font-size:13px;line-height:1.5;color:#d3d6db;white-space:pre-wrap}
.comment-meta{font-size:10px;color:var(--muted);margin-top:6px}
.comment-actions,.attachment-actions{margin-top:8px;display:flex;justify-content:flex-end}
.comment-delete,.attachment-delete{
    border:1px solid #6f3034;background:#321719;color:#ffb5b8;border-radius:8px;
    padding:6px 9px;font-size:10px;font-weight:800;cursor:pointer
}
.attachment-item{
    padding:14px;
    border:1px solid var(--border);
    border-radius:12px;
    margin-bottom:10px;
    background:#13161a;
}
.attachment-name{font-weight:800;font-size:12px}
.attachment-meta{font-size:10px;color:var(--muted);margin-top:5px}
.attachment-preview{margin-top:10px;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:#0f1114}
.attachment-preview img{display:block;width:100%;max-height:260px;object-fit:contain}
.attachment-preview iframe{display:block;width:100%;height:280px;border:0;background:#fff}
.file-preview-generic{padding:16px;display:flex;align-items:center;gap:12px;color:#c7cbd1}
.file-preview-ext{
    min-width:54px;height:54px;border-radius:10px;background:#242830;
    display:flex;align-items:center;justify-content:center;font-weight:900;font-size:11px
}
.lifecycle-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;margin-top:12px}
.btn-archive{background:#c9a542!important;border-color:#c9a542!important;color:#111!important}
.btn-trash{background:#321719!important;border-color:#6f3034!important;color:#ffb5b8!important}
.lifecycle-page{max-width:1050px;margin:0 auto;padding:34px 22px 60px}
.lifecycle-card{
    background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:18px;margin-bottom:12px
}
.lifecycle-card h2{margin:0 0 7px;font-size:17px}
.lifecycle-meta{display:flex;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:11px;margin-bottom:10px}
.lifecycle-desc{
    font-size:13px;line-height:1.45;color:#c6c9cf;
    display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden
}


/* SMART TASK 0.5.1 - Dashboard contrast + visible trash icon */
body.dashboard-page{
    background:#9ca0a4;
}

body.dashboard-page .page-title-dark,
body.dashboard-page .page-title-dark h1,
body.dashboard-page .page-title-dark .subtitle{
    color:#111 !important;
}

body.dashboard-page .board-column{
    background:#17191d;
}

body.dashboard-page .task-card{
    background:#22252a;
    color:#f3f3f3;
}

body.dashboard-page .task-card:hover{
    background:#282c32;
}

.task-card{
    position:relative;
    padding-right:52px;
}

.task-trash-form{
    position:absolute !important;
    top:10px;
    right:10px;
    z-index:20;
    width:30px;
    height:30px;
    margin:0;
    padding:0;
    pointer-events:auto;
}

.task-trash{
    position:static !important;
    width:30px;
    height:30px;
    margin:0;
    padding:0;
    border:1px solid #7d3439;
    border-radius:8px;
    background:#351719;
    color:#ff9fa4;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    pointer-events:auto;
    line-height:1;
    box-shadow:none;
}

.task-trash:hover{
    background:#481d20;
    border-color:#b4474e;
    color:#ffd0d2;
}

.task-trash svg{
    display:block;
    width:16px;
    height:16px;
    fill:currentColor;
    pointer-events:none;
}

.task-card .task-link{
    z-index:1;
}


/* SMART TASK 0.6 - column DnD, filters, due dates, latest comments */
.task-filters{
    display:grid;
    grid-template-columns:minmax(220px,1.3fr) repeat(3,minmax(150px,.7fr)) auto auto auto;
    gap:9px;
    align-items:center;
    margin-bottom:14px;
}
.task-filters input[type="search"],
.task-filters select{
    min-height:42px;
}
.filter-toggle{
    min-height:42px;
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:9px 11px;
    border-radius:10px;
    border:1px solid #c4c8cd;
    background:#e7e9ec;
    color:#111;
    font-size:11px;
    font-weight:800;
    white-space:nowrap;
}
.filter-toggle input{
    width:auto;
    margin:0;
}
.filter-toggle.active{
    border-color:rgb(17,197,176);
    box-shadow:inset 0 0 0 1px rgba(17,197,176,.25);
}
.filter-actions{
    display:flex;
    gap:7px;
    flex-wrap:wrap;
}
.filter-note{
    margin:-2px 0 14px;
    font-size:11px;
    color:#202326;
    font-weight:700;
}
.task-drag-disabled{
    cursor:pointer;
}
.due-overdue{
    color:#ffd0d3!important;
    background:#421b1f!important;
    border-color:#8b3d43!important;
}
.due-today{
    color:#ffe1a3!important;
    background:#3a2a0d!important;
    border-color:#8c6722!important;
}
.due-tomorrow{
    color:#fff1b8!important;
    background:#322b16!important;
    border-color:#6f622c!important;
}
.latest-comment{
    margin:0 0 11px;
    padding:9px 10px;
    border-left:3px solid rgb(17,197,176);
    border-radius:7px;
    background:#191c20;
}
.latest-comment-author{
    margin-bottom:3px;
    color:rgb(17,197,176);
    font-size:9px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.latest-comment-text{
    color:#d5d7db;
    font-size:11px;
    line-height:1.35;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.board-column{
    cursor:grab;
}
.board-column.column-dragging{
    opacity:.55;
    transform:scale(.985);
}
.board-column .task-card{
    cursor:grab;
}
.board-column .task-drag-disabled{
    cursor:pointer;
}
@media(max-width:1250px){
    .task-filters{grid-template-columns:repeat(3,minmax(180px,1fr))}
}
@media(max-width:760px){
    .task-filters{grid-template-columns:1fr}
}


/* SMART TASK 0.7 - UI refinement, avatars, login */
body.dashboard-page{
    background:
        linear-gradient(
            30deg,
            #87919b 0%,
            #b9c0c7 34%,
            #e0e3e6 58%,
            #a8b0b8 100%
        );
    background-attachment:fixed;
}

body.dashboard-page .page-title-dark,
body.dashboard-page .page-title-dark h1,
body.dashboard-page .page-title-dark .subtitle{
    color:#111 !important;
}

.current-user{
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:#17191d;
    font-size:11px;
    font-weight:800;
    white-space:nowrap;
}

.avatar{
    flex:0 0 auto;
    width:34px;
    height:34px;
    border-radius:50%;
    overflow:hidden;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#343a40;
    color:#fff;
    font-size:11px;
    font-weight:900;
    border:2px solid rgba(17,197,176,.75);
    vertical-align:middle;
}

.avatar img{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
}

.avatar-header{
    width:36px;
    height:36px;
}

.avatar-mini{
    width:22px;
    height:22px;
    border-width:1px;
    font-size:8px;
}

.avatar-large{
    width:72px;
    height:72px;
    font-size:20px;
}

.avatar-editor{
    display:flex;
    align-items:center;
    gap:14px;
}

.user-name-cell,
.task-assignee{
    display:inline-flex;
    align-items:center;
    gap:7px;
}

.task-assignee{
    padding:3px 7px;
    border:1px solid #454a51;
    border-radius:999px;
    color:#d8dadd;
    font-size:10px;
    font-weight:800;
    background:#17191d;
}

.login-page{
    width:100%;
    max-width:480px;
    margin:0 auto;
    padding:72px 22px 60px;
}

.login-card{
    padding:36px;
    border:1px solid #d0d4d8;
    border-radius:20px;
    background:rgba(245,247,248,.94);
    color:#16191c;
    box-shadow:0 18px 48px rgba(0,0,0,.12);
    backdrop-filter:blur(18px);
}

.login-brand-logo{
    display:block;
    width:auto;
    max-width:92px;
    max-height:78px;
    margin:0 auto 20px;
    object-fit:contain;
}

.login-wordmark{
    text-align:center;
    margin-bottom:24px;
}

.login-wordmark strong{
    display:block;
    font-size:27px;
    line-height:1;
    letter-spacing:.02em;
    color:#111;
}

.login-wordmark span{
    display:block;
    margin-top:8px;
    font-size:12px;
    color:#636a72;
    letter-spacing:.02em;
}

.login-intro{
    margin:0 0 20px;
    text-align:center;
    color:#596068;
    font-size:12px;
}

.login-card label{
    color:#24282c;
}

.login-card input{
    background:#fff;
    color:#111;
    border-color:#c8cdd2;
}

@media(max-width:760px){
    .current-user span:last-child{display:none}
    .login-card{padding:28px 22px}
}


/* SMART TASK 0.7.2 - refined dashboard background */
body.dashboard-page{
    background-color:#c9d0d6;
    background-image:
        linear-gradient(
            30deg,
            rgba(104, 117, 129, 0.92) 0%,
            rgba(165, 175, 184, 0.90) 24%,
            rgba(229, 233, 236, 0.94) 46%,
            rgba(188, 197, 205, 0.90) 66%,
            rgba(140, 151, 160, 0.94) 100%
        ),
        radial-gradient(
            circle at 14% 18%,
            rgba(255,255,255,0.34) 0%,
            rgba(255,255,255,0) 26%
        ),
        radial-gradient(
            circle at 86% 24%,
            rgba(17,197,176,0.11) 0%,
            rgba(17,197,176,0) 22%
        ),
        radial-gradient(
            circle at 70% 78%,
            rgba(255,255,255,0.22) 0%,
            rgba(255,255,255,0) 18%
        ),
        repeating-linear-gradient(
            120deg,
            rgba(255,255,255,0.06) 0px,
            rgba(255,255,255,0.06) 1px,
            rgba(255,255,255,0) 1px,
            rgba(255,255,255,0) 7px
        );
    background-attachment:fixed;
    background-size:cover, cover, cover, cover, auto;
}

/* Slightly more refined board contrast over the new background */
body.dashboard-page .board-column{
    background:rgba(24, 27, 31, 0.94);
    border:1px solid rgba(255,255,255,0.05);
    box-shadow:0 10px 30px rgba(0,0,0,0.14);
}

body.dashboard-page .task-card{
    background:#23272c;
    border:1px solid #353a41;
    box-shadow:0 8px 18px rgba(0,0,0,0.10);
}

body.dashboard-page .task-card:hover{
    background:#2a2f36;
}

body.dashboard-page .task-filters{
    padding:12px;
    border-radius:16px;
    background:rgba(245,247,248,0.58);
    backdrop-filter:blur(10px);
    border:1px solid rgba(255,255,255,0.45);
    box-shadow:0 10px 22px rgba(0,0,0,0.08);
}

body.dashboard-page .filter-note{
    padding:10px 12px;
    border-radius:12px;
    background:rgba(255,255,255,0.42);
    backdrop-filter:blur(8px);
    border:1px solid rgba(255,255,255,0.40);
}

body.dashboard-page .section-head{
    margin-bottom:14px;
}


/* SMART TASK 0.8 - user personalization */
.current-user-link{
    text-decoration:none;
}
.current-user-link:hover span:last-child{
    text-decoration:underline;
}

body.dashboard-page.dashboard-bg-gradient{
    background:
        linear-gradient(
            var(--user-bg-angle, 30deg),
            var(--user-bg-color1, #87919b) 0%,
            var(--user-bg-color2, #e0e3e6) 100%
        );
    background-attachment:fixed;
    background-size:cover;
}

body.dashboard-page.dashboard-bg-image{
    position:relative;
    background:#aeb6bd;
}

body.dashboard-page.dashboard-bg-image::before{
    content:"";
    position:fixed;
    inset:-24px;
    z-index:-2;
    background-image:var(--user-bg-image);
    background-size:cover;
    background-position:center;
    filter:blur(14px);
    transform:scale(1.05);
}

body.dashboard-page.dashboard-bg-image::after{
    content:"";
    position:fixed;
    inset:0;
    z-index:-1;
    background:
        linear-gradient(30deg, rgba(65,74,82,.58), rgba(233,236,239,.48)),
        rgba(255,255,255,.08);
    backdrop-filter:saturate(.85);
}

.profile-section{
    padding:20px 0;
    border-bottom:1px solid var(--border);
}
.profile-section:first-child{
    padding-top:0;
}
.profile-section:last-of-type{
    border-bottom:0;
}

.background-options{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}

.background-choice{
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:14px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#17191d;
    cursor:pointer;
}

.background-choice input{
    width:auto;
    margin-top:3px;
}

.background-choice strong,
.background-choice small{
    display:block;
}

.background-choice small{
    margin-top:4px;
    color:var(--muted);
    line-height:1.35;
}

.profile-background-preview{
    margin-top:18px;
    border:1px solid var(--border);
    border-radius:14px;
    overflow:hidden;
    background:#111;
}

.profile-background-preview img{
    display:block;
    width:100%;
    max-height:260px;
    object-fit:cover;
    filter:blur(3px);
    transform:scale(1.01);
    opacity:.88;
}

.admin-toggle{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:14px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#17191d;
}

.admin-toggle input{
    width:auto;
    margin-top:3px;
}

.admin-toggle strong,
.admin-toggle small{
    display:block;
}

.admin-toggle small{
    margin-top:4px;
    color:var(--muted);
}

@media(max-width:760px){
    .background-options{
        grid-template-columns:1fr;
    }
}


/* SMART TASK 0.9 - notifications & roles */
.notification-bell{
    position:relative;
    width:40px;
    height:40px;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    text-decoration:none;
    background:#f4f5f6;
    border:1px solid #c5c9ce;
    color:#111;
    font-size:17px;
}

.notification-bell:hover{
    border-color:rgb(17,197,176);
}

.notification-count{
    position:absolute;
    top:-5px;
    right:-5px;
    min-width:20px;
    height:20px;
    padding:0 5px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#d43d48;
    color:#fff;
    font-size:9px;
    font-weight:900;
    border:2px solid #e7e9ec;
}

.notification-list{
    display:grid;
    gap:10px;
}

.notification-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:16px;
    border-radius:14px;
    border:1px solid var(--border);
    background:var(--panel);
}

.notification-item.unread{
    border-left:4px solid rgb(17,197,176);
    background:#20252a;
}

.notification-copy{
    min-width:0;
    flex:1;
}

.notification-message{
    font-size:13px;
    font-weight:800;
    color:#eceff2;
}

.notification-meta{
    margin-top:5px;
    color:var(--muted);
    font-size:10px;
}

.notification-actions{
    flex:0 0 auto;
}

.badge-role-admin{background:#3b1e48;color:#e7b5ff}
.badge-role-manager{background:#17384a;color:#a9dcff}
.badge-role-user{background:#18392e;color:#a8e2c7}
.badge-role-guest{background:#343434;color:#d5d5d5}

@media(max-width:760px){
    .notification-item{
        align-items:flex-start;
        flex-direction:column;
    }
}


/* SMART TASK 0.9.2 - Sticky header */
.topbar{
    position:sticky;
    top:0;
    z-index:1000;
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
    box-shadow:0 6px 18px rgba(0,0,0,0.10);
}

.topbar .nav{
    position:relative;
    z-index:1001;
}


/* SMART TASK 0.9.4 - Dashboard custom image background fix */

/*
 * The custom image is now applied directly to the dashboard body.
 * This avoids negative z-index pseudo-elements being hidden behind
 * the body/background canvas on some browsers.
 */
body.dashboard-page.dashboard-bg-image{
    position:relative;
    background-color:#9fa8b0;
    background-image:
        linear-gradient(
            30deg,
            rgba(54, 62, 69, 0.52) 0%,
            rgba(112, 123, 132, 0.28) 38%,
            rgba(230, 234, 237, 0.24) 100%
        ),
        var(--user-bg-image);
    background-size:cover, cover;
    background-position:center, center;
    background-repeat:no-repeat, no-repeat;
    background-attachment:fixed, fixed;
}

/* Disable the previous pseudo-element implementation. */
body.dashboard-page.dashboard-bg-image::before,
body.dashboard-page.dashboard-bg-image::after{
    content:none;
    display:none;
}


/* SMART TASK 0.9.6 - Primary new-task CTA */
.btn-new-task{
    font-size:13px;
    font-weight:900;
    letter-spacing:.055em;
    text-transform:uppercase;
}

.btn-new-task:hover{
    letter-spacing:.065em;
}


/* SMART TASK 0.9.7 - Brand blue buttons from brain.svg */
:root{
    --smart-brand-blue:#0089a9;
    --smart-brand-blue-hover:#006d87;
}

/* All standard application buttons use the exact blue from brain.svg */
.btn,
button.btn,
input[type="submit"].btn{
    background:var(--smart-brand-blue) !important;
    border-color:var(--smart-brand-blue) !important;
    color:#fff !important;
}

.btn:hover,
button.btn:hover,
input[type="submit"].btn:hover{
    background:var(--smart-brand-blue-hover) !important;
    border-color:var(--smart-brand-blue-hover) !important;
    color:#fff !important;
}

/* Main dashboard action: clearly stronger hover */
.btn-new-task{
    transition:
        transform .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        letter-spacing .18s ease;
    transform-origin:center;
    will-change:transform;
}

.btn-new-task:hover{
    background:var(--smart-brand-blue-hover) !important;
    border-color:var(--smart-brand-blue-hover) !important;
    transform:scale(1.07);
    box-shadow:0 10px 24px rgba(0,0,0,.22);
    letter-spacing:.075em;
}

.btn-new-task:active{
    transform:scale(1.025);
}


/* SMART TASK 0.9.8 - Filter typography + subtle transparency */

/* Filter fields: 2px smaller text */
body.dashboard-page .task-filters input[type="search"],
body.dashboard-page .task-filters select{
    font-size:11px;
}

/* Placeholder too */
body.dashboard-page .task-filters input[type="search"]::placeholder{
    font-size:11px;
}

/* Keep the panel black, but at 90% opacity */
body.dashboard-page .task-filters{
    background:rgba(0,0,0,0.90);
}


/* SMART TASK 0.9.9 - Filter sizing/alignment + CTA border */

/* Filter text: +1px versus 0.9.8 */
body.dashboard-page .task-filters input[type="search"],
body.dashboard-page .task-filters select,
body.dashboard-page .task-filters input[type="search"]::placeholder{
    font-size:12px;
}

/* Same height for filter fields and right-side action buttons */
body.dashboard-page .task-filters input[type="search"],
body.dashboard-page .task-filters select,
body.dashboard-page .task-filters .btn{
    height:40px;
    min-height:40px;
    box-sizing:border-box;
}

/* Right-side filter buttons: consistent vertical alignment */
body.dashboard-page .task-filters .btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    padding-top:0;
    padding-bottom:0;
    white-space:nowrap;
}

/* Main CTA: subtle 1px white outline */
.btn-new-task{
    border:1px solid rgba(255,255,255,1) !important;
}

.btn-new-task:hover{
    border-color:#fff !important;
}


/* SMART TASK 0.9.10 - Precise filter alignment */
body.dashboard-page .task-filters{
    align-items:stretch;
}

/* Force one identical outer height for every filter control */
body.dashboard-page .task-filters > input[type="search"],
body.dashboard-page .task-filters > select,
body.dashboard-page .task-filters > .filter-toggle,
body.dashboard-page .task-filters > .filter-actions{
    height:42px;
    min-height:42px;
    box-sizing:border-box;
    margin:0;
}

/* Search + selects */
body.dashboard-page .task-filters > input[type="search"],
body.dashboard-page .task-filters > select{
    padding-top:0;
    padding-bottom:0;
    line-height:40px;
}

/* Checkbox controls */
body.dashboard-page .task-filters > .filter-toggle{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    padding:0 16px;
    line-height:1;
}

/* Action wrapper must not add any extra height */
body.dashboard-page .task-filters > .filter-actions{
    display:flex;
    align-items:stretch;
    gap:8px;
}

/* FILTRA / AZZERA exactly match the controls height */
body.dashboard-page .task-filters > .filter-actions .btn{
    height:42px;
    min-height:42px;
    padding:0 18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    box-sizing:border-box;
    margin:0;
}


/* SMART TASK 0.9.11 - Compact filter buttons */
body.dashboard-page .task-filters > .filter-toggle{
    padding-left:14px;
    padding-right:14px;
}

body.dashboard-page .task-filters > .filter-actions .btn{
    padding-left:16px;
    padding-right:16px;
}


/* SMART TASK 0.9.12 - Task trash icon color */
.task-trash{
    color:#cfd3d7 !important;
}

.task-trash svg{
    fill:currentColor !important;
}

.task-trash:hover{
    color:#ffffff !important;
}


/* SMART TASK 0.10 - Dashboard Summary & Smart Filters */
.dashboard-summary{
    display:grid;
    grid-template-columns:repeat(5,minmax(130px,1fr));
    gap:10px;
    margin:0 0 12px;
}

.summary-card{
    min-height:74px;
    padding:12px 16px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    text-decoration:none;
    color:#eef2f4;
    background:rgba(0,0,0,.82);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 8px 18px rgba(0,0,0,.10);
    backdrop-filter:blur(9px);
    -webkit-backdrop-filter:blur(9px);
    transition:
        transform .16s ease,
        border-color .16s ease,
        background-color .16s ease,
        box-shadow .16s ease;
}

.summary-card:hover{
    transform:translateY(-2px);
    border-color:rgba(255,255,255,.42);
    background:rgba(0,0,0,.90);
    box-shadow:0 10px 22px rgba(0,0,0,.16);
}

.summary-card.active{
    border-color:var(--smart-brand-blue);
    box-shadow:
        0 0 0 1px var(--smart-brand-blue),
        0 10px 24px rgba(0,0,0,.18);
    background:rgba(0,0,0,.94);
}

.summary-value{
    flex:0 0 auto;
    font-size:30px;
    line-height:1;
    font-weight:900;
    letter-spacing:-.04em;
    color:#fff;
}

.summary-label{
    font-size:10px;
    line-height:1.2;
    font-weight:850;
    letter-spacing:.06em;
    text-align:right;
    color:#cfd5d9;
}

.summary-card.active .summary-label{
    color:#fff;
}

.summary-overdue .summary-value{
    color:#ff8d97;
}

.summary-today .summary-value{
    color:#f3d27a;
}

.summary-high .summary-value{
    color:#ffb08f;
}

.summary-mine .summary-value{
    color:#8edced;
}

@media(max-width:1050px){
    .dashboard-summary{
        grid-template-columns:repeat(5,minmax(110px,1fr));
    }

    .summary-card{
        padding:11px 12px;
    }

    .summary-value{
        font-size:26px;
    }
}

@media(max-width:780px){
    .dashboard-summary{
        display:flex;
        overflow-x:auto;
        padding-bottom:4px;
        scrollbar-width:thin;
    }

    .summary-card{
        min-width:145px;
        flex:0 0 145px;
    }
}


/* SMART TASK 0.11 - Checklist / Subtask */
.checklist-panel{
    overflow:hidden;
}

.checklist-progress-label{
    margin-top:4px;
    color:var(--muted);
    font-size:10px;
    font-weight:700;
}

.checklist-progress{
    height:6px;
    margin:0 0 16px;
    overflow:hidden;
    border-radius:999px;
    background:#30353a;
}

.checklist-progress > span{
    display:block;
    height:100%;
    border-radius:inherit;
    background:var(--smart-brand-blue);
    transition:width .2s ease;
}

.checklist-add-form{
    display:grid;
    grid-template-columns:1fr auto;
    gap:8px;
    align-items:stretch;
    margin-bottom:16px;
}

.checklist-add-form input[type="text"],
.checklist-add-form .btn{
    height:42px;
    box-sizing:border-box;
}

.checklist-list{
    display:grid;
    gap:8px;
}

.checklist-item{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:48px;
    padding:8px 10px;
    border:1px solid #363b41;
    border-radius:12px;
    background:#1d2024;
}

.checklist-item.completed{
    background:#191c1f;
}

.checklist-toggle-form{
    margin:0;
    flex:0 0 auto;
}

.checklist-check{
    width:25px;
    height:25px;
    padding:0;
    border:1px solid #7a8289;
    border-radius:6px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#111417;
    color:#fff;
    cursor:pointer;
    font-size:16px;
    font-weight:900;
    line-height:1;
}

.checklist-check:hover{
    border-color:var(--smart-brand-blue);
}

.checklist-check.readonly{
    cursor:default;
}

.checklist-item.completed .checklist-check{
    background:var(--smart-brand-blue);
    border-color:var(--smart-brand-blue);
}

.checklist-copy{
    flex:1;
    min-width:0;
}

.checklist-title{
    color:#eef1f3;
    font-size:13px;
    font-weight:750;
    line-height:1.35;
}

.checklist-item.completed .checklist-title{
    color:#929aa1;
    text-decoration:line-through;
}

.checklist-meta{
    margin-top:3px;
    color:var(--muted);
    font-size:9px;
}

.checklist-delete{
    width:28px;
    height:28px;
    padding:0;
    border:0;
    border-radius:7px;
    background:transparent;
    color:#aeb5ba;
    cursor:pointer;
    font-size:20px;
    line-height:1;
}

.checklist-delete:hover{
    color:#fff;
    background:#30353a;
}

.task-checklist-progress{
    margin:10px 0 3px;
}

.task-checklist-progress-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:5px;
    color:#aeb6bc;
    font-size:8px;
    font-weight:850;
    letter-spacing:.05em;
}

.task-checklist-progress-bar{
    height:4px;
    overflow:hidden;
    border-radius:999px;
    background:#3a3f45;
}

.task-checklist-progress-bar > span{
    display:block;
    height:100%;
    border-radius:inherit;
    background:var(--smart-brand-blue);
}

@media(max-width:620px){
    .checklist-add-form{
        grid-template-columns:1fr;
    }
}


/* SMART TASK 0.11.3 - More compact dashboard summary */
.dashboard-summary .summary-card{
    min-height:64px;
    padding-top:8px;
    padding-bottom:8px;
}


/* SMART TASK 0.11.4 - Branded trash button */
.task-trash{
    border:1px solid #0089A9 !important;
    background:rgba(0,137,169,.42) !important;
    color:#cfd3d7 !important;
}

.task-trash:hover{
    border-color:#0089A9 !important;
    background:rgba(0,137,169,.68) !important;
    color:#fff !important;
}


/* SMART TASK 0.11.5 - Task title brand color */
.task-title{
    color:#0089A9 !important;
}


/* SMART TASK 0.11.6 - Project/Area brand color */
.task-title{
    color:inherit !important;
}

.task-project{
    color:#0089A9 !important;
}


/* SMART TASK 0.11.7 - Restore manual task progress bar */
.task-progress{
    margin:10px 0 5px;
}

.task-progress-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:5px;
    color:#bfc7cc;
    font-size:8px;
    font-weight:800;
    letter-spacing:.055em;
    line-height:1;
}

.task-progress-bar{
    height:5px;
    overflow:hidden;
    border-radius:999px;
    background:#3a3f45;
}

.task-progress-bar > span{
    display:block;
    height:100%;
    border-radius:inherit;
    background:#0089A9;
    transition:width .2s ease;
}


/* SMART TASK 0.12 - Advanced notifications */
.notification-pref-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.notification-pref-choice{
    display:flex;
    align-items:flex-start;
    gap:10px;
    min-height:66px;
    padding:12px 14px;
    border:1px solid #353a40;
    border-radius:12px;
    background:#1d2024;
    cursor:pointer;
}

.notification-pref-choice:hover{
    border-color:#0089A9;
}

.notification-pref-choice input{
    margin-top:3px;
    accent-color:#0089A9;
}

.notification-pref-choice span{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.notification-pref-choice strong{
    color:#eef1f3;
    font-size:11px;
    letter-spacing:.04em;
}

.notification-pref-choice small{
    color:#9ea7ad;
    font-size:10px;
    line-height:1.35;
}

.notification-page-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

.notification-type{
    display:inline-flex;
    margin-bottom:6px;
    padding:3px 7px;
    border-radius:999px;
    color:#d7eef4;
    background:rgba(0,137,169,.22);
    border:1px solid rgba(0,137,169,.58);
    font-size:8px;
    font-weight:900;
    letter-spacing:.07em;
}

.notification-type-overdue{
    color:#ffd5d8;
    background:rgba(180,45,55,.18);
    border-color:rgba(218,76,87,.58);
}

.notification-type-task_completed{
    color:#d7f1e0;
    background:rgba(52,146,93,.18);
    border-color:rgba(79,177,119,.55);
}

@media(max-width:700px){
    .notification-pref-grid{
        grid-template-columns:1fr;
    }

    .notification-page-actions{
        align-items:stretch;
        flex-direction:column;
    }
}

/* Identità Tecnochef */
.brand-logo{max-width:175px;width:auto;height:auto;max-height:58px}
.login-brand-logo{max-width:260px;max-height:125px;width:100%;height:auto}
.login-card{max-width:460px}

/* Testata Tecnochef: logo +10%, intestazione personalizzata */
.topbar .brand-logo{max-width:193px;max-height:64px}

/* Tecnochef - rifinitura testata */
.topbar .brand{flex-direction:column;align-items:flex-start;gap:2px}
.topbar .brand-logo{max-width:180px;max-height:60px;width:auto;height:auto}
.topbar .brand-copy span{display:block;font-size:12px;font-weight:400;color:#777d85;margin-top:1px}
body.dashboard-page .page-title-dark h1{font-size:28px}

/* Tecnochef: logo testata ridotto di un ulteriore 10% (180px -> 162px) */
.topbar .brand-logo{max-width:162px;max-height:54px}
