/* ============================================
   Task Manager — Main Stylesheet
   ============================================ */

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

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

:root {
    --bg:        #0f1117;
    --surface:   #1a1d27;
    --surface2:  #22263a;
    --border:    #2e3350;
    --accent:    #6c63ff;
    --accent2:   #a78bfa;
    --green:     #22d3a5;
    --yellow:    #fbbf24;
    --red:       #f87171;
    --orange:    #fb923c;
    --text:      #e2e8f0;
    --muted:     #7c85a2;
    --radius:    12px;
    --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

/* ─── AUTH PAGES ─── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 30%, #1e1b4b 0%, #0f1117 60%);
    padding: 20px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

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

.auth-logo .logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.auth-logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.auth-logo p  { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

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

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

.form-group select option { background: var(--surface2); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a52e0; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,99,255,.4); }

.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: rgba(248,113,113,.15); color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.25); }

.btn-success { background: rgba(34,211,165,.15); color: var(--green); border: 1px solid rgba(34,211,165,.3); }
.btn-success:hover { background: rgba(34,211,165,.25); }

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ─── LAYOUT ─── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    padding: 24px 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}

.sidebar-logo span { font-weight: 700; font-size: 16px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 0 8px;
    margin: 16px 0 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .15s;
    margin-bottom: 2px;
}

.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: rgba(108,99,255,.15); color: var(--accent2); }
.nav-link .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface2);
}

.user-pill .avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff;
    flex-shrink: 0;
}

.user-pill .info { flex: 1; min-width: 0; }
.user-pill .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill .role-badge { font-size: 10px; color: var(--muted); }

/* ─── MAIN CONTENT ─── */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

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

.page-header h2 { font-size: 22px; font-weight: 700; }
.page-header p  { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ─── STATS CARDS ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color .2s;
}

.stat-card:hover { border-color: var(--accent); }
.stat-card .stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ─── TASK CARDS ─── */
.tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-bar select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color .15s, transform .15s;
}

.task-card:hover { border-color: var(--accent); transform: translateX(3px); }
.task-card.status-completed { opacity: .6; }

.task-card .task-check {
    width: 20px; height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    transition: all .2s;
}

.task-card .task-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.task-card .task-check.progress { background: var(--accent); border-color: var(--accent); color: #fff; }
.task-card .task-check.cancelled { background: var(--muted); border-color: var(--muted); color: #fff; }

.task-card .task-body { flex: 1; min-width: 0; }
.task-card .task-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-card.status-completed .task-title { text-decoration: line-through; color: var(--muted); }
.task-card .task-meta { display: flex; gap: 10px; margin-top: 5px; flex-wrap: wrap; align-items: center; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-high     { background: rgba(248,113,113,.15); color: var(--red); }
.badge-medium   { background: rgba(251,191,36,.15);  color: var(--yellow); }
.badge-low      { background: rgba(34,211,165,.15);  color: var(--green); }
.badge-pending  { background: rgba(124,133,162,.15); color: var(--muted); }
.badge-progress { background: rgba(108,99,255,.15);  color: var(--accent2); }
.badge-completed{ background: rgba(34,211,165,.15);  color: var(--green); }
.badge-cancelled{ background: rgba(107,114,128,.15); color: #9ca3af; }

.deadline-tag {
    font-size: 11px;
    color: var(--muted);
}

.deadline-tag.overdue { color: var(--red); font-weight: 600; }
.deadline-tag.urgent  { color: var(--orange); font-weight: 600; }
.deadline-tag.soon    { color: var(--yellow); }

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

/* ─── MODAL ─── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: slideUp .2s ease;
}

@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }

.modal-close {
    background: var(--surface2);
    border: none;
    color: var(--muted);
    width: 30px; height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s;
}

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

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ─── ALERTS ─── */
.alert {
    padding: 12px 16px;
    border-radius: 9px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error   { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: var(--red); }
.alert-success { background: rgba(34,211,165,.1);  border: 1px solid rgba(34,211,165,.3);  color: var(--green); }
.alert-info    { background: rgba(108,99,255,.1);  border: 1px solid rgba(108,99,255,.3);  color: var(--accent2); }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }

/* ─── ADMIN TABLE ─── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
}

.card-body { padding: 0; }

/* ─── MISC ─── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--muted); }
.auth-link { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-link a { color: var(--accent2); text-decoration: none; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Notification badge */
.notif-badge {
    display:inline-flex;align-items:center;justify-content:center;
    background:#ef4444;color:#fff;border-radius:50%;
    width:18px;height:18px;font-size:10px;font-weight:700;
    margin-left:auto;
}
.nav-link { display:flex;align-items:center;gap:8px; }

/* Submitted status */
.badge-submitted { background: rgba(34,211,165,.15); color: #22d3a5; }
.status-submitted { border-left-color: #22d3a5; }
.task-check.submitted { background: #22d3a5; color: #fff; }

/* Profile styles */
.section-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:24px; margin-bottom:16px; }

/* Chat realtime indicator */
.online-dot { width:8px;height:8px;background:#22d3a5;border-radius:50%;display:inline-block;margin-left:6px;animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
