:root {
    --surface-bg: #f2f4f7;
    --panel-bg: #ffffff;
    --panel-border: rgba(15, 23, 42, 0.08);
    --text-primary: #1f2937;
    --text-secondary: rgba(31, 41, 55, 0.65);
    --accent: #25d366;
    --accent-dark: #128c7e;
    --danger: #ff6b6b;
    --danger-dark: #ff4f4f;
    --bubble-outgoing: rgba(37, 211, 102, 0.18);
    --bubble-incoming: rgba(15, 23, 42, 0.06);
    font-family: "Inter", "SF Pro Text", "San Francisco", "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--surface-bg);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    padding: 0;
}

#root {
    flex: 1;
    width: 100%;
    height: 100%;
}

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    background: var(--surface-bg);
}

.auth-shell {
    width: min(480px, 100%);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-card h1 {
    margin: 0 0 12px;
    font-size: 1.6rem;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-form input {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
}

.auth-form input[readonly] {
    opacity: 0.7;
}

.auth-form button,
.auth-actions button {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.auth-actions button:first-child {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.auth-form button:hover,
.auth-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.25);
}

.auth-dev-banner {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(37, 211, 102, 0.12);
    border: 1px dashed rgba(18, 140, 126, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.auth-dev-banner span {
    color: var(--accent-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-dev-banner strong {
    font-size: 1.4rem;
    color: var(--accent-dark);
}

.auth-profile-summary {
    margin: 8px 0 0;
    font-size: 0.95rem;
    text-align: center;
    color: var(--text-secondary);
}

.first-task-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(48px, 8vh, 110px) 18px;
    background: #fbf9f5;
}

.first-task-container {
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(32px, 6vw, 48px);
}

.first-task-logo {
    height: clamp(200px, 32vw, 320px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.first-task-logo img {
    max-height: clamp(260px, 40vw, 460px);
    width: auto;
    object-fit: contain;
    display: block;
}

.first-task-card {
    width: 100%;
    border-radius: 28px;
    background: linear-gradient(135deg, #fdfcfb, #f6eee5);
    border: 1px solid #dcd4c8;
    box-shadow:
        0 18px 32px rgba(35, 27, 18, 0.16),
        -6px -6px 18px rgba(255, 255, 255, 0.7);
    padding: clamp(28px, 5vw, 36px);
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vw, 28px);
}

.first-task-card__header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.first-task-card__header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    color: #222;
    text-align: left;
}

.first-task-card__header p {
    margin: 0;
    font-size: 1rem;
    color: rgba(34, 34, 34, 0.7);
    line-height: 1.5;
}

.first-task-primary {
    width: 100%;
    border: none;
    border-radius: 18px;
    padding: 18px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #28d16c, #159f63);
    box-shadow: 0 20px 48px rgba(21, 159, 99, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.first-task-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 60px rgba(21, 159, 99, 0.42);
}

.first-task-form {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3.5vw, 22px);
}

.first-task-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(34, 34, 34, 0.65);
}

.first-task-form input,
.first-task-form select,
.first-task-form textarea {
    background: #fdfbf7;
    border: 1px solid rgba(220, 212, 200, 0.9);
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 1rem;
    color: #222;
    box-shadow: inset 0 1px 3px rgba(35, 27, 18, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.first-task-form select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(34, 34, 34, 0.4) 50%),
        linear-gradient(135deg, rgba(34, 34, 34, 0.4) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 5px), calc(100% - 14px) calc(50% - 5px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 48px;
}

.first-task-form textarea {
    resize: vertical;
    min-height: 140px;
}

.first-task-form input:focus,
.first-task-form select:focus,
.first-task-form textarea:focus {
    outline: none;
    border-color: #19b85b;
    box-shadow: 0 0 0 2px rgba(40, 209, 108, 0.12);
}

.first-task-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.first-task-actions button {
    flex: 1;
    border-radius: 16px;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.first-task-actions button:last-child {
    background: linear-gradient(135deg, #28d16c, #159f63);
    color: #fff;
    box-shadow: 0 18px 40px rgba(21, 159, 99, 0.32);
}

.first-task-actions button:last-child:hover {
    transform: translateY(-1px);
}

.first-task-actions button:first-child {
    background: rgba(250, 244, 236, 0.7);
    color: rgba(34, 34, 34, 0.7);
    border: 1px solid rgba(220, 212, 200, 0.9);
}

.first-task-actions button:first-child:hover {
    transform: translateY(-1px);
}

.first-task-error {
    margin: 0;
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.35);
    color: #b3261e;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
}

@media (max-width: 600px) {
    .first-task-card {
        padding: 24px;
        border-radius: 24px;
    }

    .first-task-card__header h1 {
        text-align: center;
    }

    .first-task-card__header p {
        text-align: center;
    }

    .first-task-form input,
    .first-task-form select,
    .first-task-form textarea {
        border-radius: 14px;
        padding: 12px 14px;
    }
}

@media (max-width: 600px) {
    .auth-screen {
        padding: 32px 12px;
    }
    .auth-shell {
        padding: 24px;
        border-radius: 20px;
    }
}

.app-shell {
    display: flex;
    background: var(--panel-bg);
    border-radius: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    box-shadow: none;
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
    }
}

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 24px 20px 80px;
    gap: 20px;
    background: rgba(15, 23, 42, 0.03);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-resizer {
    width: 6px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    position: relative;
}

.sidebar-resizer::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(15, 23, 42, 0.08);
    transform: translateX(-50%);
}

.sidebar-resizer:hover::after {
    background: rgba(37, 211, 102, 0.4);
}

@media (max-width: 960px) {
    .sidebar {
        width: 100% !important;
        height: auto;
    }
    .sidebar-resizer {
        display: none;
    }
}

.sidebar-search input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.new-task-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    border-radius: 16px;
    padding: 10px 18px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.new-task-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.3);
}

.identity-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.identity-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.identity-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.identity-user strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.identity-user span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.identity-actions {
    display: flex;
    justify-content: flex-end;
}

.logout-btn {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.identity-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}


.task-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 6px;
    flex: 1;
    padding-bottom: 96px;
}

.task-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-group__header {
    margin: 8px 4px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.task-group__header button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.task-group__header button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.22);
}

.task-group__header-title {
    display: inline-flex;
    align-items: center;
}

.task-group__header-pill {
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.task-group__header-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    font-size: 0.68rem;
}

.task-group__header-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.task-group:first-of-type .task-group__header {
    margin-top: 0;
}

.task-pill {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, border 0.15s ease, background 0.15s ease;
    text-align: left;
    outline: none;
}

.task-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 211, 102, 0.35);
    background: rgba(37, 211, 102, 0.12);
}

.task-pill.active {
    border-color: rgba(37, 211, 102, 0.5);
    background: rgba(37, 211, 102, 0.18);
}

.task-pill__indicator {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--accent-dark);
    background: rgba(37, 211, 102, 0.18);
    flex-shrink: 0;
}

.task-pill__indicator--assignee {
    background: rgba(37, 211, 102, 0.18);
    color: var(--accent-dark);
}

.task-pill__indicator--requester {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
}

.task-pill__indicator--neutral {
    background: rgba(15, 23, 42, 0.08);
    color: rgba(15, 23, 42, 0.6);
}

.task-pill__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-pill__title {
    font-weight: 400;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-pill__description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.2);
}

.status-dot.status-open {
    background: var(--text-secondary);
}

.status-dot.status-pending {
    background: #f59e0b;
}

.status-dot.status-in_progress {
    background: var(--accent);
}

.status-dot.status-closed {
    background: #64748b;
}

.status-dot.status-unassigned {
    background: var(--danger);
}

.task-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid transparent;
    cursor: pointer;
    transition: border 0.2s ease, background 0.2s ease;
}

.task-card.active {
    border-color: rgba(37, 211, 102, 0.4);
    background: rgba(37, 211, 102, 0.15);
}

.task-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.task-card h2 {
    margin: 0;
    font-size: 1rem;
}

.task-card p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.task-card__meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-chip {
    background: rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 2px 10px;
    line-height: 1.4;
}


.main-panel {
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    height: 100vh;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: 2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 36px rgba(37, 211, 102, 0.28);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 50;
}

.fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(37, 211, 102, 0.32);
}

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

.main-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

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

.user-panel {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.04em;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
    min-width: 180px;
    z-index: 10;
}

.user-menu span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-menu button {
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
    cursor: pointer;
}

.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 32px;
    overflow-y: auto;
}

.task-details {
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.task-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.task-editor label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.archive-card {
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.archive-count {
    background: rgba(37, 211, 102, 0.18);
    color: var(--accent-dark);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 6px;
}

.archive-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
}

.archive-title {
    flex: 1;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
}

.archive-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.task-editor input,
.task-editor select,
.task-editor textarea {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.task-editor input:disabled,
.task-editor select:disabled,
.task-editor textarea:disabled {
    opacity: 0.6;
    background: rgba(15, 23, 42, 0.02);
    cursor: not-allowed;
}

.task-editor textarea {
    min-height: 160px;
    resize: vertical;
}

.task-editor select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%230f172a' d='M5 6a1 1 0 0 1-.71-.29l-4-4A1 1 0 0 1 1.41.59L5 4.17 8.59.59A1 1 0 0 1 10 1.71l-4 4A1 1 0 0 1 5 6Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 6px;
}

.task-editor select::-ms-expand {
    display: none;
}

.select-static {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.category-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-custom input {
    flex: 1;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.category-custom .button-pill {
    padding: 10px 18px;
    border-radius: 16px;
    min-width: 120px;
    justify-content: center;
}

.button-pill {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 211, 102, 0.28);
}

.button-pill:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-pill.danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    box-shadow: 0 16px 30px rgba(255, 107, 107, 0.28);
}

.button-pill.danger:hover {
    box-shadow: 0 18px 32px rgba(255, 107, 107, 0.34);
}

.button-pill.ghost {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.button-pill.ghost:hover {
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
    background: rgba(37, 211, 102, 0.12);
}

.button-pill.success {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.button-pill.success:hover {
    box-shadow: 0 16px 30px rgba(37, 211, 102, 0.28);
}

.button-pill.compact {
    min-width: auto;
    padding: 10px 16px;
}

.editor-full {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.editor-actions .button-pill {
    padding: 10px 18px;
}

.read-only-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.assign-inline {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.assign-inline select {
    flex: 1;
    max-width: 260px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 10px 14px;
}

.assign-inline button {
    padding: 12px 18px;
}

.task-actions textarea {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.9rem;
    min-height: 80px;
    resize: vertical;
}

.chat-panel {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
}

.chat-body {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.chat-body .bubble {
    font-size: 0.85rem;
    padding: 10px 12px;
}

.chat-composer {
    margin-top: 8px;
    display: flex;
    gap: 12px;
}

.chat-composer input {
    flex: 1;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.chat-composer button {
    padding: 12px 18px;
}

.conversation {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.task-overview {
    padding: 20px 24px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-overview__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.task-overview__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-day {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chat-day::before,
.chat-day::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(15, 23, 42, 0.12);
}

.bubble {
    max-width: min(320px, 65%);
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bubble.outgoing {
    margin-left: auto;
    background: var(--bubble-incoming);
    border-bottom-right-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.bubble.incoming {
    background: var(--bubble-incoming);
    border-bottom-left-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.bubble.system {
    max-width: min(360px, 70%);
    text-align: center;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.06);
    border: none;
}

.bubble.system .reason {
    margin-top: 4px;
    color: var(--text-secondary);
    font-style: normal;
}

.bubble .message {
    word-break: break-word;
}

.bubble .meta {
    font-size: 0.72rem;
    color: rgba(15, 23, 42, 0.55);
    align-self: flex-end;
}

.bubble.system .meta {
    position: static;
    margin-top: 4px;
}

.action-buttons .icon-button {
    min-width: 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: none;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-buttons .icon-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.25);
}

.action-buttons .icon-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.task-pill.has-update .task-pill__title {
    font-weight: 700;
}

.task-pill .pill-update {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--accent-dark);
    background: rgba(37, 211, 102, 0.18);
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.task-pill .pill-rejected {
    margin-left: auto;
    font-size: 0.7rem;
    color: #d14343;
    background: rgba(209, 67, 67, 0.18);
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.task-pill .pill-returned {
    margin-left: auto;
    font-size: 0.7rem;
    color: #d97706;
    background: rgba(217, 119, 6, 0.18);
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.task-details-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.task-details-grid strong {
    color: var(--text-primary);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.12);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pill span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.15);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-chip.status-open { color: #16a34a; background: rgba(22, 163, 74, 0.14); }
.status-chip.status-pending { color: #c2410c; background: rgba(194, 65, 12, 0.16); }
.status-chip.status-in_progress { color: #2563eb; background: rgba(37, 99, 235, 0.16); }
.status-chip.status-closed,
.status-chip.status-close { color: #475569; background: rgba(71, 85, 105, 0.18); }

.actions-panel {
    border-top: 1px solid var(--panel-border);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: rgba(15, 23, 42, 0.02);
}

.actions-panel h3 {
    margin: 0;
    font-size: 1.05rem;
}

.assign-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assign-row {
    display: flex;
    gap: 12px;
}

.assign-row select {
    flex: 1;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    padding: 12px 16px;
    color: var(--text-primary);
}

.assign-row button {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    border-radius: 16px;
    padding: 12px 18px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}


.action-buttons button:hover,
.assign-row button:hover,
.task-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(37, 211, 102, 0.22);
}

.task-form {
    border-top: 1px solid var(--panel-border);
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--panel-bg);
}

.task-form h3 {
    margin: 0;
    font-size: 1.05rem;
}

.task-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.task-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.task-form input,
.task-form textarea,
.task-form select,
.actions-panel textarea {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
}

.task-form textarea,
.actions-panel textarea {
    min-height: 96px;
}

.task-form button {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    border-radius: 18px;
    padding: 14px 18px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.error-banner {
    margin: 0 32px 24px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 107, 107, 0.16);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ffe8e8;
    font-size: 0.9rem;
}

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

.empty-state h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.12);
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

@keyframes pulse {
    0% { opacity: 0.35; }
    50% { opacity: 0.8; }
    100% { opacity: 0.35; }
}

@media (max-width: 960px) {
    .fab {
        bottom: 18px;
        left: 18px;
    }
}


@supports (-webkit-touch-callout: none) {
    .task-editor select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        padding-right: 40px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%230f172a' d='M5 6a1 1 0 0 1-.71-.29l-4-4A1 1 0 0 1 1.41.59L5 4.17 8.59.59A1 1 0 0 1 10 1.71l-4 4A1 1 0 0 1 5 6Z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        background-size: 10px 6px;
    }

    .task-editor select::-ms-expand {
        display: none;
    }

    .date-input {
        position: relative;
        color: transparent;
        background-image: none;
    }

    .date-input::before {
        content: attr(placeholder);
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(15, 23, 42, 0.45);
        pointer-events: none;
    }

    .date-input.has-value,
    .date-input:focus {
        color: var(--text-primary);
    }

    .date-input.has-value::before,
    .date-input:focus::before {
        display: none;
    }

    .date-input::-webkit-datetime-edit-fields-wrapper,
    .date-input::-webkit-datetime-edit-text,
    .date-input::-webkit-datetime-edit-year-field,
    .date-input::-webkit-datetime-edit-month-field,
    .date-input::-webkit-datetime-edit-day-field {
        color: inherit;
    }
}
