:root {
    --bg0: #0c1020;
    --bg1: #0b0f24;
    --card: #141b3a;
    --accent: #6a7dff;
    --accent2: #22d6c8;
    --text: #eef3ff;
    --muted: #9eabc9;
    --danger: #ff6585;
    --warn: #ffd166;
    --ok: #56f0a5;
    --deleted: #ff9fb2;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    color: var(--text);
    font-family: Inter, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(120vmax 80vmax at 20% -10%, rgba(106, 125, 255, .20), transparent 60%),
        radial-gradient(110vmax 70vmax at 120% 10%, rgba(34, 214, 200, .18), transparent 60%),
        linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

header {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px) saturate(130%);
    background: linear-gradient(180deg, rgba(10, 14, 30, .75), rgba(10, 14, 30, .35));
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px
}

.title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

.title h1 {
    margin: 0;
    font-size: clamp(20px, 3vw, 34px)
}

.actions-bar {
    display: flex;
    gap: 10px;
    align-items: center
}

.btn {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: linear-gradient(180deg, var(--accent), #4f60ff);
    color: white;
    cursor: pointer;
    transition: transform .15s ease, filter .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05)
}

.icon-btn {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .1)
}

.icon-btn:active {
    transform: scale(.96)
}

.danger {
    border-color: rgba(255, 101, 133, .35);
    background: rgba(255, 101, 133, .08);
    color: #ffd7e0
}

.muted {
    opacity: .75
}

/* Login centered and button centered */
#loginPanelWrap {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center
}

#loginPanel {
    width: min(560px, 92vw);
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    padding: 20px
}

.field {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px
}

.field input {
    padding: 12px 42px 12px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .25);
    color: var(--text);
    width: 100%;
}

.password-wrap {
    position: relative
}

.eye {
    position: absolute;
    right: 10px;
    top: 50%;
    /* transform: translateY(-50%); */
    height: 24px;
    width: 24px;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: .85;
    background: transparent;
    border: 0;
    color: var(--text)
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center
}

#loginForm .btn {
    align-self: center
}

/* Empty state hidden by default; JS shows it only after auth and when zero containers */
#hero {
    display: none;
    /* min-height: 30vh; */
    display: flex;
    align-items: center;
    justify-content: center
}

.heroBox {
    border: 1px dashed rgba(255, 255, 255, .2);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center
}

.heroHelp {
    margin-top: 8px
}

.hscroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px;
    scroll-snap-type: x proximity;
    align-items: flex-start;
    /* prevent equal-height stretching */
}

.hscroll>.card {
    scroll-snap-align: start
}

.hscroll::-webkit-scrollbar {
    height: 10px
}

.hscroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .15);
    border-radius: 10px
}

.card {
    min-width: 320px;
    max-width: 360px;
    flex: 0 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .04);
    /* no fixed height so it grows only for its own content */
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px
}

.small {
    font-size: 12px;
    color: var(--muted)
}

/* Filter buttons as a button group under the input row */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 6px 0 8px
}

.tab {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    cursor: pointer;
    background: rgba(255, 255, 255, .04)
}

.tab.active {
    background: var(--accent);
    color: #fff;
    border-color: transparent
}

/* Add bar */
.add-bar {
    display: flex;
    gap: 8px;
    margin: 10px 0 8px;
    align-items: center
}

.add-bar input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .25);
    color: var(--text)
}

.micBadge {
    font-size: 12px;
    color: #111;
    background: var(--warn);
    border-radius: 999px;
    padding: 4px 8px;
    display: none;
    margin-left: 6px
}

/* Task lists */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px
}

li {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(0, 0, 0, .25);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.dragging {
    opacity: .6
}

.status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06)
}

.status.processing {
    color: #1a1a1a;
    background: var(--warn)
}

.status.completed {
    color: #0b1a12;
    background: var(--ok)
}

.status.deleted {
    color: #2b0f14;
    background: var(--deleted)
}

.editable {
    outline: none
}

.task-title[contenteditable="true"] {
    cursor: text
}

/* Toast & dialogs */
.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: #111a;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .15);
    z-index: 20;
    display: none
}

dialog {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(14, 16, 36, .95), rgba(14, 16, 36, .92));
    color: var(--text);
    padding: 18px;
    width: min(460px, 92vw);
    box-shadow: 0 25px 60px rgba(0, 0, 0, .5)
}

dialog::backdrop {
    background: rgba(0, 0, 0, .6)
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px
}

/* Focus outlines */
button:focus,
input:focus,
[contenteditable="true"]:focus,
.tab:focus {
    outline: 2px solid var(--accent2);
    outline-offset: 2px
}

/* Mobile */
@media (max-width:600px) {
    .card {
        min-width: 88vw
    }
    .field {
    width: 350px;
}
}
@media (max-width:400px) {
    .card {
        min-width: 88vw
    }
    .field {
    width: 250px;
}
}
