/* Sharpe CPA Client Portal ------------------------------------------------ */

:root {
  --navy:      #1f3a5f;
  --navy-dark: #16293f;
  --accent:    #2f6f9f;
  --ink:       #22313f;
  --muted:     #6b7c8d;
  --line:      #dde5ec;
  --bg:        #f4f7fa;
  --panel:     #ffffff;
  --good:      #1f6b45;
  --good-bg:   #e6f4ec;
  --warn:      #8a5a00;
  --warn-bg:   #fdf3e0;
  --bad:       #93242b;
  --bad-bg:    #fbeaeb;
  --info:      #1f4e79;
  --info-bg:   #e8f1f8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:hover { color: var(--navy); }

/* Header ------------------------------------------------------------------ */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}
.site-header .bar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
/* The shipped artwork is drawn for a dark bar, so it sits straight on the navy.
   A hosted fallback logo is not, and keeps the white plaque it needs. */
.site-header img.logo { max-height: 46px; width: auto; display: block; }
.site-header img.logo-hosted { max-height: 52px; background: #fff; padding: 4px 8px; border-radius: 4px; }
.site-header .title { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.site-header .spacer { flex: 1 1 auto; }
.site-header .who { font-size: 13.5px; color: #cddceb; text-align: right; line-height: 1.35; }
.site-header .who strong { color: #fff; display: block; font-weight: 600; }

/* Nav --------------------------------------------------------------------- */
.site-nav { background: var(--navy-dark); }
.site-nav ul {
  max-width: 1040px; margin: 0 auto; padding: 0 12px;
  list-style: none; display: flex; flex-wrap: wrap;
}
.site-nav a {
  display: block; padding: 11px 14px;
  color: #c9d8e6; text-decoration: none; font-size: 14.5px;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.site-nav a.active { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }

/* Layout ------------------------------------------------------------------ */
.wrap { max-width: 1040px; margin: 0 auto; padding: 26px 20px 60px; }
.wrap-narrow { max-width: 460px; margin: 0 auto; padding: 44px 20px 60px; }

h1 { font-size: 24px; margin: 0 0 6px; color: var(--navy); font-weight: 650; }
h2 { font-size: 17px; margin: 0 0 14px; color: var(--navy); font-weight: 650; }
.lede { color: var(--muted); margin: 0 0 24px; font-size: 15px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(31,58,95,.05);
}
.panel > h2:first-child { margin-top: 0; }
.panel-tight { padding: 0; overflow: hidden; }
.panel-tight h2 { padding: 18px 22px 0; }

/* Forms ------------------------------------------------------------------- */
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; margin: 4px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=file], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c3d0dc;
  border-radius: 5px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,111,159,.16);
}
.field { margin-bottom: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .field { flex: 1 1 220px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  padding: 10px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-quiet { background: #fff; color: var(--navy); border-color: #c3d0dc; }
.btn-quiet:hover { background: #eef3f8; color: var(--navy); border-color: var(--accent); }
.btn-small { padding: 6px 12px; font-size: 13.5px; }
.btn-danger { background: #fff; color: var(--bad); border-color: #e0bfc2; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }

/* Alerts ------------------------------------------------------------------ */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 14.5px;
  border: 1px solid transparent;
}
.alert-good { background: var(--good-bg); color: var(--good); border-color: #bfe0cd; }
.alert-bad  { background: var(--bad-bg);  color: var(--bad);  border-color: #eccace; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #eddcb8; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #c8dcec; }
.alert strong { display: block; margin-bottom: 3px; }

/* Drop zone --------------------------------------------------------------- */
.dropzone {
  border: 2px dashed #b9cadb;
  border-radius: 8px;
  background: #fafcfe;
  padding: 30px 20px;
  text-align: center;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.hot { border-color: var(--accent); background: #eef5fb; }
.dropzone .big { font-size: 16px; font-weight: 600; color: var(--navy); }
.dropzone .small { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.dropzone input[type=file] { display: none; }
#picked { margin-top: 14px; font-size: 14px; text-align: left; }
#picked ul { margin: 6px 0 0; padding-left: 20px; }

/* Tables ------------------------------------------------------------------ */
.table-scroll { overflow-x: auto; }
table.files { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.files th {
  text-align: left; padding: 10px 14px;
  background: #eef3f8; color: var(--navy);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.files td { padding: 11px 14px; border-bottom: 1px solid #eef2f6; vertical-align: top; }
table.files tr:last-child td { border-bottom: none; }
table.files tr:hover td { background: #f8fbfd; }
table.files .name { font-weight: 600; color: var(--navy); word-break: break-word; }
table.files .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
table.files td.actions { text-align: right; }
table.files td.actions form { display: inline-block; margin: 0; }
table.files td.actions .btn { margin: 0 0 4px 4px; }

.tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; letter-spacing: .3px; white-space: nowrap;
}
.tag-in  { background: var(--good-bg); color: var(--good); }
.tag-out { background: var(--info-bg); color: var(--info); }
.tag-off { background: #eceff2; color: var(--muted); }

.empty { padding: 34px 22px; text-align: center; color: var(--muted); font-size: 15px; }

/* Misc -------------------------------------------------------------------- */
.credential {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 14px 16px; margin-top: 12px; font-size: 15px;
}
.credential code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #eef3f8; padding: 3px 8px; border-radius: 4px;
  font-size: 15px; color: var(--navy); font-weight: 600;
}
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13.5px;
}
.site-footer .bar {
  max-width: 1040px; margin: 0 auto; padding: 18px 20px;
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between;
}
.notice-secure { font-size: 13px; color: var(--muted); margin-top: 18px; text-align: center; }

/* Sharing ----------------------------------------------------------------- */
.tag-share { background: #f1ecfa; color: #5b3f96; }

.shared-line {
  margin-top: 7px;
  font-size: 13px;
  color: var(--muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1ecfa;
  color: #5b3f96;
  border-radius: 20px;
  padding: 2px 4px 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
  margin: 2px 3px 2px 0;
}
.chip form { display: inline; margin: 0; }
.chip button {
  border: none;
  background: rgba(91, 63, 150, .14);
  color: #5b3f96;
  border-radius: 50%;
  width: 17px; height: 17px;
  line-height: 15px;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.chip button:hover { background: #5b3f96; color: #fff; }

.share-box { margin-top: 8px; }
.share-box summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  display: inline-block;
  list-style: none;
}
.share-box summary::-webkit-details-marker { display: none; }
.share-box summary::before { content: "+ "; }
.share-box[open] summary::before { content: "\2212 "; }
.share-box summary:hover { color: var(--navy); }
.share-box form {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fafcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 340px;
}
.share-option {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 5px;
  cursor: pointer;
}
.share-option input { margin-right: 7px; }
.share-option .meta { margin-left: 4px; }

.inline-mobile { display: flex; gap: 6px; align-items: center; max-width: 260px; }
.inline-mobile input[type=text] { padding: 6px 9px; font-size: 14px; }
.inline-mobile .btn { flex: 0 0 auto; }

/* Shown only on narrow screens, where whole table columns are dropped. */
.show-sm { display: none; }

@media (max-width: 620px) {
  .site-header .who { text-align: left; width: 100%; }
  .wrap { padding: 18px 14px 50px; }

  /* Tables become stacked cards so nothing runs off the side of the screen. */
  .table-scroll { overflow-x: visible; }
  table.files, table.files tbody, table.files tr, table.files td { display: block; width: 100%; }
  table.files thead { display: none; }
  table.files .hide-sm { display: none; }
  table.files tr { padding: 14px 0 12px; border-bottom: 1px solid #eef2f6; }
  table.files tr:hover td { background: transparent; }
  table.files td { border-bottom: none; padding: 2px 16px; }
  table.files .meta { white-space: normal; }
  table.files .name { display: block; }
  table.files td.actions { text-align: left; padding-top: 12px; }
  table.files td.actions .btn { margin: 0 8px 0 0; padding: 9px 16px; }
  table.files td.actions form { margin: 0; }

  .show-sm { display: inline-block; margin-left: 8px; vertical-align: 2px; }
}

/* ==========================================================================
   CRM — the company-facing pages inside the portal.
   ========================================================================== */

.nav-badge{
  display:inline-block; background:var(--accent); color:#fff; border-radius:999px;
  font-size:11px; font-weight:700; padding:1px 7px; margin-left:5px; vertical-align:1px;
}

.crm-context{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background:#eef3f8; border:1px solid var(--line); border-radius:8px;
  padding:10px 16px; margin:0 0 22px; font-size:14px;
}
.crm-context .spacer{flex:1 1 auto}
.crm-context strong{color:var(--navy)}

.crm-stats{display:flex; gap:14px; flex-wrap:wrap; margin:0 0 24px}
.crm-stat{
  background:var(--panel); border:1px solid var(--line); border-radius:10px;
  padding:16px 20px; min-width:160px;
}
.crm-stat .n{font-size:24px; font-weight:700; color:var(--navy); letter-spacing:-.02em}
.crm-stat .t{font-size:13px; color:var(--muted)}
.crm-stat.is-bad .n{color:var(--bad)}

.credential{margin-top:12px; font-size:14px}
.credential div{margin-bottom:4px}
.credential span{display:inline-block; min-width:82px; color:var(--muted)}
.credential code{
  background:#fff; border:1px solid var(--line); border-radius:4px;
  padding:2px 8px; font-size:13.5px;
}

table.crm-lines td{padding:6px 8px}
table.crm-lines input{width:100%; padding:8px 10px}
table.crm-lines td.num,table.crm-lines th.num{text-align:right}

.crm-steps{margin:0 0 20px; padding-left:22px; color:var(--ink)}
.crm-steps li{margin-bottom:9px}

.crm-snippet{
  width:100%; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12.5px; line-height:1.5; background:#f7fafc;
  border:1px solid var(--line); border-radius:8px; padding:12px 14px; resize:vertical;
}

.crm-logo-preview{
  background:#fff; border:1px solid var(--line); border-radius:8px;
  padding:10px 14px; margin-bottom:10px; display:inline-block;
}
.crm-logo-preview img{max-height:60px; max-width:240px; display:block}

.crm-thread{display:flex; flex-direction:column; gap:12px}
.crm-msg{background:var(--bg); border-radius:9px; padding:13px 16px; max-width:88%}
.crm-msg.is-mine{background:#e8f1f8; align-self:flex-end}
.crm-msg .who{font-size:12.5px; font-weight:700; color:var(--navy); margin-bottom:4px}
.crm-msg .who span{font-weight:400; color:var(--muted); margin-left:8px}
.crm-msg .body{white-space:pre-wrap}

label.check{font-weight:500; display:flex; align-items:center; gap:9px}
label.check input{width:auto; margin:0}
.opt{font-weight:400; color:var(--muted)}

/* ---------------------------------------------------- quality management */
.qm-obj{
  border-top:1px solid var(--line); padding:18px 0 4px;
}
.qm-obj:first-of-type{border-top:none}
.qm-obj.is-empty{background:linear-gradient(90deg,var(--warn-bg) 0 3px,transparent 3px);
  padding-left:14px; margin-left:-14px}
.qm-obj-head{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:6px}
.qm-obj-head .code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12px; font-weight:700; letter-spacing:.04em; color:var(--ink);
  background:#eef2f6; border-radius:4px; padding:2px 7px;
}
.qm-obj-text{margin:0 0 10px; color:var(--muted); max-width:80ch; line-height:1.55}
.qm-obj-foot{display:flex; align-items:center; gap:12px; margin-bottom:10px}
.qm-obj textarea{width:100%}

.tabs{display:flex; flex-wrap:wrap; gap:4px}
.tabs a{
  font-size:13.5px; padding:6px 11px; border-radius:6px; text-decoration:none;
  color:var(--muted); white-space:nowrap;
}
.tabs a:hover{background:#eef2f6; color:var(--ink)}
.tabs a.active{background:var(--ink); color:#fff}
