/* IREX Tasks — Premium Minimal */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #000000;
    --bg-card: #0a0a0a;
    --bg-input: #141414;
    --bg-hover: #1a1a1a;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6e6e73;
    --accent: #e4002b;
    --accent-hover: #ff1a3d;
    --accent-subtle: rgba(228, 0, 43, 0.08);
    --success: #30d158;
    --warning: #ffd60a;
    --danger: #ff453a;
    --border: #1d1d1f;
    --border-light: #2c2c2e;
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-w: 240px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

.hidden { display: none !important; }

/* ── Login ─────────────────────────────────────────────── */
.screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    padding: 48px 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    border: 1px solid var(--border);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

/* ── Forms ──────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--text-muted);
    background: var(--bg-hover);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.error { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(255, 69, 58, 0.3);
}
.btn-danger:hover {
    background: rgba(255, 69, 58, 0.1);
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
}
.btn-icon:hover { color: var(--text); }

/* ── Header ────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.header-left, .header-right { display: flex; align-items: center; gap: 12px; }
.header-left h1 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.user-badge {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 56px;
    left: -260px;
    bottom: 0;
    width: var(--sidebar-w);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    transition: left 0.3s ease;
    z-index: 90;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar.open { left: 0; }

.sidebar-section { margin-bottom: 24px; }
.sidebar-section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    padding: 0 12px;
}
.sidebar-bottom { margin-top: auto; }

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

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

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

.project-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ── Content ───────────────────────────────────────────── */
.content {
    margin-top: 56px;
    padding: 24px 20px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.content h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 32px 0 12px;
}

/* ── Project Cards ─────────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.project-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.25s;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.project-card:hover::after { opacity: 1; }

.project-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.project-card .stats { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.project-card .stats .overdue { color: var(--accent); font-weight: 600; }

.btn-members {
    margin-top: 12px;
    font-size: 12px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-members:hover { color: var(--text); border-color: var(--text-muted); }
.member-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* ── Search ────────────────────────────────────────────── */
.filter-search { flex: 1; min-width: 120px; }

/* ── Kanban ────────────────────────────────────────────── */
.kanban-board {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    min-height: 300px;
}

.kanban-col {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    min-height: 200px;
}

.kanban-col h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.kanban-col[data-status="todo"] h3 { color: var(--text-secondary); }
.kanban-col[data-status="in_progress"] h3 { color: var(--warning); }
.kanban-col[data-status="done"] h3 { color: var(--success); }

.kanban-tasks { display: flex; flex-direction: column; gap: 8px; min-height: 50px; }

.kanban-card {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: grab;
    font-size: 13px;
    transition: all 0.2s;
    border: 1px solid transparent;
    border-left: 3px solid var(--border);
}
.kanban-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.4; transform: scale(0.97); }
.kanban-card .task-title { font-weight: 500; margin-bottom: 6px; letter-spacing: -0.01em; }
.kanban-card .task-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.kanban-card.priority-urgent { border-left-color: var(--accent); }
.kanban-card.priority-high { border-left-color: #ff9f0a; }
.kanban-card.priority-medium { border-left-color: var(--text-muted); }
.kanban-card.priority-low { border-left-color: var(--border); }
.kanban-tasks.drag-over { background: var(--accent-subtle); border-radius: var(--radius-sm); }

@media (max-width: 768px) {
    .kanban-board { grid-template-columns: 1fr; }
}

/* ── Subtasks ──────────────────────────────────────────── */
.subtask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.subtask-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.subtask-item .subtask-title { flex: 1; font-weight: 400; }
.subtask-item .subtask-title.done { text-decoration: line-through; color: var(--text-muted); }
.subtask-item .btn-delete-subtask { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 2px 6px; }
.subtask-item .btn-delete-subtask:hover { color: var(--danger); }
.subtask-progress { height: 2px; background: var(--bg-input); border-radius: 1px; margin-bottom: 10px; overflow: hidden; }
.subtask-progress-bar { height: 100%; background: var(--accent); transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* ── Task List ─────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 2px; }

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.task-item:hover { background: var(--bg-hover); }

.task-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.task-check:hover { border-color: var(--success); }
.task-check.done {
    background: var(--success);
    border-color: var(--success);
}
.task-check.done::after { content: '✓'; color: white; font-size: 12px; font-weight: 700; }

.task-info { flex: 1; min-width: 0; }
.task-title {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}
.task-title.done { text-decoration: line-through; color: var(--text-muted); font-weight: 400; }

.task-meta {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.task-meta .overdue { color: var(--accent); font-weight: 500; }

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
}

.priority-dot.urgent { background: var(--accent); }
.priority-dot.high { background: #ff9f0a; }
.priority-dot.medium { background: var(--text-muted); }
.priority-dot.low { background: var(--border-light); }

.tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Filters ───────────────────────────────────────────── */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select { width: auto; min-width: 140px; font-size: 14px; }

/* ── Status Pills ──────────────────────────────────────── */
.status-pills { display: flex; gap: 8px; }
.pill input { display: none; }
.pill span {
    display: block;
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--bg-input);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.pill input:checked + span {
    background: var(--accent);
    color: white;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    width: 100%;
    max-width: 520px;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    padding: 28px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.modal-close { font-size: 24px; }

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 12px;
}

/* ── Comments ──────────────────────────────────────────── */
#comments-list { margin-bottom: 8px; }

.comment {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.comment-author { font-weight: 600; font-size: 13px; }
.comment-date { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.comment-input { display: flex; gap: 8px; align-items: center; }
.comment-input input { flex: 1; }

/* ── Desktop ───────────────────────────────────────────── */
@media (min-width: 768px) {
    .sidebar { left: 0; }
    .content { margin-left: var(--sidebar-w); }
    #menu-toggle { display: none; }

    .modal { align-items: center; }
    .modal-content { border-radius: 20px; }
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Selection ─────────────────────────────────────────── */
::selection { background: rgba(228, 0, 43, 0.3); color: white; }
