/* ─── FONTS ───────────────────────────────────────────────────────────────── */
@font-face { font-family:"Lato"; font-weight:100; font-display:swap; src:url("fonts/Lato-Thin.ttf") format("truetype"); }
@font-face { font-family:"Lato"; font-weight:300; font-display:swap; src:url("fonts/Lato-Light.ttf") format("truetype"); }
@font-face { font-family:"Lato"; font-weight:400; font-display:swap; src:url("fonts/Lato-Regular.ttf") format("truetype"); }
@font-face { font-family:"Lato"; font-weight:700; font-display:swap; src:url("fonts/Lato-Bold.ttf") format("truetype"); }
@font-face { font-family:"Lato"; font-weight:900; font-display:swap; src:url("fonts/Lato-Black.ttf") format("truetype"); }
@font-face { font-family:"PP Monument Extended"; font-weight:900; font-display:swap; src:url("fonts/PPMonumentExtended-Black.ttf") format("truetype"); }

/* ─── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  /* Marktplatz Brand */
  --mp-primary:       #0064d3;
  --mp-primary-hover: #0054b0;
  --mp-primary-press: #003f87;
  --mp-dark-blue:     #1d3557;
  --mp-cyan:          #3ec0f0;
  --mp-magenta:       #941680;

  /* Brand gradient (Sina badge & specials only) */
  --gradient:    linear-gradient(135deg, #941680 0%, #0064d3 55%, #3ec0f0 100%);
  --gradient-h:  linear-gradient(135deg, #7a1269 0%, #0054b0 55%, #00aede 100%);

  /* Surfaces */
  --bg:       #f5f7fb;
  --surface:  #ffffff;

  /* Text */
  --fg:     #1d3557;
  --dark:   #1d3557;
  --mid:    #3a4a64;
  --muted:  #5b6a82;
  --subtle: #8a98ad;

  /* Borders */
  --border:     #e7ecf3;
  --border-mid: #c9d2e0;

  /* Status */
  --green:      #1f9d55;
  --green-bg:   rgba(31,157,85,.12);
  --green-text: #14693a;
  --red:        #dc2626;
  --red-bg:     rgba(220,38,38,.12);
  --orange:     #d97706;
  --orange-bg:  rgba(217,119,6,.12);
  --blue:       #0064d3;
  --blue-bg:    rgba(0,100,211,.10);
  --gray-bg:    rgba(29,53,87,.05);

  /* Shadows (blue-tinted, from DS) */
  --shadow-xs: 0 1px 2px rgba(29,53,87,.06);
  --shadow-sm: 0 1px 3px rgba(29,53,87,.08), 0 1px 2px rgba(29,53,87,.04);
  --shadow-md: 0 4px 12px rgba(29,53,87,.08), 0 2px 4px rgba(29,53,87,.04);
  --shadow-lg: 0 12px 32px rgba(29,53,87,.12), 0 4px 8px rgba(29,53,87,.06);
  --shadow-brand: 0 4px 16px rgba(0,100,211,.22), 0 2px 6px rgba(0,100,211,.12);

  /* Radius (Marktplatz: sharper) */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   8px;
  --r-xl:   12px;
  --r-pill: 999px;

  /* Motion */
  --ease:   cubic-bezier(0.2,0,0,1);
  --spring: cubic-bezier(0.16,1,0.3,1);
  --fast:   0.12s;
  --mid-t:  0.2s;
  --slow:   0.32s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── NAVBAR ─────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 56px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}
.navbar-logo { height: 22px; width: auto; }
.navbar-wordmark {
  font-family: "Lato", sans-serif;
  font-size: .875rem;
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -.01em;
}
.navbar-wordmark span { color: var(--mp-primary); font-weight: 700; }

.navbar-actions { display: flex; align-items: center; gap: .5rem; }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .52rem 1rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 700;
  font-family: "Lato", inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--fast) var(--ease),
              color var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--mp-primary);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover  { background: var(--mp-primary-hover); box-shadow: 0 4px 20px rgba(0,100,211,.3); }
.btn-primary:active { background: var(--mp-primary-press); }

.btn-white {
  background: var(--surface);
  color: var(--dark);
  border-color: var(--border-mid);
  box-shadow: var(--shadow-xs);
}
.btn-white:hover { border-color: var(--dark); box-shadow: var(--shadow-sm); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: .4rem .55rem;
}
.btn-ghost:hover { background: var(--gray-bg); color: var(--dark); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(220,38,38,.2);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31,157,85,.25);
}
.btn-green:hover { filter: brightness(1.06); }

.btn-sm { padding: .3rem .75rem; font-size: .8rem; }

.btn-navbar {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-mid);
  font-size: .8rem;
}
.btn-navbar:hover { background: var(--gray-bg); color: var(--dark); border-color: var(--border-mid); }

/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 2rem; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 2rem; }

/* ─── HUB LAYOUT ─────────────────────────────────────────────────────────── */
.hub-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.75rem;
  align-items: start;
}
@media (max-width: 1024px) { .hub-layout { grid-template-columns: 1fr; } }

/* ─── HUB TABS ───────────────────────────────────────────────────────────── */
.hub-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}
.hub-tab {
  padding: .55rem 1.25rem;
  font-size: .875rem;
  font-weight: 700;
  font-family: "Lato", inherit;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--fast), border-color var(--fast);
}
.hub-tab:hover { color: var(--dark); }
.hub-tab.active { color: var(--mp-primary); border-bottom-color: var(--mp-primary); }
.hub-tab-panel.hidden { display: none; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
}
.section-header h2 {
  font-size: .72rem;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: "Lato", inherit;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ─── PROJECT CARD ───────────────────────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0,100,211,.15);
}
.project-card.overdue {
  background: #fff5f5;
  border-color: #fca5a5;
}
.project-card.overdue:hover {
  border-color: #f87171;
  box-shadow: 0 4px 16px rgba(220,38,38,.12);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.project-card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}
.project-card-client {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .2rem;
}
.project-card-meta {
  font-size: .77rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}

.notification-badge {
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .3rem;
  flex-shrink: 0;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--gray-bg);
  border-radius: 2px;
  overflow: hidden;
  margin-top: .4rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--mp-primary);
  border-radius: 2px;
  transition: width .6s var(--ease);
}
.progress-label { font-size: .73rem; color: var(--muted); }

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .18rem .6rem;
  border-radius: var(--r-pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
  font-family: "Lato", inherit;
}
.badge-planned    { background: var(--gray-bg);    color: var(--muted); }
.badge-active     { background: var(--blue-bg);    color: var(--mp-primary); }
.badge-completed  { background: var(--green-bg);   color: var(--green-text); }
.badge-delayed    { background: var(--red-bg);     color: var(--red); }
.badge-archived   { background: var(--gray-bg);    color: var(--subtle); }
.badge-in_progress{ background: var(--blue-bg);    color: var(--mp-primary); }

/* ─── ACTIVITY SIDEBAR ───────────────────────────────────────────────────── */
.activity-sidebar { position: sticky; top: 72px; }

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  padding: 1.25rem;
}

.activity-feed { display: flex; flex-direction: column; }
.activity-item { padding: .65rem 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-action { font-size: .82rem; color: var(--dark); font-weight: 700; }
.activity-project { font-size: .74rem; color: var(--mp-primary); font-weight: 700; }
.activity-time { font-size: .7rem; color: var(--subtle); margin-top: .1rem; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: "Lato", inherit;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 44px;
  padding: 0 .875rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-family: "Lato", inherit;
  font-weight: 400;
  color: var(--dark);
  background: var(--surface);
  outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--mp-primary);
  box-shadow: 0 0 0 3px rgba(0,100,211,.16);
}
.form-input::placeholder { color: var(--subtle); }
.form-textarea { height: auto; padding: .65rem .875rem; resize: vertical; min-height: 80px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--mp-primary); cursor: pointer; }

/* ─── TEMPLATE GRID ──────────────────────────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.template-card {
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: .8rem;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.template-card:hover { border-color: var(--mp-primary); background: rgba(0,100,211,.03); }
.template-card.selected {
  border-color: var(--mp-primary);
  background: rgba(0,100,211,.06);
  box-shadow: 0 0 0 3px rgba(0,100,211,.12);
}
.template-card strong { display: block; font-size: .84rem; color: var(--dark); margin-bottom: .25rem; }
.template-card small { font-size: .72rem; color: var(--muted); line-height: 1.45; }

/* ─── MODALS ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29,53,87,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in var(--fast) var(--ease);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slide-up var(--mid-t) var(--spring);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -.01em;
  font-family: "Lato", inherit;
}

/* ─── PROJECT PAGE HEADER ────────────────────────────────────────────────── */
.project-header {
  background: #fff;
  padding: 2rem 1.5rem 1.75rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.project-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mp-primary) 0%, var(--mp-cyan) 100%);
}

.header-blob { display: none; }

.header-float-card {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
}

.project-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}

.project-title {
  font-family: "PP Monument Extended", "Lato", sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--dark);
}
.project-subtitle {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .35rem;
  font-family: "Lato", inherit;
}
.project-header-actions { display: flex; gap: .45rem; flex-wrap: wrap; }

/* ─── SINA BADGE ──────────────────────────────────────────────────────────── */
.sina-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.sina-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(-4deg);
  transition: transform var(--slow) var(--spring), filter var(--mid-t) var(--ease);
  cursor: pointer;
  user-select: none;
}
.sina-badge:hover {
  transform: rotate(0deg) scale(1.06);
  filter: drop-shadow(0 8px 24px rgba(0,100,211,.3));
}

.sina-badge-outer {
  position: relative;
  width: 170px;
  height: 170px;
}

.sina-spin-text {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: badge-spin 18s linear infinite;
}
.sina-badge:hover .sina-spin-text { animation-duration: 12s; }
@keyframes badge-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.sina-photo-ring {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gradient);
  padding: 3px;
  box-shadow: 0 4px 24px rgba(0,100,211,.35), 0 0 0 2px rgba(255,255,255,.8);
}
.sina-photo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid #fff;
}

.sina-crown {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
  animation: crown-bounce 5s ease-in-out infinite;
}
@keyframes crown-bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}

.sina-ribbon {
  background: var(--gradient);
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .28rem .9rem;
  border-radius: var(--r-pill);
  margin-top: -.2rem;
  box-shadow: var(--shadow-brand);
  white-space: nowrap;
  position: relative;
  z-index: 2;
  font-family: "Lato", inherit;
}

.sina-tagline {
  font-size: .7rem;
  color: var(--subtle);
  margin-top: .55rem;
  text-align: center;
  line-height: 1.4;
  font-style: italic;
}

/* ─── PHASE TIMELINE (GANTT) ─────────────────────────────────────────────── */
.ptl-wrapper {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.ptl-heading {
  font-size: .72rem;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
  font-family: "Lato", inherit;
}

.ptl-track {
  position: relative;
  height: 48px;
  border-radius: var(--r-sm);
  overflow: visible;
}
.ptl-track.ptl-equal {
  display: flex;
  gap: 3px;
  height: 48px;
}

.ptl-seg {
  position: absolute;
  height: 100%;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 .7rem;
  overflow: hidden;
  transition: transform var(--fast) var(--spring), filter var(--fast) var(--ease);
  box-shadow: var(--shadow-sm);
}
.ptl-seg.ptl-seg-equal { position: relative; flex: 1; min-width: 0; }
.ptl-seg:hover { transform: translateY(-2px); filter: brightness(1.06); z-index: 10; box-shadow: var(--shadow-md); }

.ptl-seg.ptl-planned    { background: #c9d2e0; }
.ptl-seg.ptl-in_progress { background: var(--mp-primary); }
.ptl-seg.ptl-completed  { background: var(--green); }
.ptl-seg.ptl-delayed    { background: var(--red); }

.ptl-name  { font-size: .72rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ptl-range { font-size: .62rem; color: rgba(255,255,255,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .05rem; }

.ptl-today-line {
  position: absolute;
  top: -6px; bottom: -6px;
  width: 2px;
  background: var(--orange);
  border-radius: 2px;
  z-index: 20;
  box-shadow: 0 0 6px rgba(217,119,6,.5);
}
.ptl-today-tag {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .62rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  background: var(--surface);
  padding: .1rem .35rem;
  border-radius: 3px;
  border: 1px solid rgba(217,119,6,.3);
}

.ptl-rail { height: 3px; background: var(--gray-bg); border-radius: 2px; margin-top: .75rem; }

/* ─── DELAY BANNER ───────────────────────────────────────────────────────── */
.delay-banner {
  background: var(--red-bg);
  border-bottom: 1px solid rgba(220,38,38,.2);
  padding: .7rem 2rem;
  font-size: .84rem;
  color: var(--red);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.delay-banner.hidden { display: none; }

/* ─── TIMELINE (VERTICAL) ────────────────────────────────────────────────── */
.timeline { position: relative; padding: .5rem 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--mp-primary), var(--mp-cyan));
  opacity: .25;
  border-radius: 2px;
}

.phase-block { position: relative; padding-left: 44px; margin-bottom: .875rem; }
.phase-dot {
  position: absolute;
  left: 6px;
  top: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  z-index: 1;
  transition: box-shadow var(--fast) var(--ease);
}
.phase-block:hover .phase-dot { transform: none; }
.phase-dot.planned    { background: var(--subtle); box-shadow: 0 0 0 3px rgba(138,152,173,.2); }
.phase-dot.in_progress{ background: var(--mp-primary); box-shadow: 0 0 0 4px rgba(0,100,211,.2), 0 0 10px rgba(0,100,211,.25); }
.phase-dot.completed  { background: var(--green); box-shadow: 0 0 0 4px rgba(31,157,85,.2); }
.phase-dot.delayed    { background: var(--red); box-shadow: 0 0 0 4px rgba(220,38,38,.2); }

/* ─── PHASE CARD ─────────────────────────────────────────────────────────── */
.phase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--mid-t) var(--ease), border-color var(--mid-t) var(--ease);
}
.phase-card:hover { box-shadow: var(--shadow-md); }
.phase-card.delayed { border-color: rgba(220,38,38,.3); }
.phase-card.completed { opacity: .85; }

.phase-card-header {
  padding: .95rem 1.15rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--fast) var(--ease);
}
.phase-card-header:hover { background: var(--gray-bg); }

.phase-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--dark);
  flex: 1;
  font-family: "Lato", inherit;
}
.phase-dates { font-size: .76rem; color: var(--muted); margin-top: .1rem; }

.phase-card-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-left: auto; }

.phase-chevron {
  color: var(--subtle);
  transition: transform var(--mid-t) var(--ease);
  flex-shrink: 0;
}
.phase-chevron.open { transform: rotate(90deg); color: var(--mp-primary); }

.phase-body {
  border-top: 1px solid var(--border);
  padding: 1.15rem;
  display: none;
  background: var(--bg);
}
.phase-body.open { display: block; }

/* ─── PHASE SECTIONS ─────────────────────────────────────────────────────── */
.phase-section { margin-bottom: 1.35rem; }
.phase-section:last-child { margin-bottom: 0; }
.phase-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--subtle);
  margin-bottom: .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "Lato", inherit;
}

.phase-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .6rem;
  margin-bottom: .6rem;
}
@media (max-width: 600px) { .phase-edit-grid { grid-template-columns: 1fr; } }

/* ─── TODOS ──────────────────────────────────────────────────────────────── */
.todo-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 580px) { .todo-columns { grid-template-columns: 1fr; } }

.todo-column-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  font-family: "Lato", inherit;
}
.todo-column-label.agency { color: var(--mp-primary); }
.todo-column-label.client { color: var(--mp-cyan); }

.todo-list { display: flex; flex-direction: column; gap: .25rem; }

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .4rem .55rem;
  border-radius: var(--r-sm);
  transition: background var(--fast) var(--ease);
}
.todo-item:hover { background: var(--gray-bg); }

.todo-checkbox { width: 15px; height: 15px; accent-color: var(--mp-primary); cursor: pointer; flex-shrink: 0; margin-top: 2px; }
.todo-text { flex: 1; font-size: .86rem; line-height: 1.45; color: var(--dark); }
.todo-text.done { text-decoration: line-through; color: var(--subtle); }

.todo-actions { display: flex; gap: .2rem; opacity: 0; transition: opacity var(--fast) var(--ease); }
.todo-item:hover .todo-actions { opacity: 1; }

.comment-count {
  font-size: .68rem;
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--r-pill);
  padding: .1rem .38rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast) var(--ease);
}
.comment-count:hover { background: var(--red); color: #fff; }
.comment-count.read { background: var(--gray-bg); color: var(--muted); }

.todo-add-row { display: flex; gap: .4rem; margin-top: .45rem; }
.todo-add-input {
  flex: 1;
  padding: .4rem .7rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-size: .84rem;
  font-family: "Lato", inherit;
  outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  background: var(--surface);
  height: 36px;
}
.todo-add-input:focus {
  border-color: var(--mp-primary);
  box-shadow: 0 0 0 3px rgba(0,100,211,.12);
}

/* ─── MEETINGS ───────────────────────────────────────────────────────────── */
.meeting-list { display: flex; flex-direction: column; gap: .7rem; }

.meeting-item {
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.meeting-item:focus-within {
  border-color: rgba(0,100,211,.3);
  box-shadow: 0 0 0 3px rgba(0,100,211,.08);
}
.meeting-header {
  padding: .55rem .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--gray-bg);
  border-bottom: 1px solid var(--border);
}
.meeting-date-input {
  border: none;
  outline: none;
  font-size: .8rem;
  font-weight: 700;
  font-family: "Lato", inherit;
  color: var(--dark);
  background: transparent;
  cursor: pointer;
  width: 130px;
  flex-shrink: 0;
}
.meeting-date-input:focus { color: var(--mp-primary); }
.meeting-title-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: .84rem;
  font-family: "Lato", inherit;
  color: var(--muted);
}
.meeting-title-input::placeholder { color: var(--subtle); }
.meeting-notes-textarea {
  width: 100%;
  border: none;
  outline: none;
  padding: .75rem .85rem;
  font-size: .875rem;
  font-family: "Lato", inherit;
  line-height: 1.65;
  resize: none;
  color: var(--dark);
  background: var(--surface);
  min-height: 80px;
}
.meeting-notes-textarea::placeholder { color: var(--subtle); }

/* ─── MEETING RICH EDITOR ────────────────────────────────────────────────── */
.meeting-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: .3rem .6rem;
  background: var(--gray-bg);
  border-bottom: 1px solid var(--border);
}
.meeting-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font: 700 13px "Lato", sans-serif;
  color: var(--ink-600);
  cursor: pointer;
  transition: background 100ms, color 100ms;
  flex-shrink: 0;
}
.meeting-toolbar button:hover { background: var(--border); color: var(--dark); }
.meeting-toolbar button.is-active { background: rgba(0,100,211,.12); color: var(--mp-primary); }
.meeting-toolbar__sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.meeting-toolbar__expand { margin-left: auto !important; color: var(--muted); }

.meeting-editor {
  width: 100%;
  min-height: 90px;
  padding: .75rem .85rem;
  font-size: .875rem;
  font-family: "Lato", inherit;
  line-height: 1.7;
  color: var(--dark);
  background: var(--surface);
  outline: none;
  cursor: text;
}
.meeting-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--subtle);
  pointer-events: none;
}
.meeting-editor ul { padding-left: 1.4em; margin: .3em 0; }
.meeting-editor ol { padding-left: 1.6em; margin: .3em 0; }
.meeting-editor li { margin: .15em 0; }
.meeting-editor b, .meeting-editor strong { font-weight: 700; }

/* ─── MEETING EXPAND OVERLAY ─────────────────────────────────────────────── */
.meeting-expand-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(29,53,87,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.meeting-expand-overlay.hidden { display: none; }
.meeting-expand-box {
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 860px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.meeting-expand-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--gray-bg);
  flex-shrink: 0;
}
.meeting-expand-header input[type="date"],
.meeting-expand-header input[type="text"] {
  border: none;
  outline: none;
  background: transparent;
  font-family: "Lato", inherit;
}
.meeting-expand-header input[type="date"] { font-size: .85rem; font-weight: 700; color: var(--dark); width: 140px; }
.meeting-expand-header input[type="text"] { flex: 1; font-size: 1rem; font-weight: 700; color: var(--dark); }
.meeting-expand-toolbar { flex-shrink: 0; }
.meeting-expand-editor {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  font-family: "Lato", inherit;
  line-height: 1.75;
  color: var(--dark);
  outline: none;
}
.meeting-expand-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--subtle);
  pointer-events: none;
}
.meeting-expand-editor ul { padding-left: 1.5em; margin: .4em 0; }
.meeting-expand-editor ol { padding-left: 1.8em; margin: .4em 0; }
.meeting-expand-editor li { margin: .2em 0; }
.meeting-expand-editor b, .meeting-expand-editor strong { font-weight: 700; }

/* ─── COMMENTS ───────────────────────────────────────────────────────────── */
.comment-list { display: flex; flex-direction: column; gap: .5rem; }
.comment-bubble {
  max-width: 84%;
  padding: .6rem .85rem;
  border-radius: var(--r-md);
  font-size: .85rem;
  line-height: 1.45;
}
.comment-bubble.pm {
  background: var(--mp-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,100,211,.2);
}
.comment-bubble.client {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  color: var(--dark);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  box-shadow: var(--shadow-xs);
}
.comment-meta { font-size: .67rem; margin-top: .2rem; color: rgba(255,255,255,.55); text-align: right; }
.comment-meta.client-meta { color: var(--subtle); text-align: left; }
.comment-input-row { display: flex; gap: .5rem; }
.comment-input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-family: "Lato", inherit;
  outline: none;
  transition: border-color var(--fast) var(--ease);
  height: 44px;
}
.comment-input:focus { border-color: var(--mp-primary); box-shadow: 0 0 0 3px rgba(0,100,211,.12); }

/* ─── APPROVAL ───────────────────────────────────────────────────────────── */
.approval-section {
  background: var(--blue-bg);
  border: 1px solid rgba(0,100,211,.2);
  border-radius: var(--r-md);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.approval-section.approved { background: var(--green-bg); border-color: rgba(31,157,85,.2); }
.approval-text { font-size: .85rem; font-weight: 700; color: var(--dark); }
.approval-meta { font-size: .74rem; color: var(--muted); margin-top: .1rem; }

/* ─── COPY LINK ──────────────────────────────────────────────────────────── */
.copy-link-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: .45rem .45rem .45rem .85rem;
}
.copy-link-url { flex: 1; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── CLIENT PAGE ────────────────────────────────────────────────────────── */
.client-header {
  background: var(--mp-dark-blue);
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.client-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0,100,211,.35) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(62,192,240,.2) 0%, transparent 60%);
  pointer-events: none;
}
.client-header h1 {
  font-family: "PP Monument Extended", "Lato", sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -.02em;
  position: relative;
  z-index: 1;
}
.client-header p { color: rgba(255,255,255,.6); margin-top: .4rem; position: relative; z-index: 1; }
.client-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.8);
  font-size: .78rem;
  padding: .32rem .75rem;
  border-radius: var(--r-pill);
  margin-top: .85rem;
  position: relative;
  z-index: 1;
}

/* ─── MISC ───────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.empty-state { text-align: center; padding: 1.5rem; color: var(--subtle); font-size: .84rem; }
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.mt-1 { margin-top: .5rem; }

/* ─── TOAST ──────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; display: flex; flex-direction: column; gap: .4rem; }
.toast {
  background: var(--mp-dark-blue);
  color: #fff;
  padding: .65rem 1.05rem;
  border-radius: var(--r-md);
  font-size: .84rem;
  font-family: "Lato", inherit;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: slide-up var(--fast) var(--spring);
  max-width: 300px;
  border: 1px solid rgba(255,255,255,.08);
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ─── CHANGELOG ──────────────────────────────────────────────────────────── */
.changelog-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.changelog-item { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.changelog-item:last-child { border-bottom: none; }
.changelog-action { font-size: .8rem; color: var(--dark); }
.changelog-detail { font-size: .73rem; color: var(--subtle); }

/* ─── ANIMATIONS ─────────────────────────────────────────────────────────── */
@keyframes fade-in  { from { opacity: 0 } to { opacity: 1 } }
@keyframes slide-up { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes pulse-highlight {
  0%   { box-shadow: var(--shadow-sm) }
  50%  { box-shadow: 0 0 0 4px rgba(0,100,211,.2), var(--shadow-md) }
  100% { box-shadow: var(--shadow-sm) }
}

/* ─── PRODUCTS ───────────────────────────────────────────────────────────── */
.product-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mp-primary);
  margin-bottom: .3rem;
  font-family: "Lato", inherit;
}
.product-phase-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mp-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: .25rem;
  font-family: "Lato", inherit;
}

/* ─── FILES & LINKS ─────────────────────────────────────────────────────── */
.assets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) { .assets-grid { grid-template-columns: 1fr; } }

.asset-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .4rem;
  border-radius: var(--r-sm);
  transition: background .15s;
}
.asset-item:hover { background: var(--bg); }
.asset-icon { font-size: 1.2rem; flex-shrink: 0; }
.asset-info { flex: 1; min-width: 0; }
.asset-name {
  display: block;
  font-size: .84rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-name:hover { color: var(--mp-primary); text-decoration: underline; }
.asset-meta {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.link-add-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.link-add-row .form-input { margin: 0; }

/* ─── DRAG & DROP ───────────────────────────────────────────────────────── */
.phase-drag-handle {
  cursor: grab;
  color: var(--subtle);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 .5rem 0 0;
  flex-shrink: 0;
  transition: color .15s;
  user-select: none;
}
.phase-drag-handle:hover { color: var(--muted); }
.phase-drag-handle:active { cursor: grabbing; }
.phase-block.dragging { opacity: .35; }
.phase-block.drag-over > .phase-card {
  outline: 2px solid var(--mp-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(0,100,211,.12), var(--shadow-md);
}

/* ─── EASTER EGG ─────────────────────────────────────────────────────────── */
@keyframes ee-fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes ee-pop {
  from { transform: scale(.25) rotate(-12deg); opacity: 0 }
  to   { transform: scale(1)   rotate(0);     opacity: 1 }
}
#__ee {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(29,53,87,.88);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  animation: ee-fade-in .35s ease;
}
#__ee-box {
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  animation: ee-pop .55s cubic-bezier(.175,.885,.32,1.275);
}
#__ee-box img { height: 160px; width: auto; filter: drop-shadow(0 8px 40px rgba(0,100,211,.5)); }
#__ee-box p { color: rgba(255,255,255,.85); font-size: .95rem; letter-spacing: .04em; margin: 0; }
#__ee-box .sina-badge { transform: scale(3) rotate(-4deg); margin: 10rem 0 16rem; }
#__ee-box .sina-badge:hover { transform: scale(3) rotate(0deg); }
#__ee-box .sina-tagline { font-size: 1.1rem; color: rgba(255,255,255,.9); font-style: italic; text-align: center; line-height: 1.5; }

/* ─── PRINT ──────────────────────────────────────────────────────────────── */
@media print {
  .navbar, .project-header-actions, .btn, .phase-chevron,
  .todo-actions, .todo-add-row, .comment-input-row,
  .delay-banner, .modal-overlay, .toast-container,
  .ptl-wrapper { display: none !important; }
  body { background: #fff; }
  .phase-body { display: block !important; }
  .phase-card { box-shadow: none; border: 1px solid #ddd; }
  .container-narrow { padding: 0; }
  .project-header { background: #fff; }
}
