:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d8dfeb;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #274c77;
  --accent-soft: #eaf0f8;
  --success: #e8f7ed;
  --error: #fdecec;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.topbar h1 { margin: 0; font-size: 1.35rem; }
.topbar-actions { display: flex; gap: 0.75rem; align-items: center; }
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.nav-tabs a {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
}
.nav-tabs a.active, .nav-tabs a:hover { background: var(--accent-soft); }
.page { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}
.narrow { max-width: 480px; margin: 2rem auto; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.header-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.subtle { color: var(--muted); margin: 0.25rem 0 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
}
.button-secondary {
  background: white;
  color: var(--accent);
}
.icon-button {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}
.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.attorney-button { width: 100%; }
.stack-form { display: grid; gap: 1rem; }
.grid { display: grid; gap: 1rem; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 0.72rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  background: white;
}
textarea { resize: vertical; }
.task-list { display: grid; gap: 1rem; }
.task-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.task-meta-row, .task-details {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.task-card {
  border-left: 6px solid #cfd6e4;
  border-radius: 10px;
  padding: 1rem;
}
.task-card h3 { margin: 0.5rem 0; }
/*.badge {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
}
*/
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-brief {
  background: #dbeafe;
  color: #1d4ed8;
}
.badge-memo {
  background: #ede9fe;
  color: #6d28d9;
}
.badge-argument {
  background: #ffedd5;
  color: #c2410c;
}
.badge-minor_filing {
  background: #dcfce7;
  color: #15803d;
}
.badge-minor_research {
  background: #BFBA99;
  color: #FFE23D;
}
.badge-misc {
 color: #160f53;
 background: #9AD872;
}
.task-actions { display: flex; gap: 0.6rem; flex-wrap: nowrap; }
.notes {
  margin-top: 0.75rem;
  color: var(--muted);
}
/*Edits for week-based grouping*/
.week-group {
  margin-bottom: 1rem;
}
.week-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #d9dde5;
}
.week-header h3 {
  margin: 0;
  font-size: 1.05rem;
}
.week-task-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
/*Type-based task card colors*/
.task-type-brief {
  border-left-color: #2f6fed;
  background: #f5f9ff;
}
.task-type-memo {
  border-left-color: #7a3ff2;
  background: #faf7ff;
}
.task-type-argument {
  border-left-color:  #d97706;
  background: #fff8ef;
}
.task-type-minor_filing {
  border-left-color: #0f9d58;
  background: #f2fcf6;
}
.task-type-minor_research {
  border-left-color: #FFE23D;
  background: #FFFADB;
}
.task-type-misc {
  background: #BADFDB;
  border-left-color: #160f53;
}
.task-overdue {
  box-shadow: 0 0 0 4px #f04438 inset;
  position: relative;
}
.task-overdue::after {
  content: "Overdue";
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: (-50%, -50%);
  font-size: 1rem;
  font-weight: 700;
  color: #b42318;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.3 rem 0.6rem;
  border-radius: 6px;
}

.flash-stack { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.flash { padding: 0.9rem 1rem; border-radius: 10px; border: 1px solid var(--border); }
.flash-success { background: var(--success); }
.flash-error { background: var(--error); }
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.modal-panel {
  position: relative;
  z-index: 31;
  max-width: 860px;
  margin: 4vh auto;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 1.25rem;
  max-height: 92vh;
  overflow: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.form-actions { display: flex; justify-content: flex-end; }
.is-hidden-field { display: none; }
#calendar { min-height: 720px; }
@media (max-width: 900px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
  .task-card-main, .page-header, .topbar { flex-direction: column; align-items: stretch; }
}
.you-pill{
  display: inline-flex;
  align-items: center;

  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;

  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;

  color: #111827;
  background: #ffffff;
  border: 1px solid #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}
.owner-chip-wrapper {
  display: inline-flex;
  align-items: center;
}
.owner-chip {
  display: inline-flex;
  align-items: center;

  padding: 0.2rem 0.6rem;
  border-radius: 999px;

  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  
  background: #eef2ff;
  color: #3730a3;

  border: 1px solid #c7d2fe;
  cursor: pointer;

  transition: all 0.15s ease;
}
.owner-chip:hover{
  filter:brightness(0.96);
}
.reassign-form select {
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: white;
}
.hidden {
  display: none !important;
}
