/* ==========================================
   SHTAB — Task Management System
   Modern, clean design
   ========================================== */

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;

    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #334155;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #eef2ff;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   AUTH PAGES
   ========================================== */

.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-tertiary);
    font-size: 14px;
    margin-top: 4px;
}

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

.auth-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    border: 1px solid #fecaca;
    margin-bottom: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-tertiary);
}

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

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

/* ==========================================
   FORMS
   ========================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input, input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.input:focus, input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.input-sm {
    padding: 6px 10px;
    font-size: 13px;
}

textarea {
    resize: vertical;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

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

.btn-danger-icon:hover {
    background: #fef2f2;
    color: var(--danger);
}

/* ==========================================
   LAYOUT
   ========================================== */

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-logo svg {
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.sidebar-section {
    margin-top: 24px;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    margin-bottom: 6px;
}

.sidebar-section-header span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sidebar-text);
    opacity: 0.6;
}

.sidebar-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    opacity: 0.6;
}

.sidebar-add-btn:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
    opacity: 1;
}

.sidebar-projects {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-project {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.sidebar-project:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-project.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.project-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-dot-lg {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text-active);
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--sidebar-text);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sidebar-logout:hover {
    background: var(--sidebar-hover);
    color: var(--danger);
}

/* ==========================================
   AVATAR
   ========================================== */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-xs {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.avatar-img-xs {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    flex: 1;
    overflow: auto;
    padding: 28px 32px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================
   HOME PAGE
   ========================================== */

.home-content {
    max-width: 960px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.project-card-header {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.project-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.project-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.project-card-header p {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.project-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    gap: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    color: var(--text-tertiary);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-tertiary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==========================================
   KANBAN BOARD
   ========================================== */

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: calc(100vh - 160px);
    align-items: flex-start;
}

.kanban-column {
    width: 310px;
    min-width: 310px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 160px);
}

.kanban-column-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.kanban-column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.column-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.column-count {
    background: var(--bg-hover);
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 99px;
}

.kanban-column-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition);
}

.kanban-column:hover .kanban-column-actions {
    opacity: 1;
}

.kanban-tasks {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px;
}

/* scrollbar */
.kanban-tasks::-webkit-scrollbar {
    width: 4px;
}
.kanban-tasks::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-tasks::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 99px;
}

/* old kanban-add-task moved to TASK GROUPS section */

/* ==========================================
   TASK CARD
   ========================================== */

.task-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.task-card.sortable-ghost {
    opacity: 0.4;
    transform: rotate(2deg);
}

.task-card.sortable-chosen {
    box-shadow: var(--shadow-lg);
}

.task-priority-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.priority-urgent {
    background: var(--danger);
}

.priority-high {
    background: var(--warning);
}

.task-card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-due-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.task-due-date.overdue {
    color: var(--danger);
}

.task-comments-count {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==========================================
   MODAL
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

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

.modal-sm {
    max-width: 460px;
}

.modal-lg {
    max-width: 860px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

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

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ==========================================
   TASK MODAL
   ========================================== */

.task-modal-title-wrap {
    flex: 1;
    margin-right: 12px;
}

.task-modal-title {
    width: 100%;
    border: none;
    font-size: 20px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    padding: 0;
}

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

.task-modal-body {
    display: flex;
    gap: 24px;
}

.task-modal-main {
    flex: 1;
    min-width: 0;
}

.task-modal-section {
    margin-bottom: 28px;
}

.task-modal-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.task-modal-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-left: 1px solid var(--border-light);
    padding-left: 24px;
}

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

.task-meta-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.task-meta-value {
    font-size: 13px;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    background: var(--accent-light);
    color: var(--accent);
}

/* Quill editor overrides */
#taskDescriptionEditor {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 160px;
}

#taskDescriptionEditor .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--bg-tertiary);
}

#taskDescriptionEditor .ql-container {
    border: none;
    font-family: inherit;
    font-size: 14px;
}

#taskDescriptionEditor .ql-editor {
    min-height: 120px;
    padding: 14px;
    line-height: 1.7;
}

#taskDescriptionEditor .ql-editor.ql-blank::before {
    color: var(--text-tertiary);
    font-style: normal;
}

/* Comments */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.comment-item {
    display: flex;
    gap: 10px;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 11px;
    color: var(--text-tertiary);
}

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

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.comment-form textarea {
    width: 100%;
}

/* ==========================================
   COLOR PICKER
   ========================================== */

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-secondary);
}

/* ==========================================
   CONTEXT MENU
   ========================================== */

.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 2000;
    display: none;
    min-width: 160px;
}

.context-menu.active {
    display: block;
}

.context-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.context-menu button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.context-menu button.danger {
    color: var(--danger);
}

.context-menu button.danger:hover {
    background: #fef2f2;
}

/* ==========================================
   SCROLLBAR
   ========================================== */

.main-content::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 99px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
}

/* ==========================================
   COLUMN NAME LINK
   ========================================== */

.column-name-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1.5px dashed transparent;
    transition: all var(--transition);
}

.column-name-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ==========================================
   BACK LINK
   ========================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

/* ==========================================
   STATUS BADGE ON CARDS
   ========================================== */

.task-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.status-created       { background: #f1f5f9; color: #64748b; }
.status-planned       { background: #eff6ff; color: #3b82f6; }
.status-in_progress   { background: #fffbeb; color: #d97706; }
.status-blocked       { background: #fef2f2; color: #ef4444; }
.status-ball_other_side { background: #f5f3ff; color: #7c3aed; }
.status-completed     { background: #ecfdf5; color: #059669; }

/* ==========================================
   TEAM TABLE
   ========================================== */

.team-content {
    max-width: 960px;
}

.team-table-wrap {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
}

.team-table thead {
    background: var(--bg-tertiary);
}

.team-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.team-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-top: 1px solid var(--border-light);
    vertical-align: middle;
}

.team-table tr:hover {
    background: var(--bg-tertiary);
}

.team-table tr.user-inactive {
    opacity: 0.5;
}

.user-name-cell {
    font-weight: 500;
}

.user-username-cell {
    color: var(--text-tertiary);
    font-family: monospace;
    font-size: 13px;
}

.user-email-cell {
    color: var(--text-secondary);
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}

.role-superadmin {
    background: linear-gradient(135deg, #eef2ff, #faf5ff);
    color: #6366f1;
    border: 1px solid #c7d2fe;
}

.role-admin {
    background: #eff6ff;
    color: #3b82f6;
}

.role-member {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.status-active {
    background: var(--success);
}

.status-disabled {
    background: var(--text-tertiary);
}

/* ==========================================
   SIDEBAR LOGO LINK
   ========================================== */

.sidebar-logo-link {
    text-decoration: none;
    border-radius: var(--radius-md);
    padding: 6px 8px;
    margin: -6px -8px;
    transition: background var(--transition);
}

.sidebar-logo-link:hover {
    background: var(--sidebar-hover);
}

/* ==========================================
   SETTINGS LAYOUT
   ========================================== */

.settings-layout {
    display: flex;
    height: 100%;
    min-height: calc(100vh - 56px);
    margin: -28px -32px;
    width: calc(100% + 64px);
    min-height: 100vh;
}

.settings-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.settings-sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-light);
}

.settings-sidebar-header .back-link {
    margin-bottom: 12px;
}

.settings-sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-nav {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.settings-nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

.settings-nav-link.active svg {
    color: var(--accent);
}

/* ==========================================
   SETTINGS CONTENT
   ========================================== */

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
}

.settings-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.settings-content-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-content-header p {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ==========================================
   TEAM GRID (CARD LAYOUT)
   ========================================== */

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

.team-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.team-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

.team-card-inactive {
    opacity: 0.55;
}

.team-card-inactive:hover {
    opacity: 0.75;
}

.team-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 0;
    position: relative;
}

.team-card-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.team-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.team-card-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.team-card-inactive-badge {
    position: absolute;
    bottom: -2px;
    right: -4px;
    background: var(--text-tertiary);
    color: white;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.team-card-info {
    flex: 1;
    min-width: 0;
}

.team-card-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-card-username {
    font-size: 13px;
    color: var(--text-tertiary);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.team-card-menu {
    position: absolute;
    top: 16px;
    right: 16px;
    opacity: 0;
    transition: opacity var(--transition);
}

.team-card:hover .team-card-menu {
    opacity: 1;
}

.team-card-details {
    padding: 12px 20px;
}

.team-card-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.team-card-detail svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.team-card-footer {
    padding: 12px 20px 16px;
}

/* ==========================================
   AVATAR UPLOAD
   ========================================== */

.avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-upload-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-upload-preview span {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.3;
}

.avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.avatar-upload-btn {
    cursor: pointer;
}

/* ==========================================
   BUTTON DANGER
   ========================================== */

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger:disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ==========================================
   TEAM LIST (SETTINGS)
   ========================================== */

.team-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.team-search-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.team-search-wrap svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.team-search-input {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    box-shadow: none !important;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 16px;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.team-row:last-child {
    border-bottom: none;
}

.team-row:hover {
    background: var(--bg-tertiary);
}

.team-row-inactive {
    opacity: 0.5;
}

.team-row-inactive:hover {
    opacity: 0.7;
}

.team-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.team-row-avatar {
    position: relative;
    flex-shrink: 0;
}

.team-row-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.project-settings-color {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.team-row-off {
    position: absolute;
    bottom: -2px;
    right: -4px;
    background: var(--text-tertiary);
    color: white;
    font-size: 7px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.team-row-info {
    min-width: 0;
}

.team-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.team-row-username {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.team-row-position {
    font-size: 12px;
    color: var(--text-secondary);
}

.team-row-position::before {
    content: '·';
    margin-right: 8px;
    color: var(--text-tertiary);
}

.team-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.team-row-email {
    font-size: 13px;
    color: var(--text-tertiary);
    display: none;
}

@media (min-width: 960px) {
    .team-row-email {
        display: block;
    }
}

.team-row-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition);
}

.team-row:hover .team-row-actions {
    opacity: 1;
}

/* ==========================================
   TASK GROUPS
   ========================================== */

.task-group {
    background: rgba(255,255,255,0.7);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.task-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    cursor: pointer;
    transition: background var(--transition);
    user-select: none;
}

.task-group-header:hover {
    background: linear-gradient(135deg, #eef2ff, #e8ecf4);
}

.task-group-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    letter-spacing: -0.01em;
}

.task-group-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.06);
    padding: 2px 7px;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}

.task-group-tasks {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 36px;
    background: rgba(241,245,249,0.4);
}

.task-group-tasks .task-card {
    border: 1px solid var(--border-light);
    box-shadow: none;
}

.task-group-tasks .task-card:hover {
    box-shadow: var(--shadow-sm);
}

/* Group weekly highlight */
.task-group-weekly {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.task-group-weekly .task-group-header {
    background: linear-gradient(135deg, #eef2ff, #e8ecf4) !important;
}

.task-group-weekly .task-group-name::after {
    content: ' 📅';
    font-size: 11px;
}

.kanban-add-task {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    margin: 0 10px 10px;
    background: transparent;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.kanban-add-task:hover {
    background: var(--bg-secondary);
    color: var(--accent);
    border-color: var(--accent);
}

.kanban-add-column {
    min-width: 80px;
    width: 80px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all var(--transition);
    border: 2px dashed var(--border-color);
    min-height: 200px;
    flex-shrink: 0;
}

.kanban-add-column:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}

/* ==========================================
   TASK CARD — FLAGGED
   ========================================== */

.task-card-flagged {
    border-color: var(--danger) !important;
    background: #fef2f2 !important;
}

.task-card-flagged .task-card-title {
    font-weight: 700;
    color: var(--danger);
}

.task-flag-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--danger);
}

.task-flag-icon {
    color: var(--danger);
    display: inline-flex;
    align-items: center;
}

/* Flag button in modal header */
.btn-flag {
    color: var(--text-tertiary);
}

.btn-flag:hover {
    color: var(--danger);
    background: #fef2f2;
}

.btn-flag.flagged {
    color: var(--danger);
    background: #fef2f2;
}

.btn-flag.flagged svg {
    fill: var(--danger);
}

/* ==========================================
   TASK CATEGORY BADGES
   ========================================== */

.task-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.category-money_now {
    background: #ecfdf5;
    color: #059669;
}

.category-money_later {
    background: #eff6ff;
    color: #3b82f6;
}

.category-support {
    background: #f5f3ff;
    color: #7c3aed;
}

/* ==========================================
   COST PICKER (₽₽₽)
   ========================================== */

.cost-picker {
    display: flex;
    gap: 4px;
}

.cost-ruble {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.cost-ruble:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cost-ruble.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ==========================================
   ASSIGNEE PICKER
   ========================================== */

.assignee-picker {
    position: relative;
}

.assignee-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: border-color var(--transition);
}

.assignee-current:hover {
    border-color: var(--accent);
}

.assignee-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 260px;
    overflow: hidden;
    flex-direction: column;
}

.assignee-dropdown.open {
    display: flex;
}

.assignee-search {
    border: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-radius: 0 !important;
    padding: 8px 12px !important;
    font-size: 13px;
    box-shadow: none !important;
}

.assignee-options {
    overflow-y: auto;
    max-height: 210px;
    padding: 4px;
}

.assignee-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
}

.assignee-option:hover {
    background: var(--bg-tertiary);
}

.assignee-option.selected {
    background: var(--accent-light);
}

.assignee-option-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.assignee-option-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.assignee-option-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignee-option-pos {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ==========================================
   SIDEBAR PROJECT DRAG
   ========================================== */

.sidebar-project-ghost {
    opacity: 0.4;
}

.sidebar-project-chosen {
    background: var(--sidebar-active) !important;
}

/* ==========================================
   CONTEXT MENU — icons
   ========================================== */

.context-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu button svg {
    flex-shrink: 0;
}

/* ==========================================
   PROJECT TABS
   ========================================== */

.project-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.project-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Search bar */
.project-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    position: relative;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 7px 12px;
    flex: 1;
    max-width: 360px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.search-input-wrap svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-input {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    box-shadow: none !important;
}

.search-clear {
    border: none;
    background: none;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.search-clear:hover {
    color: var(--text-primary);
}

.filter-pills {
    display: flex;
    gap: 6px;
}

.filter-dropdown-wrap {
    position: relative;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-dropdown-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.filter-dropdown-btn.filter-active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 280px;
    overflow: hidden;
    flex-direction: column;
}

.filter-dropdown.open {
    display: flex;
}

.filter-dropdown-search {
    border: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-radius: 0 !important;
    padding: 8px 12px !important;
    font-size: 13px;
    box-shadow: none !important;
}

.filter-dropdown-options {
    overflow-y: auto;
    max-height: 230px;
    padding: 4px;
}

.filter-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
}

.filter-dropdown-option:hover {
    background: var(--bg-tertiary);
}

.filter-dropdown-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.filter-dropdown-option-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.filter-dropdown-option-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-dropdown-option-sub {
    font-size: 11px;
    color: var(--text-tertiary);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 360px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    margin-top: 4px;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.search-result-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

.search-highlight {
    animation: searchPulse 0.6s ease 3;
}

@keyframes searchPulse {
    0%, 100% { box-shadow: var(--shadow-sm); }
    50% { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3); }
}

.project-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border-light);
}

.project-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.project-tab:hover {
    color: var(--text-primary);
}

.project-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.project-tab svg {
    flex-shrink: 0;
}

/* Week filter toggle */
.week-filter {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.week-filter-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition);
}

.week-filter-btn:hover {
    color: var(--text-primary);
}

.week-filter-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Weekly button in task modal */
.btn-weekly {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition);
}

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

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

/* Weekly indicator on card */
.task-card-weekly {
    border-left: 3px solid var(--accent);
}

/* Inside a fully-weekly group — no need to highlight individual cards */
.task-group-weekly .task-card-weekly {
    border-left: none;
}

/* In week mode — no highlighting at all (everything is weekly already) */
.kanban-board.week-mode .task-card-weekly {
    border-left: none;
}

.kanban-board.week-mode .task-group-weekly {
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-sm);
}

.kanban-board.week-mode .task-group-weekly .task-group-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
}

.kanban-board.week-mode .task-group-weekly .task-group-name::after {
    content: '';
}

/* Completed via double-click */
.task-card-completed {
    text-decoration: line-through;
}

/* ==========================================
   CALENDAR
   ========================================== */

.calendar-wrap {
    max-width: 960px;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.calendar-month-title {
    font-size: 20px;
    font-weight: 700;
    min-width: 200px;
    text-align: center;
}

.calendar-grid {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.calendar-weekday {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.calendar-weekend {
    color: var(--text-tertiary);
    opacity: 0.7;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 100px;
    padding: 6px 8px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
    user-select: none;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: var(--bg-tertiary);
}

.calendar-day-empty {
    cursor: default;
    background: var(--bg-tertiary);
    opacity: 0.3;
}

.calendar-day-empty:hover {
    background: var(--bg-tertiary);
}

.calendar-day-today {
    background: var(--accent-light) !important;
}

.calendar-day-today .calendar-day-num {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-weekend {
    background: rgba(241, 245, 249, 0.5);
}

.calendar-day-num {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-height: 20px;
}

.calendar-event:hover {
    opacity: 0.8;
}

.cal-ev-title {
    display: inline;
}

.cal-ev-single {
    border-radius: 4px;
}

.cal-ev-start {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: -8px;
}

.cal-ev-end {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    margin-left: -8px;
}

.cal-ev-start.cal-ev-end {
    margin: 0;
    border-radius: 4px;
}

.calendar-day.cal-selected {
    background: rgba(99, 102, 241, 0.1) !important;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        min-width: 60px;
    }
    .sidebar-logo span,
    .sidebar-link span,
    .sidebar-section-header span,
    .sidebar-project .project-name,
    .sidebar-user-info,
    .sidebar-section-header {
        display: none;
    }
    .sidebar-project {
        justify-content: center;
    }
    .kanban-column {
        width: 260px;
        min-width: 260px;
    }
    .task-modal-body {
        flex-direction: column;
    }
    .task-modal-sidebar {
        width: 100%;
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-light);
        padding-top: 16px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .task-meta-group {
        min-width: 100px;
    }
    .settings-layout {
        flex-direction: column;
    }
    .settings-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .settings-content {
        padding: 20px;
    }
    .team-grid {
        grid-template-columns: 1fr;
    }
}
