/* public/css/style.css — Knack Design System */

/* ─── Fonts ──────────────────────────────────────────────────────────────────*/
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────────────────*/
:root {
  --brand:   #FF6B2C;
  --brand-d: #E05520;
  --ink:     #14110D;
  --ink-2:   #3A352D;
  --ink-3:   #6B6358;
  --paper:   #FAF7F2;
  --sunken:  #F2EDE5;
  --line:    #E6DFD3;
  --white:   #FFFFFF;
  --success: #1F8A5C;
  --danger:  #C0392B;
  --info:    #2563A6;

  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-ui:    'Inter', system-ui, sans-serif;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 1px 3px rgba(20,17,13,.06), 0 4px 12px rgba(20,17,13,.08);
  --shadow-lg:  0 8px 32px rgba(20,17,13,.12);
  --transition: 200ms ease;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* ─── Typography ─────────────────────────────────────────────────────────────*/
.serif         { font-family: var(--font-serif); }
.display-xl    { font-family: var(--font-serif); font-size: clamp(40px, 6vw, 80px); line-height: 1.1; }
.display-lg    { font-family: var(--font-serif); font-size: clamp(28px, 4vw, 52px); line-height: 1.15; }
.display-md    { font-family: var(--font-serif); font-size: clamp(22px, 3vw, 36px); line-height: 1.2; }
.text-brand    { color: var(--brand); }
.text-muted    { color: var(--ink-3); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.font-500      { font-weight: 500; }
.font-600      { font-weight: 600; }

/* ─── Layout ─────────────────────────────────────────────────────────────────*/
.container   { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-sm{ max-width: 720px;  margin: 0 auto; padding: 0 24px; }
.section     { padding: 80px 0; }
.section-sm  { padding: 48px 0; }
.grid-2      { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4      { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.gap-24      { gap: 24px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mt-32       { margin-top: 32px; }
.mt-48       { margin-top: 48px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }

/* ─── Navbar ─────────────────────────────────────────────────────────────────*/
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  height: 64px;
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 24px; color: var(--ink); letter-spacing: -.5px;
}
.nav-logo span { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover      { background: var(--sunken); color: var(--ink); }
.nav-link.active     { background: var(--ink); color: var(--paper); }
.nav-actions         { display: flex; align-items: center; gap: 12px; }

/* Avatar dropdown */
.nav-avatar-wrap     { position: relative; }
.nav-avatar          { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; object-fit: cover; background: var(--sunken); border: 2px solid var(--line); }
.nav-dropdown        { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 180px; display: none; z-index: 200; overflow: hidden; }
.nav-dropdown.open   { display: block; }
.nav-dropdown a      { display: block; padding: 10px 16px; font-size: 14px; color: var(--ink-2); transition: background var(--transition); }
.nav-dropdown a:hover{ background: var(--sunken); color: var(--ink); }
.nav-dropdown hr     { border: none; border-top: 1px solid var(--line); margin: 4px 0; }

/* Notification bell */
.notif-btn           { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--sunken); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.notif-btn:hover     { background: var(--line); }
.notif-badge         { position: absolute; top: -2px; right: -2px; background: var(--brand); color: var(--white); font-size: 10px; font-weight: 600; border-radius: 999px; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px; display: none; }
.notif-badge.visible { display: flex; }

/* Hamburger */
.nav-hamburger       { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; background: none; border: none; }
.nav-hamburger span  { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all var(--transition); }
.mobile-menu         { display: none; position: fixed; inset: 64px 0 0 0; background: var(--paper); z-index: 99; padding: 24px; border-top: 1px solid var(--line); overflow-y: auto; }
.mobile-menu.open    { display: block; }
.mobile-menu a       { display: block; padding: 14px 0; font-size: 16px; font-weight: 500; border-bottom: 1px solid var(--line); color: var(--ink-2); }

/* ─── Buttons ────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn:active          { transform: scale(.97); }
.btn-primary         { background: var(--ink); color: var(--paper); }
.btn-primary:hover   { background: #2a2520; }
.btn-brand           { background: var(--brand); color: var(--white); }
.btn-brand:hover     { background: var(--brand-d); }
.btn-outline         { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover   { border-color: var(--ink); background: var(--sunken); }
.btn-ghost           { background: transparent; color: var(--ink-2); }
.btn-ghost:hover     { background: var(--sunken); color: var(--ink); }
.btn-danger          { background: var(--danger); color: var(--white); }
.btn-danger:hover    { background: #a93226; }
.btn-success         { background: var(--success); color: var(--white); }
.btn-sm              { padding: 7px 16px; font-size: 13px; }
.btn-lg              { padding: 14px 32px; font-size: 16px; }
.btn-full            { width: 100%; }

/* ─── Cards ──────────────────────────────────────────────────────────────────*/
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover          { box-shadow: var(--shadow); }
.card-lift:hover     { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-sunken         { background: var(--sunken); border-color: transparent; }

/* ─── Forms ──────────────────────────────────────────────────────────────────*/
.form-group          { display: flex; flex-direction: column; gap: 6px; }
.form-label          { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 16px;
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 14px; color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-textarea       { min-height: 120px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,17,13,.08);
}
.form-input.error, .form-select.error, .form-textarea.error {
  border-color: var(--danger);
}
.form-error          { font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 4px; }
.form-hint           { font-size: 12px; color: var(--ink-3); }

/* Password strength */
.pw-strength-bar     { height: 3px; background: var(--line); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.pw-strength-fill    { height: 100%; width: 0; border-radius: 99px; transition: width .3s, background .3s; }

/* ─── Badges / Tags ──────────────────────────────────────────────────────────*/
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
}
.badge-open       { background: #E8F5EE; color: var(--success); }
.badge-progress   { background: #FFF0E8; color: var(--brand); }
.badge-completed  { background: var(--sunken); color: var(--ink-3); }
.badge-cancelled  { background: #FDEDEB; color: var(--danger); }
.badge-pending    { background: #EEF3FF; color: var(--info); }
.badge-accepted   { background: #E8F5EE; color: var(--success); }
.badge-rejected   { background: #FDEDEB; color: var(--danger); }
.badge-disputed   { background: #FFF8E8; color: #B45309; }
.skill-tag        { background: var(--sunken); color: var(--ink-2); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; }

/* Match score */
.match-score      { background: var(--brand); color: var(--white); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.match-score.high { background: var(--success); }
.match-score.med  { background: var(--brand); }

/* ─── Stars ──────────────────────────────────────────────────────────────────*/
.stars            { display: inline-flex; gap: 2px; }
.star             { color: var(--line); font-size: 14px; }
.star.filled      { color: #F59E0B; }

/* ─── Stat Cards ─────────────────────────────────────────────────────────────*/
.stat-card        { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.stat-card .value { font-family: var(--font-serif); font-size: 36px; line-height: 1; color: var(--ink); }
.stat-card .label { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.stat-card .delta { font-size: 12px; color: var(--success); font-weight: 500; margin-top: 8px; }

/* ─── Progress Bar ───────────────────────────────────────────────────────────*/
.progress-track   { background: var(--line); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill    { height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.progress-fill.complete { background: var(--success); }

/* ─── Tables ─────────────────────────────────────────────────────────────────*/
.table-wrap       { overflow-x: auto; }
.table            { width: 100%; border-collapse: collapse; }
.table th         { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td         { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td{ background: var(--paper); }

/* ─── Sidebar layout ─────────────────────────────────────────────────────────*/
.page-layout      { display: grid; grid-template-columns: 260px 1fr; gap: 32px; max-width: 1160px; margin: 0 auto; padding: 40px 24px; }
.sidebar          { display: flex; flex-direction: column; gap: 8px; }
.sidebar-link     { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--ink-2); transition: all var(--transition); }
.sidebar-link:hover   { background: var(--sunken); color: var(--ink); }
.sidebar-link.active  { background: var(--ink); color: var(--paper); }
.sidebar-link svg     { width: 16px; height: 16px; flex-shrink: 0; }
.page-main        { min-width: 0; }

/* ─── Toast ──────────────────────────────────────────────────────────────────*/
#toast-container  { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast            { background: var(--ink); color: var(--paper); padding: 14px 20px; border-radius: var(--radius); font-size: 14px; box-shadow: var(--shadow-lg); pointer-events: all; animation: slideUp .25s ease; max-width: 340px; }
.toast-success    { background: var(--success); }
.toast-error      { background: var(--danger); }
.toast-info       { background: var(--info); }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Hero ───────────────────────────────────────────────────────────────────*/
.hero             { padding: 100px 0 80px; }
.hero-eyebrow     { display: inline-flex; align-items: center; gap: 8px; background: var(--sunken); color: var(--ink-3); padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 24px; }
.hero-title       { font-family: var(--font-serif); font-size: clamp(44px, 7vw, 88px); line-height: 1.05; color: var(--ink); margin-bottom: 24px; }
.hero-title em    { color: var(--brand); font-style: italic; }
.hero-sub         { font-size: 18px; color: var(--ink-3); line-height: 1.7; max-width: 560px; margin-bottom: 40px; }

/* ─── Category grid ──────────────────────────────────────────────────────────*/
.category-card    { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 24px; cursor: pointer; transition: all var(--transition); text-align: center; }
.category-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.category-icon    { font-size: 28px; margin-bottom: 12px; }
.category-name    { font-weight: 500; font-size: 14px; }

/* ─── Job card ───────────────────────────────────────────────────────────────*/
.job-card         { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; transition: all var(--transition); }
.job-card:hover   { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.job-card-title   { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.job-card-meta    { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.job-card-budget  { font-family: var(--font-serif); font-size: 20px; color: var(--ink); }

/* ─── Freelancer card ────────────────────────────────────────────────────────*/
.fl-card          { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 24px; text-align: center; transition: all var(--transition); }
.fl-card:hover    { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.fl-avatar        { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--sunken); margin: 0 auto 16px; border: 2px solid var(--line); }
.fl-name          { font-weight: 600; font-size: 15px; }
.fl-headline      { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

/* ─── Profile ────────────────────────────────────────────────────────────────*/
.profile-header   { display: flex; align-items: flex-start; gap: 32px; padding: 40px 0 32px; border-bottom: 1px solid var(--line); }
.profile-avatar   { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; background: var(--sunken); flex-shrink: 0; border: 3px solid var(--line); }
.profile-name     { font-family: var(--font-serif); font-size: 32px; }

/* ─── Page header ────────────────────────────────────────────────────────────*/
.page-header      { border-bottom: 1px solid var(--line); padding: 32px 0; margin-bottom: 32px; }
.page-header h1   { font-family: var(--font-serif); font-size: 32px; }

/* ─── Alert ──────────────────────────────────────────────────────────────────*/
.alert            { padding: 14px 18px; border-radius: var(--radius); font-size: 14px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success    { background: #E8F5EE; color: var(--success); border: 1px solid #B7DFCC; }
.alert-error      { background: #FDEDEB; color: var(--danger); border: 1px solid #F1C1BC; }
.alert-info       { background: #EEF3FF; color: var(--info); border: 1px solid #BDD0F5; }

/* ─── Empty state ────────────────────────────────────────────────────────────*/
.empty-state      { text-align: center; padding: 64px 24px; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state h3   { font-family: var(--font-serif); font-size: 24px; margin-bottom: 8px; }
.empty-state p    { color: var(--ink-3); margin-bottom: 24px; }

/* ─── Footer ─────────────────────────────────────────────────────────────────*/
.footer           { background: var(--ink); color: var(--paper); padding: 64px 0 32px; margin-top: auto; }
.footer-logo      { font-family: var(--font-serif); font-size: 28px; color: var(--paper); margin-bottom: 8px; }
.footer-logo span { color: var(--brand); }
.footer-tagline   { font-size: 14px; color: #7A7069; margin-bottom: 32px; }
.footer-cols      { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-col h4    { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7A7069; margin-bottom: 16px; }
.footer-col a     { display: block; font-size: 14px; color: #B5AFA7; margin-bottom: 10px; transition: color var(--transition); }
.footer-col a:hover { color: var(--paper); }
.footer-bottom    { border-top: 1px solid #2A2520; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-copy      { font-size: 13px; color: #7A7069; }
.footer-social    { display: flex; gap: 16px; }
.footer-social a  { color: #7A7069; font-size: 14px; transition: color var(--transition); }
.footer-social a:hover { color: var(--paper); }

/* ─── Notifications page ─────────────────────────────────────────────────────*/
.notif-item       { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.notif-item.unread{ background: var(--paper); }
.notif-dot        { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.notif-dot.read   { background: var(--line); }
.notif-content    { flex: 1; }
.notif-msg        { font-size: 14px; }
.notif-time       { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ─── Skeleton loader ────────────────────────────────────────────────────────*/
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton         { background: linear-gradient(90deg, var(--line) 25%, var(--sunken) 50%, var(--line) 75%); background-size: 800px 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
.sk-title         { height: 20px; width: 70%; margin-bottom: 10px; }
.sk-text          { height: 14px; width: 100%; margin-bottom: 8px; }
.sk-text-sm       { height: 12px; width: 60%; }

/* ─── Auth pages ─────────────────────────────────────────────────────────────*/
.auth-wrap        { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--sunken); }
.auth-card        { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 48px 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.auth-logo        { font-family: var(--font-serif); font-size: 28px; text-align: center; margin-bottom: 32px; }
.auth-logo span   { color: var(--brand); }
.auth-title       { font-family: var(--font-serif); font-size: 26px; text-align: center; margin-bottom: 8px; }
.auth-sub         { font-size: 14px; color: var(--ink-3); text-align: center; margin-bottom: 32px; }
.auth-divider     { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--ink-3); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.role-selector    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.role-option      { position: relative; }
.role-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-label       { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: all var(--transition); text-align: center; }
.role-label:hover { border-color: var(--ink-3); }
.role-option input:checked + .role-label { border-color: var(--ink); background: var(--sunken); }
.role-icon        { font-size: 24px; }
.role-name        { font-size: 14px; font-weight: 600; }
.role-desc        { font-size: 12px; color: var(--ink-3); }

/* ─── Dashboard ──────────────────────────────────────────────────────────────*/
.dash-header      { padding: 40px 0 24px; }
.dash-header h1   { font-family: var(--font-serif); font-size: 32px; }
.stats-grid       { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.chart-card       { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.chart-card h3    { font-size: 14px; font-weight: 600; margin-bottom: 20px; color: var(--ink-2); }

/* ─── 403 / 404 / Error pages ────────────────────────────────────────────────*/
.error-page       { min-height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; }
.error-code       { font-family: var(--font-serif); font-size: clamp(80px,15vw,160px); color: var(--line); line-height: 1; margin-bottom: 16px; }
.error-title      { font-family: var(--font-serif); font-size: 32px; margin-bottom: 12px; }
.error-msg        { color: var(--ink-3); margin-bottom: 32px; }

/* ─── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 1024px) {
  .stats-grid     { grid-template-columns: repeat(2, 1fr); }
  .grid-4         { grid-template-columns: repeat(2, 1fr); }
  .page-layout    { grid-template-columns: 1fr; padding: 24px; }
  .sidebar        { flex-direction: row; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .footer-cols    { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .nav-links, .nav-actions .btn { display: none; }
  .nav-hamburger  { display: flex; }
  .nav-actions    { gap: 8px; }
  .hero           { padding: 60px 0 48px; }
  .section        { padding: 48px 0; }
  .grid-2, .grid-3{ grid-template-columns: 1fr; }
  .stats-grid     { grid-template-columns: repeat(2, 1fr); }
  .auth-card      { padding: 32px 24px; }
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .footer-cols    { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom  { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .stats-grid     { grid-template-columns: 1fr; }
  .container      { padding: 0 16px; }
}

/* ─── Cover letter / user text overflow fix ──────────────────────────────────*/
.cover-letter, .user-text {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ─── Save button (job bookmark) ─────────────────────────────────────────────*/
.save-btn {
  background: rgba(255,255,255,.92);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-3);
  transition: all 200ms ease;
  padding: 0;
  z-index: 2;
}
.save-btn:hover         { border-color: var(--brand); color: var(--brand); }
.save-btn.saved         { border-color: var(--brand); color: var(--brand); background: #fff5ef; }

/* ─── Portfolio grid ─────────────────────────────────────────────────────────*/
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.portfolio-item {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 200ms ease;
}
.portfolio-item:hover   { box-shadow: var(--shadow); }
.portfolio-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.portfolio-link-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sunken);
  color: var(--ink-3);
  text-decoration: none;
}
.portfolio-info {
  padding: 10px 12px;
  background: var(--white);
}

/* ─── Chat page layout ───────────────────────────────────────────────────────*/
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
}
.chat-header {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-body .container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-footer {
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 12px 0;
  flex-shrink: 0;
}
/* Chat messages */
.chat-msg {
  display: flex;
  gap: 10px;
  padding: 2px 24px;
  max-width: 100%;
}
.chat-msg.mine   { flex-direction: row-reverse; }
.chat-msg.theirs { flex-direction: row; }
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 4px;
}
.chat-bubble {
  max-width: 65%;
  min-width: 60px;
}
.chat-msg.mine .chat-bubble {
  background: var(--brand);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  padding: 10px 14px;
}
.chat-msg.theirs .chat-bubble {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 14px;
}
.chat-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chat-text {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.mine .chat-text { color: #fff; }
.chat-time {
  font-size: 11px;
  margin-top: 4px;
  opacity: .6;
  text-align: right;
}
.chat-msg.theirs .chat-time { text-align: left; }
.chat-img {
  max-width: 240px;
  max-height: 200px;
  border-radius: 8px;
  display: block;
  margin-top: 4px;
  object-fit: cover;
}
.chat-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-top: 4px;
  background: rgba(0,0,0,.08);
  color: inherit;
  text-decoration: none;
  word-break: break-all;
}
/* Compose bar */
.chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-attach-btn {
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  color: var(--ink-3);
  transition: color 200ms;
}
.chat-attach-btn:hover { color: var(--brand); }
.chat-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-input {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  padding: 0 18px;
  font-size: 14px;
  font-family: var(--font-ui);
  background: var(--white);
  outline: none;
  transition: border-color 200ms;
}
.chat-input:focus { border-color: var(--brand); }
.chat-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
  padding: 0 18px;
}
.chat-send-btn {
  height: 44px;
  padding: 0 20px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 200ms;
}
.chat-send-btn:hover { background: var(--brand-d); }

/* ─── Milestone status badges ────────────────────────────────────────────────*/
.badge-revision_requested { background: #FFF0E8; color: var(--brand); }
.badge-submitted          { background: #EEF3FF; color: var(--info); }

/* ─── Proposal cover letter overflow fix ─────────────────────────────────────*/
[style*="background:var(--paper)"] p,
[style*="background: var(--paper)"] p {
  word-break: break-word;
  overflow-wrap: anywhere;
}
