.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    padding: 0.35rem 0.6rem;
    border-radius: 0.45rem;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 19;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}
*,
*::before,
*::after {
    box-sizing: border-box;
}

body.theme-dark {
    margin: 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: #111827;
    color: #e5e7eb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 200px;
    min-width: 180px;
}

.app-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.app-tagline {
    font-size: 0.78rem;
    color: #9ca3af;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 230px;
    min-width: 200px;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.header-filter {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #9ca3af;
    flex: 1 1 220px;
    min-width: 200px;
}

.header-filter label {
    font-size: 0.82rem;
}

.project-filter {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    color: #f8fafc;
    font-size: 0.82rem;
    outline: none;
}

.project-filter:focus {
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}

.header-actions .login-actions {
    display: flex;
    gap: 0.5rem;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.auto-refresh-toggle input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 0.95rem;
    height: 0.95rem;
}

.user-menu {
    padding-left: 10px;
    border-left: 1px solid #4b5563;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    line-height: 0.85rem;
    color: #94a3b8;
}

.user-email {
    font-size: 0.78rem;
    color: #64748b;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-main {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}

.app-footer {
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-size: 0.83rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
}

.btn-secondary {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

.btn-link {
    background: transparent;
    color: #93c5fd;
    padding: 0.2rem 0.45rem;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.kanban-board {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    flex: 1;
}

.kanban-column {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 16px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 135px);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.1);
    flex: 1 1 240px;
    min-width: 220px;
    transition: max-width 0.2s ease, min-width 0.2s ease, padding 0.2s ease;
}

.kanban-column-header {
    border-left: 4px solid;
    padding-left: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.kanban-column-title {
    margin: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.column-title-short {
    display: none;
    font-size: 1.1rem;
}

.column-collapse-toggle {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    color: #cbd5f5;
    width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.column-collapse-toggle:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.6);
}

.column-collapse-toggle .toggle-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.kanban-column.collapsed {
    flex: 0 0 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 0.75rem 0.5rem;
}

.kanban-column.collapsed .kanban-column-body {
    display: none;
}

.kanban-column.collapsed .column-title-full {
    display: none;
}

.kanban-column.collapsed .column-title-short {
    display: inline;
}

.kanban-column-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.35) rgba(15, 23, 42, 0.4);
}

.kanban-column-body::-webkit-scrollbar {
    width: 6px;
}

.kanban-column-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 999px;
}

.kanban-column-body::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.45);
    border-radius: 999px;
}

.kanban-column-body::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.6);
}

.kanban-card {
    background: rgba(17, 24, 39, 0.9);
    border-radius: 12px;
    padding: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.kanban-card[draggable="true"] {
    cursor: grab;
}

.kanban-card[draggable="true"]:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-card.filtered-out {
    display: none !important;
}

.kanban-column-body.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border: 2px dashed rgba(59, 130, 246, 0.5);
}

.kanban-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 2px solid var(--project-color, transparent);
    opacity: 0.35;
    pointer-events: none;
}

.kanban-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
}

.kanban-card header {
    display: flex;
    margin-bottom: 0.55rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #a5b4fc;
    align-items: center;
    justify-content: space-between;
}

.kanban-card h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
}

.empty-column {
    color: #6b7280;
    text-align: center;
    font-size: 0.9rem;
}

.muted {
    color: #6b7280;
}

.badge,
.project-pill,
.type-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-right: 0.35rem;
    text-transform: uppercase;
}

.badge {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

.project-pill {
    background: rgba(20, 184, 166, 0.25);
    color: #5eead4;
}

.project-short {
    background: rgba(20, 184, 166, 0.25);
    color: #5eead4;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.kanban-card .project-short {
    background: color-mix(in srgb, var(--project-color, #5eead4) 18%, transparent);
    color: color-mix(in srgb, var(--project-color, #5eead4) 90%, white);
    border-color: color-mix(in srgb, var(--project-color, #5eead4) 45%, transparent);
}

.type-pill {
    background: rgba(244, 114, 182, 0.2);
    color: #f9a8d4;
}

.card-detail-info small {
    display: block;
    color: #94a3b8;
}

.card-detail-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.filter-empty {
    color: #6b7280;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.card-detail .project-pill {
    background: color-mix(in srgb, var(--project-color, #5eead4) 18%, transparent);
    color: color-mix(in srgb, var(--project-color, #5eead4) 90%, white);
    border: 1px solid color-mix(in srgb, var(--project-color, #5eead4) 45%, transparent);
}

@media (max-width: 1400px) {
    .app-title {
        font-size: 1rem;
    }

    .app-tagline {
        font-size: 0.69rem;
    }

    .header-actions {
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.75rem;
    }

    .auto-refresh-toggle {
        font-size: 0.72rem;
    }
}

dialog {
    border: none;
    border-radius: 18px;
    padding: 0;
    background: rgba(17, 24, 39, 0.95);
    color: #f3f4f6;
    width: min(600px, 90vw);
    box-shadow: 0 30px 80px rgba(8, 47, 73, 0.45);
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
}

.modal-close {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.75rem 0 0;
}

.modal-close button {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-content {
    padding: 0 1.75rem 1.75rem;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-body {
    display: grid;
    gap: 0.75rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.form-field label {
    font-size: 0.85rem;
    color: #cbd5f5;
}

input[type="text"],
textarea,
select,
input[type="color"] {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    color: #f8fafc;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="color"] {
    padding: 0.25rem;
    width: 80px;
    height: 30px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 8px;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.form-feedback {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #fca5a5;
}

.hidden {
    display: none !important;
}

.admin-panel {
    display: grid;
    gap: 1.5rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.admin-card {
    background: rgba(15, 23, 42, 0.9);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 45px rgba(8, 47, 73, 0.35);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.65rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(71, 85, 105, 0.35);
}

.color-pill {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.auth-error {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    background: rgba(15, 23, 42, 0.85);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.25);
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .kanban-column {
        height: auto;
        max-height: none;
    }
}

@media (max-width: 1400px) {
    .kanban-column {
        height: calc(100vh - 135px);
    }
}

@media (max-width: 768px) {
    .kanban-column {
        height: calc(100vh - 135px);
        min-width: 200px;
    }
}

