/* ===========================
   MyTask — Notion-like Dark UI
   =========================== */

:root {
    /* Color Palette */
    --bg-primary: #191919;
    --bg-secondary: #202020;
    --bg-tertiary: #2a2a2a;
    --bg-card: #252525;
    --bg-card-hover: #2d2d2d;
    --bg-input: #2a2a2a;
    --bg-modal: #1e1e1e;

    --border-color: #333;
    --border-light: #3a3a3a;

    --text-primary: #ececec;
    --text-secondary: #a0a0a0;
    --text-muted: #6b6b6b;
    --text-placeholder: #555;

    --accent: #6C5CE7;
    --accent-hover: #7c6ff0;
    --accent-glow: rgba(108, 92, 231, 0.15);

    --danger: #e74c3c;
    --danger-hover: #c0392b;

    --dot-todo: #6C5CE7;
    --dot-progress: #f0a500;
    --dot-done: #27ae60;

    /* Urgency Colors */
    --urgency-1: #3a7d44;
    --urgency-2: #4a8c54;
    --urgency-3: #6b9e3a;
    --urgency-4: #8fb02a;
    --urgency-5: #c4a820;
    --urgency-6: #d4941a;
    --urgency-7: #d47e1a;
    --urgency-8: #d4611a;
    --urgency-9: #d43d1a;
    --urgency-10: #c0392b;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --transition: 180ms ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== LOGIN ===== */
.login-container {
    max-width: 380px;
    margin: 0 auto;
    padding: 40px 32px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-switch {
    margin-top: 14px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkbox-row {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin-bottom: 0 !important;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.93rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-placeholder);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-group input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    border: none;
    outline: none;
    margin-top: 4px;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

.urgency-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
    min-width: 160px;
}

.error-msg {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.25);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

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

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

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

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

.btn-logout {
    padding: 8px;
    border: none;
}

/* ===== TOP BAR ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cloud-open {
    margin-left: 6px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    background: var(--bg-tertiary);
    border-radius: 80px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

/* ===== KANBAN BOARD ===== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    height: calc(100vh - 57px);
    overflow: hidden;
}

.kanban-column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow: hidden;
}

.kanban-column:last-child {
    border-right: none;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

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

.dot-todo {
    background: var(--dot-todo);
}

.dot-progress {
    background: var(--dot-progress);
}

.dot-done {
    background: var(--dot-done);
}

.column-header h2 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.column-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

.column-cards {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.column-cards.drag-over {
    background: var(--accent-glow);
}

/* ===== TASK CARD ===== */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: grab;
    transition: all var(--transition);
    position: relative;
}

.task-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

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

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

.task-card.task-card-readonly {
    cursor: pointer;
}

.task-card.task-card-readonly:active {
    cursor: pointer;
}

.card-urgency-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius) 0 0 var(--radius);
}

.card-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    padding-left: 8px;
    line-height: 1.4;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-assignee .mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-urgency-num {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 150ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    box-shadow: var(--shadow);
    animation: slideUp 200ms ease;
}

.modal-wide {
    max-width: 680px;
}

.modal-admin {
    width: min(1100px, 96vw);
    max-width: min(1100px, 96vw);
}

.modal-cloud {
    max-width: 980px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-cloud .admin-table-wrap {
    margin-top: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition);
    line-height: 1;
}

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

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

/* ===== TASK DETAIL ===== */
.detail-meta {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.meta-row+.meta-row {
    border-top: 1px solid var(--border-color);
}

.meta-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.status-badge {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.status-badge.status-todo {
    background: rgba(108, 92, 231, 0.15);
    color: #a29bfe;
}

.status-badge.status-in_progress {
    background: rgba(240, 165, 0, 0.15);
    color: #f0a500;
}

.status-badge.status-done {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.urgency-badge {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    color: #fff;
}

.detail-description {
    margin-bottom: 20px;
}

.detail-description h4,
.detail-section h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.detail-description p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.7;
}

.detail-readonly-note {
    margin: -6px 0 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.detail-section {
    margin-bottom: 20px;
}

/* ===== COMMENTS ===== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    max-height: 240px;
    overflow-y: auto;
}

.comment-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 12px 14px;
}

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

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

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

.comment-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.5;
}

.comment-form {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.comment-form textarea {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    resize: none;
    outline: none;
    min-height: 42px;
}

.comment-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.comments-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
    padding: 8px 0;
}

/* ===== FILES ===== */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    min-width: 0;
}

.file-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-glow);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.file-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.file-upload-label:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.task-files-summary {
    margin-top: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    padding: 8px 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.task-files-summary-item + .task-files-summary-item {
    margin-top: 4px;
}

.files-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
    padding: 8px 0;
}

/* ===== ADMIN TABLE ===== */
.admin-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-add-form {
    margin-bottom: 0;
}

.admin-user-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1.4fr) minmax(180px, 1fr) minmax(120px, 140px) auto;
    gap: 10px;
    align-items: end;
}

.admin-user-grid .form-group {
    margin-bottom: 0;
}

.admin-user-grid>.btn {
    min-height: 40px;
    justify-content: center;
}

.admin-add-form h4,
.admin-users-list h4,
.admin-invites h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 12px;
}

.admin-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--bg-secondary);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 760px;
}

.admin-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.72rem;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

.admin-table td strong {
    color: var(--text-primary);
}

.cloud-workspace-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cloud-header-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.cloud-summary {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.cloud-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.cloud-crumb-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.cloud-crumb-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-tertiary);
}

.cloud-crumb-sep {
    color: var(--text-muted);
}

.cloud-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cloud-folder-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.cloud-folder-form input {
    width: 220px;
    max-width: 100%;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
}

.cloud-transfer-list {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    padding: 10px;
    margin-bottom: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.cloud-transfer-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

.cloud-transfer-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cloud-transfer-item+.cloud-transfer-item {
    margin-top: 8px;
}

.cloud-transfer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.cloud-progress {
    width: 100%;
    height: 7px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.cloud-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 120ms linear;
}

.cloud-progress-bar.error {
    background: var(--danger);
}

.cloud-progress-bar.done {
    background: var(--dot-done);
}

.cloud-dropzone {
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    padding: 10px 12px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.cloud-dropzone.active {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--accent-glow);
}

.cloud-table-wrap {
    max-height: 55vh;
    overflow-y: auto;
}

.cloud-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.cloud-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

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

.cloud-entry-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-align: left;
}

.cloud-entry-btn:hover {
    color: var(--accent);
}

.cloud-folder-icon {
    font-size: 0.95rem;
}

.admin-invite-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.invite-code {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.invite-status {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

.invite-status.active {
    background: rgba(46, 204, 113, 0.15);
    color: #7bed9f;
}

.invite-status.used {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.invite-status.inactive {
    background: rgba(231, 76, 60, 0.15);
    color: #ff7675;
}

.role-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.role-badge.role-admin {
    background: rgba(108, 92, 231, 0.15);
    color: #a29bfe;
}

.role-badge.role-user {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

/* ===== FILE PREVIEW ===== */
.file-item {
    flex-wrap: wrap;
}

.file-thumbnail {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: opacity var(--transition);
}

.file-thumbnail:hover {
    opacity: 0.8;
}

.preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 70vh;
    overflow: auto;
}

.preview-image {
    max-width: 100%;
    max-height: 65vh;
    border-radius: var(--radius);
    object-fit: contain;
}

.preview-pdf {
    width: 100%;
    height: 65vh;
    border: none;
    border-radius: var(--radius);
}

.preview-video {
    max-width: 100%;
    max-height: 65vh;
    border-radius: var(--radius);
}

/* ===== ADMIN ACTIONS ===== */
.admin-actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

/* ===== TOAST ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    animation: toastIn 300ms ease;
    max-width: 340px;
}

.toast.toast-success {
    border-left: 3px solid var(--dot-done);
}

.toast.toast-error {
    border-left: 3px solid var(--danger);
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .kanban-board {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .kanban-column {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: auto;
    }

    .column-cards {
        max-height: 400px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .modal {
        padding: 20px;
        margin: 16px;
    }

    .admin-user-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .admin-user-grid>.btn {
        grid-column: 1 / -1;
    }

    .cloud-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cloud-folder-form {
        width: 100%;
    }

    .cloud-folder-form input {
        flex: 1;
        width: auto;
    }

    .admin-table th,
    .admin-table td {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {

    /* Topbar: two-row layout */
    .topbar {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .topbar-left {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-right {
        order: 2;
        width: 100%;
        justify-content: space-between;
        gap: 6px;
        padding-top: 4px;
        border-top: 1px solid var(--border-color);
    }

    .topbar-title {
        font-size: 0.95rem;
    }

    /* Full-screen modals on mobile */
    .modal-overlay {
        align-items: stretch;
        padding: 0;
    }

    .modal,
    .modal.modal-wide {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
    }

    /* Kanban columns: better touch targets */
    .column-header {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--bg);
        padding: 14px 16px;
    }

    .task-card {
        padding: 14px 14px 14px 18px;
    }

    .card-title {
        font-size: 0.88rem;
    }

    /* Workspace dropdown full-width */
    .ws-dropdown {
        left: 0;
        right: auto;
        width: calc(100vw - 24px);
        max-width: 100%;
    }

    /* Detail body scroll */
    .detail-body {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
}

@media (max-width: 600px) {
    .user-badge span {
        display: none;
    }

    .btn-new-task-text,
    .btn-admin-text,
    .btn-change-pass-text,
    .btn-cloud-text {
        display: none;
    }

    .ws-name {
        max-width: 80px;
    }

    .ws-divider {
        display: none;
    }

    .topbar-title {
        display: none;
    }

    /* Login compact */
    .login-container {
        padding: 24px 16px;
    }

    .login-logo h1 {
        font-size: 1.3rem;
    }

    /* Toast full-width at bottom */
    #toast-container {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        padding: 10px;
    }

    .toast {
        max-width: 100%;
    }

    /* Admin form stacks */
    .admin-user-grid {
        grid-template-columns: 1fr;
    }

    /* Workspace members compact */
    .ws-member-item {
        padding: 8px 0;
    }

    .ws-member-email {
        font-size: 0.7rem;
    }
}

/* ===== WORKSPACE SWITCHER ===== */
.ws-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 10px;
}

.ws-switcher {
    position: relative;
}

.ws-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    white-space: nowrap;
}

.ws-current:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

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

.ws-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 280px;
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    z-index: 1000;
    overflow: hidden;
    animation: wsDropIn 150ms ease;
}

@keyframes wsDropIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ws-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
}

.ws-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
    transition: var(--transition);
}

.ws-dropdown-item:hover {
    background: var(--bg-tertiary);
}

.ws-dropdown-item.active {
    background: var(--accent-glow);
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.ws-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-item-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 7px;
    border-radius: 10px;
}

.ws-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

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

.ws-dropdown-footer {
    border-top: 1px solid var(--border-color);
    padding: 6px;
}

.ws-new-btn {
    width: 100%;
    justify-content: center;
    gap: 6px;
}

/* ===== COLOR PICKER ===== */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0;
}

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

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

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

/* ===== WORKSPACE MEMBERS ===== */
.ws-members-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

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

.ws-member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-member-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.ws-member-email {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ws-member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== BUTTON DANGER ===== */
.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition);
}

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