/* ============================================================
   Roadmap Portal — Clean executive dashboard style
   ============================================================ */

:root {
    --bg: #0f0f10;
    --bg-card: #18181b;
    --bg-hover: #1f1f23;
    --border: #27272a;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --text-dim: #52525b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --green: #22c55e;
    --green-dim: #166534;
    --blue: #3b82f6;
    --blue-dim: #1e3a5f;
    --orange: #f59e0b;
    --orange-dim: #78350f;
    --red: #ef4444;
    --red-dim: #7f1d1d;
    --purple: #a855f7;
    --gray: #3f3f46;
    --radius: 8px;
    --radius-sm: 4px;
}

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

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

/* --- Login --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
}

.error-msg {
    background: var(--red-dim);
    border: 1px solid var(--red);
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

button[type="submit"], .btn-primary {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"]:hover, .btn-primary:hover {
    background: var(--accent-hover);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Layout --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
}

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

.user-info {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-logout {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

.layout {
    display: flex;
    min-height: calc(100vh - 52px);
}

.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 16px;
    flex-shrink: 0;
    overflow-y: auto;
}

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

.sidebar-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 8px;
    padding: 0 8px;
}

.nav-link {
    display: block;
    padding: 7px 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    margin-bottom: 2px;
}

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

.nav-link.active {
    background: var(--accent);
    color: #fff;
}

.nav-link.sub {
    padding-left: 20px;
    font-size: 12px;
}

.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.loading {
    color: var(--text-muted);
    text-align: center;
    padding: 48px;
    font-size: 14px;
}

/* --- Cards & Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Progress bar --- */
.progress-bar {
    height: 6px;
    background: var(--gray);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-fill.green { background: var(--green); }
.progress-fill.blue { background: var(--blue); }
.progress-fill.accent { background: var(--accent); }

/* --- Tables --- */
.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-green { background: var(--green-dim); color: var(--green); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-purple { background: rgba(168,85,247,0.15); color: var(--purple); }
.badge-gray { background: var(--gray); color: var(--text-muted); }

.card-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.card-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.card-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.card-title-link {
    color: var(--text);
    text-decoration: none;
}

.card-title-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* --- Group cards --- */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.group-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

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

.group-card .meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* --- Kanban mini --- */
.kanban-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.kanban-col {
    flex: 1;
    min-width: 100px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.kanban-col-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.kanban-col-count {
    background: var(--gray);
    padding: 0 6px;
    border-radius: 8px;
    font-size: 10px;
    color: var(--text-muted);
}

.kanban-item {
    padding: 6px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state h2 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-dim);
}

.empty-state p {
    font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .group-grid { grid-template-columns: 1fr; }
}
