/* BAAM Project Manager - style.css */

/* ── Reset & base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #f5f4f0;
  color: #1a1a1a;
  line-height: 1.6;
}
a { color: #534AB7; text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-weight: 500; line-height: 1.3; }

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

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: 230px;
  background: #fff;
  border-right: 0.5px solid rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.2s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}
.brand-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: #534AB7; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; flex-shrink: 0;
}
.brand-name { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.brand-sub { font-size: 10px; color: #888; line-height: 1.3; }

.nav-section {
  padding: 14px 16px 4px;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: #999; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px;
  font-size: 13px; color: #555;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  cursor: pointer;
}
.nav-item:hover { background: #f5f4f0; color: #1a1a1a; text-decoration: none; }
.nav-item.active { background: #EEEDFE; color: #534AB7; border-left-color: #534AB7; font-weight: 500; }
.nav-icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-badge { background: #E24B4A; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 10px; margin-left: auto; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 0.5px solid rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 8px;
}
.footer-info { flex: 1; min-width: 0; }
.footer-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer-role { font-size: 11px; color: #888; text-transform: capitalize; }
.logout-btn { color: #999; display: flex; align-items: center; }
.logout-btn:hover { color: #E24B4A; }
.logout-btn svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Main content ─────────────────────────────────── */
.main-wrap { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: #fff;
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 500; flex: 1; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: #555; padding: 4px; }
.content { padding: 24px; flex: 1; max-width: 1400px; }

/* ── Flash messages ───────────────────────────────── */
.flash {
  padding: 10px 16px 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 500;
}
.flash-success { background: #E1F5EE; color: #0F6E56; border-left: 3px solid #1D9E75; }
.flash-error   { background: #FCEBEB; color: #A32D2D; border-left: 3px solid #E24B4A; }
.flash-info    { background: #E6F1FB; color: #185FA5; border-left: 3px solid #378ADD; }
.flash-close { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.6; line-height: 1; }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; }

/* ── Stat tiles ───────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-tile { background: #fff; border: 0.5px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 16px; }
.stat-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 500; }
.stat-sub { font-size: 11px; color: #999; margin-top: 2px; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 13px;
  border: 0.5px solid rgba(0,0,0,0.2);
  border-radius: 8px; cursor: pointer;
  background: #fff; color: #1a1a1a;
  font-family: inherit; font-weight: 400;
  transition: all 0.1s; white-space: nowrap;
}
.btn:hover { background: #f5f4f0; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #534AB7; color: #fff; border-color: #534AB7; }
.btn-primary:hover { background: #3C3489; }
.btn-danger { background: #FCEBEB; color: #A32D2D; border-color: #F09595; }
.btn-danger:hover { background: #F7C1C1; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #f0eff8; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Badges ───────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-idea     { background: #EEEDFE; color: #3C3489; }
.badge-planning { background: #E6F1FB; color: #185FA5; }
.badge-active   { background: #E1F5EE; color: #0F6E56; }
.badge-hold     { background: #FAEEDA; color: #854F0B; }
.badge-done     { background: #EAF3DE; color: #3B6D11; }
.badge-cancel   { background: #f0f0f0; color: #666; }
.badge-todo     { background: #f0f0f0; color: #555; }
.badge-in_progress { background: #E6F1FB; color: #185FA5; }
.badge-personal { background: #EEEDFE; color: #534AB7; }
.badge-team     { background: #E1F5EE; color: #0F6E56; }

/* ── Priority dot ─────────────────────────────────── */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Avatar ───────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0; letter-spacing: 0;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid #fff; }

/* ── Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #888; border-bottom: 0.5px solid rgba(0,0,0,0.1); white-space: nowrap; }
tbody td { padding: 11px 12px; border-bottom: 0.5px solid rgba(0,0,0,0.06); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #faf9ff; }
.td-actions { display: flex; gap: 4px; }

/* ── Forms ────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: span 2; }
label { font-size: 12px; font-weight: 600; color: #555; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: 8px 11px; font-size: 13px;
  border: 0.5px solid rgba(0,0,0,0.2); border-radius: 8px;
  background: #fff; color: #1a1a1a; font-family: inherit;
  transition: border-color 0.1s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #534AB7; box-shadow: 0 0 0 3px rgba(83,74,183,0.1); }
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.form-hint { font-size: 11px; color: #999; }

/* ── Project list ─────────────────────────────────── */
.project-list { background: #fff; border: 0.5px solid rgba(0,0,0,0.1); border-radius: 12px; overflow: hidden; }
.project-list-header {
  display: grid;
  grid-template-columns: 2fr 90px 100px 100px 80px 90px;
  gap: 8px; padding: 10px 16px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: #999;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}
.project-row {
  display: grid;
  grid-template-columns: 2fr 90px 100px 100px 80px 90px;
  gap: 8px; padding: 12px 16px;
  align-items: center;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  transition: background 0.1s; cursor: pointer;
  text-decoration: none; color: inherit;
}
.project-row:last-child { border-bottom: none; }
.project-row:hover { background: #faf9ff; }
.project-title { font-weight: 500; font-size: 13px; }
.project-desc { font-size: 11px; color: #888; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Task list ────────────────────────────────────── */
.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.07);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid rgba(0,0,0,0.25);
  cursor: pointer; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.1s; background: #fff;
}
.task-check.checked { background: #534AB7; border-color: #534AB7; }
.task-check.checked::after { content: ''; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px,-1px); display: block; }
.task-title { font-size: 13px; font-weight: 500; }
.task-title.done { text-decoration: line-through; color: #bbb; }
.task-meta { font-size: 11px; color: #999; margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.task-body { flex: 1; }

/* ── Comments ─────────────────────────────────────── */
.comment {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.comment-bubble { background: #f5f4f0; border-radius: 10px; padding: 10px 14px; flex: 1; }
.comment-meta { font-size: 11px; color: #999; margin-bottom: 4px; }
.comment-text { font-size: 13px; }

/* ── Timer widget ─────────────────────────────────── */
.timer-card { background: #fff; border: 0.5px solid rgba(0,0,0,0.1); border-radius: 12px; padding: 20px; }
.timer-display { font-size: 36px; font-weight: 300; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; margin: 12px 0; color: #534AB7; }
.timer-controls { display: flex; gap: 8px; }

/* ── Progress bar ─────────────────────────────────── */
.progress { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; background: #534AB7; border-radius: 2px; transition: width 0.3s; }

/* ── Tabs ─────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 0.5px solid rgba(0,0,0,0.1); margin-bottom: 20px; gap: 0; }
.tab { padding: 9px 18px; font-size: 13px; cursor: pointer; color: #888; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.1s; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.tab:hover { color: #534AB7; }
.tab.active { color: #534AB7; border-bottom-color: #534AB7; font-weight: 500; }

/* ── Section heading ──────────────────────────────── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 15px; font-weight: 600; }

/* ── Empty state ──────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; color: #aaa; }
.empty svg { width: 40px; height: 40px; stroke: #ddd; fill: none; stroke-width: 1.5; margin-bottom: 12px; }
.empty p { font-size: 13px; }

/* ── Utility ──────────────────────────────────────── */
.text-muted   { color: #999; }
.text-danger  { color: #E24B4A; }
.text-warning { color: #BA7517; }
.text-success { color: #1D9E75; }
.text-purple  { color: #534AB7; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Reminder ─────────────────────────────────────── */
.reminder-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 0.5px solid rgba(0,0,0,0.07); }
.reminder-item:last-child { border-bottom: none; }
.reminder-icon { width: 34px; height: 34px; border-radius: 8px; background: #EEEDFE; color: #534AB7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.reminder-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reminder-overdue { color: #E24B4A; font-size: 11px; font-weight: 600; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .project-list-header, .project-row { grid-template-columns: 1fr auto; }
  .project-list-header span:nth-child(n+2),
  .project-row > *:nth-child(n+2) { display: none; }
  .project-row > *:nth-child(2) { display: flex; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ── Comment hover actions ────────────────────────── */
.comment { display:flex; gap:10px; }
.comment-bubble { background:#f5f4f0; border-radius:10px; padding:10px 14px; flex:1; }
.comment-meta { font-size:11px; color:#bbb; margin-bottom:4px; }
.comment-text { font-size:13px; line-height:1.65; }
.comment-actions { display:none; gap:4px; }
.comment:hover .comment-actions { display:flex; }

/* ── Project status select (used on cards) ─────────── */
.proj-status-select {
  font-size:11px; padding:3px 7px; border-radius:6px;
  border:0.5px solid rgba(0,0,0,0.14); background:#f5f4f0;
  cursor:pointer; font-family:inherit; color:#555;
  transition:border-color 0.1s;
}
.proj-status-select:hover { border-color:#534AB7; }

/* ── Resource lines ───────────────────────────────── */
.resource-line { display:flex; align-items:flex-start; gap:7px; padding:6px 0; border-bottom:0.5px solid rgba(0,0,0,0.06); }
.resource-line:last-child { border-bottom:none; }
.resource-line a { font-size:13px; color:#534AB7; word-break:break-all; }
.resource-line span { font-size:13px; color:#555; }

/* ── Calendar day tooltip ─────────────────────────── */
.cal-day { position:relative; }
.cal-tooltip {
  display:none; position:absolute; left:50%; transform:translateX(-50%);
  top:calc(100% + 4px); background:#fff;
  border:0.5px solid rgba(0,0,0,0.15); border-radius:8px;
  padding:8px 10px; z-index:20; min-width:170px; max-width:220px;
  box-shadow:0 4px 16px rgba(0,0,0,0.12); font-size:11px;
  line-height:1.8; pointer-events:none; white-space:normal;
}
.cal-day:hover .cal-tooltip { display:block; }

/* ── Subtle animated progress ─────────────────────── */
@keyframes progress-in { from{width:0} }
.proj-progress-bar, .mini-progress-bar, .progress-bar { animation:progress-in 0.5s ease; }

/* ── View layout responsive ───────────────────────── */
.view-layout { display:grid; grid-template-columns:1fr 340px; gap:20px; align-items:start; }
@media(max-width:1000px) { .view-layout { grid-template-columns:1fr; } }
