/* ============================================================
   PrimeProof Client Portal — Design System
   Top-nav layout. Cream / Gold / Ink palette.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:      #1a1a1a;
  --gold:     #c9a84c;
  --gold-lt:  #e8d49a;
  --cream:    #f5f0e8;
  --mist:     #e8e3d8;
  --fog:      #d0cac0;
  --mid:      #888;
  --dim:      #bbb;
  --white:    #ffffff;

  --green:    #2d7a4f;
  --green-bg: #edf7f2;
  --red:      #c0392b;
  --red-bg:   #fdf0ef;
  --amber:    #c9811a;
  --amber-bg: #fef8ed;

  --topnav-h: 60px;
  --font: 'Avenir Next', 'Avenir', Helvetica, Arial, sans-serif;
  --radius:  6px;
  --shadow:  0 2px 12px rgba(0,0,0,.07);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
}

html { font-size: 15px; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }


/* ── Top Nav ──────────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: #fff;
  z-index: 100;
  border-bottom: 1px solid var(--mist);
}

.topnav-inner {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  gap: 24px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
}

.topnav-wordmark {
  display: block;
  color: var(--ink);
  line-height: 0;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 22px;
  fill: currentColor;
}

.brand-logo .logo-plate { fill: #fff; }

.topnav-client {
  font-size: 12px;
  color: var(--mid);
}

.topnav-links {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.topnav-link {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.topnav-link:hover {
  color: var(--ink);
  background: var(--cream);
  text-decoration: none;
}

.topnav-link--active {
  color: var(--ink);
  background: var(--cream);
  font-weight: 700;
}

.topnav-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.topnav-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  border-radius: 50%;
}

.topnav-bell svg { width: 18px; height: 18px; display: block; }

.topnav-bell:hover,
.topnav-bell--active {
  background: var(--cream);
  text-decoration: none;
}

.topnav-bell-count {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.topnav-name {
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}

a.topnav-name:hover,
.topnav-name--active {
  text-decoration: underline;
}

.topnav-logout {
  font-size: 12px;
  color: var(--mid);
  text-decoration: none;
}

.topnav-logout:hover {
  color: var(--red);
  text-decoration: none;
}


/* ── Main layout ──────────────────────────────────────────── */
.layout { display: block; }

.main {
  margin-top: 0;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 36px 32px 60px;
}

.client-brand {
  margin-top: var(--topnav-h);
  min-height: 180px;
  background: #2a2620 center / cover no-repeat;
}

.client-brand-inner {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 180px;
  padding: 28px 32px;
  display: flex;
  align-items: flex-start;
}

.client-brand-logo {
  width: 88px;
  height: 88px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.client-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.client-brand-mark {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .04em;
}

@media (max-width: 860px) {
  .topnav { position: sticky; height: auto; }
  .topnav-inner {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 10px 16px;
  }
  .topnav-user { margin-left: auto; }
  .topnav-links { width: 100%; flex-wrap: wrap; }
  .client-brand { margin-top: 0; min-height: 148px; }
  .client-brand-inner { min-height: 148px; padding: 20px; }
  .client-brand-logo { width: 72px; height: 72px; }
  .main { margin-top: 0; padding: 24px 20px; }
}


/* ── Auth pages ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 40px 20px;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 48px 44px 44px;
}

.auth-card--center { text-align: center; }

.wordmark {
  color: var(--ink);
  margin-bottom: 28px;
}

.wordmark .brand-logo { height: 32px; }

.auth-card--center .wordmark .brand-logo { margin-inline: auto; }

.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.auth-intro {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 24px;
}

.auth-help {
  margin-top: 20px;
  font-size: 13px;
  color: var(--mid);
  text-align: center;
}

.sent-icon,
.error-icon {
  font-size: 40px;
  margin-bottom: 16px;
}


/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
}

.page-sub {
  font-size: 14px;
  color: var(--mid);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 10px;
}


/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: opacity .15s;
  white-space: nowrap;
}

.btn:hover { opacity: .85; text-decoration: none; }

.btn-primary  { background: var(--gold); color: var(--ink); }
.btn-secondary { background: transparent; border-color: var(--mist); color: var(--ink); }
.btn-secondary:hover { background: var(--mist); }

.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm    { padding: 6px 14px; font-size: 11px; }


/* ── Banners ──────────────────────────────────────────────── */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
  flex-wrap: wrap;
}

.banner--action {
  background: var(--amber-bg);
  border-left: 3px solid var(--gold);
}

.banner-meta { color: var(--mid); }


/* ── Stat cards ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-card--alert { border-left: 3px solid var(--gold); }

.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mid);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin: 4px 0 2px;
}

.stat-sub  { font-size: 12px; color: var(--mid); }
.stat-link { font-size: 12px; color: var(--gold); margin-top: 8px; }

.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.overview-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.overview-columns .project-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 980px) {
  .overview-stats,
  .overview-columns,
  .profile-address,
  .experience-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Section ──────────────────────────────────────────────── */
.section { margin-bottom: 36px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mid);
}

.section-link { font-size: 13px; color: var(--gold); }

.experience-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.experience-card + .experience-card { margin-top: 14px; }

.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.experience-grid .experience-card + .experience-card { margin-top: 0; }

.experience-card-image {
  height: 140px;
  background: #ece7df center / cover no-repeat;
}

.experience-card-body { padding: 16px 18px 18px; }

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

.experience-card-desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--mid);
  line-height: 1.5;
}

.experience-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.experience-links a {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.profile-address {
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr;
  gap: 12px;
}

.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--mist);
}

.col-muted { color: var(--mid); font-size: 13px; }


/* ── Project cards ────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.project-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  text-decoration: none;
  transition: box-shadow .15s;
  display: block;
}

.project-card:hover {
  box-shadow: var(--shadow);
  text-decoration: none;
}

.project-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.3;
}

.project-card-phase { }


/* ── Todo list ────────────────────────────────────────────── */
.todo-list {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.todo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--mist);
}

.todo-row:last-child { border-bottom: none; }

.todo-row-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.todo-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.todo-project {
  font-size: 12px;
  color: var(--mid);
}

.todo-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.todo-due {
  font-size: 12px;
  color: var(--mid);
}


/* ── Forms ────────────────────────────────────────────────── */
.form-group  { margin-bottom: 20px; }
fieldset.form-group { border: 0; padding: 0; min-inline-size: 0; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 6px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--mist);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
}

select.form-control {
  cursor: pointer;
  padding-right: 42px;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%231a1a1a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}


/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.badge-active, .badge-paid, .badge-approved { background: var(--green-bg); color: var(--green); }
.badge-paused, .badge-draft                 { background: var(--mist);     color: var(--mid);   }
.badge-overdue                              { background: var(--red-bg);   color: var(--red);   }
.badge-sent, .badge-needs_review            { background: var(--amber-bg); color: var(--amber); }

/* Phase badges */
.badge-discovery    { background: #e8f0fb; color: #2c5fa0; }
.badge-strategy     { background: #e8f0fb; color: #2c5fa0; }
.badge-design       { background: var(--amber-bg); color: var(--amber); }
.badge-development  { background: var(--amber-bg); color: var(--amber); }
.badge-launch       { background: var(--green-bg); color: var(--green); }
.badge-maintenance  { background: var(--mist);     color: var(--mid);   }

/* Priority badges */
.badge-critical { background: var(--red-bg);   color: var(--red);   }
.badge-high     { background: var(--amber-bg); color: var(--amber); }
.badge-medium   { background: var(--mist);     color: var(--mid);   }
.badge-low      { background: var(--mist);     color: var(--dim);   }


/* ── Flash messages ───────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error   { background: var(--red-bg);   color: var(--red);   }
.flash-warning { background: var(--amber-bg); color: var(--amber); }
.flash-info    { background: #e8f4fd;         color: #1a6ea0;      }


/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  font-size: 14px;
  color: var(--mid);
  padding: 32px;
  text-align: center;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}


/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--cream);
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 1px solid var(--mist);
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--mist);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fdfcf8; }

.form-error { color: var(--red); font-size: 13px; margin: 0 0 8px; }

.note-list { display: flex; flex-direction: column; gap: 8px; }
.note {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.note:hover { text-decoration: none; }
.note--unread { border-left: 3px solid var(--gold); }
.note-title { font-weight: 600; color: var(--ink); }
.note-body { font-size: 13px; color: var(--mid); margin-top: 2px; }
.note-time { font-size: 12px; color: var(--dim); margin-top: 6px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.choice-list label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
