/*
 * FH Messages — Frontend CSS v1.0.0
 * Scoped to .fhm-* | Montserrat | Brand: #f16a22
 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --fhm-primary:       #f16a22;
  --fhm-primary-hover: #d4561a;
  --fhm-primary-light: #fef0e6;
  --fhm-font:          'Montserrat', sans-serif;
  --fhm-text:          #0f172a;
  --fhm-text-muted:    #64748b;
  --fhm-text-light:    #94a3b8;
  --fhm-bg:            #ffffff;
  --fhm-bg-subtle:     #f8fafc;
  --fhm-border:        #e2e8f0;
  --fhm-radius:        10px;
  --fhm-radius-lg:     14px;
  --fhm-shadow:        0 1px 3px rgba(0,0,0,.06),0 4px 20px rgba(0,0,0,.07);
  --fhm-transition:    0.16s ease;
}
.fhm-wrap*,.fhm-wrap*::before,.fhm-wrap*::after{box-sizing:border-box;}
.fhm-wrap{
  font-family:var(--fhm-font);font-size:14px;color:var(--fhm-text);
  line-height:1.6;-webkit-font-smoothing:antialiased;
  max-width:1100px;margin:0 auto;padding:40px 20px 80px;
}
.fhm-hidden{display:none!important;}

/* Page title suppression */
.fhm-page .entry-title,.fhm-page .page-title,.fhm-page h1.entry-title,
.fhm-page header.entry-header,.fhm-page .page-header{display:none!important;}

/* ── Page header ─────────────────────────────────────────────────────────────── */
.fhm-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:28px;flex-wrap:wrap;}
.fhm-page-title{font-size:22px;font-weight:700;margin:0 0 4px;}
.fhm-page-subtitle{font-size:13px;color:var(--fhm-text-muted);margin:0;}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.fhm-card{background:var(--fhm-bg);border:1px solid var(--fhm-border);border-radius:var(--fhm-radius-lg);padding:0;margin-bottom:20px;box-shadow:var(--fhm-shadow);overflow:hidden;}

/* ── Notices ─────────────────────────────────────────────────────────────────── */
.fhm-notice{padding:13px 18px;border-radius:var(--fhm-radius);font-size:13px;font-weight:500;margin-bottom:16px;}
.fhm-notice--error{background:#fef2f2;border:1px solid #fecaca;color:#dc2626;}
.fhm-notice a{font-weight:700;color:inherit;}
.fhm-msg-error{font-size:12px;color:#dc2626;margin-top:4px;min-height:16px;}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.fhm-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 18px;border-radius:var(--fhm-radius);font-size:13px;font-weight:600;font-family:var(--fhm-font);cursor:pointer;border:2px solid transparent;text-decoration:none;white-space:nowrap;line-height:1;transition:background var(--fhm-transition),color var(--fhm-transition),transform var(--fhm-transition);}
.fhm-btn:hover{transform:translateY(-1px);text-decoration:none;}
.fhm-btn:disabled{opacity:.55;cursor:not-allowed;pointer-events:none;transform:none;}
.fhm-btn-send{background:#f16a22;color:#fff;border-color:#f16a22;padding:0;width:48px;height:48px;border-radius:12px;flex-shrink:0;}
.fhm-btn-send:hover{background:#d4561a;border-color:#d4561a;}
.fhm-btn-outline{background:transparent;color:#f16a22;border-color:#f16a22;}
.fhm-btn-outline:hover{background:var(--fhm-primary-light);}
.fhm-btn-sm{padding:5px 12px;font-size:12px;border-radius:6px;}
.fhm-btn-spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:fhm-spin .65s linear infinite;}
@keyframes fhm-spin{to{transform:rotate(360deg);}}

/* ── Breadcrumb ──────────────────────────────────────────────────────────────── */
.fhm-breadcrumb{font-size:13px;margin-bottom:18px;}
.fhm-breadcrumb a{color:#f16a22;text-decoration:none;}
.fhm-breadcrumb a:hover{text-decoration:underline;}

/* ── Inbox list ──────────────────────────────────────────────────────────────── */
.fhm-inbox-list{display:flex;flex-direction:column;}
.fhm-inbox-row{
  display:flex;align-items:center;gap:14px;
  padding:16px 20px;
  border-bottom:1px solid var(--fhm-border);
  text-decoration:none;color:var(--fhm-text);
  transition:background var(--fhm-transition);
  position:relative;
}
.fhm-inbox-row:last-child{border-bottom:none;}
.fhm-inbox-row:hover{background:var(--fhm-bg-subtle);}
.fhm-inbox-row--unread{background:#fffaf7;}
.fhm-inbox-row--unread:hover{background:#fef3e8;}
.fhm-inbox-avatar{position:relative;flex-shrink:0;}
.fhm-inbox-avatar .fhm-avatar{border-radius:50%;display:block;width:44px;height:44px;}
.fhm-inbox-unread-dot{
  position:absolute;top:1px;right:1px;
  width:10px;height:10px;border-radius:50%;
  background:#f16a22;border:2px solid #fff;
}
.fhm-inbox-info{flex:1;min-width:0;}
.fhm-inbox-name-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:2px;}
.fhm-inbox-name{font-size:14px;font-weight:600;color:var(--fhm-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fhm-inbox-time{font-size:11px;color:var(--fhm-text-light);flex-shrink:0;}
.fhm-inbox-job{font-size:12px;color:var(--fhm-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fhm-unread-badge{display:inline-block;margin-top:4px;background:#f16a22;color:#fff;font-size:10px;font-weight:700;padding:1px 7px;border-radius:99px;}

/* ── Thread layout ───────────────────────────────────────────────────────────── */
.fhm-thread-wrap{}
.fhm-thread-layout{display:grid;grid-template-columns:1fr 260px;gap:24px;align-items:start;}
@media(max-width:768px){.fhm-thread-layout{grid-template-columns:1fr;}}

/* Thread header */
.fhm-thread-header{padding:16px 20px!important;margin-bottom:0;}
.fhm-thread-header-inner{display:flex;align-items:center;gap:14px;}
.fhm-thread-avatar-wrap .fhm-avatar{border-radius:50%;width:42px;height:42px;display:block;}
.fhm-thread-other-name{font-size:15px;font-weight:700;color:var(--fhm-text);margin-bottom:2px;}
.fhm-thread-job-ref{font-size:12px;color:var(--fhm-text-muted);}
.fhm-thread-job-link{color:#f16a22;text-decoration:none;}
.fhm-thread-job-link:hover{text-decoration:underline;}

/* Messages area */
.fhm-messages-wrap{
  background:var(--fhm-bg-subtle);
  border-top:1px solid var(--fhm-border);
  min-height:380px;max-height:520px;
  overflow-y:auto;
  padding:20px;
  display:flex;flex-direction:column;gap:14px;
  scroll-behavior:smooth;
}
.fhm-empty-thread{
  display:flex;align-items:center;justify-content:center;
  flex:1;color:var(--fhm-text-light);font-size:13px;padding:40px 0;text-align:center;
}

/* Message bubbles */
.fhm-msg{display:flex;align-items:flex-end;gap:10px;}
.fhm-msg--mine{flex-direction:row-reverse;}
.fhm-msg-avatar .fhm-avatar{border-radius:50%;width:32px;height:32px;display:block;flex-shrink:0;}
.fhm-msg-body-wrap{display:flex;flex-direction:column;max-width:72%;min-width:0;}
.fhm-msg--mine .fhm-msg-body-wrap{align-items:flex-end;}
.fhm-msg-sender-name{font-size:11px;font-weight:600;color:var(--fhm-text-muted);margin-bottom:3px;padding-left:4px;}
.fhm-msg-bubble{
  padding:10px 14px;
  border-radius:18px;
  font-size:13.5px;line-height:1.55;
  word-break:break-word;
}
.fhm-msg--theirs .fhm-msg-bubble{
  background:#fff;
  border:1px solid var(--fhm-border);
  border-bottom-left-radius:4px;
  color:var(--fhm-text);
}
.fhm-msg--mine .fhm-msg-bubble{
  background:#f16a22;
  color:#fff;
  border-bottom-right-radius:4px;
}
.fhm-msg-time{font-size:10px;color:var(--fhm-text-light);margin-top:4px;padding:0 4px;}

/* Compose */
.fhm-compose-wrap{
  border-top:1px solid var(--fhm-border);
  padding:14px 16px;
  background:var(--fhm-bg);
}
.fhm-compose-row{display:flex;gap:10px;align-items:flex-end;}
.fhm-compose-textarea{
  flex:1;
  border:1px solid var(--fhm-border);
  border-radius:12px;
  padding:10px 14px;
  font-size:13px;
  font-family:var(--fhm-font);
  color:var(--fhm-text);
  resize:none;
  background:#fff;
  transition:border-color var(--fhm-transition);
  line-height:1.5;
}
.fhm-compose-textarea:focus{border-color:#f16a22;outline:none;box-shadow:0 0 0 3px rgba(241,106,34,.15);}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.fhm-sidebar-card{background:var(--fhm-bg);border:1px solid var(--fhm-border);border-radius:var(--fhm-radius-lg);padding:18px;box-shadow:var(--fhm-shadow);}
.fhm-sidebar-title{font-size:11px;font-weight:700;color:var(--fhm-text-light);text-transform:uppercase;letter-spacing:.07em;margin:0 0 12px;}
.fhm-detail-list{list-style:none;margin:0;padding:0;}
.fhm-detail-list li{display:flex;justify-content:space-between;align-items:flex-start;padding:7px 0;border-bottom:1px solid var(--fhm-bg-subtle);font-size:13px;gap:8px;}
.fhm-detail-list li:last-child{border-bottom:none;}
.fhm-detail-label{color:var(--fhm-text-light);flex-shrink:0;font-size:12px;}

/* ── Nav badge ───────────────────────────────────────────────────────────────── */
.fhm-nav-badge{display:inline-flex;align-items:center;justify-content:center;background:#f16a22;color:#fff;font-size:10px;font-weight:700;padding:1px 5px;border-radius:99px;min-width:18px;line-height:1.4;}

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.fhm-empty-state{text-align:center;padding:48px 20px;color:var(--fhm-text-light);}
.fhm-empty-state svg{margin:0 auto 14px;opacity:.4;display:block;}
.fhm-empty-state p{font-size:14px;margin:0 0 4px;color:var(--fhm-text-muted);}
.fhm-empty-sub{font-size:13px;color:var(--fhm-text-light)!important;}
