/* ============================================================
   MoM System — Design System v3.0
   Inspired by Lark Base: bright, minimal, rounded, soft-shadow.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #3370FF;
  --primary-dark: #1F54D6;
  --primary-light: #EAF0FF;
  --secondary: #7B61FF;
  --secondary-light: #F1EDFF;
  --success: #16C47F;
  --success-light: #E7FBF3;
  --warning: #FF9F43;
  --warning-light: #FFF3E4;
  --error: #F04438;
  --error-light: #FEECEB;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --ink: #1D2129;
  --ink-muted: #6B7280;
  --ink-faint: #9CA3AF;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 2px 8px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.10);

  --sidebar-w: 240px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', 'SF Pro Display', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ============================================================
   App shell: fixed left sidebar + top bar + scrollable content
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1030;
  transition: width .2s ease;
  overflow: hidden;
}
.app-shell.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
.app-shell.sidebar-collapsed .sidebar-label,
.app-shell.sidebar-collapsed .sidebar-section-title,
.app-shell.sidebar-collapsed .sidebar-brand-content { display: none; }
.app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-link { justify-content: center; }

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sidebar-brand-content {
  width: 100%;
  text-align: center;
}
.sidebar-brand-collapsed-mark {
  display: none;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.08em;
}
.sidebar-brand-logo {
  display: block;
  width: min(100%, 150px);
  height: auto;
  max-height: 52px;
  object-fit: contain;
  margin: 0 auto 6px;
}
.sidebar-brand-meeting {
  display: block;
  padding-top: 6px;
  border-top: 2px solid var(--secondary);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.app-shell.sidebar-collapsed .sidebar-brand-collapsed-mark { display: inline-block; }
.dashboard-task-check:disabled { opacity: .45; cursor: not-allowed; }
.module-control-icon { width:42px; height:42px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:20px; background:#eef2ff; color:#4f46e5; }
.module-control-icon.module-machine { background:#e0f2fe; color:#0369a1; }
.module-control-icon.module-task { background:#fff1e5; color:#ea580c; }
.module-control-icon.module-general { background:#fce7f3; color:#db2777; }
.dashboard-task-checklist { padding:14px; border:1px solid #dbe3ee; border-radius:12px; background:#fff; box-shadow:var(--shadow-sm); }
.dashboard-task-checklist .section-label { justify-content:flex-start; font-size:15px; letter-spacing:.02em; gap:4px; }
.dashboard-task-checklist .section-label i { margin-right:0 !important; font-size:18px; color:#f97316; }
.dashboard-task-table { font-size:12px; }
.dashboard-task-table th { color:var(--ink-muted); font-size:10px; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; }
.dashboard-task-table td { border-color:#e5e7eb; }
.priority-badge { font-weight:600; text-transform:capitalize; }
.priority-high { background:#fee2e2; color:#b91c1c; }
.priority-medium { background:#fef3c7; color:#92400e; }
.priority-low { background:#dcfce7; color:#166534; }
.project-status-card { display:block; min-height:145px; padding:11px; border:1px solid var(--border); border-top:3px solid #60a5fa; border-radius:10px; background:#fff; color:var(--ink); box-shadow:var(--shadow-sm); transition:transform .15s ease, box-shadow .15s ease; }
.dashboard-project-section { padding:12px; border:1px solid #dbe3ee; border-radius:12px; background:#fff; box-shadow:var(--shadow-sm); }
.dashboard-project-section > .d-flex:first-child .section-label { justify-content:flex-start; font-size:15px; letter-spacing:.02em; gap:4px; }
.dashboard-project-section > .d-flex:first-child .section-label i { margin-right:0 !important; font-size:18px; }
.dashboard-section-kickstart > .d-flex:first-child .section-label i { color:#7c3aed; }
.dashboard-section-machine > .d-flex:first-child .section-label i { color:#2563eb; }
.dashboard-section-task > .d-flex:first-child .section-label i { color:#f97316; }
.project-status-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.project-status-card:hover { color:var(--ink); transform:translateY(-2px); box-shadow:var(--shadow); }
.project-status-card > .d-flex:first-child { margin:-11px -11px 8px; padding:8px 11px; border-radius:7px 7px 0 0; }
.project-status-card.status-in_progress { border-color:#facc15; border-top-color:#facc15; background:#fff; }
.project-status-card.status-overdue { border-color:#f87171; border-top-color:#f87171; background:#fff; }
.project-status-card.status-completed { border-color:#4ade80; border-top-color:#4ade80; background:#fff; }
.project-status-card.status-in_progress > .d-flex:first-child { background:#fff8d6; }
.project-status-card.status-overdue > .d-flex:first-child { background:#fff0f0; }
.project-status-card.status-completed > .d-flex:first-child { background:#effcf2; }
.project-status-pill { display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border-radius:999px; background:#eef0f2; color:#475569; font-size:11px; font-weight:700; line-height:1.1; }
.status-in_progress .project-status-pill { background:#fff3bf; color:#8a6500; }
.status-overdue .project-status-pill { background:#fee2e2; color:#b91c1c; }
.status-completed .project-status-pill { background:#dcfce7; color:#15803d; }
.status-dot { width:8px; height:8px; border-radius:50%; background:#60a5fa; }
.status-in_progress .status-dot { background:#eab308; }.status-overdue .status-dot { background:#ef4444; }.status-completed .status-dot { background:#22c55e; }
.project-status-title { display:flex; align-items:center; gap:6px; font-size:14px; line-height:1.25; margin:7px 0; color:#111827; }
.project-status-meta { display:flex; flex-wrap:wrap; gap:8px 14px; font-size:12px; color:var(--ink-muted); }
.project-important-info { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:8px; }
.project-meta-item { display:flex; align-items:center; min-width:0; gap:4px; color:var(--ink-muted); }
.project-meta-item i { flex:0 0 auto; font-size:13px; color:#64748b; }
.project-meta-item strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); font-size:14px; line-height:1.2; font-weight:600; }
.border-dashed { border-style:dashed; }
@media (max-width: 1199.98px) { .project-status-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width: 767.98px) { .project-status-grid { grid-template-columns:1fr; } .dashboard-project-section { padding:12px; } }
.task-status-select.status-pending { background-color: #dff3ff; border-color: #9ed8f4; color: #075985; }
.task-status-select.status-progress { background-color: #fff9a6; border-color: #e7d84b; color: #713f12; }
.task-status-select.status-completed { background-color: #d9f99d; border-color: #86efac; color: #166534; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
  padding: 14px 12px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.sidebar-link:hover { background: var(--primary-light); color: var(--primary-dark); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-link i { flex-shrink: 0; width: 18px; height: 18px; }

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  transition: margin-left .2s ease;
}

.app-topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px 9px 38px;
  font-size: 13.5px;
  transition: border-color .12s, box-shadow .12s;
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--card);
}
.topbar-search .lucide {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); width: 16px; height: 16px;
}
.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  position: relative;
  transition: background .12s;
}
.topbar-icon-btn:hover { background: var(--bg); color: var(--ink); }
.topbar-icon-btn .badge-dot {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--error);
  border: 2px solid var(--card);
}
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar-toggle-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  background: transparent; border: none;
}
.sidebar-toggle-btn:hover { background: var(--bg); }

.app-content { padding: 24px 28px 48px; max-width: 1600px; }

/* ============================================================
   Cards, buttons, badges, forms — Lark-style: soft shadow, rounded
   ============================================================ */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat-card-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-card-label { color: var(--ink-muted); font-size: 12.5px; font-weight: 500; margin-top: 3px; }

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  transition: all .13s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(51,112,255,.28); }

.btn-outline-primary { color: var(--primary); border-color: var(--border); background: var(--card); }
.btn-outline-primary:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

.btn-outline-secondary { color: var(--ink-muted); border-color: var(--border); background: var(--card); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--ink); border-color: var(--ink-faint); }

.btn-outline-danger { color: var(--error); border-color: var(--border); background: var(--card); }
.btn-outline-danger:hover { background: var(--error-light); border-color: var(--error); }

.btn-outline-dark { color: var(--ink); border-color: var(--border); background: var(--card); }
.btn-outline-dark:hover { background: var(--bg); }

.btn-outline-warning { color: var(--warning); border-color: var(--border); background: var(--card); }
.btn-outline-warning:hover { background: var(--warning-light); border-color: var(--warning); }

.btn-kickstart { background: linear-gradient(135deg, var(--secondary), var(--primary)); border: none; color: #fff; }
.btn-kickstart:hover { filter: brightness(1.06); color: #fff; box-shadow: 0 4px 12px rgba(123,97,255,.3); }

.btn-light { background: #fff; color: var(--ink); border-color: var(--border); }

.badge { border-radius: 6px; font-weight: 600; font-size: 11px; padding: .32em .6em; }
.bg-success-subtle { background: var(--success-light) !important; }
.text-success-emphasis { color: #0E9A66 !important; }
.bg-danger-subtle { background: var(--error-light) !important; }
.text-danger-emphasis { color: #D92D20 !important; }
.bg-warning-subtle { background: var(--warning-light) !important; }
.text-warning-emphasis { color: #DD8420 !important; }
.bg-primary-subtle { background: var(--primary-light) !important; }
.text-primary-emphasis { color: var(--primary-dark) !important; }
.bg-secondary-subtle { background: #F0F1F3 !important; }
.text-secondary-emphasis { color: var(--ink-muted) !important; }

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13.5px;
  padding: 8px 12px;
  transition: border-color .12s, box-shadow .12s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-label { font-weight: 600; font-size: 12.5px; color: var(--ink); margin-bottom: 5px; }
.form-text { color: var(--ink-faint); font-size: 12px; }

.avatar-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11.5px;
  flex-shrink: 0;
}

/* --- Tables: sticky header, hover row, modern look --- */
.table {
  --bs-table-bg: transparent;
  font-size: 13.5px;
}
.table thead th {
  position: sticky; top: 0; z-index: 5;
  background: #FAFBFC;
  border-bottom: 1px solid var(--border);
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 11px 12px;
}
.table tbody td { padding: 10px 12px; border-color: var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table-hover tbody tr:hover { background: var(--primary-light); }

.task-table th {
  background: var(--primary);
  color: #fff;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}
.task-table td, .task-table th { border-color: var(--border) !important; }
.task-table-zebra tbody tr:nth-child(even) { background-color: #FAFBFC; }
.task-grid-scroll { max-height: 68vh; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.task-editor-table { min-width: 1820px; margin-bottom: 0; table-layout: fixed; }
.task-editor-table td { padding: 8px !important; vertical-align: top !important; }
.task-editor-table .form-control, .task-editor-table .form-select { min-width: 0; }
.task-editor-table textarea { resize: vertical; overflow: hidden; line-height: 1.35; }
.machine-plan-table { min-width: 1760px; }
.machine-plan-table th { position: relative; white-space: normal; }
.machine-plan-table th:nth-child(8), .machine-plan-table td:nth-child(8) { min-width: 480px; }
.machine-plan-table td:nth-child(8) textarea { min-height: 104px; resize: both; overflow: auto; }
.machine-column-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 2; }
.machine-column-resizer:hover, .machine-column-resizer.is-resizing { background: rgba(255,255,255,.4); }
.machine-action-grid { table-layout: fixed; min-width: 2060px; }
.machine-action-grid th { position: relative; vertical-align: top; }
.machine-action-grid td { vertical-align: top; }
.machine-action-grid textarea.general-cell { min-height: 92px; resize: both; overflow: auto; white-space: pre-wrap; }
.machine-action-grid textarea.machine-remarks-textarea { min-height: 150px; resize: vertical; line-height: 1.45; padding: .6rem; }
.text-preline { white-space: pre-line; }
.task-editor-focus { position: fixed; inset: 14px; z-index: 1060; margin: 0 !important; box-shadow: 0 18px 60px rgba(16, 24, 40, .24); overflow: hidden; }
.task-editor-focus .card-body { height: 100%; display: flex; flex-direction: column; }
.task-editor-focus .task-grid-scroll { flex: 1; max-height: none; }
.task-editor-focus-active { overflow: hidden; }
.task-discussion-cell { min-width: 200px; }
.task-discussion-cell ul { margin-bottom: 0; padding-left: 1.1rem; }
.task-discussion-cell li { margin-bottom: 2px; }

.card-mom-title { font-weight: 700; color: var(--ink); font-size: 15px; }

.info-box { border: 1.5px solid var(--primary); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }
.info-box-header { background: linear-gradient(90deg, var(--primary), var(--secondary)); color: #fff; padding: .6rem 1.25rem; font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .04em; }
.info-box-body { padding: 1.1rem 1.25rem; background: var(--card); }
.info-box dt { color: var(--ink-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.info-box dd { margin-bottom: .6rem; font-weight: 600; color: var(--ink); }

.section-label { font-weight: 700; color: var(--ink); text-transform: uppercase; font-size: .78rem; letter-spacing: .04em; margin-bottom: .6rem; display: flex; align-items: center; justify-content: space-between; }

.search-bar { background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

.booking-slot { border-left: 3px solid var(--primary); background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }

.venue-pick-card { transition: box-shadow .15s, border-color .15s; border-radius: var(--radius); }
.venue-pick-card:hover { box-shadow: var(--shadow); border-color: var(--primary) !important; }

.template-picker { border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); background: linear-gradient(180deg, #fff, #fbfcff); }
.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.template-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 14px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  text-align: left;
  text-decoration: none;
  position: relative;
  width: 100%;
}
.template-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--primary); color: var(--ink); }
.template-card.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 6px 18px rgba(51,112,255,.12); }
.template-card.disabled {
  opacity: .58;
  cursor: not-allowed;
  background: #fafafa;
  text-align: left;
  border: 1px solid var(--border);
}
.template-card-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: #F3F6FF;
  color: var(--primary);
}
.template-card-title { font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.25; }
.template-card-desc { font-size: 12px; color: var(--ink-muted); margin-top: 2px; line-height: 1.25; }
.template-card:nth-child(1) .template-card-icon { background: #F1F5FF; color: #4F6BED; }
.template-card:nth-child(2) .template-card-icon { background: #F2F7FF; color: #3A86FF; }
.template-card:nth-child(3) .template-card-icon { background: #FFF1E8; color: #EA731D; }
.template-card:nth-child(4) .template-card-icon { background: #FFF0F6; color: #D9468B; }
.template-card-check { position: absolute; top: 12px; right: 12px; color: var(--primary); }
.template-card-badge { display: inline-block; margin-top: 8px; width: fit-content; padding: 2px 7px; border-radius: 999px; background: #eef1f5; color: var(--ink-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 767.98px) { .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.general-grid-scroll { max-height: 520px; overflow: auto; }
.general-action-grid { min-width: 760px; margin-bottom: 0; }
.general-action-grid thead th { position: sticky; top: 0; z-index: 2; background: #f3f6fb; min-width: 150px; }
.general-action-grid thead th:last-child { min-width: 95px; }
.general-action-grid td { min-width: 150px; padding: .35rem; }
.general-action-grid .general-cell { min-height: 42px; }
.general-action-grid textarea.general-cell { min-width: 240px; min-height: 86px; resize: vertical; }
.general-action-grid input { border-color: transparent; background: transparent; min-height: 36px; }
.general-action-grid input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 .15rem rgba(51,112,255,.12); }
.general-action-grid select.general-cell { font-weight: 600; border-radius: 999px; }
.general-action-grid select.general-cell[data-type="department"], .general-action-grid select.general-cell[data-type="person"] { min-width: 210px; border-radius: 7px; font-weight: 500; background-color: #fff; }
.general-action-grid select.general-cell option[value="not_started"] { color: #64748b; }
.general-action-grid select.general-cell option[value="in_progress"] { color: #2563eb; }
.general-action-grid select.general-cell option[value="pending"] { color: #d97706; }
.general-action-grid select.general-cell option[value="completed"] { color: #16a34a; }
.general-action-grid select.general-cell option[value="cancelled"] { color: #dc2626; }
.project-task-grid .general-action-grid tbody tr { transition: background-color .15s ease, box-shadow .15s ease; }
.project-task-grid .general-action-grid tbody tr.task-row-completed { background: #ecfdf5; }
.project-task-grid .general-action-grid tbody tr.task-row-completed td { border-color: #bbf7d0; }
.project-task-grid .general-action-grid tbody tr.task-row-overdue { background: #fff1f2; }
.project-task-grid .general-action-grid tbody tr.task-row-overdue td { border-color: #fecdd3; }
.project-task-grid .general-action-grid tbody tr.task-row-upcoming { background: #eff6ff; }
.project-task-grid .general-action-grid .checklist-completed { width: 22px; height: 22px; accent-color: #16a34a; cursor: pointer; display: block; margin: .35rem auto; }
.project-task-grid .general-action-grid .timeline-cell { min-width: 190px; color: #2563eb; font-weight: 600; background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 100%); border-color: #bfdbfe; text-align: center; }
.project-task-grid .general-action-grid .priority-high { color: #b91c1c; background: #fee2e2; border-color: #fecaca; font-weight: 700; }
.project-task-grid .general-action-grid .priority-medium { color: #b45309; background: #fef3c7; border-color: #fde68a; font-weight: 700; }
.project-task-grid .general-action-grid .priority-low { color: #166534; background: #dcfce7; border-color: #bbf7d0; font-weight: 700; }
.general-richtext { min-height: 170px; resize: vertical; }
.legacy-task-editor { display: none !important; }
.general-grid-focus { position: fixed; inset: 14px; z-index: 1060; margin: 0 !important; box-shadow: 0 18px 60px rgba(16, 24, 40, .24); overflow: hidden; }
.general-grid-focus .card-body { height: 100%; display: flex; flex-direction: column; }
.general-grid-focus .general-grid-scroll { flex: 1; max-height: none; }
.rich-toolbar { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; background: #f8fafc; }
.rich-toolbar button { border: 0; background: transparent; padding: 3px 9px; border-radius: 5px; color: var(--ink); }
.rich-toolbar button:hover { background: #e8eefb; }
.rich-editor { min-height: 170px; border: 1px solid var(--border); border-radius: 0 0 8px 8px; padding: 12px; outline: 0; overflow-y: auto; }
.rich-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 .15rem rgba(51,112,255,.12); }

/* ETD dashboard project portfolio */
.etd-portfolio { background: var(--card); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-sm); padding: 24px; }
.etd-portfolio-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.etd-portfolio-title { font-size: 21px; font-weight: 800; color: var(--ink); }
.etd-summary { display: flex; gap: 42px; margin: 20px 0 22px; }
.etd-summary div { display: flex; flex-direction: column; }
.etd-summary strong { font-size: 23px; line-height: 1.1; color: var(--ink); }
.etd-summary span { color: var(--ink-muted); font-size: 12px; margin-top: 4px; }
.etd-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-height: 610px; overflow-y: auto; padding: 2px 7px 4px 2px; }
.etd-project-card { min-height: 260px; display: flex; flex-direction: column; border-radius: 27px; padding: 20px; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.etd-project-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.etd-project-overdue { background: #FFE2E4; }
.etd-project-soon { background: #FFF0D9; }
.etd-project-upcoming { background: #DDF3FB; }
.etd-card-top { display: flex; justify-content: space-between; color: var(--ink-muted); font-size: 14px; font-weight: 600; line-height: 1.15; }
.etd-card-top i { font-size: 22px; line-height: 15px; color: var(--ink); }
.etd-card-title { text-align: center; font-size: 18px; font-weight: 800; margin-top: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etd-card-subtitle { text-align: center; font-size: 15px; color: var(--ink-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etd-card-progress-label { margin-top: auto; font-size: 15px; font-weight: 800; }
.etd-card-progress { height: 6px; border-radius: 20px; background: rgba(255,255,255,.78); margin-top: 8px; }
.etd-card-progress .progress-bar { background: var(--ink); border-radius: 20px; }
.etd-project-overdue .progress-bar { background: #EA5B4C; }
.etd-project-soon .progress-bar { background: #F28C28; }
.etd-project-upcoming .progress-bar { background: #167B8E; }
.etd-card-percent { text-align: right; font-size: 16px; font-weight: 800; line-height: 1; margin-top: 5px; }
.etd-card-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.etd-card-bottom strong { padding: 6px 10px; border-radius: 20px; background: rgba(255,255,255,.72); color: var(--ink); white-space: nowrap; font-size: 13px; }
.dashboard-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.dashboard-widget-hidden { display: none !important; }
@media (max-width: 991.98px) { .etd-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .etd-portfolio { padding: 18px; } .etd-summary { gap: 20px; } .etd-project-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 12px; } .etd-project-card { min-height: 235px; padding: 15px; } .etd-card-title { font-size: 16px; margin-top: 18px; } .etd-card-subtitle { font-size: 13px; } .etd-card-top { font-size: 12px; } }

.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.text-brand { color: var(--primary); }

.gantt .bar-wrapper.gantt-status-not_started .bar { fill: var(--ink-faint); }
.gantt .bar-wrapper.gantt-status-in_progress .bar { fill: var(--primary); }
.gantt .bar-wrapper.gantt-status-done .bar { fill: var(--success); }
.gantt .bar-wrapper.gantt-status-overdue .bar { fill: var(--error); }
.gantt .bar-wrapper .bar-progress { fill: rgba(0,0,0,.15); }

.dynrow-remove { cursor: pointer; }

/* Password fields use an eye button without changing their normal sizing. */
.password-toggle-wrap { position: relative; }
.password-toggle-wrap input { padding-right: 2.75rem; }
.password-toggle-btn {
  position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
  width: 2.25rem; height: 2.25rem; border: 0; background: transparent;
  color: var(--ink-muted); border-radius: 6px; cursor: pointer;
}
.password-toggle-btn:hover, .password-toggle-btn:focus { color: var(--ink); background: var(--primary-light); outline: none; }

/* Modals rounded to match */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }

/* Responsive: collapse sidebar automatically on small screens */
@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app-shell.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
  .app-main { margin-left: 0 !important; }
  .app-content { padding: 16px; }
}
