/* =========================================================
   Grinity TMS — Corporate UI
   Brand: teal primary (#187068) + orange accent (#F0A038) from logo.png
   ========================================================= */

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

:root {
  --brand: #187068;
  --brand-strong: #0F5A54;
  --brand-hover: #0C4E49;
  --brand-soft: #E8F3F1;
  --brand-ring: rgba(24, 112, 104, 0.18);
  --accent: #F0A038;
  --accent-soft: #FFF6E8;

  --ink: #1F2937;
  --ink-2: #334155;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --line: #E5E7EB;
  --line-2: #F1F5F9;
  --bg: #F7F7F8;
  --card: #FFFFFF;
  --sidebar: #FFFFFF;
  --sidebar-border: #EEF0F3;
  --danger: #EF4444;
  --success: #22C55E;
  --info: #3B82F6;
  --purple: #8B5CF6;
  --teal: #187068;
  --yellow: #F59E0B;
  --pink: #EC4899;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --sidebar-w: 280px;
  --header-h: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 16px; font-weight: 600; cursor: pointer;
  transition: .15s ease; line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-outline {
  background: #fff; border-color: var(--line); color: var(--ink-2);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ========== AUTH / LOGIN ========== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #fff;
}
.auth-visual {
  position: relative;
  background: #0F5A54;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  min-height: 100vh;
}
.auth-visual-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.auth-visual-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(15, 90, 84, 0.35), rgba(24, 112, 104, 0.15));
  pointer-events: none;
}
.auth-visual-blob,
.auth-visual-art {
  display: none;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 72px;
  position: relative;
  min-height: 100vh;
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 42px;
}
.brand-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}
.brand-logo-login {
  height: 52px;
  max-width: 280px;
}
.brand-logo-sidebar {
  height: 36px;
  max-width: 200px;
}
.sidebar-brand-link {
  display: inline-flex;
  align-items: center;
}
.auth-title { font-size: 34px; font-weight: 700; margin: 0 0 8px; color: #111827; letter-spacing: -0.03em; }
.auth-subtitle { margin: 0 0 32px; color: var(--muted); font-size: 14.5px; }

.form-group { margin-bottom: 22px; }
.form-label {
  display: block; margin-bottom: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
}
.input-line {
  position: relative;
  display: flex; align-items: center;
  border-bottom: 1px solid #D1D5DB;
  transition: border-color .15s ease;
}
.input-line:focus-within { border-bottom-color: var(--brand); }
.input-line input {
  width: 100%; border: 0; outline: 0; background: transparent;
  padding: 10px 36px 10px 0; color: var(--ink); font-size: 14.5px;
}
.input-line .input-icon {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); background: none; border: 0; padding: 4px; cursor: pointer;
  display: inline-flex;
}
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 24px;
}
.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-size: 13.5px; cursor: pointer; user-select: none;
}
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand); }
.link-brand { color: var(--brand); font-weight: 600; font-size: 13.5px; }
.link-brand:hover { color: var(--brand-hover); }
.auth-submit { margin-top: 4px; padding: 13px 16px; font-size: 15px; border-radius: 6px; }
.auth-footer a {
  color: var(--brand);
  font-weight: 600;
}
.auth-footer a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}
.link-muted {
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
  pointer-events: none;
  cursor: default;
}
.alert {
  border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; font-size: 13.5px;
}
.alert-danger { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

.auth-panel-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
.auth-footer {
  position: static;
  margin-top: 40px;
  text-align: center; color: var(--muted-2); font-size: 12px;
}

@media (max-width: 992px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 40px 24px 72px; }
}

/* ========== APP SHELL ========== */
.app-shell { min-height: 100vh; display: flex; background: var(--bg); }
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 40;
}
.sidebar-brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px; border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-search { display: none; }
.topbar-spacer { flex: 1; }
.topbar-search { display: none; }
.notif-unread { background: #F0FDFA; border-left: 3px solid var(--brand); padding-left: 10px; }
.toolbar-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sidebar-nav {
  flex: 1; overflow: auto; padding: 8px 12px 20px;
}
.nav-section-label {
  font-size: 11px; font-weight: 700; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: #64748B; }
.nav-item:hover { background: #F8FAFC; color: var(--ink); }
.nav-item.active {
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}
.nav-item.active svg { color: var(--brand); }
.nav-item .badge-new {
  margin-left: auto; background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 2px 7px;
}
.nav-sub { padding-left: 12px; margin-bottom: 6px; }
.nav-sub a {
  display: block; padding: 7px 12px 7px 28px; border-radius: 6px;
  color: var(--muted); font-size: 13px;
}
.nav-sub a:hover, .nav-sub a.active { color: var(--brand); background: var(--brand-soft); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.topbar-search { display: none !important; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: #64748B; cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  background: #EF4444; border-radius: 50%; border: 2px solid #fff;
}
.icon-btn .notif-badge {
  position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  border: 2px solid #fff;
}
.icon-btn .dot { display: none; }
a.icon-btn { text-decoration: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px; border-radius: 999px; border: 0; background: transparent;
  cursor: pointer; margin-left: 4px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #2A9A8E, #187068);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-meta { text-align: left; line-height: 1.15; }
.user-meta strong { display: block; font-size: 13px; color: var(--ink); }
.user-meta span { font-size: 11.5px; color: var(--muted); }

.content { padding: 20px 22px 28px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { opacity: .5; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.card {
  background: var(--card); border: 1px solid #EEF0F3;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-body { padding: 16px 18px; }
.card-title {
  margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}

.welcome-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; margin-bottom: 18px;
  background: #fff; border: 1px solid #EEF0F3; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.welcome-left { display: flex; align-items: center; gap: 14px; }
.welcome-left .avatar { width: 52px; height: 52px; font-size: 18px; }
.welcome-text h2 { margin: 0 0 4px; font-size: 18px; }
.welcome-text p { margin: 0; color: var(--muted); font-size: 13px; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.stat-card {
  background: #fff; border: 1px solid #EEF0F3; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px;
  min-height: 0;
  display: flex; flex-direction: row; align-items: center; gap: 12px;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 0; color: #fff; flex-shrink: 0;
}
.stat-icon.red { background: #F87171; }
.stat-icon.teal { background: #2DD4BF; }
.stat-icon.blue { background: #60A5FA; }
.stat-icon.pink { background: #F472B6; }
.stat-icon.purple { background: #A78BFA; }
.stat-icon.yellow { background: #FBBF24; }
.stat-icon.green { background: #34D399; }
.stat-icon.dark { background: #1F2937; }
.stat-body {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-label {
  color: var(--muted); font-size: 12px; margin-bottom: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-value {
  font-size: 18px; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 0; line-height: 1.2; color: var(--ink);
}
.stat-link { margin-top: 0; font-size: 11.5px; font-weight: 600; color: var(--brand); }

.grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-label { width: 110px; color: var(--muted); font-size: 12.5px; }
.bar-track { flex: 1; height: 10px; background: #F1F5F9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--brand); }
.bar-val { width: 34px; text-align: right; font-weight: 600; font-size: 12.5px; }

.stack-bar {
  height: 14px; border-radius: 999px; overflow: hidden; display: flex; margin: 12px 0 16px;
}
.stack-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.dot-c { width: 8px; height: 8px; border-radius: 50%; }

.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line-2);
}
.list-row:last-child { border-bottom: 0; }
.list-meta { flex: 1; min-width: 0; }
.list-meta strong { display: block; font-size: 13px; }
.list-meta span { color: var(--muted); font-size: 12px; }
.pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 3px 9px; font-size: 11.5px; font-weight: 600;
}
.pill-success { background: #DCFCE7; color: #166534; }
.pill-danger { background: #FEE2E2; color: #991B1B; }
.pill-warning { background: #FEF3C7; color: #92400E; }
.pill-info { background: #DBEAFE; color: #1E40AF; }
.pill-purple { background: #EDE9FE; color: #5B21B6; }
.pill-default { background: var(--line-2); color: var(--muted); }

.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 8px;
  font-size: 13px; font-weight: 500;
}
.todo-item input { accent-color: var(--brand); }
.todo-blue { background: #EFF6FF; }
.todo-green { background: #ECFDF5; }
.todo-purple { background: #F5F3FF; }
.todo-pink { background: #FDF2F8; }
.todo-yellow { background: #FFFBEB; }

.chart-placeholder {
  height: 220px; display: flex; align-items: flex-end; gap: 8px; padding: 8px 4px 0;
}
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bars { width: 100%; display: flex; align-items: flex-end; gap: 3px; height: 170px; }
.chart-bars i { display: block; width: 50%; border-radius: 4px 4px 0 0; }
.chart-bars .inc { background: var(--accent); }
.chart-bars .exp { background: #E5E7EB; }
.chart-bar-col span { font-size: 10px; color: var(--muted-2); }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
.progress {
  height: 6px; background: #F1F5F9; border-radius: 999px; overflow: hidden; min-width: 80px;
}
.progress > span { display: block; height: 100%; background: var(--brand); }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut {
  width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--brand) 0 40%, #60A5FA 40% 64%, #F87171 64% 80%, var(--accent) 80% 100%);
  mask: radial-gradient(circle at center, transparent 58%, #000 59%);
  -webkit-mask: radial-gradient(circle at center, transparent 58%, #000 59%);
  flex-shrink: 0;
}
.activity-item { display: flex; gap: 12px; padding: 10px 0; }
.activity-item .time { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }

.app-footer {
  margin-top: auto; padding: 14px 22px; color: var(--muted-2); font-size: 12px;
  display: flex; justify-content: space-between; border-top: 1px solid var(--line-2);
  background: transparent; gap: 12px; flex-wrap: wrap;
}
.app-footer a {
  color: var(--brand);
  font-weight: 600;
}
.app-footer a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); min-width: 180px; padding: 6px; z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 12px; border-radius: 8px; color: var(--ink-2); cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg); }

.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .sidebar-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-md);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 50;
    background: rgba(15, 23, 42, 0.45);
  }
}
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: 1fr; }
  .welcome-card { flex-direction: column; align-items: flex-start; }
  .content { padding: 16px; }
  .user-meta { display: none; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .toolbar > .form-control,
  .toolbar-search,
  .toolbar-select,
  .toolbar-date { max-width: none; width: 100%; flex: 1 1 100%; }
  .inline-controls { flex-wrap: wrap; }
}

/* ========== LIST / ORG CRUD (Phase 3) ========== */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 14px;
}
.toolbar-search { max-width: 280px; }
.toolbar-select { max-width: 200px; }
.toolbar-date { max-width: 170px; }
.table-wrap { overflow-x: auto; }
.table-actions {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end; white-space: nowrap;
}
.inline-form { display: inline; margin: 0; }
.inline-controls { display: flex; gap: 10px; align-items: center; }
.inline-controls .form-control { flex: 1; }
.member-add-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.empty-cell { color: var(--muted); text-align: center; padding: 28px 8px !important; }
.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}
.empty-state p { margin: 0 0 12px; }
.empty-state .btn { margin-top: 4px; }
.muted-sm { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.form-card { max-width: 860px; margin-inline: auto; }
.form-card-wide { max-width: 980px; margin-inline: auto; }
.form-group-full { grid-column: 1 / -1; }
.section-title { font-size: 15px; margin: 18px 0 10px; }
.text-danger { color: #B91C1C; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.task-desc { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; }
.simple-list { margin: 0; padding-left: 18px; font-size: 13px; }
.simple-list li { margin-bottom: 6px; }
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item { padding-bottom: 10px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.history-item:last-child { border-bottom: 0; padding-bottom: 0; }
.weekday-grid { display: flex; flex-wrap: wrap; gap: 10px 14px; padding-top: 6px; }
code { font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.btn-danger {
  background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA;
}
.btn-danger:hover { background: #FEE2E2; color: #991B1B; }
.table a { color: var(--brand); font-weight: 600; }
.table a:hover { text-decoration: underline; }
.table-actions-sticky { position: sticky; right: 0; background: var(--card); }
.attachment-list { margin-bottom: 10px; }
.attachment-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.attachment-row .remove-label {
  font-size: 0.85em; color: var(--danger); display: inline-flex; align-items: center; gap: 4px;
}
.settings-actions {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 0 4px; margin-top: 8px;
}
.decision-actions { display: flex; flex-direction: column; gap: 12px; }
.decision-actions .app-form {
  padding: 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg);
}
.card-title-static {
  margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--ink);
  padding: 16px 18px 0;
}

/* ========== APP FORMS (Phase 2) ========== */
.app-form .form-group { margin-bottom: 16px; }
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 16px;
}
.repeater-row,
.milestone-row,
.step-row,
.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px 16px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  align-items: end;
}
.metric-row,
.step-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}
.repeater-row:last-of-type,
.milestone-row:last-of-type,
.step-row:last-of-type,
.metric-row:last-of-type {
  border-bottom: 0;
}
.row-remove-cell {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
  margin-bottom: 16px;
}
.row-remove-cell .remove-row {
  white-space: nowrap;
}
.form-control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.form-control:disabled {
  background: var(--bg);
  color: var(--muted);
}
.form-actions {
  display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap;
}
.meta-list > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.meta-list > div span { color: var(--muted); }
.meta-list > div:last-child { border-bottom: 0; }
.content > .alert { margin-bottom: 14px; }
@media (max-width: 768px) {
  .form-grid,
  .repeater-row,
  .milestone-row,
  .step-row,
  .metric-row {
    grid-template-columns: 1fr;
  }
  .row-remove-cell {
    align-items: stretch;
    margin-bottom: 8px;
  }
  .row-remove-cell .remove-row { width: 100%; }
}

/* ========== REPORTS (Phase 12) ========== */
.report-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.report-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.report-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(24, 112, 104, 0.08);
}
.report-card strong { font-size: 15px; color: var(--ink); }
.report-card span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .app-footer, .no-print, .page-actions, .toolbar, .sidebar-nav { display: none !important; }
  .app-shell, .app-main, .content { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .print-only { display: block !important; }
  .print-header { margin-bottom: 16px; }
  .print-header h1 { font-size: 20px; margin: 0 0 4px; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
  a { text-decoration: none; color: #000; }
}

.audit-json {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  overflow: auto;
  max-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========== CALENDAR ========== */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 0;
  color: var(--muted);
}
.cal-cell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 90px;
  padding: 6px;
  background: var(--card);
  vertical-align: top;
}
.cal-cell.cal-empty {
  background: transparent;
  border: none;
}
.cal-cell.cal-today {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.cal-day-num {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.cal-today .cal-day-num {
  color: var(--brand);
}
.cal-task {
  display: block;
  font-size: 0.73rem;
  background: var(--brand);
  color: #fff;
  border-radius: 3px;
  padding: 2px 5px;
  margin-bottom: 3px;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-task:hover {
  opacity: 0.85;
}
.cal-task.cal-overdue {
  background: var(--danger);
}
@media (max-width: 768px) {
  .cal-grid { display: none; }
  .cal-mobile-list { display: block; }
  .cal-cell { min-height: 60px; }
}
.cal-mobile-list { display: none; }
.cal-mobile-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--card);
}
.cal-mobile-day.cal-today { border-color: var(--brand); background: var(--brand-soft); }
.cal-mobile-day h4 { margin: 0 0 8px; font-size: 13px; }
.cal-mobile-day .cal-task { white-space: normal; }

/* ========== PILL MULTI-SELECT ========== */
.pill-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.pill-select {
  position: relative;
  width: 100%;
}
.pill-select-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 28px;
  align-items: center;
}
.pill-select-empty {
  color: var(--muted-2);
  font-size: 12.5px;
}
.pill-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #c5e3de;
}
.pill-select-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.pill-select-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 90, 84, 0.12);
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.pill-select-pill-remove:hover {
  background: var(--brand);
  color: #fff;
}
.pill-select-control {
  position: relative;
}
.pill-select-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.pill-select-search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.pill-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 4px;
}
.pill-select-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13px;
}
.pill-select-option:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.pill-select-option-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
