/* =========================================================
   ClearPro global UI polish — admin + staff same look & feel
   Bubble / pill buttons + press animation everywhere
   Loaded LAST so it wins over older CSS
   ========================================================= */

:root {
  --cp-blue: #0a5f93;
  --cp-blue-dark: #08496f;
  --cp-blue-soft: #e8f4fb;
  --cp-lime: #b6df3c;
  --cp-lime-dark: #9fc72f;
  --cp-ink: #17222c;
  --cp-muted: #5f6f7a;
  --cp-line: #d7e2e8;
  --cp-paper: #ffffff;
  --cp-wash: #f3f7fa;
  --cp-danger: #b3261e;
  --cp-danger-soft: #fff1ef;
  --cp-success: #2f7a3e;
  --cp-success-soft: #eaf7ec;
  --cp-radius-btn: 999px;
  --cp-radius-card: 14px;
  --cp-shadow: 0 4px 14px rgba(12, 63, 89, 0.08);
  --cp-shadow-btn: 0 4px 12px rgba(10, 95, 147, 0.16);
  --cp-font: Arial, Helvetica, sans-serif;
}

/* ---------- Shared page shell (admin + staff) ---------- */
body.admin-mode,
body.staff-mode {
  background: var(--cp-wash);
  color: var(--cp-ink);
  font-family: var(--cp-font);
}

.app-main {
  padding-top: 28px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.page-heading h1,
.welcome h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.5px;
  color: var(--cp-ink);
}

.page-heading p,
.page-heading .eyebrow,
.welcome p,
.welcome .eyebrow {
  color: var(--cp-muted);
}

.welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel,
.form-panel,
.quote-form-panel,
.auth-card,
.install-card,
.job-card,
.staff-bubble,
.dashboard-review-queue,
.urgent-dashboard,
.urgent-jobs,
.awaiting-review-jobs {
  border-radius: var(--cp-radius-card) !important;
  box-shadow: var(--cp-shadow) !important;
  border-color: var(--cp-line) !important;
  background: var(--cp-paper);
}

/* ---------- Action row helpers ---------- */
.btn-row,
.action-buttons,
.job-invoice-line-actions,
.quote-actions,
.form-actions,
.job-actions,
.dashboard-review-actions,
.completed-job-actions,
.staff-profile-buttons,
.quote-toolbar,
.customer-save-actions,
.pay-entry-actions,
.staff-bubble-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.job-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* =========================================================
   UNIFIED BUBBLE BUTTONS
   Catch every actionable control on admin + staff pages
   ========================================================= */
button,
.button,
.btn,
a.button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.link-button,
button.link,
.dashboard-review-button,
.dashboard-invoice-button,
.review-quick-button,
.invoice-quick-button,
.job-search-toggle,
.complete-button,
.danger-button,
.map-button,
.enable-job-alert,
.cancel-button,
.customer-search-button,
.saved-line-remove,
.invoice-export-menu > summary,
.quote-more > summary,
.sales-menu > summary,
.cp-action,
.page-heading > a,
.page-heading > div > a,
.welcome > a,
.calendar-heading > div > a,
.panel-heading > a,
.staff-bubble-actions a,
.staff-bubble-actions button,
table .actions a,
table td.actions a,
table td.actions button,
.actions a,
.actions button,
.quote-toolbar button,
.quote-toolbar a,
.form-stack > button,
.form-stack > div > button,
.form-grid button,
.prestart-checklist button,
.end-job-checklist button,
.job-live-timer button {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  border-radius: var(--cp-radius-btn) !important;
  background: var(--cp-blue) !important;
  color: #fff !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 700 !important;
  font-size: 14px !important;
  line-height: 1.15 !important;
  padding: 11px 18px !important;
  min-height: 42px;
  text-decoration: none !important;
  box-shadow: var(--cp-shadow-btn) !important;
  text-shadow: none !important;
  transition:
    transform 0.12s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    filter 0.16s ease,
    border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  vertical-align: middle;
}

/* Hover lift */
button:hover,
.button:hover,
.btn:hover,
a.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.link-button:hover,
.dashboard-review-button:hover,
.dashboard-invoice-button:hover,
.review-quick-button:hover,
.invoice-quick-button:hover,
.job-search-toggle:hover,
.complete-button:hover,
.map-button:hover,
.enable-job-alert:hover,
.cancel-button:hover,
.customer-search-button:hover,
.invoice-export-menu > summary:hover,
.quote-more > summary:hover,
.sales-menu > summary:hover,
.cp-action:hover,
.page-heading > a:hover,
.page-heading > div > a:hover,
.welcome > a:hover,
.calendar-heading > div > a:hover,
.panel-heading > a:hover,
.staff-bubble-actions a:hover,
table .actions a:hover,
.actions a:hover {
  background: var(--cp-blue-dark) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(10, 95, 147, 0.22) !important;
}

/* Press / click animation */
button:active,
.button:active,
.btn:active,
a.button:active,
input[type="submit"]:active,
input[type="button"]:active,
.link-button:active,
.dashboard-review-button:active,
.dashboard-invoice-button:active,
.review-quick-button:active,
.invoice-quick-button:active,
.job-search-toggle:active,
.complete-button:active,
.danger-button:active,
.map-button:active,
.enable-job-alert:active,
.cancel-button:active,
.customer-search-button:active,
.invoice-export-menu > summary:active,
.quote-more > summary:active,
.sales-menu > summary:active,
.cp-action:active,
.page-heading > a:active,
.page-heading > div > a:active,
.welcome > a:active,
.calendar-heading > div > a:active,
.panel-heading > a:active,
.staff-bubble-actions a:active,
table .actions a:active,
.actions a:active,
.cp-btn-pressed {
  transform: translateY(1px) scale(0.97) !important;
  box-shadow: 0 2px 6px rgba(10, 95, 147, 0.14) !important;
  filter: brightness(0.96);
}

/* ---------- Secondary / outline bubble ---------- */
button.secondary,
.button.secondary,
.btn.secondary,
a.button.secondary,
.button.ghost,
button.ghost,
a.cancel-button,
.cancel-button,
.map-button,
.dashboard-invoice-button,
.invoice-quick-button,
.enable-job-alert,
.job-search-toggle,
.customer-search-button,
.invoice-export-menu > summary,
.quote-more > summary,
.sales-menu > summary,
.page-heading > a:not(.button):not(.btn),
.page-heading > div > a:not(.button):not(.btn),
.welcome > a.button.secondary,
.calendar-heading > div > a:not(.button),
.panel-heading > a:not(.button),
.staff-bubble-actions a,
table .actions a:not(.button),
.actions a:not(.button),
a.cp-action-secondary {
  background: #fff !important;
  color: var(--cp-blue) !important;
  border: 1.5px solid #b7cdd9 !important;
  box-shadow: 0 2px 8px rgba(12, 63, 89, 0.06) !important;
}

button.secondary:hover,
.button.secondary:hover,
.btn.secondary:hover,
a.button.secondary:hover,
.button.ghost:hover,
button.ghost:hover,
.cancel-button:hover,
.map-button:hover,
.dashboard-invoice-button:hover,
.invoice-quick-button:hover,
.enable-job-alert:hover,
.job-search-toggle:hover,
.customer-search-button:hover,
.invoice-export-menu > summary:hover,
.quote-more > summary:hover,
.sales-menu > summary:hover,
.page-heading > a:not(.button):not(.btn):hover,
.page-heading > div > a:not(.button):not(.btn):hover,
.calendar-heading > div > a:not(.button):hover,
.panel-heading > a:not(.button):hover,
.staff-bubble-actions a:hover,
table .actions a:not(.button):hover,
.actions a:not(.button):hover {
  background: var(--cp-blue-soft) !important;
  color: var(--cp-blue-dark) !important;
  border-color: var(--cp-blue) !important;
  box-shadow: 0 4px 12px rgba(10, 95, 147, 0.1) !important;
}

/* Accent / lime bubble (primary CTA alternative) */
.button.accent,
button.accent,
a.button.accent,
.button.lime,
button.lime {
  background: var(--cp-lime) !important;
  color: #1a2d31 !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(155, 199, 47, 0.22) !important;
}

.button.accent:hover,
button.accent:hover,
a.button.accent:hover {
  background: var(--cp-lime-dark) !important;
  color: #1a2d31 !important;
}

/* Success / complete / start-positive */
.complete-button,
.button.success,
button.success,
.btn.success,
.dashboard-review-button,
.review-quick-button {
  background: var(--cp-success) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(47, 122, 62, 0.22) !important;
}

.complete-button:hover,
.button.success:hover,
button.success:hover,
.dashboard-review-button:hover,
.review-quick-button:hover {
  background: #256432 !important;
  color: #fff !important;
}

/* Danger / delete / stop */
.danger-button,
button.danger,
.button.danger,
.btn.danger,
.link-button.danger,
button.link.danger,
button.link.danger,
.staff-bubble-actions button,
table .actions button.link,
table .actions .link.danger,
.actions button.link,
.actions .link.danger {
  background: var(--cp-danger-soft) !important;
  color: var(--cp-danger) !important;
  border: 1.5px solid #e7b5af !important;
  box-shadow: none !important;
}

.danger-button:hover,
button.danger:hover,
.button.danger:hover,
.link-button.danger:hover,
button.link.danger:hover,
.staff-bubble-actions button:hover,
table .actions button.link:hover,
.actions button.link:hover {
  background: #ffe4e0 !important;
  color: #8f1e18 !important;
  border-color: #d89a92 !important;
}

/* Solid danger for explicit delete customer zones */
.customer-danger-zone .danger-button {
  background: var(--cp-danger) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(179, 38, 30, 0.2) !important;
}

.customer-danger-zone .danger-button:hover {
  background: #8f1e18 !important;
  color: #fff !important;
}

/* Compact table / inline action bubbles */
.link-button,
button.link,
.inline-form .link-button,
table .actions a,
table .actions button,
.actions a,
.actions button,
.staff-bubble-actions a,
.staff-bubble-actions button,
.pay-entry-actions button,
.saved-line-remove {
  min-height: 34px !important;
  padding: 7px 12px !important;
  font-size: 13px !important;
}

/* Kill old 3D “save bubble” styles (save-bubble.css / customer-save-actions) */
.form-grid > div.wide:last-child button,
.customer-save-actions button,
.customer-save-actions .button,
.customer-save-actions .button.secondary {
  border-radius: var(--cp-radius-btn) !important;
  background: var(--cp-blue) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: var(--cp-shadow-btn) !important;
  text-shadow: none !important;
  min-width: 160px;
  padding: 12px 20px !important;
}

.form-grid > div.wide:last-child button:hover,
.customer-save-actions button:hover,
.customer-save-actions .button:hover {
  background: var(--cp-blue-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(10, 95, 147, 0.22) !important;
}

.form-grid > div.wide:last-child button:active,
.customer-save-actions button:active,
.customer-save-actions .button:active {
  transform: translateY(1px) scale(0.97) !important;
  box-shadow: 0 2px 6px rgba(10, 95, 147, 0.14) !important;
}

.customer-save-actions .button.secondary {
  background: #fff !important;
  color: var(--cp-blue) !important;
  border: 1.5px solid #b7cdd9 !important;
  box-shadow: 0 2px 8px rgba(12, 63, 89, 0.06) !important;
}

/* Disabled */
button:disabled,
.button:disabled,
.btn:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled,
.cp-btn-pressed:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  transform: none !important;
  filter: none !important;
  pointer-events: none;
}

/* ---------- Ripple on click ---------- */
.cp-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: cp-ripple-anim 0.55s ease-out;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 2;
}

.cp-ripple.dark {
  background: rgba(10, 95, 147, 0.22);
}

@keyframes cp-ripple-anim {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* =========================================================
   Exceptions — keep list pickers / menus readable
   ========================================================= */
.address-results button,
.address-results button:hover,
.address-results button:active,
.address-results button.cp-btn-pressed {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  justify-content: flex-start !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #18364c !important;
  box-shadow: none !important;
  border: 0 !important;
  border-bottom: 1px solid #e1edf2 !important;
  padding: 10px 12px !important;
  min-height: 0 !important;
  font-weight: 600 !important;
  transform: none !important;
  filter: none !important;
}

.address-results button:hover {
  background: #eef8fc !important;
}

.sales-menu-links a,
.sales-menu-links a:hover,
.sales-menu-links a:active {
  display: block !important;
  width: 100%;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--cp-ink) !important;
  box-shadow: none !important;
  border: 0 !important;
  min-height: 0 !important;
  padding: 8px 10px !important;
  font-weight: 600 !important;
  justify-content: flex-start !important;
  transform: none !important;
}

.sales-menu-links a:hover {
  background: var(--cp-blue-soft) !important;
  color: var(--cp-blue) !important;
}

/* Brand logo never looks like a button */
a.brand,
a.brand:hover,
a.brand:active {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  transform: none !important;
  color: inherit !important;
}

/* ---------- Header nav — same professional chips admin + staff ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--cp-line);
  box-shadow: 0 2px 10px rgba(12, 63, 89, 0.04);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.site-header nav > a,
.site-header nav .sales-menu > summary {
  border-radius: 999px !important;
  padding: 8px 12px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  min-height: 36px !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  text-decoration: none !important;
}

/* Admin nav: soft blue chips */
body.admin-mode .site-header nav > a {
  background: transparent !important;
  color: var(--cp-muted) !important;
  box-shadow: none !important;
  border: 0 !important;
}

body.admin-mode .site-header nav > a:hover {
  background: var(--cp-blue-soft) !important;
  color: var(--cp-blue) !important;
  transform: none;
  box-shadow: none !important;
}

body.admin-mode .site-header nav .sales-menu > summary {
  background: transparent !important;
  color: var(--cp-muted) !important;
  box-shadow: none !important;
  border: 0 !important;
  cursor: pointer;
  list-style: none;
}

body.admin-mode .site-header nav .sales-menu > summary:hover {
  background: var(--cp-blue-soft) !important;
  color: var(--cp-blue) !important;
  transform: none;
}

/* Staff nav: lime chips (distinct role, same bubble language) */
body.staff-mode .site-header nav > a {
  background: var(--cp-lime) !important;
  color: #1a2d31 !important;
  border: 1px solid var(--cp-lime-dark) !important;
  box-shadow: 0 2px 8px rgba(82, 115, 10, 0.12) !important;
}

body.staff-mode .site-header nav > a:hover {
  background: var(--cp-lime-dark) !important;
  color: #1a2d31 !important;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(82, 115, 10, 0.2) !important;
}

body.staff-mode .site-header nav > a:active,
body.staff-mode .site-header nav > a.cp-btn-pressed {
  transform: translateY(1px) scale(0.97) !important;
}

/* ---------- Forms ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="file"],
select,
textarea {
  border-radius: 10px !important;
  border: 1px solid #c3d1d9 !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cp-blue) !important;
  box-shadow: 0 0 0 3px rgba(10, 95, 147, 0.12);
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: 12px !important;
  padding: 12px 14px !important;
  box-shadow: 0 2px 8px rgba(16, 42, 58, 0.04);
}

/* ---------- Cards / job cards ---------- */
.job-card {
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--cp-line) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(12, 63, 89, 0.1) !important;
}

.staff-job-link:hover .panel,
.staff-job-link:hover article {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(12, 63, 89, 0.1) !important;
}

/* Checklists — keep highly visible on staff job cards */
.prestart-checklist,
.end-job-checklist {
  border-radius: 12px !important;
  border: 1px solid #e3c766 !important;
  background: #fff9e7 !important;
  padding: 14px 16px !important;
  margin-top: 14px !important;
  display: block !important;
}

.end-job-checklist {
  border-color: #9dcea3 !important;
  background: #f3fbf4 !important;
}

.prestart-checklist summary,
.end-job-checklist summary {
  cursor: pointer;
  font-weight: 800;
  color: #654c00;
  list-style: none;
  font-size: 15px;
}

.end-job-checklist summary {
  color: #2f7a3e;
}

.prestart-checklist summary::-webkit-details-marker,
.end-job-checklist summary::-webkit-details-marker {
  display: none;
}

.prestart-checklist label,
.end-job-checklist label,
.prestart-checklist label.checkbox,
.end-job-checklist label.checkbox {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
  font-weight: 600;
  color: var(--cp-ink);
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  cursor: pointer;
}

.prestart-checklist input[type="checkbox"],
.end-job-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 18px;
  accent-color: var(--cp-blue);
}

.checklist-complete {
  display: block !important;
  padding: 10px 12px !important;
  background: #eff8e9 !important;
  border-radius: 10px !important;
  color: #36691f !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 12px 0 !important;
}

.job-actions {
  border-top: 1px solid var(--cp-line);
  padding-top: 14px;
  margin-top: 14px;
}

.job-live-timer {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef8fc;
  border: 1px solid #c5dceb;
}

.job-live-timer .timer-display {
  display: block;
  color: var(--cp-blue);
  font-size: 16px;
}

.timer-running-note {
  color: var(--cp-muted);
  font-weight: 700;
}

/* Tables */
.table-wrap table,
.panel table {
  border-radius: 10px;
  overflow: hidden;
}

.table-wrap td.actions,
td.actions,
.actions {
  white-space: nowrap;
}

/* Badges */
.badge {
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-weight: 700;
}

/* Auth / install */
.auth-card,
.install-card {
  max-width: 420px;
  margin: 40px auto;
  padding: 28px 26px;
}

.auth-card button,
.install-card button,
.auth-card .button {
  width: 100%;
  min-height: 46px;
}

/* Footer */
footer {
  color: var(--cp-muted);
  text-align: center;
  padding: 24px 16px 40px;
  font-size: 13px;
}

/* Mobile comfort */
@media (max-width: 700px) {
  button,
  .button,
  .btn,
  a.button,
  input[type="submit"],
  input[type="button"],
  .page-heading > a,
  .page-heading > div > a,
  .job-actions button,
  .job-actions a.button {
    min-height: 44px;
    padding: 11px 16px !important;
  }

  .page-heading,
  .welcome {
    flex-direction: column;
  }

  .page-heading > div,
  .calendar-heading > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}
