/* ============================================================
   ST. MICHAEL CLEANING – BILLING MODULE STYLES
   ============================================================ */

/* ── Root Variables ─────────────────────────────────────────── */
:root {
  /* Brand greens (matching main site) */
  --green-dark:  #2e5e1a;
  --green:       #4a8c2a;
  --green-mid:   #5fa033;
  --green-light: #e8f5e0;
  --green-pale:  #f4faf0;

  /* Neutrals */
  --white:       #ffffff;
  --gray-50:     #fafafa;
  --gray-100:    #f5f5f5;
  --gray-200:    #eeeeee;
  --gray-300:    #e0e0e0;
  --gray-400:    #bdbdbd;
  --gray-600:    #757575;
  --gray-800:    #424242;
  --gray-900:    #212121;

  /* Billing-specific accents */
  --blue:        #4f90ba;
  --blue-light:  #e3f0f9;
  --red:         #e53935;
  --red-light:   #fdecea;
  --amber:       #f9a825;
  --amber-light: #fff8e1;

  /* Shared tokens */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:   0 8px 30px rgba(0,0,0,.12);
  --radius:      12px;
  --radius-sm:   8px;
  --transition:  .3s cubic-bezier(.4,0,.2,1);
}

/* Shared mailbox */
.mail-head,.mail-head-actions{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.mail-head-actions{justify-content:flex-end}
.mail-status{display:flex;align-items:center;gap:.85rem;margin:1rem 0;padding:1rem 1.15rem;border:1px solid #d9dee5;border-radius:12px;background:#f7f8fa}
.mail-status-dot{width:10px;height:10px;border-radius:50%;background:#7f8995;flex:0 0 auto}
.mail-status div{display:flex;flex-direction:column;gap:.15rem}.mail-status div span{color:#66717d;font-size:.86rem}
.mail-status.connected{background:#f0f8f1;border-color:#b9d8be}.mail-status.connected .mail-status-dot{background:#2f8a48}
.mail-status.needs-connection{background:#fff8e9;border-color:#ead3a0}.mail-status.needs-connection .mail-status-dot{background:#c38612}
.mail-layout{display:grid;grid-template-columns:190px 1fr;min-height:430px;border:1px solid #dfe3e8;border-radius:14px;overflow:hidden;background:#fff}
.mail-folders{padding:1rem;background:#f7f8fa;border-right:1px solid #e2e5e9}
.mail-folders button{width:100%;display:flex;justify-content:space-between;padding:.75rem;border:0;border-radius:8px;background:transparent;text-align:left;font-weight:650}
.mail-folders select{width:100%;margin-top:.35rem;padding:.55rem;border:1px solid #d3dbd5;border-radius:7px;background:#fff;color:#334238;font:650 .75rem Montserrat,sans-serif}
.mail-folders button.active{background:#e9f1e7;color:#285623}.mail-folders button:disabled{color:#8b949e}
.mail-location{border-top:1px solid #dde1e5;margin-top:1rem;padding:.9rem .75rem;display:flex;flex-direction:column}.mail-location span{font-size:.72rem;text-transform:uppercase;color:#77818c}
.mail-list-wrap{min-width:0}.mail-empty{height:100%;min-height:430px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#6d7782;text-align:center;gap:.35rem}
.mail-list{display:flex;flex-direction:column}.mail-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:.9rem;padding:1rem 1.15rem;border-bottom:1px solid #e7e9ec;align-items:start}
.mail-row.unread{background:#f7fbf6}.mail-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#e4eee1;color:#285623;font-weight:750}
.mail-row-body>div{display:flex;justify-content:space-between;gap:1rem}.mail-row time{color:#77818c;font-size:.8rem}.mail-row h3{font-size:.95rem;margin:.2rem 0}.mail-row p{margin:0;color:#68727d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mail-location-tag{font-size:.72rem;padding:.3rem .5rem;background:#eef0f2;border-radius:999px}.mail-compose-card{max-width:650px}.mail-compose-card textarea{resize:vertical}
.mail-location-control{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .45rem;border-radius:6px;background:#eef3ef;color:#58665c;font:700 .67rem Montserrat,sans-serif}.mail-location-control select{padding:.2rem;border:0;background:transparent;color:#24452d;font:700 .7rem Montserrat,sans-serif}
@media(max-width:760px){.mail-head{align-items:flex-start;flex-direction:column}.mail-head-actions{width:100%}.mail-head-actions .btn{flex:1}.mail-layout{grid-template-columns:1fr}.mail-folders{display:flex;border-right:0;border-bottom:1px solid #e2e5e9;padding:.6rem}.mail-folders button{width:auto}.mail-location{margin:0 0 0 auto;border:0;padding:.3rem .6rem}.mail-empty{min-height:300px}.mail-row{grid-template-columns:38px minmax(0,1fr)}.mail-location-tag{display:none}}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Fast Operations splash */
.operations-splash{position:fixed;inset:0;z-index:12000;display:grid;place-items:center;overflow:hidden;background:linear-gradient(145deg,#075f25 0%,#079332 58%,#19a846 100%);transition:opacity .24s ease,visibility .24s ease;animation:operationsSplashFailsafe .01s 4s forwards}
.operations-splash.dismissed{opacity:0;visibility:hidden;pointer-events:none}
.operations-splash-content{position:relative;z-index:2;text-align:center;color:#fff;animation:operationsSplashIn .36s ease-out both}
.operations-splash-logo{display:block;width:94px;height:94px;margin:0 auto .8rem;object-fit:contain;filter:drop-shadow(0 8px 20px rgba(0,0,0,.14));animation:operationsLogoReady .7s ease-out both}
.operations-splash h1{margin:0;font-size:clamp(1.35rem,3vw,2rem);line-height:1.1;letter-spacing:-.02em}.operations-splash p{margin:.4rem 0 1.2rem;color:rgba(255,255,255,.82);font:600 .76rem Montserrat,sans-serif;letter-spacing:.16em;text-transform:uppercase}
.operations-splash-progress{width:150px;height:3px;margin:auto;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.2)}.operations-splash-progress span{display:block;width:55%;height:100%;border-radius:inherit;background:#fff;animation:operationsProgress .75s ease-in-out infinite}
.operations-splash-bubble{position:absolute;border:1px solid rgba(255,255,255,.18);border-radius:50%;background:rgba(255,255,255,.05);animation:operationsBubble 3s ease-in-out infinite}.bubble-one{width:170px;height:170px;left:8%;top:18%}.bubble-two{width:90px;height:90px;right:12%;bottom:17%;animation-delay:-1s}.bubble-three{width:42px;height:42px;right:28%;top:20%;animation-delay:-2s}
@keyframes operationsSplashFailsafe{to{opacity:0;visibility:hidden;pointer-events:none}}@keyframes operationsSplashIn{from{transform:translateY(8px)}to{transform:none}}@keyframes operationsLogoReady{from{transform:scale(.86) rotate(-3deg)}to{transform:scale(1) rotate(0)}}@keyframes operationsProgress{from{transform:translateX(-110%)}to{transform:translateX(185%)}}@keyframes operationsBubble{50%{transform:translateY(-10px);opacity:.65}}
@media(prefers-reduced-motion:reduce){.operations-splash-content,.operations-splash-logo,.operations-splash-progress span,.operations-splash-bubble{animation:none}}

h1, h2, h3, h4 {
  font-family: 'Montserrat', system-ui, sans-serif;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2e5e1a 0%, #4a8c2a 50%, #5fa033 100%);
  min-height: 100vh;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: cardIn .5s ease-out both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .25rem;
}

.login-sub {
  font-size: .9rem;
  color: var(--gray-600);
  margin-bottom: 2rem;
}

.login-card .g_id_signin {
  display: flex;
  justify-content: center;
  margin-top: .5rem;
}

.login-error {
  margin-top: 1rem;
  padding: .6rem 1rem;
  font-size: .85rem;
  color: var(--red);
  background: var(--red-light);
  border-radius: var(--radius-sm);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.header-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.header-name {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
}

.header-sub {
  display: block;
  font-size: .75rem;
  color: rgba(255,255,255,.7);
}

/* ── Header Nav Tabs ──────────────────────────────────────── */
.header-nav {
  display: flex;
  gap: .25rem;
}

.nav-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  background: transparent;
  border: none;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--white);
  background: rgba(255,255,255,.12);
}

.nav-btn.active {
  color: var(--green-dark);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.expense-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin:0 0 1.25rem}.expense-actions a{display:flex;flex-direction:column;gap:.25rem;padding:1rem;border:1px solid var(--gray-300);border-radius:var(--radius-sm);background:var(--white);color:var(--green-dark);text-decoration:none;transition:var(--transition)}.expense-actions a:hover{border-color:var(--green);box-shadow:var(--shadow-sm);transform:translateY(-1px)}.expense-actions strong{font-family:'Montserrat',sans-serif;font-size:.88rem}.expense-actions span{font-size:.76rem;color:var(--gray-600)}.expense-inbox{grid-column:1/-1}@media(max-width:700px){.expense-actions{grid-template-columns:1fr}.expense-actions a{padding:.8rem}}

/* ── Header User ──────────────────────────────────────────── */
.header-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.header-user #userEmail {
  font-size: .78rem;
  color: rgba(255,255,255,.8);
}
.mobile-header-actions{display:none}.mobile-menu-panel{display:contents}
.location-switcher{display:flex;align-items:center;gap:.35rem;padding:.22rem .45rem;border:1px solid rgba(255,255,255,.28);border-radius:999px}
.location-switcher span{font-size:.62rem;text-transform:uppercase;letter-spacing:.05em;color:rgba(255,255,255,.7)}
.location-switcher select{max-width:120px;border:0;outline:0;background:transparent;color:#fff;font:600 .74rem inherit;cursor:pointer}.location-switcher option{color:#26302a;background:#fff}
.marketing-card{max-width:600px;margin-top:1.25rem;padding:1.35rem;border:1px solid var(--border);border-radius:var(--radius);background:#fff;box-shadow:var(--shadow-sm)}
.marketing-card-head{margin-bottom:1rem}.marketing-card-head>span{display:inline-block;margin-bottom:.25rem;color:var(--green);font-size:.68rem;font-weight:750;text-transform:uppercase;letter-spacing:.08em}.marketing-card-head h3{margin:0!important;color:var(--green-dark)}

.btn-sm {
  font-family: 'Montserrat', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  padding: .35rem .8rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-sm:hover {
  background: rgba(255,255,255,.25);
}

/* ============================================================
   VIEWS (Content Sections)
   ============================================================ */
.view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  animation: viewIn .35s ease-out both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 3px solid var(--green-light);
}

.view h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-top: 1.75rem;
  margin-bottom: .75rem;
}

/* ============================================================
   TABLE STYLES (Submissions & Invoices)
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

thead {
  background: var(--green-pale);
}

th {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--green-dark);
  text-align: left;
  padding: .85rem 1rem;
  border-bottom: 2px solid var(--green-light);
  white-space: nowrap;
}

td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}

/* Striped rows */
tbody tr:nth-child(even) {
  background: var(--gray-50);
}

/* Hover effect */
tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--green-light);
}

/* Status badges in tables */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.badge-new {
  color: var(--blue);
  background: var(--blue-light);
}

.badge-invoiced {
  color: var(--green-dark);
  background: var(--green-light);
}

.badge-sent {
  color: #2e7d32;
  background: #c8e6c9;
}

.badge-pending {
  color: #e65100;
  background: var(--amber-light);
}

/* Action buttons in table rows */
.tbl-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-800);
  cursor: pointer;
  transition: var(--transition);
}

.tbl-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-pale);
}

/* ============================================================
   INVOICE FORM LAYOUT
   ============================================================ */
.invoice-form,
.settings-form {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
}

.invoice-form h3,
.settings-form h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-top: 1.5rem;
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--green-light);
}

.invoice-form h3:first-of-type,
.settings-form h3:first-of-type {
  margin-top: .5rem;
}

/* ── Form Row (flex container) ──────────────────────────────── */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

/* ── Form Group (field wrapper) ─────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.form-group.wide {
  flex: 2;
}

.form-group.small {
  flex: 0.6;
  min-width: 80px;
}

.form-group.full {
  flex: 1 1 100%;
}

.form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ── Inputs, Selects, Textareas ─────────────────────────────── */
.invoice-form input,
.invoice-form select,
.invoice-form textarea,
.settings-form input,
.settings-form select,
.settings-form textarea {
  padding: .65rem .85rem;
  font-size: .9rem;
  font-family: 'Open Sans', sans-serif;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  width: 100%;
  color: var(--gray-900);
}

.invoice-form input:focus,
.invoice-form select:focus,
.invoice-form textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(74,140,42,.15);
}

.invoice-form textarea,
.settings-form textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Readonly Input ─────────────────────────────────────────── */
.readonly {
  background: var(--gray-100) !important;
  color: var(--gray-600) !important;
  cursor: not-allowed;
  border-color: var(--gray-300) !important;
}

.readonly:focus {
  box-shadow: none !important;
  border-color: var(--gray-300) !important;
}

/* ── Radio Group ────────────────────────────────────────────── */
.radio-group {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding-top: .3rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.radio-group input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================
   TOTALS BOX
   ============================================================ */
.totals-box {
  margin-top: 1.5rem;
  margin-left: auto;
  max-width: 340px;
  background: var(--green-pale);
  border: 2px solid var(--green-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .35rem 0;
  font-size: .9rem;
  color: var(--gray-800);
}

.total-row span:first-child {
  font-weight: 500;
}

.total-row span:last-child {
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}

.total-row.total-due {
  margin-top: .5rem;
  padding-top: .75rem;
  border-top: 2px solid var(--green);
}

.total-row.total-due span:first-child {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
}

.total-row.total-due span:last-child {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-dark);
}

/* ============================================================
   FORM ACTIONS
   ============================================================ */
.form-actions {
  display: flex;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.6rem;
  font-family: 'Montserrat', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Primary – Green */
.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--green), var(--green-mid));
  box-shadow: 0 3px 10px rgba(74,140,42,.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(74,140,42,.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary – Gray */
.btn-secondary {
  color: var(--gray-800);
  background: var(--gray-200);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-300);
  transform: translateY(-1px);
}

/* Accent – Blue */
.btn-accent {
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 3px 10px rgba(79,144,186,.3);
}

.btn-accent:hover:not(:disabled) {
  background: #3d7ba6;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(79,144,186,.35);
}

/* ============================================================
   PDF PREVIEW MODAL
   ============================================================ */
.preview-modal {
  background: #1a1a1a;
  border-radius: var(--radius);
  max-width: 820px;
  width: 95%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: modalIn .25s ease-out;
}

.preview-header {
  padding: .65rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
  flex-shrink: 0;
}

.preview-header span {
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
}

.preview-header button {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color var(--transition);
}

.preview-header button:hover {
  color: #fff;
}

.preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  text-align: center;
}

.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
}

.preview-loading span {
  font-size: .85rem;
  color: #888;
}

.preview-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #333;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: btnSpin .7s linear infinite;
}

/* Preview button loading animation */
.btn-preview-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-preview-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2.5px solid var(--gray-400);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: btnSpin .6s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* Small button variant */
.btn.btn-sm {
  padding: .35rem .8rem;
  font-size: .75rem;
}

/* ============================================================
   SETTINGS FORM – Allowed Emails List
   ============================================================ */
#allowedEmailsList {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  font-size: .82rem;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 50px;
  font-weight: 500;
}

.email-chip button {
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: .6;
  transition: opacity var(--transition);
}

.email-chip button:hover {
  opacity: 1;
}

/* ============================================================
   SLIDER TOGGLE
   ============================================================ */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.toggle-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .03em;
  transition: color var(--transition);
}

.toggle-label.active {
  color: var(--green-dark);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 26px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ============================================================
   FILTER TABS
   ============================================================ */
.filter-tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 0;
}

.filter-tab {
  font-family: 'Montserrat', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
  background: none;
  border: none;
  padding: .6rem 1.2rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.filter-tab:hover {
  color: var(--green);
}

.filter-tab.active {
  color: var(--green-dark);
  border-bottom-color: var(--green);
}

.filter-tab .tab-count {
  font-size: .68rem;
  background: var(--gray-200);
  color: var(--gray-600);
  padding: .1rem .4rem;
  border-radius: 50px;
  margin-left: .35rem;
}

.filter-tab.active .tab-count {
  background: var(--green-light);
  color: var(--green-dark);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 640px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn .25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--green-light);
}

.modal .form-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  color: var(--gray-800);
}

/* ============================================================
   SERVICES CHECKLIST (Invoice Editor)
   ============================================================ */
.checklist-section {
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

.checklist-section h4 {
  font-size: .72rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
  margin-top: .6rem;
  padding-bottom: .15rem;
  border-bottom: 1px solid var(--gray-200);
}

.checklist-section h4:first-child {
  margin-top: 0;
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 1rem;
}

.checklist-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0 .75rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .1rem 0;
  font-size: .72rem;
  color: var(--gray-800);
  line-height: 1.3;
}

.checklist-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--green);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-item label {
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: .72rem;
}

@media (max-width: 640px) {
  .checklist-grid,
  .checklist-grid-4 {
    grid-template-columns: 1fr;
  }
}

@media(max-width:760px){
  .header{min-height:56px}
  .header-inner{position:relative;min-height:56px;padding:.35rem .75rem;flex-wrap:nowrap!important;justify-content:space-between!important;gap:.5rem!important}
  .header-logo{width:38px;height:38px}.header-brand{min-width:0}.header-brand .header-name{font-size:.78rem}.header-brand .header-sub{font-size:.62rem}
  .mobile-header-actions{display:flex;align-items:center;gap:.35rem;margin-left:auto}
  .mobile-header-actions button{display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid rgba(255,255,255,.28);border-radius:8px;background:rgba(255,255,255,.1);color:#fff;font-size:1.25rem}
  .mobile-header-actions svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .mobile-menu-panel{display:none;position:absolute;z-index:100;top:56px;left:0;right:0;padding:.7rem;background:var(--green-dark);border-top:1px solid rgba(255,255,255,.15);box-shadow:0 12px 24px rgba(0,0,0,.2)}
  .header.menu-open .mobile-menu-panel{display:flex;flex-direction:column;gap:.65rem}
  .mobile-menu-panel .header-nav{order:0;width:100%;display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
  .mobile-menu-panel .header-nav .nav-btn{width:100%;min-height:40px;text-align:left;justify-content:flex-start;font-size:.76rem;padding:.55rem .7rem}
  .mobile-menu-panel .header-nav .nav-mail-icon{display:none!important}
  .mobile-menu-panel .header-user{order:1;width:100%;display:grid;grid-template-columns:1fr 1fr;gap:.45rem;padding-top:.65rem;border-top:1px solid rgba(255,255,255,.15)}
  .mobile-menu-panel .location-switcher{grid-column:1/-1;justify-content:space-between;min-height:40px}.mobile-menu-panel .location-switcher select{max-width:none;flex:1;text-align:right}
  .mobile-menu-panel .header-user .btn-sm{display:flex;align-items:center;justify-content:center;min-height:38px;margin:0}
  .mobile-menu-panel .header-user #userEmail{display:none}
  #viewMail{padding:.5rem}
  #viewMail .mail-head{display:flex;flex-direction:row;align-items:center;margin:0 0 .45rem}
  #viewMail .mail-title-line h2{font-size:1rem;white-space:nowrap}
  #viewMail .mail-status{display:none}
  #viewMail .mail-head-actions{width:auto;margin-left:auto;gap:.35rem}
  #viewMail .mail-head-actions .btn{flex:0 0 auto;min-height:36px;padding:.45rem .75rem;font-size:.74rem}
  #viewMail .mail-refresh-button{width:36px;padding:0!important}
  #viewMail .mail-layout{border-radius:8px}
  #viewMail .mail-folders{min-height:43px;padding:.35rem .45rem;align-items:center}
  #viewMail .mail-folders button{min-height:34px;padding:.4rem .65rem}
  #viewMail .mail-folders .mail-location{display:none}
}

/* ============================================================
   CSV DOWNLOAD CONTROLS
   ============================================================ */
.csv-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.csv-controls input[type="date"] {
  padding: .4rem .6rem;
  font-size: .82rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: 'Open Sans', sans-serif;
}

.csv-controls label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
}

/* ============================================================
   PHOTO GRID
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .4rem;
  min-height: 40px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--gray-200);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb .photo-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-thumb:hover .photo-delete {
  opacity: 1;
}

.photo-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .55rem;
  padding: 2px 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  position: relative;
  height: 22px;
  background: var(--gray-200);
  border-radius: 50px;
  overflow: hidden;
  margin-top: .4rem;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-mid));
  border-radius: 50px;
  transition: width .2s ease;
}

.upload-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* ============================================================
   PAYMENTS LIST
   ============================================================ */
.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: .82rem;
}

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

.payment-amount {
  font-weight: 700;
  color: var(--green-dark);
}

.payment-meta {
  color: var(--gray-600);
  font-size: .72rem;
}

/* ============================================================
   HISTORY LOG
   ============================================================ */
.history-entry {
  display: flex;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .78rem;
}

.history-entry:last-child {
  border-bottom: none;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  margin-top: 4px;
}

.history-dot.sent { background: var(--blue); }
.history-dot.payment { background: #c9a227; }
.history-dot.edited { background: var(--gray-400); }

.history-time {
  color: var(--gray-400);
  font-size: .68rem;
  white-space: nowrap;
}

.history-text {
  color: var(--gray-800);
  flex: 1;
}

/* ============================================================
   ACTIVE SUBMISSION ROW
   ============================================================ */
tr.submission-active {
  border-left: 3px solid var(--green);
}

tr.submission-completed {
  opacity: .6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-user {
    order: 2;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
    gap: .75rem;
  }

  .form-group,
  .form-group.wide,
  .form-group.small,
  .form-group.full {
    flex: 1 1 100%;
  }

  .totals-box {
    max-width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .header-brand .header-name {
    font-size: .88rem;
  }

  .header-user #userEmail {
    display: none;
  }

  .nav-btn {
    font-size: .72rem;
    padding: .4rem .65rem;
  }

  .view {
    padding: 1.25rem 1rem;
  }

  .invoice-form,
  .settings-form {
    padding: 1.25rem;
  }

  table {
    font-size: .8rem;
  }

  th, td {
    padding: .6rem .65rem;
  }

  .view h2 {
    font-size: 1.25rem;
  }
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-block;
  padding: .2rem .65rem;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.status-invoiced {
  color: #2e7d32;
  background: #c8e6c9;
}

.status-pending {
  color: #e65100;
  background: var(--amber-light);
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: .85rem 1.5rem;
  background: var(--green-dark);
  color: var(--white);
  font-size: .88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  animation: notifyIn .3s ease-out both;
}

.notification-error {
  background: var(--red);
}

@keyframes notifyIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Small mobile */
@media (max-width: 400px) {
  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-logo {
    width: 72px;
    height: 72px;
  }

  .login-card h1 {
    font-size: 1.25rem;
  }

  .header-nav {
    gap: .15rem;
  }

  .nav-btn {
    font-size: .68rem;
    padding: .35rem .5rem;
  }
}

/* ============================================================
   ACCOUNTING / RECEIPT CAPTURE
   ============================================================ */
.accounting-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:1.25rem; }
.view-intro { color:var(--text-light); font-size:.9rem; max-width:66ch; }

/* Compact operations mailbox */
#viewMail{max-width:1540px;padding:1.15rem 1.25rem}
.nav-mail-icon{width:40px;height:36px;padding:7px!important;display:grid!important;place-items:center}
.nav-mail-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#viewMail .mail-head h2{margin:0 0 .2rem;padding:0;border:0}
#viewMail .mail-title-line{display:flex;align-items:center;gap:.8rem}
#viewMail .mail-status{margin:0;padding:0;border:0;border-radius:0;background:transparent}
#viewMail .mail-status div{flex-direction:row;align-items:center;gap:.55rem}
#viewMail .mail-status div strong{font-size:.74rem}#viewMail .mail-status div span{padding-left:.55rem;border-left:1px solid #b8c2bb;font-size:.72rem}
#viewMail .mail-status.connected{background:transparent;border:0}
.mail-refresh-button{width:40px;height:38px;padding:0!important;font-size:1.25rem;line-height:1}
#viewMail .mail-layout{grid-template-columns:150px minmax(320px,390px) minmax(420px,1fr);height:calc(100vh - 205px);min-height:520px;border-radius:10px}
#viewMail .mail-folders{padding:.65rem}
#viewMail .mail-folders button{padding:.6rem}
#viewMail .mail-location{margin-top:.6rem;padding:.7rem .6rem}
#viewMail .mail-list-wrap{overflow-y:auto;border-right:1px solid #e2e5e9}
#viewMail .mail-empty{min-height:100%}
#viewMail .mail-row{grid-template-columns:34px minmax(0,1fr);gap:.65rem;padding:.75rem;border-bottom:1px solid #e7e9ec;cursor:pointer}
#viewMail .mail-row:hover,#viewMail .mail-row.selected{background:#edf5eb}
#viewMail .mail-row.selected{box-shadow:inset 3px 0 var(--green)}
#viewMail .mail-avatar{width:32px;height:32px;font-size:.82rem}
#viewMail .mail-row-body>div{gap:.5rem}
#viewMail .mail-row-body strong{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#viewMail .mail-row time{font-size:.68rem;white-space:nowrap}
#viewMail .mail-row h3{font-family:inherit;font-size:.86rem;margin:.15rem 0;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#viewMail .mail-row p{font-size:.76rem}
.mail-delivery-status{display:inline-flex;align-items:center;width:max-content;margin-top:.3rem;padding:.18rem .42rem;border-radius:999px;background:#edf0f2;color:#52606a;font-size:.66rem;font-weight:750}
.mail-delivery-status.status-delivered,.mail-delivery-status.status-opened,.mail-delivery-status.status-clicked{background:#e5f4e8;color:#24703a}
.mail-delivery-status.status-bounced,.mail-delivery-status.status-blocked,.mail-delivery-status.status-invalid,.mail-delivery-status.status-error{background:#fde9e7;color:#a33a31}
.mail-engagement-status{display:inline-flex;width:max-content;margin:.3rem 0 0 .3rem;padding:.18rem .42rem;border-radius:999px;background:#eef0f8;color:#485487;font-size:.66rem;font-weight:750;cursor:help}
.mail-reader header>.mail-delivery-status{margin-left:.35rem}
#viewMail .mail-row>.mail-location-tag{display:none}
.mail-reader{min-width:0;overflow-y:auto;background:#fff}
.mail-mobile-back{display:none}
.mail-reader-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.3rem;color:#77818c}
.mail-reader header{padding:1.25rem 1.5rem;border-bottom:1px solid #e5e8ea}
.mail-reader header h2{font-family:inherit!important;color:var(--text)!important;font-size:1.2rem!important;margin:.65rem 0!important;padding:0!important;border:0!important}
.mail-reader header>div{display:flex;gap:.45rem;align-items:center;font-size:.82rem}.mail-reader header>div span{color:#69747e}.mail-reader header time{margin-left:auto;color:#69747e}
.mail-reader-actions{display:flex!important;gap:.4rem!important;margin-top:.85rem}.mail-reader-actions button{padding:.42rem .7rem;border:1px solid #c8d2ca;border-radius:6px;background:#f7f9f7;color:#2f4935;font:700 .72rem Montserrat,sans-serif;cursor:pointer}.mail-reader-actions button:hover{border-color:var(--green);background:#edf5eb}
.mail-reader-actions>select{padding:.4rem .5rem;border:1px solid #c8d2ca;border-radius:6px;background:#fff;color:#2f4935;font:700 .72rem Montserrat,sans-serif}
.mail-zoom-controls{display:flex!important;align-items:center;gap:.25rem!important;margin-left:auto}.mail-zoom-controls button{min-width:38px}.mail-zoom-controls output{min-width:42px;color:#526057;font:700 .7rem Montserrat,sans-serif;text-align:center}
.mail-reader-body{padding:1.5rem;white-space:pre-wrap;line-height:1.55;font-size:.9rem;color:#313b35}
.mail-attachments{display:flex;gap:.5rem;flex-wrap:wrap;padding:.65rem 1.5rem;border-bottom:1px solid #e5e8ea;background:#f7f9f7}
.mail-attachments button{display:flex;align-items:center;gap:.45rem;max-width:280px;padding:.45rem .65rem;border:1px solid #cbd5cd;border-radius:7px;background:#fff;color:#2e3931;cursor:pointer}.mail-attachments button:hover{border-color:var(--green);background:#f0f7ef}.mail-attachments strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.76rem}.mail-attachments small{color:#758078;white-space:nowrap}
.mail-html-frame{display:block;width:100%;height:calc(100% - 112px);min-height:420px;border:0;background:#fff}
.mail-compose-card{position:relative;max-width:680px;padding:0!important;overflow:hidden!important}
.mail-compose-card .modal-close{position:absolute;top:1rem;right:1.1rem;z-index:1}
.mail-compose-card>h2{margin:0!important;padding:1.25rem 1.5rem!important;border:0!important;background:var(--green-dark);color:#fff!important;font-size:1.2rem!important}
.mail-compose-card>.view-intro{max-width:none;margin:0;padding:.8rem 1.5rem;background:#f3f7f2;border-bottom:1px solid var(--border)}
.mail-compose-card form{padding:1.25rem 1.5rem 1.4rem;background:#fff}
.mail-compose-card .form-group{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin:0 0 1rem}
.mail-compose-card .form-group label{margin:0;font-size:.72rem;font-weight:750;text-transform:uppercase;letter-spacing:.07em;color:#4f5b53}
.mail-compose-card .form-group input,.mail-compose-card .form-group textarea{display:block;box-sizing:border-box;width:100%;min-height:44px;border:1px solid #b9c5bc!important;border-radius:7px!important;background:#f8faf8!important;box-shadow:inset 0 1px 2px rgba(25,50,30,.05);padding:.7rem .8rem!important;font:inherit;color:var(--text)}
.mail-compose-card .form-group textarea{min-height:220px;line-height:1.5;background:#fff!important}
.mail-compose-card .form-group input:focus,.mail-compose-card .form-group textarea:focus{outline:2px solid rgba(46,94,26,.2);border-color:var(--green)}
.mail-compose-card .form-actions{display:flex;justify-content:flex-end;gap:.65rem;margin:1rem 0 0;padding:1rem 0 0;border-top:1px solid var(--border)}
.mail-from-line,.mail-address-row{display:flex;align-items:center;gap:.65rem;min-height:42px;border-bottom:1px solid #dfe5df}
.mail-contact-picker{display:grid;grid-template-columns:130px minmax(0,1fr);align-items:center;gap:.7rem;margin-bottom:.4rem;padding:.65rem .75rem;border:1px solid #c9d5cc;border-radius:7px;background:#f3f7f2}
.mail-contact-picker label{font-size:.72rem;font-weight:750;text-transform:uppercase;letter-spacing:.05em;color:#4f5b53}
.mail-contact-picker select{min-width:0;width:100%;border:1px solid #b9c5bc;border-radius:6px;background:#fff;padding:.55rem .65rem;color:var(--text);font:inherit}
.mail-from-line>span,.mail-address-row>label{width:52px;flex:0 0 52px;color:#68736b;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.mail-from-line strong{font-size:.86rem}.mail-from-line small{color:#707a73}
.mail-address-row input{flex:1;min-width:0;border:0!important;background:transparent!important;box-shadow:none!important;padding:.65rem 0!important;font:inherit}
.mail-address-row input:focus{outline:0!important}
.mail-address-row button{border:0;background:transparent;color:var(--green-dark);font-weight:700;padding:.4rem;cursor:pointer}
.mail-subject-row{border-bottom:1px solid #dfe5df;margin-bottom:1rem}
.mail-subject-row input{width:100%;border:0;background:transparent;padding:.85rem 0;font:600 1rem inherit;color:var(--text)}
.mail-subject-row input:focus{outline:0}
.mail-editor{border:1px solid #b9c5bc;border-radius:8px;overflow:hidden;background:#fff}
.mail-format-toolbar{display:flex;align-items:center;gap:.2rem;padding:.4rem .5rem;border-bottom:1px solid #dfe5df;background:#f4f7f4}
.mail-format-toolbar button{min-width:32px;height:30px;border:0;border-radius:5px;background:transparent;color:#354038;cursor:pointer}
.mail-format-toolbar button:hover{background:#e2ebe1}.mail-format-toolbar>span{width:1px;height:20px;background:#ccd5ce;margin:0 .25rem}
.mail-body-editor{min-height:220px;max-height:340px;overflow-y:auto;padding:1rem;line-height:1.55;outline:0}
.mail-body-editor:empty:before{content:attr(data-placeholder);color:#929b95;pointer-events:none}
.mail-quoted-message{margin-top:1.25rem;padding-top:.8rem;border-top:1px solid #dfe5df;color:#68736b;font-size:.82rem}.mail-quoted-message p{margin:0 0 .5rem}.mail-quoted-message blockquote{margin:0;padding-left:.8rem;border-left:3px solid #cbd5cd;color:#566159}
.mail-attachment-row{display:flex;align-items:center;gap:.7rem;min-height:42px;padding-top:.7rem}
.mail-attach-button{display:inline-flex;align-items:center;border:1px solid #b9c5bc;border-radius:999px;padding:.45rem .8rem;font-size:.78rem;font-weight:700;cursor:pointer;background:#f7f9f7}
.mail-attachment-row>small{margin-left:auto;color:#78827b}
#mailAttachmentList{display:flex;gap:.4rem;flex-wrap:wrap}#mailAttachmentList>span{padding:.35rem .55rem;border-radius:6px;background:#edf3ec;font-size:.75rem}#mailAttachmentList small{color:#6d776f}
@media(max-width:600px){#mailComposeModal{align-items:stretch}.mail-compose-card{display:flex;flex-direction:column;width:100%;max-width:none;max-height:none;height:100dvh;border-radius:0}.mail-compose-card>h2{flex:0 0 auto;padding:.9rem 1rem!important;font-size:1rem!important}.mail-compose-card>.view-intro{display:none}.mail-compose-card form{box-sizing:border-box;display:flex;flex:1;min-height:0;flex-direction:column;padding:.5rem .75rem calc(.55rem + env(safe-area-inset-bottom));overflow:hidden}.mail-compose-card .modal-close{top:.72rem}.mail-from-line{flex:0 0 auto;min-height:30px}.mail-from-line small{display:none}.mail-contact-picker{flex:0 0 auto;display:block;margin-bottom:.15rem;padding:.35rem}.mail-contact-picker label{display:none}.mail-contact-picker select{padding:.4rem;font-size:.76rem}.mail-address-row{flex:0 0 auto;min-height:34px}.mail-subject-row{flex:0 0 auto;margin-bottom:.4rem}.mail-subject-row input{padding:.55rem 0}.mail-editor{display:flex;flex:1;min-height:150px;flex-direction:column}.mail-format-toolbar{flex:0 0 auto;overflow-x:auto;white-space:nowrap}.mail-body-editor{flex:1;min-height:0;padding:.65rem;overflow-y:auto}.mail-attachment-row{flex:0 0 auto;min-height:36px;align-items:center;flex-wrap:nowrap;overflow-x:auto}.mail-attachment-row>small{display:none}.mail-compose-card .form-actions{position:static;flex:0 0 auto;margin:.35rem 0 0;padding:.5rem 0 0;background:#fff}.mail-compose-card .form-actions .btn{width:auto;flex:1}}
@media(max-width:1050px){#viewMail .mail-layout{grid-template-columns:130px minmax(280px,360px) 1fr}}
@media(max-width:820px){#viewMail .mail-status div{flex-direction:column;align-items:flex-start;gap:.15rem}#viewMail .mail-status div span{padding:0;border:0}#viewMail .mail-layout{grid-template-columns:1fr;height:auto}.mail-reader{display:none}#viewMail .mail-list-wrap{border-right:0}#viewMail .mail-row{grid-template-columns:34px minmax(0,1fr)}.mail-reader.mobile-open{display:block;position:fixed;inset:0;z-index:11000;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;background:#fff}.mail-mobile-back{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:.45rem;width:100%;padding:.7rem .85rem;border:0;border-bottom:1px solid #dfe5df;background:#087b2c;color:#fff;font:700 .8rem Montserrat,sans-serif;text-align:left}.mail-reader.mobile-open header{padding:.65rem .75rem}.mail-reader.mobile-open header>.mail-location-tag{display:none}.mail-reader.mobile-open header h2{font-size:1rem!important;margin:.35rem 0!important}.mail-reader.mobile-open header>div{align-items:flex-start;flex-wrap:wrap}.mail-reader.mobile-open header time{width:100%;margin:.15rem 0 0}.mail-reader.mobile-open .mail-reader-actions{align-items:center;flex-wrap:wrap;margin-top:.45rem}.mail-reader.mobile-open .mail-reader-body{padding:.75rem;font-size:1rem;overflow:visible}.mail-reader.mobile-open .mail-html-frame{display:block;width:100%;height:320px;min-height:320px;border:0;pointer-events:none}.mail-reader.mobile-open .mail-attachments{padding:.4rem .75rem}.mail-reader.mobile-open .mail-attachments button{max-width:100%}}
@media(max-width:820px){.mail-reader.mobile-open .mail-zoom-controls{position:fixed;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:5;gap:0!important;margin:0;padding:5px;border:1px solid #cbd5cd;border-radius:999px;background:#fff;box-shadow:0 5px 20px rgba(20,38,25,.24)}.mail-reader.mobile-open .mail-zoom-controls button{width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:50%;background:#edf5eb;color:#174d25;font-size:1.5rem}.mail-reader.mobile-open .mail-zoom-controls output{min-width:48px;font-size:.72rem}}
@media(max-width:760px){#viewMail{position:relative}#viewMail .mail-head{height:34px;min-height:34px;margin:0 0 .35rem;align-items:center}#viewMail .mail-title-line{display:none}#viewMail .mail-folders{position:absolute;z-index:2;top:.5rem;left:.5rem;right:108px;display:flex;align-items:center;height:34px;min-height:34px;padding:0;border:0;background:transparent;white-space:nowrap}#viewMail .mail-folders::before{content:"Mail ·";display:flex;align-items:center;height:32px;margin-right:.1rem;color:#26352b;font-size:.72rem;line-height:1;font-weight:700}#viewMail .mail-folders button{display:flex;align-items:center;justify-content:center;width:auto;height:32px;min-height:32px;padding:0 .3rem;font-size:.68rem;line-height:1}#viewMail .mail-folders button span{display:inline-flex;align-items:center;margin-left:.1rem}#viewMail .mail-folders button b{font:inherit}#viewMail .mail-folders select{align-self:center;width:60px;height:32px;margin:0 0 0 .1rem;padding:0 .2rem;border-radius:6px;font-size:.65rem;line-height:32px}#viewMail .mail-head-actions{position:relative;z-index:3;align-items:center;height:34px;gap:.25rem}#viewMail .mail-head-actions .btn{height:32px;min-height:32px;padding:0 .55rem;font-size:.68rem;line-height:1}#viewMail .mail-refresh-button{width:32px;height:32px;padding:0!important;font-size:1rem}}
@media(max-width:370px){#viewMail .mail-folders::before{content:"Mail ·"}}
.accounting-stage { padding:.4rem .7rem; border-radius:999px; background:var(--blue-light); color:var(--blue-dark); font-size:.72rem; font-weight:700; white-space:nowrap; }
.receipt-layout { display:grid; gap:1.25rem; }
.receipt-capture-card,.receipt-register-card { padding:1.25rem; border:1px solid var(--border); border-radius:var(--radius); background:var(--white); box-shadow:var(--shadow-sm); }
.receipt-source { display:grid; grid-template-columns:minmax(220px,320px) 1fr; align-items:center; gap:1rem; margin-bottom:1.25rem; }
.receipt-preview { min-height:190px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.4rem; overflow:hidden; border:2px dashed var(--border); border-radius:var(--radius-sm); background:var(--bg); color:var(--text-light); text-align:center; }
.receipt-preview img { width:100%; height:230px; object-fit:contain; background:#20252a; }
.receipt-preview-icon { font-size:2rem; font-weight:700; color:var(--blue); }
.receipt-preview small { padding:0 .5rem .5rem; }
.receipt-source-actions { display:flex; gap:.65rem; flex-wrap:wrap; }
.receipt-file-btn { position:relative; overflow:hidden; cursor:pointer; }
.receipt-file-btn input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.receipt-capture-card input:not([type="file"]),.receipt-capture-card select { width:100%; padding:.65rem .85rem; border:2px solid var(--gray-300); border-radius:var(--radius-sm); background:var(--white); color:var(--gray-900); font:400 .9rem 'Open Sans',sans-serif; }
.receipt-capture-card input:focus,.receipt-capture-card select:focus { border-color:var(--green); outline:none; box-shadow:0 0 0 3px rgba(76,175,80,.14); }
.receipt-submit-row { align-items:center; }
.receipt-upload-status { color:var(--text-light); font-size:.82rem; }
.receipt-register-head { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:.75rem; }
.receipt-register-head h3 { margin:0; }
.receipt-register-head input { width:min(320px,100%); }
.receipt-table small { color:var(--text-light); }
.receipt-empty { padding:2rem; color:var(--text-light); text-align:center; }
.receipt-row-actions{display:flex;gap:.4rem;align-items:center;white-space:nowrap}.receipt-row-actions .btn-danger{color:var(--red);border-color:var(--red-light);background:var(--red-light)}.receipt-row-actions .btn-danger:hover{background:var(--red);color:var(--white)}
.receipt-sort{display:inline-flex;align-items:center;gap:.3rem;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;cursor:pointer;padding:0;text-align:left}.receipt-sort:after{content:"↕";font-size:.7rem;opacity:.35}.receipt-sort.active:after{content:"↑";opacity:1;color:var(--green)}.receipt-sort.active[data-direction="desc"]:after{content:"↓"}
.receipt-year-row th{padding:.72rem .8rem;border-top:2px solid var(--green);background:color-mix(in srgb,var(--green) 9%,var(--white));color:var(--green-dark);text-align:left}.receipt-year-row th:first-child{font-family:'Montserrat',sans-serif}.receipt-year-row th strong{font-size:1rem}.receipt-year-row th span{margin-left:.6rem;color:var(--gray-600);font-family:'Open Sans',sans-serif;font-size:.72rem;font-weight:500}.receipt-year-row th:nth-last-child(2){font-family:'Montserrat',sans-serif;font-size:.92rem;text-align:left;white-space:nowrap}.receipt-year-row th small{display:block;margin-top:.16rem;color:var(--gray-600);font-family:'Open Sans',sans-serif;font-size:.65rem;font-weight:500}
.expense-analytics{margin:0 0 1.25rem;padding:1.1rem;border:1px solid var(--gray-300);border-radius:var(--radius);background:var(--white);box-shadow:var(--shadow-sm)}.expense-report-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;margin-bottom:1rem}.expense-report-head h3{margin:0;border:0;padding:0}.expense-report-head p{margin:.2rem 0 0;color:var(--gray-600);font-size:.75rem}.expense-report-controls{display:flex;align-items:flex-end;gap:.45rem;flex-wrap:wrap}.expense-report-controls label{font-size:.68rem;color:var(--gray-600)}.expense-report-controls input{display:block;margin-top:.2rem;padding:.42rem;border:1px solid var(--gray-300);border-radius:5px}.expense-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:.65rem}.expense-kpis>div{padding:.85rem;border-radius:7px;background:var(--gray-50);border:1px solid var(--gray-200)}.expense-kpis span{display:block;color:var(--gray-600);font-size:.67rem;text-transform:uppercase;letter-spacing:.04em}.expense-kpis strong{display:block;margin-top:.3rem;color:var(--green-dark);font-family:'Montserrat',sans-serif;font-size:1.25rem}.expense-charts{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:.75rem;margin-top:.75rem}.expense-charts article{min-height:220px;padding:.85rem;border:1px solid var(--gray-200);border-radius:7px}.chart-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.chart-title h4{font-family:'Montserrat',sans-serif;font-size:.78rem}.chart-title span{color:var(--gray-600);font-size:.65rem}.monthly-chart{height:160px;display:flex;align-items:flex-end;gap:5px;border-bottom:1px solid var(--gray-300);padding-top:15px}.month-bar{flex:1;min-width:8px;background:var(--green);border-radius:3px 3px 0 0;position:relative}.month-bar:hover:after{content:attr(data-label);position:absolute;bottom:calc(100% + 4px);left:50%;transform:translateX(-50%);background:var(--gray-900);color:#fff;padding:3px 5px;border-radius:3px;font-size:.6rem;white-space:nowrap;z-index:3}.chart-row{display:grid;grid-template-columns:minmax(85px,1fr) 1.4fr auto;align-items:center;gap:.45rem;margin:.55rem 0;font-size:.68rem}.chart-row>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-track{height:7px;background:var(--gray-200);border-radius:9px;overflow:hidden}.chart-track i{display:block;height:100%;background:var(--green);border-radius:inherit}.chart-row b{font-size:.67rem}.chart-empty{color:var(--gray-600);font-size:.75rem;padding:2rem 0;text-align:center}@media(max-width:900px){.expense-charts{grid-template-columns:1fr 1fr}.expense-charts article:first-child{grid-column:1/-1}}@media(max-width:650px){.expense-report-head{align-items:stretch;flex-direction:column}.expense-report-controls{display:grid;grid-template-columns:1fr 1fr}.expense-report-controls .btn{width:100%}.expense-kpis{grid-template-columns:1fr 1fr}.expense-charts{grid-template-columns:1fr}.expense-charts article:first-child{grid-column:auto}.expense-kpis strong{font-size:1.05rem}}
.expense-report-controls .expense-scan-option{display:flex;align-items:center;gap:.35rem;min-height:2rem;padding:0 .45rem;border:1px solid var(--gray-300);border-radius:5px;background:var(--gray-50);white-space:nowrap}.expense-report-controls .expense-scan-option input{display:inline-block;width:auto;margin:0;padding:0}
.expense-report-controls .btn{color:#102617;background:#fff;border:1px solid #6b7d70;box-shadow:none}.expense-report-controls .btn:hover:not(:disabled){color:#07130a;background:#eef5f0;transform:none;box-shadow:none}
.expense-report-controls .expense-pdf-button{min-width:9.7rem;background:#087b2c;color:#fff;box-shadow:0 3px 10px rgba(8,123,44,.26)}.expense-report-controls .expense-pdf-button:hover:not(:disabled){background:#066823}.expense-report-controls .expense-pdf-button:disabled{opacity:1;cursor:progress;background:#075f27;color:#fff}.expense-pdf-button.is-building:before{content:"";width:.72rem;height:.72rem;border:2px solid rgba(255,255,255,.38);border-top-color:#fff;border-radius:50%;animation:expensePdfSpin .7s linear infinite}.expense-report-controls .expense-pdf-button.is-complete{background:#236b39}@keyframes expensePdfSpin{to{transform:rotate(360deg)}}
.receipt-edit-modal{max-width:760px;color:#102617;background:#fff}.receipt-edit-modal .form-actions{margin-top:1rem}.receipt-edit-modal label{color:#102617;font-weight:700}.receipt-edit-modal input,.receipt-edit-modal select{color:#07130a;background:#fff;border-color:#6b7d70}.receipt-edit-modal option{color:#07130a;background:#fff}.receipt-row-actions .btn{color:#102617;background:#fff;border:1px solid #6b7d70}.receipt-row-actions .btn:hover{color:#07130a;background:#eef5f0}.receipt-row-actions .btn-danger{color:#8b1e1e;border-color:#b76a6a;background:#fff}
.receipt-year-toggle{display:inline-flex;align-items:center;gap:.55rem;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.receipt-year-toggle:hover strong{text-decoration:underline}.receipt-year-twistie{display:inline-flex;align-items:center;justify-content:center;width:1rem;color:#087b2c;font-size:1rem}.receipt-year-toggle span:last-child{font-weight:400;color:#46584b}
.receipt-group-control{display:flex;align-items:center;gap:.4rem;color:#102617;font-size:.75rem;font-weight:700}.receipt-group-control select{padding:.45rem .65rem;color:#07130a;background:#fff;border:1px solid #6b7d70;border-radius:6px;font:inherit}.receipt-group-control option{color:#07130a;background:#fff}
.mail-alert-button.enabled{color:#fff;background:#087b2c;border-color:#087b2c}.mail-alert-button.enabled:hover:not(:disabled){background:#066823}

/* CRM / business development design preview */
.opportunity-subnav{display:inline-flex;gap:.25rem;margin:0 0 1rem;padding:.25rem;border:1px solid #d7dfd8;border-radius:9px;background:#eef2ee}.opportunity-subnav button{min-width:88px;padding:.48rem .8rem;border:0;border-radius:6px;background:transparent;color:#536057;font:700 .72rem Montserrat,sans-serif;cursor:pointer}.opportunity-subnav button.active{background:#fff;color:#17612a;box-shadow:0 1px 4px rgba(28,50,34,.12)}
.nav-btn.opportunity-nav{position:relative;isolation:isolate;overflow:hidden}.nav-btn.opportunity-nav>span{position:relative;z-index:2}.nav-btn.opportunity-nav::before,.nav-btn.opportunity-nav::after{content:"";position:absolute;z-index:1;border:1.5px solid rgba(255,255,255,.5);border-radius:50%;background:rgba(255,255,255,.18);pointer-events:none;animation:opportunityNavBubble 2.4s ease-in-out infinite}.nav-btn.opportunity-nav::before{width:30px;height:30px;left:3px;bottom:-15px}.nav-btn.opportunity-nav::after{width:17px;height:17px;right:5px;top:-8px;animation-delay:-1.1s}.nav-btn.opportunity-nav.active::before,.nav-btn.opportunity-nav.active::after{border-color:rgba(8,123,44,.55);background:rgba(8,123,44,.17)}@keyframes opportunityNavBubble{0%,100%{transform:translateY(3px) scale(.94);opacity:.65}50%{transform:translateY(-11px) scale(1.08);opacity:1}}@media(prefers-reduced-motion:reduce){.nav-btn.opportunity-nav::before,.nav-btn.opportunity-nav::after{animation:none}}
.opportunity-bubbles{position:absolute;z-index:1;inset:0;overflow:hidden;pointer-events:none}.opportunity-bubbles b{position:absolute;bottom:-12px;display:block;border:1.5px solid rgba(8,123,44,.72);border-radius:50%;background:rgba(8,123,44,.24);box-shadow:0 0 7px rgba(8,123,44,.22);animation:opportunityBubbleRise 2.8s ease-in infinite}.opportunity-bubbles b:nth-child(1){left:10%;width:13px;height:13px}.opportunity-bubbles b:nth-child(2){left:52%;width:8px;height:8px;animation-delay:-1.8s}.opportunity-bubbles b:nth-child(3){left:82%;width:16px;height:16px;animation-delay:-.8s}.opportunity-nav:not(.active) .opportunity-bubbles b{border-color:rgba(255,255,255,.65);background:rgba(255,255,255,.22);box-shadow:0 0 6px rgba(255,255,255,.2)}@keyframes opportunityBubbleRise{0%{transform:translateY(0) scale(.8);opacity:0}18%{opacity:1}75%{opacity:.9}100%{transform:translateY(-48px) scale(1.12);opacity:0}}@media(prefers-reduced-motion:reduce){.opportunity-bubbles b{animation:none;bottom:5px;opacity:.7}}
.nav-btn.opportunity-nav.active{border:1px solid rgba(58,145,82,.32);border-radius:13px 15px 12px 14px;background:linear-gradient(145deg,#f7fff8,#dff2e3 58%,#c9e7d0);box-shadow:inset 5px 5px 8px rgba(255,255,255,.88),inset -4px -4px 8px rgba(42,130,66,.13),0 3px 8px rgba(18,86,36,.12)}.nav-btn.opportunity-nav.active>span{color:#1b652f;text-shadow:0 1px rgba(255,255,255,.8)}.nav-btn.opportunity-nav.active.is-soap-splash{animation:opportunitySoapButtonPop .36s ease-out 2}@keyframes opportunitySoapButtonPop{50%{transform:scale(1.045);filter:saturate(1.08)}}.opportunity-screen-bubble{position:fixed;z-index:80;border:1.5px solid rgba(8,123,44,.38);border-radius:50%;background:radial-gradient(circle at 29% 24%,rgba(255,255,255,.96),rgba(138,225,159,.2) 38%,rgba(8,123,44,.08) 70%);box-shadow:inset 0 0 8px rgba(255,255,255,.82),0 3px 10px rgba(8,123,44,.12);pointer-events:none;will-change:transform,opacity}.opportunity-screen-bubble.is-burst{border-color:rgba(8,123,44,.48);box-shadow:inset 0 0 9px rgba(255,255,255,.9),0 4px 13px rgba(8,123,44,.18)}@media(prefers-reduced-motion:reduce){.opportunity-screen-bubble{display:none}.nav-btn.opportunity-nav.active.is-soap-splash{animation:none}}
.opportunity-screen-bubble.is-sud{border-width:1px;background:rgba(232,255,237,.7);box-shadow:inset 0 0 3px rgba(255,255,255,.95),0 1px 4px rgba(8,123,44,.13)}.opportunity-screen-bubble.is-sud:before,.opportunity-screen-bubble.is-sud:after{content:"";position:absolute;border:1px solid rgba(41,155,70,.3);border-radius:50%;background:rgba(239,255,243,.7);box-shadow:inset 0 0 3px #fff}.opportunity-screen-bubble.is-sud:before{width:62%;height:62%;top:-42%;left:-38%}.opportunity-screen-bubble.is-sud:after{width:46%;height:46%;right:-36%;bottom:-24%}
.opportunity-screen-bubble.is-attached{z-index:81;border-color:rgba(31,145,63,.42);background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.98),rgba(171,235,185,.35) 42%,rgba(39,158,70,.12));filter:saturate(.9)}.opportunity-screen-bubble.is-stuck{animation:opportunityBubbleCling 1.35s ease-in-out infinite alternate}@keyframes opportunityBubbleCling{to{transform:scale(1.08);filter:saturate(1.05) brightness(1.03)}}.opportunity-screen-bubble.is-popping{animation:opportunityBubblePop .36s cubic-bezier(.18,.8,.3,1) forwards}@keyframes opportunityBubblePop{55%{transform:scale(1.65);opacity:.82}100%{transform:scale(2.15);opacity:0}}
.crm-edit-button{padding:.15rem .3rem;border:0;background:transparent;color:#17612a;font:700 .62rem Open Sans,sans-serif;cursor:pointer}.crm-edit-button:hover{text-decoration:underline}.crm-opportunity-modal{max-width:780px}.crm-opportunity-modal form{margin-top:1rem}.crm-opportunity-modal textarea{width:100%;resize:vertical}
.crm-selection-actions{display:flex;align-items:center;gap:.45rem;padding:.3rem .4rem .3rem .65rem;border:1px solid #cbd9ce;border-radius:8px;background:#f2f8f3;color:#24482d;font-size:.68rem}.crm-selection-actions button{padding:.35rem .55rem;border:0;border-radius:5px;background:transparent;color:#17612a;font:700 .65rem Montserrat,sans-serif;cursor:pointer}.crm-selection-actions .crm-bulk-delete{border:1px solid #d7a4a4;background:#fff;color:#9b2929}.crm-card.is-selected{border-color:#24934a;box-shadow:0 0 0 2px rgba(36,147,74,.15),0 4px 16px rgba(24,58,33,.08)}.crm-card-select{display:inline-flex;align-items:center;cursor:pointer}.crm-card-select input{position:absolute;opacity:0;pointer-events:none}.crm-card-select>span[aria-hidden]{width:15px;height:15px;border:1.5px solid #92a198;border-radius:4px;background:#fff}.crm-card-select input:checked+span{border-color:#087b2c;background:#087b2c;box-shadow:inset 0 0 0 3px #fff}.crm-card-top-spacer{flex:1}.crm-card-actions{display:flex;align-items:center;gap:.25rem}.crm-quick-delete{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:1px solid transparent;border-radius:50%;background:transparent;color:#8b5555;font:600 1rem/1 Open Sans,sans-serif;cursor:pointer}.crm-quick-delete:hover{border-color:#e4bcbc;background:#fff2f2;color:#a51f1f}.crm-next-action{display:grid;width:100%;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:.45rem;margin:.65rem 0 0;padding:.55rem .6rem;border:1px solid transparent;border-radius:6px;background:#f5f8f5;color:#334b39;font:inherit;font-size:.67rem;line-height:1.35;text-align:left;cursor:pointer}.crm-next-action:hover{border-color:#a9cdb2;background:#edf7ef}.crm-next-action span{padding-top:.08rem;color:#16813a;font:700 .57rem Montserrat,sans-serif;letter-spacing:.06em;text-transform:uppercase}.crm-next-action strong{font-weight:600}.crm-next-action i{color:#16813a;font-style:normal;font-size:.9rem;transition:transform .15s ease}.crm-next-action:hover i{transform:translateX(2px)}
.crm-layout-toggle{display:flex;padding:3px;border:1px solid #cad7cc;border-radius:8px;background:#edf3ee}.crm-layout-toggle button{padding:.42rem .65rem;border:0;border-radius:5px;background:transparent;color:#5d6c62;font:700 .65rem Montserrat,sans-serif;cursor:pointer}.crm-layout-toggle button.active{background:#fff;color:#087b2c;box-shadow:0 1px 4px rgba(20,55,28,.12)}.crm-gantt{margin-top:1rem;overflow-x:auto;border:1px solid #dbe4dc;border-radius:11px;background:#fff;box-shadow:0 4px 18px rgba(24,58,33,.05)}.crm-gantt-top,.crm-gantt-head,.crm-gantt-row{min-width:980px}.crm-gantt-top{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.9rem 1rem;border-bottom:1px solid #dfe7e0}.crm-gantt-top>div:first-child strong,.crm-gantt-top>div:first-child small{display:block}.crm-gantt-top>div:first-child strong{font:700 .85rem Montserrat,sans-serif;color:#173d22}.crm-gantt-top>div:first-child small{margin-top:.2rem;color:#758078;font-size:.67rem}.crm-gantt-legend{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.crm-gantt-legend span{display:flex;align-items:center;gap:.3rem;color:#59675e;font-size:.62rem}.crm-gantt-legend i{width:9px;height:9px;border-radius:3px}.stage-new{--stage-color:#4b9460}.stage-contacted{--stage-color:#278fa3}.stage-walkthrough{--stage-color:#d49a24}.stage-proposal{--stage-color:#765bb3}.stage-won{--stage-color:#087b2c}.stage-lost{--stage-color:#9a6262}.crm-gantt-legend i{background:var(--stage-color)}.crm-gantt-head,.crm-gantt-row{display:grid;grid-template-columns:260px minmax(720px,1fr)}.crm-gantt-head{background:#f4f7f4;color:#657168}.crm-gantt-head>strong{padding:.6rem 1rem;font:700 .63rem Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.06em}.crm-gantt-stage-head{display:grid;grid-template-columns:repeat(6,1fr)}.crm-gantt-stage-head span{padding:.6rem .15rem;font:700 .6rem Montserrat,sans-serif;text-align:center;text-transform:uppercase;letter-spacing:.02em}.crm-gantt-row{min-height:72px;border-top:1px solid #edf1ed}.crm-gantt-row.is-selected{background:#f1f8f2}.crm-gantt-name{display:flex;align-items:center;gap:.65rem;padding:.72rem 1rem;border-right:1px solid #e1e8e2}.crm-gantt-name>button{min-width:0;padding:0;border:0;background:transparent;color:#173d22;text-align:left;cursor:pointer}.crm-gantt-name strong,.crm-gantt-name small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-gantt-name strong{font:700 .72rem Montserrat,sans-serif}.crm-gantt-name small{margin-top:.24rem;color:#738078;font-size:.61rem}.crm-gantt-track{position:relative;display:grid;grid-template-columns:repeat(6,1fr);min-width:720px}.crm-gantt-track>span{position:relative;border-right:1px solid #e6ece7}.crm-gantt-track>span.complete:after{content:"";position:absolute;top:22px;right:-1px;left:0;height:8px;background:color-mix(in srgb,var(--stage-color) 35%,#fff)}.crm-gantt-track>span.current:after{height:12px;top:20px;border-radius:999px;background:var(--stage-color);box-shadow:0 2px 6px color-mix(in srgb,var(--stage-color) 28%,transparent)}.crm-gantt-track>button{position:absolute;right:.45rem;bottom:.35rem;max-width:56%;display:flex;align-items:center;gap:.35rem;padding:.2rem .45rem;border:0;border-radius:999px;background:#f0f5f1;color:#34503b;font-size:.58rem;cursor:pointer}.crm-gantt-track>button b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-gantt-track>button i{color:#087b2c;font-style:normal}.crm-gantt-track>button:hover{background:#e2f0e5}.crm-gantt-empty{min-width:980px;margin:0;padding:2.5rem;color:#758078;text-align:center}
.crm-gantt-name{cursor:pointer}.crm-gantt-name:hover{background:#f4f9f5}.crm-gantt-name>button{flex:1}.crm-gantt-edit{padding:.2rem .35rem;border-radius:4px;color:#087b2c;background:#edf6ef;font:700 .56rem Montserrat,sans-serif;opacity:.72}.crm-gantt-name:hover .crm-gantt-edit{opacity:1}.crm-gantt-head>strong small{display:block;margin-top:.12rem;color:#78847c;font:500 .54rem Open Sans,sans-serif;letter-spacing:0;text-transform:none}.crm-gantt-select{display:grid;justify-items:center;gap:.16rem}.crm-select-label{color:#718078;font-size:.5rem;font-weight:600}
.crm-gantt-row{min-height:84px}.crm-gantt-track>span.complete:after{top:36px}.crm-gantt-track>span.current:after{top:34px}.crm-stage-control{position:absolute;top:.28rem;right:.45rem;display:flex;align-items:center;gap:.35rem;color:#6a776e;font-size:.53rem}.crm-stage-control select{max-width:130px;padding:.2rem 1.25rem .2rem .35rem;border:1px solid #bac9bd;border-radius:5px;background:#fff;color:#24472e;font:600 .58rem Open Sans,sans-serif;cursor:pointer}.crm-gantt-track>button{bottom:.3rem}
.crm-gantt-head,.crm-gantt-row{grid-template-columns:58px 242px minmax(720px,1fr);min-width:1020px}.crm-gantt-select-head{display:flex;align-items:center;justify-content:center;padding:.6rem .2rem!important;border-right:1px solid #e1e8e2;font-size:.52rem!important;letter-spacing:.02em!important}.crm-gantt-select-cell{display:flex;align-items:center;justify-content:center;border-right:1px solid #e1e8e2}.crm-gantt-name{padding:.68rem .8rem}.crm-gantt-name>button{width:100%}.crm-gantt-name strong{font-size:.74rem}.crm-gantt-name small{margin-top:.2rem}.crm-gantt-name em{display:block;margin-top:.18rem;color:#087b2c;font-size:.58rem;font-style:normal;font-weight:700}.crm-gantt-edit,.crm-gantt-select,.crm-select-label{display:none}
.crm-gantt-head,.crm-gantt-row{grid-template-columns:48px 225px 180px minmax(660px,1fr);min-width:1113px}.crm-gantt-workflow-head{display:flex;align-items:center;padding:.6rem .75rem!important;border-right:1px solid #e1e8e2}.crm-gantt-actions{display:flex;flex-direction:column;justify-content:center;gap:.42rem;padding:.48rem .58rem;border-right:1px solid #e1e8e2;background:#fbfcfb}.crm-gantt-actions select{width:100%;padding:.3rem 1.35rem .3rem .4rem;border:1px solid #b9c8bc;border-radius:6px;background:#fff;color:#24472e;font:600 .61rem Open Sans,sans-serif;cursor:pointer}.crm-gantt-actions button{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.3rem;width:100%;padding:.27rem .4rem;border:0;border-radius:6px;background:#edf5ef;color:#34503b;font-size:.56rem;text-align:left;cursor:pointer}.crm-gantt-actions button span{color:#087b2c;font:700 .5rem Montserrat,sans-serif;text-transform:uppercase}.crm-gantt-actions button b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-gantt-actions button i{color:#087b2c;font-style:normal}.crm-gantt-actions button:hover{background:#dfeee2}.crm-gantt-track{min-width:660px}.crm-gantt-track>span.complete:after{top:36px}.crm-gantt-track>span.current:after{top:34px}
.crm-head h2 span{color:#728078;font-size:.72em;font-weight:600;white-space:nowrap}.crm-column-empty{margin:0;padding:1.1rem .65rem;color:#7b867f;font-size:.68rem;line-height:1.45;text-align:center}
#settingsLocationLabel{color:#65736a;font-size:.72em;font-weight:600;white-space:nowrap}
.crm-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem}.crm-head h2{margin:.15rem 0 .35rem}.crm-eyebrow{color:var(--green);font:700 .68rem Montserrat,sans-serif;letter-spacing:.11em;text-transform:uppercase}
.crm-preview-note{display:flex;align-items:center;gap:.7rem;margin:1rem 0;padding:.7rem .85rem;border:1px solid #cfe0d2;border-radius:8px;background:#f1f8f2;color:#36513c;font-size:.77rem}.crm-preview-note strong{padding:.22rem .48rem;border-radius:999px;background:#dcefe0;color:#17612a;font-size:.66rem;text-transform:uppercase;white-space:nowrap}
.crm-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.7rem;margin:1rem 0}.crm-kpis article{padding:1rem;border:1px solid #dfe6e0;border-radius:10px;background:#fff;box-shadow:0 3px 14px rgba(24,58,33,.045)}.crm-kpis span,.crm-kpis small{display:block;color:#6c786f;font-size:.68rem}.crm-kpis span{font-weight:700;text-transform:uppercase;letter-spacing:.04em}.crm-kpis strong{display:block;margin:.25rem 0;color:#163f24;font:700 1.45rem Montserrat,sans-serif}
.crm-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:1rem 0 .75rem}.crm-search{display:flex;align-items:center;gap:.4rem;width:min(370px,100%);padding:0 .65rem;border:1px solid #ccd6ce;border-radius:8px;background:#fff}.crm-search input{width:100%;padding:.65rem 0;border:0;outline:0;background:transparent}.crm-filter-pills{display:flex;gap:.35rem}.crm-filter-pills button{padding:.48rem .68rem;border:1px solid #d7dfd8;border-radius:999px;background:#fff;color:#546159;font:600 .72rem Open Sans,sans-serif;cursor:pointer;white-space:nowrap}.crm-filter-pills button.active{border-color:#28753d;background:#edf6ef;color:#17612a}.crm-filter-pills span{display:inline-flex;align-items:center;justify-content:center;min-width:17px;height:17px;margin-left:.2rem;border-radius:50%;background:#fff}
.crm-board{display:grid;grid-template-columns:repeat(4,minmax(230px,1fr));gap:.8rem;align-items:start;overflow-x:auto;padding-bottom:.8rem}.crm-column{min-width:230px;padding:.65rem;border-radius:11px;background:#f1f4f1}.crm-column>header{display:flex;align-items:center;justify-content:space-between;padding:.2rem .25rem .65rem}.crm-column>header>div{display:flex;align-items:center;gap:.4rem}.crm-column>header strong{font:700 .75rem Montserrat,sans-serif;color:#344239}.crm-column>header b{display:flex;align-items:center;justify-content:center;min-width:22px;height:22px;border-radius:999px;background:#fff;color:#657069;font-size:.68rem}.crm-dot{width:8px;height:8px;border-radius:50%}.crm-dot.new{background:#75827a}.crm-dot.contacted{background:#3f7dc3}.crm-dot.walkthrough{background:#d89332}.crm-dot.proposal{background:#7c58bd}
.crm-card{margin-bottom:.65rem;padding:.85rem;border:1px solid #dce3dd;border-radius:9px;background:#fff;box-shadow:0 3px 10px rgba(28,50,34,.06)}.crm-card:last-child{margin-bottom:0}.crm-card-top{display:flex;align-items:center;justify-content:space-between;gap:.4rem}.crm-card-top button{border:0;background:none;color:#7a857e;cursor:pointer}.crm-sector{color:#51715b;font-size:.63rem;font-weight:700;text-transform:uppercase}.crm-due{padding:.2rem .38rem;border-radius:999px;background:#edf3fb;color:#3269a9;font-size:.61rem;font-weight:700;white-space:nowrap}.crm-due.overdue{background:#fff0ed;color:#ad3e32}.crm-card h3{margin:.55rem 0 .22rem;color:#1c2e21;font:700 .86rem Montserrat,sans-serif}.crm-card>p{min-height:2.1em;margin:0;color:#69756d;font-size:.68rem;line-height:1.45}.crm-signal{margin-top:.7rem;padding:.48rem .55rem;border-radius:6px;background:#f3f7f3;color:#4e6254;font-size:.66rem}
.crm-contact{display:flex;align-items:center;gap:.5rem;margin-top:.7rem}.crm-contact>span{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#e4efe6;color:#246036;font-size:.61rem;font-weight:800}.crm-contact strong,.crm-contact small{display:block}.crm-contact strong{font-size:.66rem}.crm-contact small{color:#8a504a;font-size:.61rem}.crm-proposal-value{display:flex;align-items:baseline;justify-content:space-between;margin-top:.7rem;padding:.55rem;border-radius:7px;background:#f4f0fa;color:#594184}.crm-proposal-value small{font-size:.62rem;text-transform:uppercase}.crm-proposal-value strong{font:700 .8rem Montserrat,sans-serif}.crm-card footer{display:flex;align-items:center;justify-content:space-between;gap:.4rem;margin-top:.75rem;padding-top:.6rem;border-top:1px solid #ebefec;color:#758078;font-size:.61rem}.crm-card footer strong{color:#304a36}.crm-card footer small{text-align:right}.crm-card.hidden{display:none}
@media(max-width:900px){.crm-kpis{grid-template-columns:1fr 1fr}.crm-board{grid-template-columns:repeat(4,260px)}}@media(max-width:600px){.crm-head,.crm-toolbar{align-items:stretch;flex-direction:column}.crm-head .btn{width:100%}.crm-preview-note{align-items:flex-start;flex-direction:column}.crm-kpis{grid-template-columns:1fr 1fr}.crm-kpis article{padding:.75rem}.crm-kpis strong{font-size:1.12rem}.crm-filter-pills{overflow-x:auto}}

@media (max-width: 700px) {
  .accounting-head,.receipt-register-head { flex-direction:column; align-items:stretch; }
  .receipt-source { grid-template-columns:1fr; }
  .receipt-preview { min-height:220px; }
  .receipt-source-actions { display:grid; grid-template-columns:1fr 1fr; }
  .receipt-source-actions .btn { justify-content:center; text-align:center; }
  .receipt-capture-card .form-row { align-items:stretch; }
  .receipt-capture-card .form-group { width:100%; }
  .receipt-capture-card,.receipt-register-card { padding:.9rem; }
}

.conditional-fields{margin-top:.8rem;padding:.8rem;border-left:3px solid #4f90ba;background:#f6fafc;border-radius:0 8px 8px 0}
/* Bank statement reconciliation */
.bank-statement-name{display:block;max-width:260px;margin-top:.18rem;overflow:hidden;color:#78847c;font-size:.58rem;text-overflow:ellipsis;white-space:nowrap}.bank-row-duplicate{color:#718078;background:#fafbfa}.bank-status.duplicate{background:#edf0ee;color:#667169}
.bank-reconcile-card{margin:1rem 0;padding:1.15rem;border:1px solid #cddcd0;border-radius:12px;background:linear-gradient(135deg,#f8fcf8,#edf6ef);box-shadow:0 4px 18px rgba(24,58,33,.05)}
.bank-reconcile-head{display:flex;align-items:center;justify-content:space-between;gap:1rem}.bank-reconcile-head h3{margin:.15rem 0 .25rem;color:#173d22;font:700 1rem Montserrat,sans-serif}.bank-reconcile-head p{margin:0;color:#617067;font-size:.75rem}.bank-eyebrow{color:#087b2c;font:700 .6rem Montserrat,sans-serif;letter-spacing:.09em;text-transform:uppercase}.bank-file-button{white-space:nowrap;cursor:pointer}.bank-reconcile-status{margin-top:.8rem;padding:.62rem .75rem;border-radius:7px;background:#fff;color:#536158;font-size:.71rem}.bank-reconcile-review{margin-top:.8rem}.bank-reconcile-summary{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.65rem}.bank-reconcile-summary span{padding:.25rem .48rem;border-radius:999px;background:#fff;color:#5e6b62;font-size:.64rem}.bank-reconcile-summary .is-matched{background:#e0f3e5;color:#17612a}.bank-reconcile-summary .is-unmatched{background:#fff0dc;color:#8a5315}.bank-transaction-table{width:100%;border-collapse:collapse;background:#fff;font-size:.68rem}.bank-transaction-table th,.bank-transaction-table td{padding:.55rem;border-bottom:1px solid #e7ece8;text-align:left;vertical-align:middle}.bank-transaction-table select{max-width:170px;padding:.35rem;border:1px solid #cbd5cd;border-radius:5px;background:#fff;font-size:.65rem}.bank-row-matched,.bank-row-imported{color:#718078;background:#fafbfa}.bank-status{display:inline-block;padding:.22rem .4rem;border-radius:999px;background:#fff0dc;color:#875115;font-weight:700;white-space:nowrap}.bank-status.matched{background:#e0f3e5;color:#17612a}.bank-status.imported{background:#edf0ee;color:#667169}.bank-reconcile-actions{display:flex;gap:.5rem;margin-top:.8rem}@media(max-width:700px){.bank-reconcile-head{align-items:stretch;flex-direction:column}.bank-file-button{text-align:center}.bank-reconcile-actions{flex-direction:column}.bank-reconcile-actions .btn{width:100%}}
.jobs-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.jobs-heading h2,.jobs-heading .view-intro{margin-top:0}.admin-quote-modal{width:min(1120px,96vw);max-width:1120px;max-height:94vh;overflow:auto;padding:1.75rem}.admin-quote-title{padding-right:2rem}.admin-quote-title h2{margin:.15rem 0 .25rem;color:#153d21}.admin-quote-title p{margin:0 0 1.25rem;color:#667169}.quote-eyebrow{color:#087b2c;font-size:.72rem;font-weight:700;letter-spacing:.11em;text-transform:uppercase}.quote-form-section{border:1px solid #d7e5da;border-radius:12px;padding:1rem;margin-top:1rem;background:#fff}.quote-form-section h3{margin:0 0 .85rem;color:#153d21}.quote-copy-section{background:#f4faf0}.admin-quote-columns{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.admin-quote-columns .quote-form-section{margin-bottom:0}.quote-form-section small{display:block;margin-top:.35rem;color:#667169}.quote-other{margin-top:1rem}.quote-checklist-groups{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}.admin-quote-actions{position:sticky;bottom:-1.75rem;background:#fff;border-top:1px solid #d7e5da;margin:1.25rem -1.75rem -1.75rem;padding:1rem 1.75rem;z-index:2}.admin-quote-actions .btn-primary{margin-left:auto}.btn.is-sending{position:relative;padding-left:2rem;opacity:.8}.btn.is-sending:before{position:absolute;left:.7rem;top:50%;width:.75rem;height:.75rem;margin-top:-.45rem;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;content:"";animation:manager-send-spin .7s linear infinite}.btn.is-sent{background:#18733a!important;color:#fff!important}.btn.is-send-error{background:#a52d25!important;color:#fff!important}@keyframes manager-send-spin{to{transform:rotate(360deg)}}
@media(max-width:760px){.jobs-heading{display:block}.jobs-heading .btn{width:100%;margin-bottom:.75rem}.admin-quote-columns{grid-template-columns:1fr}.admin-quote-modal{inset:0;width:100vw;max-width:none;max-height:100dvh;height:100dvh;border-radius:0;padding:1rem}.admin-quote-title{padding-right:1.5rem}.quote-form-section{padding:.8rem}.quote-checklist-groups,.admin-quote-modal .checklist-grid-4{grid-template-columns:1fr!important}.admin-quote-modal input,.admin-quote-modal select,.admin-quote-modal textarea{min-height:44px;font-size:16px}.admin-quote-actions{bottom:-1rem;display:grid;grid-template-columns:1fr;margin:1rem -1rem -1rem;padding:1rem}.admin-quote-actions .btn{width:100%;margin:0}.table-wrap:has(#submissionsTable){overflow:visible;border:0;background:transparent;box-shadow:none}#submissionsTable,#submissionsTable tbody,#submissionsTable tr,#submissionsTable td{display:block;width:100%}#submissionsTable thead{display:none}#submissionsTable tr{margin-bottom:.85rem;padding:.8rem;border:1px solid var(--gray-200);border-radius:12px;background:#fff;box-shadow:var(--shadow-sm)}#submissionsTable td{display:grid;grid-template-columns:90px minmax(0,1fr);gap:.65rem;padding:.42rem 0;border:0;text-align:left;overflow-wrap:anywhere}#submissionsTable td:before{content:attr(data-label);color:#68776d;font-size:.68rem;font-weight:700;text-transform:uppercase}#submissionsTable .submission-actions{display:flex;gap:.45rem;flex-wrap:wrap;padding-top:.7rem;border-top:1px solid var(--gray-200)}#submissionsTable .submission-actions:before{display:none}#submissionsTable .submission-actions .btn{flex:1 1 calc(50% - .45rem);min-height:42px;margin:0;white-space:normal}}
