* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1d23;
    --bg-secondary: #22262f;
    --bg-card: #2a2f3a;
    --bg-column: #1e222a;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a9;
    --border-color: #363d4a;
    --accent: #2563eb;
    --accent-hover: #3b82f6;
    --shadow: rgba(0, 0, 0, 0.3);
    --status-draft: #6b7280;
    --status-ready: #8b5cf6;
    --status-awaiting: #f59e0b;
    --status-wip: #3b82f6;
    --status-testing: #ec4899;
    --status-complete: #10b981;
    --error: #ef4444;
    --success: #10b981;
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-column: #e7ecf2;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #c9d4e0;
    --shadow: rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-forgot {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8125rem;
}

.auth-forgot a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-forgot a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-copied {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border-color: #10b981 !important;
}

.btn-copy {
    min-width: 70px;
    text-align: center;
}

.btn-small {
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.board-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 600px;
}

.board-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.875rem;
}

.board-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.board-btn:hover:not(.active) {
    border-color: var(--accent);
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.theme-toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    user-select: none;
}

.toggle-switch {
    width: 48px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .toggle-switch {
    background: var(--accent);
}

[data-theme="light"] .toggle-switch::after {
    transform: translateX(22px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 12px var(--shadow);
    display: none;
    z-index: 200;
}

.user-menu-dropdown.active {
    display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    color: var(--text-primary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
    background: var(--bg-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.user-avatar svg {
    width: 50%;
    height: 50%;
    fill: white;
}

.card-avatar svg {
    width: 50%;
    height: 50%;
    fill: white;
}

/* Board */
.board-container {
    padding: 1.5rem;
    overflow-x: auto;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    position: relative;
}

.board-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 36px;
}

.board-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 36px;
    height: 36px;
}

.team-settings-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    position: relative;
    top: 3px;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
    background: transparent;
}

.team-settings-btn svg {
    width: 24px;
    height: 24px;
    display: block;
}

.team-settings-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.add-story-btn {
    padding: 0.625rem 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.add-story-btn:hover {
    background: var(--accent-hover);
}

.add-story-btn svg {
    width: 16px;
    height: 16px;
}

/* User Filter */
.user-filter {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.user-filter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
    position: relative;
}

.user-filter-btn svg {
    width: 50%;
    height: 50%;
    fill: white;
}

.user-filter-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px var(--shadow);
}

.user-filter-btn.inactive {
    opacity: 0.35;
    filter: grayscale(60%);
}

.user-filter-btn.inactive:hover {
    opacity: 0.5;
}

.user-filter-tooltip {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color);
    z-index: 10;
}

.user-filter-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent var(--border-color) transparent;
}

.user-filter-tooltip::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 4px 4px 4px;
    border-style: solid;
    border-color: transparent transparent var(--bg-secondary) transparent;
}

.user-filter-btn:hover .user-filter-tooltip {
    opacity: 1;
    visibility: visible;
}

.story-card.user-hidden {
    display: none;
}

.board {
    display: flex;
    gap: 1rem;
    min-height: calc(100vh - 200px);
}

.column {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    background: var(--bg-column);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.column-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.column[data-status="draft"] .column-indicator { background: var(--status-draft); }
.column[data-status="ready"] .column-indicator { background: var(--status-ready); }
.column[data-status="awaiting"] .column-indicator { background: var(--status-awaiting); }
.column[data-status="wip"] .column-indicator { background: var(--status-wip); }
.column[data-status="testing"] .column-indicator { background: var(--status-testing); }
.column[data-status="complete"] .column-indicator { background: var(--status-complete); }

.column-count {
    background: var(--bg-card);
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.column-cards-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.column-cards-wrapper::before,
.column-cards-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 24px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.column-cards-wrapper::before {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-column) 0%, transparent 100%);
}

.column-cards-wrapper::after {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-column) 0%, transparent 100%);
}

.column-cards-wrapper.scroll-top::before {
    opacity: 1;
}

.column-cards-wrapper.scroll-bottom::after {
    opacity: 1;
}

.column-cards {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 6px 6px 6px 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.column-cards::-webkit-scrollbar {
    display: none;
}

/* Story Cards */
.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: grab;
    transition: all 0.2s;
    position: relative;
}

.story-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-2px);
}

.story-card:active {
    cursor: grabbing;
}

.story-card.sortable-ghost {
    opacity: 0.4;
}

.story-card.sortable-drag {
    box-shadow: 0 8px 24px var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.card-title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
    flex: 1;
    margin-right: 0.5rem;
}

.card-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.card-avatar svg {
    width: 50%;
    height: 50%;
    fill: white;
}

.card-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-assignee {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.card-age {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s;
}

.modal-story {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-story .modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.modal-title {
    font-size: 1.375rem;
    font-weight: 600;
    flex: 1;
}

.modal-title-input {
    font-size: 1.375rem;
    font-weight: 600;
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
}

.modal-title-input:focus {
    outline: none;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-field {
    margin-bottom: 1.5rem;
}

.modal-row-inline {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.modal-pair {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-label-inline {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.modal-pair .modal-select,
.modal-pair .modal-input {
    flex: 1;
}

.modal-value-inline {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.modal-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.modal-value {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.modal-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.modal-select:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.status-badge[data-status="draft"] { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.status-badge[data-status="ready"] { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.status-badge[data-status="awaiting"] { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-badge[data-status="wip"] { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-badge[data-status="testing"] { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.status-badge[data-status="complete"] { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge[data-status="draft"] .status-dot { background: var(--status-draft); }
.status-badge[data-status="ready"] .status-dot { background: var(--status-ready); }
.status-badge[data-status="awaiting"] .status-dot { background: var(--status-awaiting); }
.status-badge[data-status="wip"] .status-dot { background: var(--status-wip); }
.status-badge[data-status="testing"] .status-dot { background: var(--status-testing); }
.status-badge[data-status="complete"] .status-dot { background: var(--status-complete); }

.assignee-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.assignee-avatar-lg {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.assignee-avatar-lg svg {
    width: 50%;
    height: 50%;
    fill: white;
}

/* Comments Section */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.comments-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.comment {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.comment-avatar svg {
    width: 50%;
    height: 50%;
    fill: white;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.8125rem;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comment-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.add-comment {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: center;
}

.comment-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: none;
    font-family: inherit;
    height: 60px;
}

.comment-input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-submit {
    height: 48px;
    padding: 0 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9375rem;
    transition: background 0.2s;
}

.comment-submit:hover {
    background: var(--accent-hover);
}

/* Avatar colors */
.avatar-blue { background: #3b82f6; }
.avatar-green { background: #10b981; }
.avatar-purple { background: #8b5cf6; }
.avatar-orange { background: #f59e0b; }
.avatar-pink { background: #ec4899; }
.avatar-teal { background: #14b8a6; }
.avatar-red { background: #ef4444; }
.avatar-indigo { background: #6366f1; }
.avatar-cyan { background: #06b6d4; }
.avatar-amber { background: #d97706; }

/* Dashboard */
.dashboard-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    line-height: 40px;
    height: 40px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.team-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.team-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.team-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.team-card-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    gap: 1rem;
}

.personal-board-card {
    background: var(--accent);
    color: white;
    max-width: 240px;
    padding: 1.2rem;
}

.personal-board-card .team-card-title {
    font-size: 1rem;
}

.personal-board-card .team-card-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.dashboard-divider {
    height: 1px;
    background: #9aa0a9;
    margin-bottom: 2rem;
}

.dashboard-btn {
    font-size: 1rem;
    padding: 2px 1.25rem 0 1.25rem;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dashboard-btn.btn-secondary {
    min-width: 140px;
}

/* Join Team Modal */
.join-team-form {
    display: flex;
    gap: 0.75rem;
}

.join-team-form .form-input {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Team Management */
/* Team Settings Layout */
.team-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.team-layout-left {
    flex: 0 0 40%;
    max-width: 400px;
}

.team-layout-right {
    flex: 1;
}

.team-layout-right .team-settings:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .team-layout {
        flex-direction: column;
    }
    
    .team-layout-left {
        flex: none;
        width: 100%;
        max-width: none;
    }
}

.team-danger-zone {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.team-settings {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.team-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.team-invite-code {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.invite-code-display {
    background: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.member-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-name {
    font-weight: 500;
}

.member-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.member-actions {
    display: flex;
    gap: 0.5rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .board {
        gap: 0.75rem;
    }

    .column {
        min-width: 260px;
    }

    .modal-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-container {
        padding: 1rem;
    }
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.9375rem;
}

/* Priority Feature */
.priority-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    color: var(--text-secondary);
    align-self: center;
}

.priority-toggle:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.priority-toggle.active {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.priority-toggle svg {
    width: 18px;
    height: 18px;
}

.story-card.priority {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-card) 50%);
}

.story-card.priority:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px var(--shadow);
}

[data-theme="light"] .story-card.priority {
    border-color: #d97706;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08) 0%, var(--bg-card) 50%);
}

[data-theme="light"] .priority-toggle.active {
    color: #d97706;
    background: rgba(217, 119, 6, 0.12);
}

/* Story Number */
.story-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Due Date Indicator */
.due-date-display {
    justify-content: flex-end;
}

.due-date-indicator {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.due-date-indicator.due-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.due-date-indicator.due-soon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.due-date-indicator.due-urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.due-date-indicator.due-overdue {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    font-weight: 600;
}

[data-theme="light"] .due-date-indicator.due-ok {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

[data-theme="light"] .due-date-indicator.due-soon {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

[data-theme="light"] .due-date-indicator.due-urgent {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

[data-theme="light"] .due-date-indicator.due-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}