:root {
    --primary: #2563EB;
    --bg: #F8FAFC;
    --text: #111827;
    --border: #E5E7EB;
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); margin: 0; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: #1d4ed8; }

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }
.app-main { flex: 1; margin-left: var(--sidebar-width); min-width: 0; }
.app-content { padding: 24px 32px; max-width: 1400px; }

/* Sidebar */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width);
    background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 1000;
}
.sidebar-brand { padding: 20px 20px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.brand-icon { width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.brand-text { font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px;
    color: #64748b; font-weight: 500; margin-bottom: 2px; transition: all .15s;
}
.nav-item:hover { background: #f1f5f9; color: var(--text); }
.nav-item.active { background: #eff6ff; color: var(--primary); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }

/* Topbar */
.topbar {
    height: var(--topbar-height); background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 100;
}
.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px; }
.topbar-search input {
    width: 100%; padding: 9px 14px 9px 38px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg); font-size: 13px; outline: none; transition: border .15s;
}
.topbar-search input:focus { border-color: var(--primary); background: #fff; }
.search-results {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow); margin-top: 4px; display: none; max-height: 320px; overflow-y: auto; z-index: 200;
}
.search-results.show { display: block; }
.search-result-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.search-result-item:hover { background: #f8fafc; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-sprint, .topbar-clock { font-size: 13px; color: #64748b; }
.notif-badge { position: absolute; top: 2px; right: 2px; background: #ef4444; color: #fff; font-size: 10px; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px; }

/* Cards & Stats */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 16px 20px; font-weight: 600; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 16px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.stat-label { font-size: 12px; color: #64748b; margin-top: 4px; font-weight: 500; }
.project-card, .idea-card, .report-card { transition: transform .15s, box-shadow .15s; }
.project-card:hover, .idea-card:hover, .report-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }

/* Page */
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.5px; margin: 0; }
.breadcrumb { font-size: 13px; }
.breadcrumb-item a { color: #64748b; }

/* Forms */
.form-control, .form-select { border-radius: 8px; border-color: var(--border); font-size: 14px; padding: 9px 14px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.btn { border-radius: 8px; font-weight: 500; font-size: 14px; padding: 8px 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* Task detail */
.task-meta dt { font-size: 12px; color: #64748b; margin-top: 12px; }
.task-meta dd { margin: 2px 0 0; font-weight: 500; }

/* Activity */
.activity-list { padding: 8px 0; }
.activity-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #f1f5f9; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }

/* Auth */
.auth-body { background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-container { width: 100%; max-width: 400px; padding: 20px; }
.auth-card { background: #fff; border-radius: var(--radius); padding: 40px 32px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.auth-logo { width: 48px; height: 48px; background: var(--primary); color: #fff; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }

/* Table */
.table { font-size: 14px; }
.table thead th { font-weight: 600; color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom-width: 1px; padding: 12px 16px; }
.table td { padding: 14px 16px; vertical-align: middle; }

/* Badges */
.badge { font-weight: 500; font-size: 11px; padding: 4px 10px; border-radius: 6px; }

/* Responsive */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; }
    .sidebar.show { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .app-content { padding: 16px; }
}

/* Floating action */
.fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; border: none; box-shadow: 0 4px 12px rgba(37,99,235,.4); font-size: 20px; z-index: 50; cursor: pointer; }
.fab:hover { background: #1d4ed8; }

/* Work day timer */
.work-timer-panel { padding: 4px 0; }
.work-day-progress { height: 14px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.work-day-progress .progress-bar { border-radius: 999px; transition: width 1s linear; background: linear-gradient(90deg, #2563EB, #3b82f6); }
.work-day-progress .progress-bar.is-complete { background: linear-gradient(90deg, #16a34a, #22c55e); }
.work-day-progress .progress-bar.is-break { background: #94a3b8; animation: none !important; }
.work-timer-main { font-variant-numeric: tabular-nums; }
.work-day-timer-compact .topbar-timer-bar-wrap { width: 100px; }
.work-day-timer-compact .work-day-progress { height: 6px; }
.work-day-timer-compact .work-timer-count { font-variant-numeric: tabular-nums; color: var(--primary); }
.topbar-timer-inner { min-width: 180px; padding: 4px 10px; background: #f8fafc; border-radius: 8px; border: 1px solid var(--border); }

/* Log hours reminder blink */
@keyframes logHoursBlink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8); transform: scale(1); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); transform: scale(1.03); }
}
#btnLogHours.btn-log-hours-alert {
    animation: logHoursBlink 1s ease-in-out infinite;
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #fff !important;
}
.break-progress .progress-bar { transition: width 1s linear; }
