:root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-hover: #1c2129;
    --border: #30363d;
    --border-light: #21262d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --text-bright: #f0f6fc;
    --accent: #58a6ff;
    --accent-muted: #1f6feb;
    --green: #3fb950;
    --green-muted: #238636;
    --yellow: #d29922;
    --red: #f85149;
    --orange: #db6d28;
    --purple: #bc8cff;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Navbar ──────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-left { display: flex; align-items: center; gap: 0.75rem; }
.nav-right { display: flex; align-items: center; gap: 1rem; }

.nav-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-separator {
    width: 1px;
    height: 1.25rem;
    background: var(--border);
}

.nav-subtitle { color: var(--text-muted); font-size: 0.8125rem; }

.nav-team-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.nav-team-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

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

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

h1 { font-size: 1.5rem; color: var(--text-bright); font-weight: 600; }
h2 { font-size: 1.125rem; color: var(--text-bright); font-weight: 600; }

/* ── Dashboard Grid ──────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

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

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

.card-header h2 { margin: 0; font-size: 1.0625rem; }

.team-badge {
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: monospace;
}

.description { color: var(--text-muted); font-size: 0.8125rem; margin-bottom: 0.75rem; }

.stats { display: flex; gap: 1rem; margin-top: 0.75rem; }
.stat { text-align: center; flex: 1; }
.stat-value { display: block; font-size: 1.375rem; font-weight: 700; color: var(--text-muted); }
.stat-value.stat-active { color: var(--accent); }
.stat-value.stat-highlight { color: var(--green); }
.stat-value.stat-warn { color: var(--yellow); }
.stat-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.repo-path { margin-top: 0.75rem; font-size: 0.6875rem; color: var(--text-muted); font-family: monospace; padding-top: 0.75rem; border-top: 1px solid var(--border-light); }

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb { margin-bottom: 1.25rem; font-size: 0.8125rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* ── Team Header ─────────────────────────────────────── */
.team-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.team-header-info h1 { margin-bottom: 0.25rem; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-family: inherit;
}

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

.tab-count {
    font-size: 0.6875rem;
    background: var(--bg);
    color: var(--text-muted);
    padding: 0.0625rem 0.4375rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    min-width: 1.25rem;
    text-align: center;
}

.tab.active .tab-count { background: var(--accent-muted); color: var(--text-bright); border-color: var(--accent-muted); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Section Header ──────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.btn:hover { background: var(--surface-hover); border-color: var(--text-muted); }

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

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

.btn-success { border-color: var(--green-muted); color: var(--green); }
.btn-success:hover { background: var(--green-muted); color: #fff; }

.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.75rem; }

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover { color: var(--accent); background: rgba(88,166,255,0.1); }
.btn-icon.btn-danger:hover { color: var(--red); background: rgba(248,81,73,0.1); }

/* ── Task Cards ──────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 0.5rem; }

.task-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s;
    gap: 1rem;
}

.task-card:hover { border-color: var(--text-muted); }

.task-card-left { display: flex; align-items: flex-start; gap: 0.75rem; flex: 1; min-width: 0; }
.task-card-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.task-card-content { flex: 1; min-width: 0; }
.task-title { font-size: 0.875rem; font-weight: 500; color: var(--text-bright); }
.task-description { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; gap: 1rem; margin-top: 0.375rem; }
.task-due { color: var(--yellow); font-size: 0.75rem; }

.task-actions { display: flex; gap: 0.25rem; opacity: 0; transition: opacity 0.15s; }
.task-card:hover .task-actions { opacity: 1; }

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.375rem;
    flex-shrink: 0;
}

.priority-dot.priority-1 { background: var(--red); box-shadow: 0 0 6px rgba(248,81,73,0.4); }
.priority-dot.priority-2 { background: var(--orange); }
.priority-dot.priority-3 { background: var(--yellow); }
.priority-dot.priority-4 { background: var(--text-muted); }
.priority-dot.priority-5 { background: var(--border); }

/* ── Badges ──────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-pending { background: #1f2937; color: var(--text-muted); }
.badge-in_progress, .badge-in-progress { background: #0c2d6b; color: var(--accent); }
.badge-completed { background: #0d2818; color: var(--green); }
.badge-info { background: #0c2d6b; color: var(--accent); }
.badge-warning { background: #3b2607; color: var(--yellow); }
.badge-error { background: #3b0b0b; color: var(--red); }
.badge-critical { background: #5c0b0b; color: #ff7b72; }

/* ── Messages ────────────────────────────────────────── */
.message-list, .notif-list { display: flex; flex-direction: column; gap: 0.5rem; }

.message, .notif {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--surface);
    transition: border-color 0.15s;
}

.message:hover, .notif:hover { border-color: var(--text-muted); }

.unread { border-left: 3px solid var(--accent); }

.message-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; gap: 0.5rem; }
.message-header strong { color: var(--text-bright); }
.message-header-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.message-from { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.375rem; }
.message-body { color: var(--text-muted); font-size: 0.8125rem; line-height: 1.5; }

/* ── Notifications ───────────────────────────────────── */
.notif-header { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.notif-header-left { display: flex; align-items: center; gap: 0.5rem; }
.notif-header-left strong { color: var(--text-bright); }
.notif-header-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.notif-body { margin-top: 0.375rem; color: var(--text-muted); font-size: 0.8125rem; }

.severity-info { border-left: 3px solid var(--accent); }
.severity-warning { border-left: 3px solid var(--yellow); }
.severity-error { border-left: 3px solid var(--red); }
.severity-critical { border-left: 3px solid #ff7b72; background: rgba(248,81,73,0.05); }

/* ── Reminders ───────────────────────────────────────── */
.reminder-list-cards { display: flex; flex-direction: column; gap: 0.5rem; }

.reminder-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    gap: 1rem;
}

.reminder-card-left { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.reminder-time { color: var(--accent); font-family: monospace; font-size: 0.8125rem; white-space: nowrap; }
.reminder-message { font-size: 0.875rem; color: var(--text); }

/* ── Date ────────────────────────────────────────────── */
.date { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }

.empty { color: var(--text-muted); font-size: 0.875rem; font-style: italic; padding: 2rem 0; text-align: center; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1rem; color: var(--text-bright); font-weight: 600; }

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

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

.modal-body { padding: 1.25rem; }

/* ── Form ────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,166,255,0.15);
}

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

.form-group select { cursor: pointer; }

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

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

/* ── Toast ───────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    max-width: 360px;
}

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

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 0.75rem 1rem; }
    .container { padding: 1rem; }
    .grid { grid-template-columns: 1fr; }
    .stats { flex-wrap: wrap; }
    .form-row { flex-direction: column; gap: 0; }
    .task-card { flex-direction: column; gap: 0.75rem; }
    .task-card-right { width: 100%; justify-content: space-between; }
    .task-actions { opacity: 1; }
    .tab { padding: 0.625rem 0.875rem; font-size: 0.8125rem; }
    .message-header { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
    .notif-header { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
}

@media (max-width: 480px) {
    .nav-subtitle { display: none; }
    .nav-separator { display: none; }
}
