/* =====================================================================
   MTC SITE STYLESHEET (single file)

   Part 1  LEGACY BASE   - the still-used rules from the old styles.css,
                           kept first so the cascade is unchanged.
   Part 2  ADMIN-UI      - the current design system; overrides Part 1.
   ===================================================================== */

/* =====================================================================
   PART 1 - LEGACY BASE (from styles.css)
   ===================================================================== */
/* ===================================================================
   RESET / BASE
=================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

html { scroll-behavior: smooth; }

body {
    background: var(--grey-800) url('/assets/background.png') repeat;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    padding-top: 140px;
}

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

a:hover {
    color: #fff;
}

/* ===================================================================
   VARIABLES
=================================================================== */
:root {
    /* === ACCENT COLORS === */
    --accent-red: #D64949;
    --accent-green: #98c46e;

    /* === GREY SCALE === */
    --grey-100: #eee;
    --grey-200: #ccc;
    --grey-300: #999;
    --grey-400: #666;
    --grey-500: #444;
    --grey-600: #333;
    --grey-700: #222;
    --grey-800: #1a1a1a;

    /* === SEMANTIC ALIASES (use greys above) === */
    --light-grey: var(--grey-200);
    --dark-grey: var(--grey-400);
    
    /* === TILE SYSTEM (2-tier) === */
    --tile-outer-bg: rgba(255,255,255,0.12);
    --tile-outer-border: rgba(255,255,255,0.2);
    --tile-outer-hover: var(--accent-green);
    --tile-inner-bg: var(--grey-700);
    --tile-inner-border: var(--grey-500);
    --tile-inner-hover: var(--accent-green);
    
    /* Legacy aliases - use tile system above */
    --card-bg: var(--tile-outer-bg);
    --card-border: var(--tile-outer-border);
    --card-bg-dark: var(--tile-inner-bg);
    --card-border-dark: var(--tile-inner-border);
    
    --input-bg: #fff;
    --input-bg-dark: #fff;
    --input-text: #333;
    --input-border: #ccc;
    --input-border-dark: #ccc;

    /* === TYPOGRAPHY === */
    --font-primary: 'Roboto', Arial, sans-serif;
    --font-heading: 'Roboto', Arial, sans-serif;
    
    /* Text colors - USE THESE, never hardcode #666, #888 etc. 
       --text-primary:   White - headings, important text
       --text-secondary: Light grey - body text, descriptions  
       --text-muted:     Medium grey - hints, placeholders, disabled */
    --text-primary: #fff;
    --text-secondary: var(--grey-200);
    --text-muted: var(--grey-300);
    
    /* Font sizes - 7 step scale */
    --font-xs: 11px;
    --font-sm: 13px;
    --font-base: 16px;
    --font-md: 18px;
    --font-lg: 22px;
    --font-xl: 28px;
    --font-2xl: 36px;

    /* === SPACING === */
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 28px;
}

/* ===================================================================
   TYPOGRAPHY
=================================================================== */
h1, h2, h3 {
    margin-bottom: 20px;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--text-primary);
}
h1 { font-size: var(--font-2xl); }
h2 { font-size: var(--font-xl); }
h3 { font-size: var(--font-lg); }

p, label, span { font-size: var(--font-base); }

/* ===================================================================
   LAYOUT
=================================================================== */
.page-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

  .dashboard-page .page-container {
    max-width: 1440px;
  }

  .dashboard-page .dashboard-card {
    width: 100%;
    max-width: none;
  }

/* ===================================================================
   GLOBAL LINK STYLES
=================================================================== */

/* === SITE HEADER === */
.site-header {
    position: relative;
    z-index: 100;
}

/* === COMBINED STICKY NAV BAR === */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 24px;
    height: 140px;
    background: rgba(30, 30, 30, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--grey-600);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
}

.nav-logo {
    display: flex;
    align-items: center;
    margin-right: clamp(12px, 1.5vw, 20px);
    flex-shrink: 0;
}
.nav-logo img {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.4));
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.nav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--accent-green);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-info-item {
    color: var(--accent-green);
    font-size: 16px;
    white-space: nowrap;
}

.nav-phone {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-phone svg {
    flex-shrink: 0;
}

.nav-info-divider {
    color: rgba(255,255,255,0.25);
    font-size: 16px;
}

/* Hide old elements that no longer exist */

/* Mobile logo — hidden on desktop, shown on mobile */
.mobile-logo-header {
    display: none;
    width: 100%;
    text-align: center;
    padding: 20px 0 10px;
}
.mobile-logo-header img {
    width: 280px;
    max-width: 70%;
    height: auto;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
    border: none !important;
}

/* ===================================================================
   MOBILE CALL BUTTON — SHOWN ONLY ON MOBILE
=================================================================== */
.mobile-call-btn {
    display: none;
    margin: 0 auto 12px;
    padding: 14px 26px;
    background: var(--accent-green);
    color: #fff;
    border: 1px solid #fff;
    font-size: var(--font-base);
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-call-btn:hover,
.mobile-call-btn:active {
    background: var(--accent-green);
    color: #fff;
}

a.mobile-call-btn,
a.mobile-call-btn:visited,
a.mobile-call-btn:hover,
a.mobile-call-btn:active {
    color: #fff;
}

.mobile-call-btn svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@media (max-width: 850px) {
    .mobile-call-btn {
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    .mobile-call-btn:last-of-type {
        margin-bottom: 30px;
    }
}

/* ===================================================================
   MOBILE MENU — CUSTOMER NAV SYSTEM
=================================================================== */
.mobile-fab {
    display: none;
    position: fixed;
    top: 18px;
    right: 20px;
    font-size: var(--font-xl);
    color: white;
    cursor: pointer;
    z-index: 900;
}

.mobile-menu {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.92);
    padding: 40px 20px;
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    z-index: 1999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu a {
    color: #fff;
    margin-bottom: 25px;
    font-size: var(--font-md);
}

/* ===================================================================
   FORM ELEMENTS
=================================================================== */
label {
    margin-bottom: 6px;
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group label {
    display: block;
}

/* Standalone form-group: label above input */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    margin-bottom: 0;
}

/* Email form alignment */

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--input-border);
    font-size: var(--font-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--grey-400);
}

/* Override browser autofill styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #333 !important;
    box-shadow: 0 0 0 1000px #fff inset !important;
    caret-color: #333 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Admin autofill: dark bg instead of white */
body.admin-page input:-webkit-autofill,
body.admin-page input:-webkit-autofill:hover,
body.admin-page input:-webkit-autofill:focus,
body.admin-page input:-webkit-autofill:active,
body.admin-page textarea:-webkit-autofill,
body.admin-page select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--grey-700) inset !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 0 0 1000px var(--grey-700) inset !important;
    caret-color: #fff !important;
}

/* Admin selects: light arrow on dark bg */
body.admin-page select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    color-scheme: dark;
}

input::placeholder,
textarea::placeholder {
    color: var(--grey-300);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    color-scheme: light;
}

select option {
    background-color: #fff !important;
    color: #333 !important;
}

select option:checked,
select option:hover,
select option:focus {
    background-color: #eee !important;
    color: #333 !important;
}

/* Date/Time input styling */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Selection highlight color */
::selection {
    background: var(--accent-green);
    color: var(--grey-800);
}

::-moz-selection {
    background: var(--accent-green);
    color: var(--grey-800);
}

textarea { min-height: 120px; }

/* ===================================================================
   SECTION LABEL (green uppercase eyebrow text)
   Use for all section headings, taglines, category labels
=================================================================== */
.section-label {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-green);
    font-weight: 600;
    margin-bottom: 12px;
}

/* ===================================================================
   BUTTONS
   Unified button style — dark bg + white outline, green on hover
=================================================================== */
.btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--grey-700);
    border: 1px solid #fff;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 14px;
}

.btn:hover {
    background: rgba(152, 196, 110, 0.8);
    color: #fff;
}

.btn.active,
.btn.current {
    background: var(--grey-700);
    color: #fff;
}

/* Override global link colors for button links */
a.btn,
a.btn:visited,
a.btn:hover,
a.btn:active {
    color: #fff;
    text-decoration: none;
}

.btn.small {
    padding: 8px 16px;
    font-size: var(--font-sm);
}

.fullwidth-btn {
    width: 100%;
    margin-top: var(--spacing-sm);
}

/* Small red × delete / remove buttons */
.btn-delete {
    width: 28px;
    height: 28px;
    background: var(--accent-red);
    border: 1px solid #fff;
    color: #fff;
    font-size: var(--font-base);
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
}

/* ===================================================================
   CARDS
=================================================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: var(--spacing-md);
    backdrop-filter: blur(6px);
    margin-bottom: var(--spacing-md);
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: var(--tile-outer-hover);
}

/* Inner card - use inside .card for nested tiles */

/* Tile classes - semantic alternatives */
.tile {
    background: var(--tile-outer-bg);
    border: 1px solid var(--tile-outer-border);
    padding: var(--spacing-md);
    backdrop-filter: blur(6px);
    transition: border-color 0.2s ease;
}

.tile:hover {
    border-color: var(--tile-outer-hover);
}

.card.dark {
    background: var(--card-bg-dark);
    border-color: var(--card-border-dark);
}

.file-link {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
}

.file-link:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* ===================================================================
   SLIDER (Homepage)
=================================================================== */
.fade-slider {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    margin-bottom: 20px;
}

.fade-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s;
}

.fade-slide.active { opacity: 1; }

.fade-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.75);
}

/* ===================================================================
   FOOTER
=================================================================== */
footer {
    width: 100%;
    text-align: center;
    padding: 40px 0;
    margin-top: 40px;
    color: #ffffff;
    opacity: 0.8;
}

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

/* ===================================================================
   TIDIO CHAT WIDGET
=================================================================== */
#tidio-chat-iframe {
    border-radius: 0 !important;
}

@media (max-width: 850px) {
    #tidio-chat-iframe {
        filter: drop-shadow(0 0 6px rgba(152, 196, 110, 0.6)) !important;
        animation: tidio-pulse 3s ease-in-out infinite !important;
    }
}

@keyframes tidio-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(152, 196, 110, 0.4)) !important; }
    50% { filter: drop-shadow(0 0 10px rgba(152, 196, 110, 0.7)) !important; }
}

/* ===================================================================
   IMAGES
=================================================================== */
img {
    border: 1px solid var(--card-border);
}

/* ===================================================================
   RESPONSIVE — CUSTOMER NAV
=================================================================== */
@media (max-width: 850px) {
    .main-nav {
        display: none;
    }
    .mobile-fab {
        display: block !important;
    }
    .mobile-logo-header {
        display: block !important;
    }
    .nav-logo {
        display: none;
    }
    body {
        padding-top: 0;
    }
}

/* ===================================================================
   ADMIN TOOLBAR SYSTEM
=================================================================== */

/* ===================================================================
   ADMIN BOTTOM NAVIGATION
=================================================================== */

.btn.admin-nav-btn {
    margin: 0;
    background: var(--grey-700);
    color: #fff;
    border: 1px solid #fff;
    padding: 10px 20px;
    min-width: 120px;
    text-align: center;
    font-size: var(--font-sm);
}

.btn.admin-nav-btn:hover,
.btn.admin-nav-btn.active,
.btn.admin-nav-btn.current {
    background: rgba(152, 196, 110, 0.8);
}

body.admin-page {
    padding-bottom: 70px;
}

/* Admin pages: dark inputs instead of white */
body.admin-page input,
body.admin-page textarea,
body.admin-page select {
    background: var(--grey-700);
    color: var(--text-primary);
    border-color: var(--grey-500);
}

body.admin-page input:focus,
body.admin-page textarea:focus,
body.admin-page select:focus {
    border-color: var(--accent-green);
}

body.admin-page input::placeholder,
body.admin-page textarea::placeholder {
    color: var(--text-muted);
}

/* Admin cards: no hover glow (they're containers, not clickable tiles) */
body.admin-page .card:hover {
    border-color: var(--card-border);
}

/* Admin header (presale edit view, etc.) */
.admin-header {
    margin-bottom: var(--spacing-md);
}

.admin-header h1 {
    margin-bottom: 6px;
}

.admin-header p {
    color: var(--text-muted);
    font-size: var(--font-sm);
    margin-bottom: 0;
}

/* ===================================================================
   JOBS LIST (Dashboard) - Card Layout
=================================================================== */
.status-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.status-group {
    margin-bottom: 0;
}
.status-group-header {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #aaa);
    margin: 0 0 6px 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--tile-inner-border);
}
.status-group-count {
    color: var(--text-muted, #888);
    font-weight: 400;
    margin-left: 6px;
}
.jobs-list.drag-over-list {
    background: rgba(152, 196, 110, 0.08);
    outline: 2px dashed var(--accent-green, #98c46e);
    outline-offset: -2px;
    border-radius: 4px;
    min-height: 60px;
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-card {
    background: var(--tile-inner-bg);
    border: 1px solid var(--tile-inner-border);
    padding: 12px 15px;
  min-width: 0;
  overflow: hidden;
    cursor: pointer;
    display: grid;
      grid-template-columns: 20px 90px minmax(180px, 1fr) minmax(180px, 1.1fr) 160px 170px 44px;
    align-items: center;
    gap: 15px;
    min-height: 50px;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.job-card.archived-job {
  grid-template-columns: 90px minmax(180px, 1fr) minmax(180px, 1.1fr) 160px 170px 44px;
    opacity: 0.8;
    border-left: 3px solid var(--grey-400);
}

.job-card:hover {
    background: var(--grey-600);
}

.job-card.dragging {
    opacity: 0.5;
    background: var(--grey-600);
    grid-template-columns: 90px minmax(180px, 1fr) minmax(180px, 1.1fr) 160px 170px 44px;
}

.job-card.drag-over {
    border-top: 2px solid var(--accent-green);
}

.job-card.has-notes {
    border-left: 3px solid var(--accent-green);
}

.job-notes-icon {
    position: relative;
    cursor: default;
    font-size: 14px;
    margin-left: 5px;
}

.job-notes-icon::after {
    content: attr(title);
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: var(--grey-800);
    color: #fff;
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-wrap;
    max-width: 280px;
    min-width: 140px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    pointer-events: none;
    line-height: 1.4;
}

.job-notes-icon:hover::after {
    display: block;
}

.collapsible-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  margin: 0 0 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.collapsible-chevron {
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.collapsible-toggle[aria-expanded="false"] .collapsible-chevron {
  transform: rotate(-45deg) translate(-2px, 2px);
}

.collapsible-content[hidden] {
  display: none;
}

.job-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: var(--font-sm);
    user-select: none;
    display: flex;
    align-items: center;
    height: 34px;
}

.job-drag-handle:active {
    cursor: grabbing;
}

.job-ticket {
  min-width: 0;
    font-weight: 600;
    font-size: var(--font-base);
    display: flex;
    align-items: center;
    height: 34px;
}

.job-customer {
  min-width: 0;
    font-size: var(--font-base);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    height: 34px;
}

  .job-name {
    min-width: 0;
    font-size: var(--font-base);
    color: #fff;
    display: flex;
    align-items: center;
    height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

.job-date {
  min-width: 0;
    font-size: var(--font-base);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    height: 34px;
}

.job-label {
    color: var(--accent-green);
    font-size: var(--font-base);
    margin-right: 5px;
}

.job-status {
  min-width: 0;
    display: flex;
    align-items: center;
    height: 34px;
}

.job-delete {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 34px;
}

/* Status Dropdown - size overrides for job cards */
.status-dropdown {
  max-width: 100%;
    height: 40px !important;
    padding: 10px 36px 10px 12px !important;
    margin: 0;
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1.4 !important;
    font-size: 14px !important;
}

/* Mobile: stack layout */
@media (max-width: 768px) {
    .job-card {
        grid-template-columns: 20px 1fr auto;
        grid-template-rows: auto auto auto auto;
        gap: 10px;
        position: relative;
    }
    
    .job-card.archived-job {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto auto;
    }
    
    .job-drag-handle {
        grid-column: 1;
        grid-row: 1 / -1;
        align-self: flex-start;
        margin-top: 2px;
    }
    
    .job-card.archived-job .job-ticket,
    .job-ticket {
        grid-column: 2;
        grid-row: 1;
    }
    
    .job-card.archived-job .job-ticket {
        grid-column: 1;
    }
    
    .job-delete {
        grid-column: 3;
        grid-row: 1;
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .job-card.archived-job .job-delete {
        grid-column: 2;
    }
    
    .job-customer {
        grid-column: 2 / -1;
        grid-row: 2;
        padding-right: 40px; /* Make room for delete button */
    }
    
    .job-card.archived-job .job-customer {
        grid-column: 1 / -1;
    }

    .job-name {
      grid-column: 2 / -1;
      grid-row: 3;
      padding-right: 40px;
    }

    .job-card.archived-job .job-name {
      grid-column: 1 / -1;
    }
    
    .job-date {
        grid-column: 2 / -1;
      grid-row: 4;
    }
    
    .job-card.archived-job .job-date {
        grid-column: 1 / -1;
    }
    
    .job-status {
        grid-column: 2 / -1;
      grid-row: 5;
        margin-top: 5px;
    }
    
    .job-card.archived-job .job-status {
        grid-column: 1 / -1;
    }
    
    .status-dropdown {
        width: 100%;
        max-width: 200px;
        height: 40px !important;
        font-size: 14px !important;
        padding: 10px 36px 10px 12px !important;
    }
}

/* Legacy badge styles (for non-dropdown use) */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.status-progress {
    background: rgba(255,210,127,0.2);
    color: var(--accent-green);
}

.status-pending {
    background: rgba(255,210,127,0.2);
    color: var(--accent-green);
}

.status-complete {
    background: rgba(152,196,110,0.2);
    color: var(--accent-green);
}

@media (max-width: 768px) {

    .admin-nav-btn {
        padding: 8px 14px;
        font-size: var(--font-xs);
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 100px;
    }
    
    body.admin-page {
        padding-bottom: 70px;
    }

    /* Dashboard card mobile */
    body.admin-page .page-container {
        padding: 10px;
    }
    
    body.admin-page .card {
        margin: 10px auto;
        padding: 15px;
    }
    
    body.admin-page .card h2 {
        font-size: var(--font-md);
        margin-bottom: 15px;
    }
}

/* ===================================================================
   CUSTOMER PORTAL — PROOF SECTION
=================================================================== */
.proof-card {
    padding: 28px;
}

#proofContent img {
    width: 100%;
    max-width: 800px;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--card-border);
}

/* ===================================================================
   CUSTOMER PORTAL — SIZE CHART
=================================================================== */
.sizes-card {
    padding: var(--spacing-md);
}

.size-rows {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.size-row {
    background: var(--tile-inner-bg);
    border: 1px solid var(--tile-inner-border);
    padding: var(--spacing-md) var(--spacing-sm) var(--spacing-sm);
    transition: border-color 0.2s ease;
}

.size-row:hover {
    border-color: var(--tile-inner-hover);
}

.size-row-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.size-row-header .style-picker-wrapper {
    position: relative;
    flex: 1;
}

.size-row-header .style-picker-wrapper input {
    width: 100%;
    height: 34px;
    margin-bottom: 0;
}

.size-row-header .btn-delete {
    width: 34px;
    height: 34px;
    margin: 0;
}

.size-row-selection {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.size-row-selection .style-info {
    flex: 1;
    color: #fff;
    font-weight: 600;
    font-size: var(--font-sm);
}

.size-row-selection .color-select {
    width: 200px;
    height: 34px;
    padding: 0 10px;
    flex-shrink: 0;
}

.style-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.style-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
}

.style-result:hover {
    background: var(--tile-inner-bg);
}

.style-result img {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.style-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.style-result-info strong {
    color: var(--text-primary);
}

.style-result-info span {
    color: var(--text-secondary);
    font-size: var(--font-xs);
}

.style-info {
    flex: 1;
    color: var(--text-primary);
    font-size: var(--font-sm);
}

.color-picker-wrapper label {
    font-size: var(--font-sm);
    color: var(--text-primary);
    white-space: nowrap;
}

.color-select {
    flex: 1;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    font-size: var(--font-sm);
    height: 40px;
}

.color-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.size-table-container {
    width: 100%;
    overflow-x: auto;
}

.style-loading,
.style-no-results,
.style-error {
    padding: 10px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.size-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    text-align: center;
}

.size-table th {
    font-size: var(--font-xs);
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    padding: 8px 6px;
    background: var(--grey-600);
    border: 1px solid var(--tile-inner-border);
    border-bottom: none;
}

.size-table td {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 0;
    border: 1px solid var(--tile-inner-border);
}

.size-table input.qty {
    width: 100%;
    text-align: center;
    padding: 10px 6px;
    box-sizing: border-box;
    margin-bottom: 0;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    font-size: var(--font-base);
}

.size-table input.qty:focus {
    outline: none;
    border-color: var(--grey-300);
}

.row-total {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    font-weight: 600;
    color: var(--accent-green);
    background: rgba(152,196,110,0.1);
    padding: 10px 6px;
}

@media (max-width: 600px) {
    .size-table th,
    .size-table td {
        width: 42px;
        min-width: 42px;
    }
    .row-total {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
    }
}

.grand-total-box {
    margin-top: var(--spacing-md);
    padding: 12px;
    background: rgba(152,196,110,0.1);
    border: 1px solid var(--accent-green);
    font-weight: 600;
    font-size: var(--font-base);
    color: var(--accent-green);
    text-align: center;
}

/* Pale-pink flag: the row total doesn't yet account for the customer's
   requested quantity (i.e. sizes haven't been entered or are short). */

.sizes-saved-msg {
    margin-top: 12px;
    font-size: var(--font-sm);
    color: var(--accent-green);
    text-align: center;
}

/* ===================================================================
   INVOICE STATUS CARD
=================================================================== */
.invoice-status-card {
    padding: var(--spacing-md);
}

.invoice-status-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invoice-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.invoice-number {
    font-family: monospace;
    font-size: var(--font-base);
    color: #fff;
}

.invoice-status-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.invoice-status-badge.sent {
    background: rgba(66, 153, 225, 0.2);
    color: #4299e5;
    border: 1px solid rgba(66, 153, 225, 0.4);
}

.invoice-status-badge.paid {
    background: rgba(152, 196, 110, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(152, 196, 110, 0.4);
}

.invoice-status-badge.open {
    background: rgba(236, 201, 75, 0.2);
    color: #ecc94b;
    border: 1px solid rgba(236, 201, 75, 0.4);
}

.invoice-status-badge.draft {
    background: rgba(160, 174, 192, 0.2);
    color: #a0aec0;
    border: 1px solid rgba(160, 174, 192, 0.4);
}

.invoice-status-badge.void{
    background: rgba(214, 73, 73, 0.2);
    color: var(--accent-red);
    border: 1px solid rgba(214, 73, 73, 0.4);
}

.invoice-amount {
    font-size: var(--font-lg);
    font-weight: 600;
    color: #fff;
}

.invoice-actions {
    margin-top: 5px;
}

/* ===================================================================
   CUSTOMER PORTAL — STICKY ACTION BAR
=================================================================== */
.sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 18px;
    display: flex;
    gap: 12px;
    justify-content: center;
    z-index: 999;
    background: rgba(26,26,26,0.95);
    border-top: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
}

.sticky-actions .sticky-btn {
    flex: 1;
    max-width: 240px;
    text-align: center;
}

@media (max-width: 780px) {
    .sticky-actions {
        display: none;
    }
}

/* ===================================================================
   CUSTOMER PORTAL — MOBILE MENU ACTION BUTTONS
=================================================================== */

/* ===================================================================
   ADMIN — FILE LIST & DELETE BUTTONS
=================================================================== */

/* ===================================================================
   ADMIN — PROOF PREVIEW
=================================================================== */

.proof-image {
    max-width: 100%;
    display: block;
    margin-top: 10px;
    border: 1px solid var(--card-border);
}

/* Clean delete button styling for line items */
.del-cell {
    width: 50px;
    text-align: center;
    vertical-align: middle;
}

/* ======================================================
   SIZE TABLE STYLING — MTC THEME
   ====================================================== */

/* ======================================================
   EDITOR MODE
   ====================================================== */

size-edit-block input[type="number"] {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  padding: 6px;
  width: 100%;
}

/* Inline field errors */
input.invalid,
select.invalid,
textarea.invalid,
.invalid {
  border: 2px solid var(--accent-red) !important;
  margin-bottom: 4px;
}

input.invalid:focus,
select.invalid:focus,
textarea.invalid:focus {
  border-color: var(--accent-red) !important;
  outline: none;
}

.error-msg {
  color: var(--accent-red);
  font-size: var(--font-sm);
  margin-top: 2px;
  margin-bottom: 12px;
}

/* ── Field hints (focus-reveal) ── */
.field-hint-wrap {
  position: relative;
  padding-bottom: 22px; /* reserve space for hint/error below field */
}

/* Error messages inside hint wraps: absolute, same spot as hint */
.field-hint-wrap > .error-msg {
  position: absolute;
  bottom: 2px;
  left: 0;
  margin: 0;
}

.field-hint-wrap > input,
.field-hint-wrap > select,
.field-hint-wrap > textarea {
  margin-bottom: 0;
}

.field-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: var(--font-xs);
  color: var(--accent-green);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  white-space: nowrap;
}

.field-hint-wrap:focus-within > .field-hint {
  opacity: 1;
}

/* Hide hint when an error message is present */
.field-hint-wrap > .error-msg ~ .field-hint,
.field-hint-wrap:has(> .error-msg) > .field-hint {
  opacity: 0 !important;
}

/* Inside .form-row the hint anchors to each .form-group */
.form-row .field-hint-wrap {
  position: relative;
}

/* Mobile: same approach, below field */
@media (max-width: 850px) {
  .field-hint {
    white-space: normal;
  }
}

/* Form loading indicator */
.form-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--spacing-sm) 0;
  padding: 12px 16px;
  font-size: var(--font-base);
  color: #fff;
  background: rgba(0,0,0,0.5);
  border-radius: 6px;
}

.form-loading.hidden {
  display: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===================================================================
   TICKET DETAIL ROWS
=================================================================== */

/* Ticket Info Card - enhanced styling */
.ticket-detail-page .card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.ticket-detail-page .card:hover {
  border-color: var(--tile-outer-hover) !important;
}

.ticket-detail-page .card h3 {
  background: var(--grey-700);
  color: var(--accent-green);
  font-size: var(--font-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px var(--spacing-md);
  margin: calc(-1 * var(--spacing-md));
  margin-bottom: var(--spacing-md);
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm) var(--spacing-lg);
}

@media (max-width: 768px) {
  .ticket-info-grid {
    grid-template-columns: 1fr;
  }
}

.detail-row {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  background: var(--grey-700);
  border-left: 3px solid var(--accent-yellow);
  transition: background 0.2s;
}

.detail-row:hover {
  background: var(--grey-600);
}

.detail-label {
  color: var(--accent-yellow);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-weight: 600;
}

.detail-value {
  display: block;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
}

.editable-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editable-field .editable-text {
  flex: 1;
  min-width: 0;
}

.edit-field-btn {
  background: none;
  border: none;
  color: var(--accent-green);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.edit-field-btn:hover {
  opacity: 1;
}

.inline-edit-input {
  background: var(--tile-inner-bg);
  border: 1px solid var(--accent-green);
  color: #fff;
  padding: 4px 8px;
  font-size: var(--font-base);
  flex: 1;
  min-width: 0;
}

/* Full-width notes row */
.detail-row-full {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--card-border);
}

/* Ticket Detail Page Layout - Base */

/* ===================================================================
   TICKET DETAIL - MOBILE RESPONSIVE
=================================================================== */
@media (max-width: 768px) {
  .ticket-detail-page {
    padding: 10px;
    padding-bottom: 100px;
  }

  .ticket-detail-page .card {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
  }

  .ticket-detail-page .card h3 {
    font-size: var(--font-sm);
    padding: 10px var(--spacing-sm);
    margin: calc(-1 * var(--spacing-sm));
    margin-bottom: var(--spacing-sm);
  }

  .ticket-info-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
  }

  .detail-row {
    padding: 8px 10px;
    border-left-width: 2px;
  }

  .detail-label {
    font-size: var(--font-xs);
  }

  .detail-value {
    font-size: var(--font-sm);
  }

  /* Sizes card mobile */
  .sizes-card {
    padding: var(--spacing-sm);
  }

  .size-row-header .style-picker-wrapper {
    flex: 1;
  }

  .size-row-selection {
    flex-wrap: wrap;
    gap: 8px;
  }

  .size-row-selection .style-info {
    width: 100%;
  }

  .size-row-selection .color-select {
    width: 100%;
  }

  .ticket-detail-page .btn-delete {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .size-row {
    position: relative;
    padding-right: 40px;
  }

  /* Mobile size table - convert to grid */
  .size-table-container {
    overflow-x: visible;
  }

  .size-table {
    display: block;
    width: 100%;
  }

  .size-table tr.size-headers {
    display: none;
  }

  .size-table tr.size-inputs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
  }

  .size-table td {
    width: auto;
    min-width: auto;
    max-width: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
  }

  .size-table td::before {
    content: attr(data-label);
    font-size: var(--font-xs);
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    padding: 6px 8px;
    background: var(--grey-600);
    border: 1px solid var(--tile-inner-border);
    border-bottom: none;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    display: block;
    margin-bottom: 0;
  }

  .size-table input.qty {
    width: 100%;
    padding: 10px 4px;
    font-size: var(--font-base);
    border: 1px solid var(--input-border);
  }

  .size-table td.row-total {
    grid-column: span 5;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(152,196,110,0.1);
    border: 1px solid var(--accent-green);
    margin-top: 8px;
    font-size: var(--font-sm);
    color: var(--accent-green);
    font-weight: 600;
  }

  .size-table td.row-total::before {
    content: "Row Total:";
    margin-bottom: 0;
    background: none;
    border: none;
    padding: 0;
    width: auto;
    color: var(--accent-green);
  }

  /* Artwork grid mobile */

  /* Files section mobile */
  .file-row-admin {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
  }

}

@media (max-width: 480px) {
  .ticket-detail-page {
    padding: 8px;
    padding-bottom: 90px;
  }

  /* Smaller screens: 4 columns instead of 5 */
  .size-table tr.size-inputs {
    grid-template-columns: repeat(4, 1fr);
  }

  .size-table td.row-total {
    grid-column: span 4;
  }

}

/* ===================================================================
   ARTWORK / FILE GRID
=================================================================== */

.artwork-item {
  position: relative;
  text-align: center;
}

.artwork-item .btn-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  background: var(--accent-red);
  border: none;
}

.file-row-admin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.file-row-admin .file-link {
  flex: 1;
  color: var(--accent-green);
  text-decoration: none;
  font-size: var(--font-sm);
  word-break: break-all;
}

.file-row-admin .file-link:hover {
  color: var(--accent-green);
}

/* ===================================================================
   IMAGE LIGHTBOX
=================================================================== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 36px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Make proof images clickable */
.proof-image {
  cursor: zoom-in;
  transition: opacity 0.2s;
}

/* Zoomable proof viewer (js/proof_lightbox.js) — customer portal + admin ticket page */
.proof-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: var(--ui-canvas);
  color: var(--ui-text);
  font-family: var(--font-primary);
}

.proof-viewer[hidden] {
  display: none;
}

html.proof-viewer-open-page,
html.proof-viewer-open-page body {
  overflow: hidden;
}

.proof-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
}

.proof-viewer-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-viewer-bar button,
.proof-viewer-open {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  background: var(--ui-raised);
  color: var(--ui-text);
  font-size: var(--font-sm);
  line-height: 32px;
  text-decoration: none;
  cursor: pointer;
}

.proof-viewer-bar button:hover,
.proof-viewer-open:hover {
  border-color: var(--ui-accent);
}

.proof-viewer-bar button:focus-visible,
.proof-viewer-open:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 1px;
}

.proof-viewer-tools button[data-act="in"],
.proof-viewer-tools button[data-act="out"] {
  padding: 0;
  font-size: var(--font-md);
}

.proof-viewer-zoom {
  min-width: 52px;
  text-align: center;
  font-size: var(--font-sm);
  font-variant-numeric: tabular-nums;
}

.proof-viewer .proof-viewer-close {
  font-size: var(--font-lg);
  padding: 0;
}

.proof-viewer-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.proof-viewer-stage:active {
  cursor: grabbing;
}

.proof-viewer-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  transform-origin: 0 0;
  background: #fff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.proof-viewer-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-base);
  color: var(--text-secondary);
  pointer-events: none;
}

.proof-viewer-status[hidden] {
  display: none;
}

.proof-viewer-hint {
  padding: 6px 12px;
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-muted);
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-border);
}

@media (max-width: 600px) {
  .proof-viewer-open,
  .proof-viewer-tools button[data-act="actual"] {
    display: none;
  }
}

.proof-image:hover {
  opacity: 0.9;
}

/* ===================================================================
   INVOICE MODAL
=================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: var(--grey-800);
  border: 1px solid var(--grey-600);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 28px;
}

/* Invoice Modal - wider and full control */
.modal-content.invoice-modal {
  max-width: 800px !important;
  width: calc(100vw - 40px) !important;
}

.invoice-modal * {
  box-sizing: border-box;
}

.invoice-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid var(--grey-600);
  background: var(--grey-800);
}

.invoice-modal .modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}

.invoice-modal .modal-close {
  background: none;
  border: none;
  color: var(--grey-400);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.invoice-modal .modal-close:hover {
  color: #fff;
}

/* Invoice Form */
.invoice-modal .invoice-form {
  padding: 0;
}

.invoice-modal .invoice-section {
  padding: 25px 30px;
  border-bottom: 1px solid var(--grey-700);
}

.invoice-modal .invoice-section h4 {
  color: var(--grey-300);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 20px 0;
  font-weight: 600;
}

.invoice-modal .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.invoice-modal .section-header h4 {
  margin-bottom: 0;
}

/* Form Grid */
.invoice-modal .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.invoice-modal .form-row {
  margin-bottom: 0;
}

.invoice-modal .form-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--grey-300);
  font-size: 14px;
  font-weight: 500;
}

.invoice-modal input[type="text"],
.invoice-modal input[type="email"],
.invoice-modal input[type="number"] {
  width: 100% !important;
  padding: 12px 14px !important;
  background: var(--grey-700) !important;
  border: 1px solid var(--grey-600) !important;
  color: #fff !important;
  font-size: 15px !important;
  border-radius: 0 !important;
  height: auto !important;
  min-width: 0 !important;
}

.invoice-modal input:focus {
  outline: none !important;
  border-color: var(--accent-green) !important;
}

.invoice-modal input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin-right: 10px;
  cursor: pointer;
}

/* Test Mode Banner */
.invoice-modal .test-mode-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 30px;
  background: rgba(214, 73, 73, 0.1);
  border-bottom: 1px solid var(--grey-600);
}

.invoice-modal .test-mode-banner label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 0;
}

.invoice-modal .test-mode-banner label span {
  color: var(--accent-red);
}

.invoice-modal .test-mode-hint {
  color: var(--grey-400);
  font-size: 13px;
}

/* Line Items */
.invoice-modal .line-items-header {
  display: flex;
  gap: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--grey-700);
  margin-bottom: 15px;
}

.invoice-modal .line-items-header span {
  font-size: 11px;
  color: var(--grey-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.invoice-modal .line-items-header .col-desc {
  flex: 1;
  min-width: 200px;
}

.invoice-modal .line-items-header .col-amount {
  width: 140px;
  flex-shrink: 0;
}

.invoice-modal .line-items-header .col-action {
  width: 36px;
  flex-shrink: 0;
}

.invoice-modal .invoice-line-item {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  align-items: center;
}

.invoice-modal .invoice-line-item .line-desc {
  flex: 1;
  min-width: 200px;
}

.invoice-modal .invoice-line-item .line-amount {
  width: 140px !important;
  flex-shrink: 0;
}

.invoice-modal .btn-remove-line {
  background: transparent;
  border: 1px solid var(--grey-600);
  color: var(--grey-400);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.invoice-modal .btn-remove-line:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

/* Total Bar */
.invoice-modal .invoice-total-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 25px;
  padding: 20px 30px;
  background: var(--grey-700);
}

.invoice-modal .total-label {
  color: var(--grey-300);
  font-size: 15px;
}

.invoice-modal .total-amount {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.invoice-modal .modal-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  padding: 20px 30px;
  border-top: 1px solid var(--grey-600);
  background: var(--grey-800);
}

/* Tax Toggle Buttons */
.invoice-modal .toggle-buttons {
  display: flex;
  gap: 0;
}

.invoice-modal .toggle-btn {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--grey-600);
  background: var(--grey-700);
  color: var(--grey-400);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.invoice-modal .toggle-btn:first-child {
  border-right: none;
}

.invoice-modal .toggle-btn:hover {
  background: var(--grey-600);
  color: #fff;
}

.invoice-modal .toggle-btn.active {
  background: var(--grey-500);
  color: #fff;
  border-color: var(--grey-500);
  font-weight: 600;
}

@media (max-width: 700px) {
  .invoice-modal .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .invoice-modal .line-items-header .col-desc {
    min-width: 120px;
  }
  
  .invoice-modal .invoice-line-item .line-desc {
    min-width: 120px;
  }
}

/* ===================================================================
   S&S STYLE PICKER
=================================================================== */
.style-picker-wrapper {
  position: relative;
}

.style-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
  max-height: 350px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.style-loading,
.style-no-results {
  padding: 15px;
  text-align: center;
  color: var(--dark-grey);
}

.selected-style {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--grey-800);
  border: 1px solid var(--border-color);
}

.selected-style img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #fff;
  padding: 4px;
}

.selected-style .style-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-style .style-info strong {
  color: var(--accent-green);
  font-size: var(--font-base);
  font-weight: 600;
}

.selected-style .style-info span {
  color: var(--light-grey);
  font-size: var(--font-sm);
  line-height: 1.4;
}

/* Garment rows container */
.garment-row {
  margin-bottom: var(--spacing-md);
}

.garment-row:last-child {
  margin-bottom: 0;
}

.wholesale-price {
  display: block;
  margin-top: 4px;
  color: var(--accent-green);
  font-weight: 600;
  font-size: var(--font-sm);
}

/* Line items table */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
}

.line-items-table th {
  padding: 8px 6px;
  text-align: left;
  font-size: var(--font-sm);
  color: #fff;
  font-weight: 500;
}

.line-items-table td {
  padding: 6px;
  vertical-align: middle;
}

.line-items-table td input {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: var(--input-text);
  border: 1px solid var(--input-border);
}

.line-items-table td input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.line-items-table td input[type="number"]::-webkit-inner-spin-button,
.line-items-table td input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: inner-spin-button;
  opacity: 1;
  height: auto;
}

.line-items-table td.del-cell {
  text-align: center;
  width: 40px;
  vertical-align: middle;
}

.line-items-table .btn-delete {
  vertical-align: middle;
}

.line-items-table td.preset-desc-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.line-items-table td.preset-desc-cell .preset-colors {
  width: 3.5em;
  flex: 0 0 auto;
}

.line-items-table td.preset-desc-cell .desc {
  flex: 1 1 auto;
}

.line-items-table tr.preset-addon-row td {
  padding: 0 8px 8px 28px;
  border-bottom: none;
  white-space: nowrap;
}

.line-items-table tr.has-addon td {
  padding-bottom: 0;
  border-bottom: none;
}

.line-items-table tr.preset-addon-row .preset-light-ink-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
}

.line-items-table tr.preset-addon-row .preset-light-ink-label span {
  white-space: nowrap;
}

.line-items-table tr.preset-addon-row .preset-light-ink {
  margin: 0;
  cursor: pointer;
}

/* ===================================================================
   ADMIN PAGES - MOBILE RESPONSIVE ENHANCEMENTS
=================================================================== */

/* Option Card Headers */
.option-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.option-card-header h4 {
  margin-bottom: 0;
}

/* ===================================================================
   GARMENT GROUPS & PRICING OPTIONS
=================================================================== */

.garment-group {
  position: relative;
}

.garment-group-remove-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
}

.garment-section {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.pricing-options-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.pricing-options-container .option-card {
  padding: var(--spacing-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.option-fields-row {
  display: flex;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.option-fields-row > div {
  flex: 1;
}

.option-fields-row label {
  margin-bottom: 6px;
}

.option-fields-row input {
  width: 100%;
}

/* Customer artwork preview on Create Quote page */

/* Totals Row - ensure proper layout */
.totals-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}

.totals-row label {
  min-width: 100px;
  margin-bottom: 0;
}

.totals-row input,
.totals-row select {
  flex: 1;
  max-width: 200px;
}

/* Page Header Row - flex layout for title + action buttons */

/* ===================================================================
   ADMIN MOBILE RESPONSIVE (max-width: 768px)
=================================================================== */
@media (max-width: 768px) {
  /* Page header stacks on mobile */

  /* === GENERAL ADMIN PAGE FIXES === */
  body.admin-page .page-container {
    padding: var(--spacing-sm);
    max-width: 100%;
  }
  
  body.admin-page .card {
    margin: var(--spacing-sm) 0;
    padding: var(--spacing-sm);
  }
  
  body.admin-page .card h2,
  body.admin-page .card h3 {
    font-size: var(--font-md);
    margin-bottom: var(--spacing-sm);
  }
  
  /* === LINE ITEMS TABLE - MOBILE CARD LAYOUT === */
  .line-items-table {
    display: block;
    width: 100%;
  }
  
  .line-items-table thead {
    display: none;
  }
  
  .line-items-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .line-items-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--tile-inner-bg);
    border: 1px solid var(--tile-inner-border);
  }
  
  .line-items-table td {
    padding: 4px 0;
    border: none;
  }
  
  /* Description spans full width on first row */
  .line-items-table td:first-child {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }
  
  .line-items-table td:first-child input {
    width: 100%;
    font-size: var(--font-base);
  }
  
  /* Qty, Rate, Total in row */
  .line-items-table td:nth-child(2),
  .line-items-table td:nth-child(3),
  .line-items-table td:nth-child(4) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .line-items-table td:nth-child(2)::before {
    content: 'Qty';
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  
  .line-items-table td:nth-child(3)::before {
    content: 'Rate';
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  
  .line-items-table td:nth-child(4)::before {
    content: 'Total';
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  
  .line-items-table td:nth-child(2) input,
  .line-items-table td:nth-child(3) input,
  .line-items-table td:nth-child(4) input {
    width: 100%;
  }
  
  /* Delete button */
  .line-items-table td.del-cell {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-self: end;
    align-self: start;
  }
  
  /* === TOTALS ROW - MOBILE === */
  .totals-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  
  .totals-row label {
    min-width: unset;
    font-size: var(--font-sm);
  }
  
  .totals-row input,
  .totals-row select {
    max-width: 100%;
    width: 100%;
  }
  
  /* === GARMENT PICKER - MOBILE === */
  .selected-style {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
  }
  
  .selected-style img {
    width: 60px;
    height: 60px;
  }
  
  .selected-style .style-info {
    width: 100%;
  }
  
  .selected-style .btn-delete {
    align-self: flex-end;
    margin-top: -50px;
  }
  
  .garment-row .style-picker-wrapper input {
    font-size: var(--font-base);
    padding: 12px;
  }
  
  /* === FORM INPUTS - MOBILE === */
  body.admin-page input[type="text"],
  body.admin-page input[type="email"],
  body.admin-page input[type="tel"],
  body.admin-page input[type="number"],
  body.admin-page input[type="date"],
  body.admin-page select,
  body.admin-page textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 12px;
  }
  
  body.admin-page label {
    font-size: var(--font-sm);
    margin-bottom: 4px;
  }
  
  /* === BUTTONS - MOBILE === */
  body.admin-page .btn {
    padding: 12px 16px;
    font-size: var(--font-sm);
    width: 100%;
    margin-bottom: 8px;
  }
  
  body.admin-page .btn + .btn {
    margin-left: 0;
  }
  
  /* Keep inline buttons side by side where needed */

  /* === INVOICE MODAL - MOBILE === */
  .modal-content.invoice-modal {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 100%;
    height: 100%;
    border: none;
  }
  
  .invoice-modal .modal-header {
    padding: 15px;
  }
  
  .invoice-modal .invoice-section {
    padding: 15px;
  }
  
  .invoice-modal .test-mode-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 15px;
  }
  
  .invoice-modal .toggle-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .invoice-modal .toggle-btn {
    border: 1px solid var(--grey-600) !important;
  }
  
  .invoice-modal .toggle-btn:first-child {
    border-right: 1px solid var(--grey-600) !important;
    border-bottom: none !important;
  }
  
  .invoice-modal .line-items-header {
    display: none;
  }
  
  .invoice-modal .invoice-line-item {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: var(--grey-700);
    margin-bottom: 10px;
  }
  
  .invoice-modal .invoice-line-item .line-desc {
    min-width: 100%;
  }
  
  .invoice-modal .invoice-line-item .line-desc::before {
    content: 'Description';
    display: block;
    font-size: var(--font-xs);
    color: var(--grey-400);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  
  .invoice-modal .invoice-line-item .line-amount {
    width: 100% !important;
  }
  
  .invoice-modal .invoice-line-item .line-amount::before {
    content: 'Amount';
    display: block;
    font-size: var(--font-xs);
    color: var(--grey-400);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  
  .invoice-modal .btn-remove-line {
    align-self: flex-end;
    margin-top: -60px;
  }
  
  .invoice-modal .invoice-total-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 15px;
  }
  
  .invoice-modal .modal-actions {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }
  
  .invoice-modal .modal-actions .btn {
    width: 100%;
    margin: 0;
  }
}

/* ===================================================================
   ADMIN MOBILE - SMALLER SCREENS (max-width: 480px)
=================================================================== */
@media (max-width: 480px) {
  body.admin-page .page-container {
    padding: 8px;
  }
  
  body.admin-page .card {
    padding: 10px;
    margin: 8px 0;
  }
  
  body.admin-page .card h2,
  body.admin-page .card h3 {
    font-size: var(--font-base);
  }
  
  /* Line items even more compact */
  .line-items-table tr {
    padding: 10px;
    gap: 6px;
  }
  
  .line-items-table td:nth-child(2) input,
  .line-items-table td:nth-child(3) input,
  .line-items-table td:nth-child(4) input {
    width: 100%;
  }
  
  /* Admin nav */
  .admin-nav-btn {
    padding: 6px 10px !important;
    min-width: 80px !important;
    font-size: 11px !important;
  }
  
  /* Smaller headings */
  body.admin-page h1 {
    font-size: var(--font-lg);
  }
}

/* ===================================================================
   ARTICLES ADMIN - MOBILE RESPONSIVE
=================================================================== */
@media (max-width: 768px) {

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0;
  }
  
  .form-group input[type="text"],
  .form-group textarea {
    padding: 10px 12px;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  .form-group textarea {
    min-height: 200px;
  }

}

/* ===================================================================
   ADDITIONAL ADMIN MOBILE FIXES
=================================================================== */
@media (max-width: 768px) {
  /* Fix inline flex headers that can overflow */
  body.admin-page [style*="display:flex"][style*="justify-content:space-between"],
  body.admin-page [style*="display: flex"][style*="justify-content: space-between"] {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  
  /* Custom Email Card Mobile */

  /* Proof Card Mobile */
  .proof-card {
    padding: var(--spacing-sm);
  }
  
  #proofContent img,
  #proofPreview img {
    max-width: 100%;
    height: auto;
  }
  
  /* Invoice Status Card Mobile */
  .invoice-status-card {
    padding: var(--spacing-sm);
  }
  
  .invoice-status-content {
    gap: 8px;
  }
  
  .invoice-info {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Modal Overlay - Better mobile handling */
  .modal-overlay {
    padding: 0 !important;
  }
  
  .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  
  /* Proof Modal Mobile */
  #proofModal .modal-content {
    padding: 15px;
  }
  
  #proofModal .form-row {
    margin-bottom: 12px;
  }
  
  #proofModal .modal-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  #proofModal .modal-actions .btn {
    width: 100%;
  }
  
  /* Sizes table horizontal scroll indicator */
  .size-table-container {
    position: relative;
  }
  
  .size-table-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to left, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
  }

}

/* ===================================================================
   TOUCH-FRIENDLY ENHANCEMENTS
=================================================================== */
@media (max-width: 768px) {
  /* Larger touch targets for checkboxes */
  body.admin-page input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
  }
  
  /* Better spacing for clickable rows */
  .job-card {
    min-height: 60px;
    padding: 15px;
  }
  
  /* Delete buttons easier to tap */
  .btn-delete,
  .btn-remove-line {
    min-width: 36px !important;
    min-height: 36px !important;
  }
}

/* ===================================================================
   UTILITY CLASSES
=================================================================== */

/* Display */
.d-none        { display: none; }

/* Text alignment */
.text-center   { text-align: center; }

/* Overflow */

/* Width */

/* Font weight */

/* Colors */
.text-light    { color: var(--light-grey); }
.text-white    { color: #fff; }
.color-muted   { color: var(--text-muted); }
.color-secondary { color: var(--text-secondary); }
.color-primary { color: var(--text-primary); }
.text-green    { color: var(--accent-green); }

/* Margin top */
.mt-0   { margin-top: 0; }

/* Margin bottom */

.m-0    { margin: 0; }

/* Centering */

/* Card width modifiers */
.card-narrow  { max-width: 400px; margin-left: auto; margin-right: auto; }

/* Flex helpers */

/* Page section spacing */
.page-section-spacing { margin-top: 60px; margin-bottom: 80px; }

/* Loading / status messages */

.status-message  { margin-top: 15px; text-align: center; }
.msg-info  { color: var(--accent-blue); }
.msg-success { color: var(--accent-green); }
.msg-error { color: var(--accent-red); }

/* Small muted text */
.hint-text { color: var(--text-muted); font-size: var(--font-sm); margin-bottom: var(--spacing-md); }
.hint-xs   { font-size: var(--font-xs); color: var(--text-muted); }

/* ===================================================================
   TICKET DETAIL PAGE
=================================================================== */
.proof-preview     { text-align: center; }

.proof-modal-content { max-width: 400px; }
.proof-modal-desc  { color: var(--light-grey); margin-bottom: 20px; }
.proof-checkbox-row { margin-bottom: 15px; }
.proof-checkbox-row-last { margin-bottom: 20px; }
.proof-checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.proof-checkbox    { width: 18px; height: 18px; }

/* ===================================================================
   QUOTE LANDING PAGE
=================================================================== */
.quote-hero-section  { text-align: center; margin-bottom: 50px; }
.quote-hero-subtitle { color: var(--light-grey); max-width: 600px; margin: 0 auto; }
.steps-heading       { text-align: center; margin-bottom: 10px; }
.steps-subtitle      { text-align: center; color: var(--light-grey); margin-bottom: 30px; }
.portal-cta-card     { margin-top: 50px; text-align: center; }
.portal-cta-wrapper  { margin-top: 30px; max-width: 400px; margin-left: auto; margin-right: auto; }
.portal-cta-text     { text-align: center; color: var(--text-secondary); margin-bottom: 15px; }
.contact-card        { margin-top: 40px; }
.contact-return      { margin-top: 25px; max-width: 400px; }

/* ===================================================================
   CUSTOMER HOME / PORTAL
=================================================================== */
/* Cards and header bars come from the shared rules in section 7 (.customer-home .card, .portal-card-header).
   Quiet text (.proof-status-msg, .approve-both-note, .text-muted-light) uses the shared label opacity. */
body.admin-ui.customer-home .portal-page-top { margin-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
body.admin-ui.customer-home .page-container > .card { margin: 0 0 var(--ui-pad); }
body.admin-ui.customer-home .card p { color: var(--ui-text); font-size: var(--ui-font-body); line-height: 1.5; }
body.admin-ui.customer-home :is(.msg-info, .msg-success, .msg-error) { font-size: var(--ui-font-body); }

body.admin-ui.customer-home .portal-title-row { align-items: center; display: flex; gap: var(--ui-gap-lg); justify-content: space-between; margin-bottom: var(--ui-pad); }
body.admin-ui.customer-home .portal-title-row .welcome-heading { margin: 0; }

/* Order progress */
body.admin-ui.customer-home .status-grid { display: grid; gap: var(--ui-gap); grid-template-columns: repeat(5, 1fr); margin-bottom: var(--ui-pad); }
body.admin-ui.customer-home .status-box { background: var(--ui-surface); border: 1px solid var(--ui-border); padding: var(--ui-pad-inner) var(--ui-gap); text-align: center; }
body.admin-ui.customer-home .status-box.completed { border-color: var(--ui-accent); }
body.admin-ui.customer-home .status-icon { height: 28px; margin: 0 auto var(--ui-gap); width: 28px; }
body.admin-ui.customer-home .status-icon svg { fill: var(--ui-text); height: 100%; opacity: var(--ui-label-opacity); width: 100%; }
body.admin-ui.customer-home .status-box.completed .status-icon svg { fill: var(--ui-accent); opacity: 1; }
body.admin-ui.customer-home .status-label { color: var(--ui-text); font-size: var(--ui-font-label); font-weight: 500; line-height: 1.2; opacity: var(--ui-label-opacity); text-transform: uppercase; }
body.admin-ui.customer-home .status-box.completed .status-label { opacity: 1; }

/* Proof */
body.admin-ui.customer-home #proofContent img { border: 1px solid var(--ui-border); cursor: zoom-in; margin: 0 auto; max-width: 100%; width: auto; }
body.admin-ui.customer-home .proof-actions { align-items: center; display: flex; flex-wrap: wrap; gap: var(--ui-gap-lg); }
body.admin-ui.customer-home .proof-actions > * { margin: var(--ui-pad) 0 0; }
body.admin-ui.customer-home .approve-both { background: var(--ui-canvas); border: 1px solid var(--ui-accent); margin-top: var(--ui-pad); padding: var(--ui-pad); text-align: center; }
body.admin-ui.customer-home .approve-both[hidden] { display: none; }
body.admin-ui.customer-home .approve-both .approve-both-text { font-size: var(--ui-font-emphasis); margin: 0 0 var(--ui-gap-lg); }
body.admin-ui.customer-home .approve-both-btn { min-width: 240px; }
body.admin-ui.customer-home .approve-both .approve-both-note { margin: var(--ui-gap-lg) 0 0; }
body.admin-ui.customer-home .approval-confirmed { padding: 0; }
body.admin-ui.customer-home .approval-confirmed h3 { color: var(--ui-accent); font-size: var(--ui-font-emphasis); margin: 0 0 var(--ui-gap); text-transform: uppercase; }

/* Quote */
body.admin-ui.customer-home .quote-desc { margin: 0 0 var(--ui-pad-inner); }
body.admin-ui.customer-home :is(.quote-actions-row, .sizes-actions-row) { display: flex; flex-wrap: wrap; gap: var(--ui-gap); }
body.admin-ui.customer-home .quote-status-msg { margin: var(--ui-pad-inner) 0 0; }

/* Sizes */
body.admin-ui.customer-home .size-rows { gap: var(--ui-gap-lg); }
body.admin-ui.customer-home .size-row { background: var(--ui-canvas); border: 1px solid var(--ui-border); padding: var(--ui-pad-inner); }
body.admin-ui.customer-home .size-row-header { gap: var(--ui-gap); margin-bottom: var(--ui-gap-lg); }
body.admin-ui.customer-home .size-row-header input { flex: 1; margin: 0; min-width: 0; }
body.admin-ui.customer-home .size-table th { font-size: var(--ui-font-label); }
body.admin-ui.customer-home .grand-total-box { border: 1px solid var(--ui-accent); font-size: var(--ui-font-emphasis); margin: var(--ui-gap-lg) 0; padding: var(--ui-gap-lg); }
body.admin-ui.customer-home .sizes-saved-msg { margin-top: var(--ui-gap-lg); text-align: left; }
body.admin-ui.customer-home .sizes-saved-msg:empty { display: none; }

/* Files */
body.admin-ui.customer-home .ticket-files-list { list-style: none; margin: 0; padding: 0; }
body.admin-ui.customer-home .ticket-file-item { align-items: center; border-bottom: 1px solid var(--ui-border); display: flex; gap: var(--ui-gap-lg); justify-content: space-between; padding: var(--ui-gap) 0; }
body.admin-ui.customer-home .ticket-file-item:first-child { padding-top: 0; }
body.admin-ui.customer-home .ticket-file-item:last-child { border-bottom: 0; padding-bottom: 0; }
body.admin-ui.customer-home .ticket-file-name { min-width: 0; overflow-wrap: anywhere; }

/* Contact */
body.admin-ui.customer-home .contact-info-text { line-height: 1.8; margin: 0; }
body.admin-ui.customer-home .contact-strong { color: var(--ui-text); }

@media (max-width: 700px) {
    body.admin-ui.customer-home .status-grid { grid-template-columns: 1fr; }
    body.admin-ui.customer-home .status-box { align-items: center; display: flex; gap: var(--ui-gap-lg); padding: var(--ui-gap) var(--ui-pad-inner); text-align: left; }
    body.admin-ui.customer-home .status-icon { height: 20px; margin: 0; width: 20px; }
    body.admin-ui.customer-home .page-container > .card { padding: var(--ui-pad-inner); }
    body.admin-ui.customer-home .page-container > .card > .portal-card-header { margin: calc(-1 * var(--ui-pad-inner)) calc(-1 * var(--ui-pad-inner)) var(--ui-pad-inner); padding: 0 var(--ui-pad-inner); }
    body.admin-ui.customer-home :is(.quote-actions-row, .sizes-actions-row, .proof-actions) > .btn,
    body.admin-ui.customer-home .approve-both-btn { min-width: 0; width: 100%; }
    body.admin-ui.customer-home .proof-actions > p { width: 100%; }
    /* Customers get wrapped size boxes on phones instead of the admin's side-scrolling table. */
    body.admin-ui.customer-home .size-table { display: block; min-width: 0; width: 100%; }
    body.admin-ui.customer-home .size-table tr.size-headers { display: none; }
    body.admin-ui.customer-home .size-table tr.size-inputs { display: grid; gap: var(--ui-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
    body.admin-ui.customer-home .size-table :is(td, td.row-total) { border: 0; display: flex; flex-direction: column; min-width: 0; width: auto; }
    body.admin-ui.customer-home .size-table td::before { border: 1px solid var(--ui-border); border-bottom: 0; color: var(--ui-text); content: attr(data-label); display: block; font-size: var(--ui-font-label); opacity: var(--ui-label-opacity); padding: var(--ui-gap) 0; text-align: center; text-transform: uppercase; }
    body.admin-ui.customer-home .size-table input.qty { width: 100%; }
    body.admin-ui.customer-home .size-table td.row-total { align-items: center; border: 1px solid var(--ui-border); flex-direction: row; gap: var(--ui-gap); grid-column: 1 / -1; justify-content: center; padding: var(--ui-gap); }
    body.admin-ui.customer-home .size-table td.row-total::before { border: 0; content: "Row Total:"; padding: 0; }
}
.portal-login-card   { max-width: 400px; margin: 0 auto; }
.portal-login-heading { text-align: center; }
.portal-link-group   { text-align: center; margin-top: 15px; }
.portal-hint-group   { text-align: center; margin-top: 10px; }
.portal-hint-text    { color: var(--text-secondary); font-size: 14px; }
.portal-empty-msg    { margin-bottom: 15px; }
.portal-empty-detail { color: var(--light-grey); font-size: 14px; }

/* --- Signup / password form --- */
.pass-field-wrap     { position: relative; }
.pass-input          { padding-right: 45px; }
.pass-toggle-btn     { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #232323; font-size: 14px; }
.strength-bar        { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.2); margin-top: 8px; overflow: hidden; }
.strength-fill       { height: 100%; width: 0%; transition: all 0.3s ease; }
.strength-text       { font-size: 12px; margin-top: 4px; color: #ccc; }
.pass-requirements   { font-size: 13px; margin-top: 10px; padding: 10px; background: rgba(255,255,255,0.1); border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); }
.pass-req-item       { color: #aaa; }
.pass-confirm-label  { margin-top: 15px; }
.pass-match-status   { font-size: 13px; margin-top: 6px; }
.captcha-label       { margin-top: 15px; }
.captcha-box         { background: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); }
.captcha-question    { font-size: 16px; font-weight: 500; color: #fff; }
.captcha-input       { margin-top: 10px; }
.signup-status       { margin-top: 10px; }
.signup-login-link   { margin-top: 15px; text-align: center; }

/* ===================================================================
   CONTACT / PAYMENT THANKS PAGES
=================================================================== */
.thanks-hero         { text-align: center; margin-bottom: 40px; }
.thanks-card         { text-align: center; max-width: 560px; margin: 0 auto; padding: 50px 40px; }
.thanks-heading      { margin-bottom: 15px; color: #fff; }
.thanks-desc         { color: var(--light-grey); font-size: 1.1rem; line-height: 1.6; margin-bottom: 25px; }
.thanks-info         { color: var(--light-grey); margin-bottom: 30px; }
.thanks-small        { color: var(--light-grey); font-size: 0.95rem; margin-bottom: 30px; }
.thanks-cta          { max-width: 300px; margin: 0 auto; }
.confirmation-icon   { width: 48px; height: 48px; margin: 0 auto 20px; }
.confirmation-icon svg { width: 100%; height: 100%; fill: var(--accent-green); }
.ticket-ref          { font-family: monospace; background: var(--grey-700); padding: 3px 10px; border-radius: 4px; }

/* ===================================================================
   CREATE QUOTE / INVOICE PAGES
=================================================================== */

.quote-actions       { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }

/* Preset line-item dropdown — match .btn appearance */
.preset-line-select {
    width: auto;
    margin-bottom: 0;
    padding: 16px 36px 16px 32px;
    background-color: var(--grey-700);
    border: 1px solid #fff !important;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
}
.preset-line-select option {
    text-align: left;
}

.add-item-btn {
    margin-bottom: 0;
}
.quote-totals        { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--card-border); }
.items-table         { width: 100%; border-collapse: collapse; }
.col-desc            { width: 250px; }
.col-qty             { width: 80px; }
.col-rate            { width: 90px; }
.col-total           { width: 110px; }
.col-action          { width: 40px; }
.col-qty-wide        { width: 90px; }
.col-rate-wide       { width: 120px; }
.col-total-wide      { width: 120px; }
.col-action-wide     { width: 50px; }
.pdf-link            { margin-top: 10px; }

/* ===================================================================
   IMPORT ORDERS PAGE
=================================================================== */

/* ===================================================================
   INDEX / HOMEPAGE
=================================================================== */

.quote-intro-text    { color: var(--grey-300); margin-bottom: 30px; line-height: 1.7; }

/* Quote section header */
.quote-section-header { text-align: center; margin-bottom: 30px; }

/* ===================================================================
   JOB SUMMARY PAGE
=================================================================== */

/* ===================================================================
   CREATE TICKET PAGE
=================================================================== */
.create-ticket-card  { max-width: 600px; margin: 40px auto; }
.create-ticket-heading { margin-bottom: 20px; }

/* ===================================================================
   DASHBOARD PAGE
=================================================================== */
.dashboard-card      { max-width: 900px; margin: 40px auto; }
.dashboard-loading   { color: var(--text-secondary); }

.dashboard-search-row {
  margin-bottom: 16px;
}

.dashboard-search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: #fff;
  color: var(--input-text);
  box-sizing: border-box;
}

.dashboard-search-input:focus {
  outline: none;
  border-color: var(--accent, #2a7a2a);
  box-shadow: 0 0 0 3px rgba(42, 122, 42, 0.15);
}

/* ===================================================================
   PRESALE SETUP PAGE
=================================================================== */
.presale-inline-form { display: inline; }
.presale-cancel-btn  { border-color: var(--grey-400); color: var(--text-muted); }
.presale-color-flex  { display: flex; gap: var(--spacing-sm); align-items: center; flex-wrap: wrap; }
.presale-product-actions { margin-top: var(--spacing-sm); display: flex; gap: 8px; }

/* Form overrides for presale admin grids */
.presale-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); margin-bottom: var(--spacing-md); }
.presale-form-row .form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.presale-form-row .form-group.full { grid-column: 1 / -1; }
.presale-form-row .form-group label { font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary); }
.presale-form-row .form-group input { margin-bottom: 0; }

.slug-preview     { font-size: var(--font-sm); color: var(--text-muted); margin-top: 4px; }
.slug-preview span { color: var(--accent-green); }

/* Search dropdown */
#searchCard { position: relative; z-index: 10; }
.search-input { width: 100%; padding: 12px; background: var(--grey-700); border: 1px solid var(--grey-500); color: var(--text-primary); font-size: var(--font-base); }
.search-input:focus { outline: none; border-color: var(--accent-green); }
.search-input::placeholder { color: var(--text-muted); }
.search-container  { position: relative; margin-bottom: var(--spacing-md); z-index: 200; }
.search-results    { position: absolute; top: 100%; left: 0; right: 0; background: var(--grey-700); border: 1px solid var(--grey-500); max-height: 400px; overflow-y: auto; z-index: 100; display: none; }
.search-results.open { display: block; }

.search-result-item { display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm); border-bottom: 1px solid var(--grey-600); cursor: pointer; transition: background 0.2s; }
.search-result-item:hover    { background: var(--grey-600); }
.search-result-item.selected { background: rgba(152, 196, 110, 0.15); border-left: 3px solid var(--accent-green); }
.search-result-img   { width: 50px; height: 50px; object-fit: contain; background: #fff; flex-shrink: 0; }
.search-result-info  { flex: 1; min-width: 0; }
.search-result-info strong { display: block; font-size: var(--font-sm); }
.search-result-info span   { font-size: var(--font-xs); color: var(--text-muted); }
.search-result-check { color: var(--accent-green); font-weight: bold; font-size: var(--font-lg); display: none; }
.search-result-item.selected .search-result-check { display: block; }

/* Design library */
.design-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--spacing-sm); margin-top: var(--spacing-sm); }
.design-thumb     { background: var(--tile-inner-bg); border: 1px solid var(--tile-inner-border); padding: var(--spacing-sm); text-align: center; position: relative; }
.design-thumb img { width: 100%; height: 120px; object-fit: contain; background: var(--grey-800); }
.design-thumb .design-label  { font-size: var(--font-sm); color: var(--text-secondary); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.design-thumb .design-delete { position: absolute; top: 4px; right: 4px; background: var(--accent-red); border: none; color: #fff; width: 22px; height: 22px; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }

.design-upload-area { border: 2px dashed var(--grey-500); padding: var(--spacing-lg); text-align: center; cursor: pointer; transition: border-color 0.2s; margin-bottom: var(--spacing-sm); }
.design-upload-area:hover { border-color: var(--accent-green); }
.design-upload-area .upload-hint        { font-size: var(--font-sm); color: var(--text-muted); margin-top: 6px; }
.design-upload-area .transparency-note  { font-size: var(--font-xs); color: var(--text-muted); margin-top: 4px; opacity: 0.7; }

/* Presale product cards */
.product-grid          { display: flex; flex-direction: column; gap: var(--spacing-md); }
.admin-page .product-card { background: var(--tile-inner-bg); border: 1px solid var(--tile-inner-border); padding: var(--spacing-md); cursor: default; transition: none; overflow: visible; }
.admin-page .product-card:hover { transform: none; border-color: var(--tile-inner-border); }
.admin-page .product-card.dragging { opacity: 0.45; }
.admin-page .product-card.drag-over { border-color: var(--accent-green); border-style: dashed; }
.product-card-header   { display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-md); }
.product-card.collapsed .product-card-header { margin-bottom: 0; }
.product-card.collapsed .product-card-body { display: none; }
.product-card-thumb    { width: 56px; height: 56px; object-fit: contain; background: #fff; flex-shrink: 0; }
.product-card-info     { flex: 1; min-width: 0; }
.product-card-info .product-name  { font-size: var(--font-md); font-weight: 600; }
.product-card-info .product-brand { font-size: var(--font-sm); color: var(--text-muted); }
.product-card-drag-handle, .product-card-toggle { width: 28px; height: 28px; flex-shrink: 0; background: transparent; border: 1px solid var(--grey-500); color: var(--text-muted); cursor: pointer; font: inherit; display: flex; align-items: center; justify-content: center; }
.product-card-drag-handle { cursor: grab; font-size: 18px; line-height: 1; }
.product-card-drag-handle:active { cursor: grabbing; }
.product-card-drag-handle:hover, .product-card-toggle:hover { border-color: var(--accent-green); color: var(--accent-green); }
.product-card-remove   { background: var(--accent-red); border: none; color: #fff; width: 28px; height: 28px; cursor: pointer; font-size: var(--font-base); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Inline field editing */
.inline-field { width: 100%; padding: 6px 8px; font-size: var(--font-sm); font-family: inherit; background: var(--grey-800); border: 1px solid var(--grey-500); color: var(--text-primary); margin-top: 6px; }
.inline-field:focus { outline: none; border-color: var(--accent-green); }
.inline-field::placeholder { color: var(--text-muted); font-style: italic; }
.field-saved      { font-size: var(--font-xs); color: var(--accent-green); margin-top: 2px; opacity: 0; transition: opacity 0.3s; }
.field-saved.show { opacity: 1; }

.price-row       { display: flex; align-items: center; gap: var(--spacing-sm); margin-top: 6px; }
.price-row label { font-size: var(--font-sm); color: var(--text-muted); white-space: nowrap; }
.price-row input { width: 100px; padding: 6px 8px; font-size: var(--font-sm); font-family: inherit; background: var(--grey-800); border: 1px solid var(--grey-500); color: var(--text-primary); margin: 0; }
.price-row input:focus { outline: none; border-color: var(--accent-green); }

/* Admin section labels (smaller than global .section-label) */
.admin-page .section-label { font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; letter-spacing: 0; text-transform: none; }

/* Color swatches (admin — smaller than products page) */
.color-swatch-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.admin-page .color-swatch { width: 28px; height: 28px; border: 2px solid var(--grey-500); cursor: pointer; padding: 0; background-size: cover; background-position: center; background-color: var(--grey-600); }
.admin-page .color-swatch:hover  { border-color: var(--accent-green); }
.admin-page .color-swatch.active { border-color: var(--accent-green); outline: 2px solid rgba(152, 196, 110, 0.4); outline-offset: 1px; }
.color-label { font-size: var(--font-xs); color: var(--text-muted); margin-bottom: var(--spacing-md); min-height: 16px; }

/* View tabs */
.view-tabs { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: var(--spacing-md); }
.view-tab  { padding: 8px 16px; font-size: var(--font-sm); font-family: inherit; background: var(--grey-700); border: 1px solid var(--grey-500); color: var(--text-muted); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.view-tab + .view-tab { border-left: none; }
.view-tab:hover  { background: var(--grey-600); color: var(--text-primary); }
.view-tab.active { background: var(--grey-800); border-color: var(--accent-green); color: var(--accent-green); z-index: 1; }
.view-tab .tab-dot { width: 6px; height: 6px; display: inline-block; margin-left: 6px; background: var(--accent-green); border-radius: 50%; vertical-align: middle; }

/* Designer area */
.designer-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-lg); margin-top: var(--spacing-sm); padding-top: var(--spacing-md); border-top: 1px solid var(--tile-inner-border); }
.designer-canvas-area { display: flex; align-items: flex-start; justify-content: center; }
.placement-canvas-wrap { position: relative; background: #fff; display: inline-block; max-width: 100%; }
.placement-canvas-wrap canvas { display: block; width: 100%; max-width: 360px; height: auto; cursor: move; }
.designer-sidebar { display: flex; flex-direction: column; gap: var(--spacing-md); }

.design-picker-list { display: flex; flex-wrap: wrap; gap: 8px; }
.design-picker-item { width: 64px; height: 64px; border: 2px solid var(--grey-500); cursor: pointer; padding: 4px; transition: border-color 0.2s; }
.design-picker-item:hover  { border-color: var(--accent-green); }
.design-picker-item.active { border-color: var(--accent-green); background: rgba(152, 196, 110, 0.1); }
.design-picker-item img { width: 100%; height: 100%; object-fit: contain; background: var(--grey-800); }

.designer-controls { display: flex; flex-direction: column; gap: 10px; }
.control-row       { display: flex; align-items: center; gap: 10px; }
.control-row label { font-size: var(--font-sm); color: var(--text-muted); min-width: 75px; }
.control-row input[type="range"] { flex: 1; }

.view-design-status { display: flex; gap: var(--spacing-sm); flex-wrap: wrap; font-size: var(--font-xs); align-items: center; }
.view-status-item   { color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.view-status-item .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--grey-500); display: inline-block; }
.view-status-item.has-design  { color: var(--accent-green); }
.view-status-item.has-design .status-dot { background: var(--accent-green); }

.remove-design-btn { background: none; border: 1px solid var(--accent-red); color: var(--accent-red); font-size: var(--font-xs); font-family: inherit; padding: 4px 10px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.remove-design-btn:hover    { background: var(--accent-red); color: #fff; }
.remove-design-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

/* Presale list */
.presale-item { display: flex; flex-direction: column; gap: var(--spacing-sm); padding: var(--spacing-md); background: var(--tile-inner-bg); border: 1px solid var(--tile-inner-border); margin-bottom: var(--spacing-sm); position: relative; }
.presale-info    { min-width: 0; }
.presale-info h3 { margin: 0 0 4px; font-size: var(--font-md); }
.presale-meta    { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--font-sm); color: var(--text-muted); }
.presale-meta a  { color: var(--accent-green); }
.presale-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-page .status-badge { position: absolute; top: var(--spacing-sm); right: var(--spacing-sm); }
.status-badge.active { background: rgba(152, 196, 110, 0.2); color: var(--accent-green); border: 1px solid var(--accent-green); }
.status-badge.draft  { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); border: 1px solid var(--grey-500); }

.empty-state  { text-align: center; padding: 40px; color: var(--text-muted); }
.success-msg  { background: rgba(152, 196, 110, 0.1); border: 1px solid var(--accent-green); color: var(--accent-green); padding: var(--spacing-sm); margin-bottom: var(--spacing-md); }
.presale-error-msg { background: rgba(214, 73, 73, 0.1); border: 1px solid var(--accent-red); color: var(--accent-red); padding: var(--spacing-sm); margin-bottom: var(--spacing-md); }

.card-header-row    { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--spacing-md); }
.card-header-row h2 { margin: 0; }

/* Staging area (selected products bar) */
.staging-area  { background: var(--grey-700); border: 1px solid var(--grey-500); padding: var(--spacing-md); margin-top: var(--spacing-md); }
.staging-count { font-size: var(--font-sm); color: var(--text-secondary); margin-bottom: var(--spacing-sm); }

.add-product-tile { background: transparent; border: 2px dashed var(--grey-500); padding: var(--spacing-md); text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80px; }
.add-product-tile:hover { border-color: var(--accent-green); background: rgba(152, 196, 110, 0.05); }
.add-product-tile .add-icon  { font-size: 32px; color: var(--text-muted); line-height: 1; margin-bottom: 8px; }
.add-product-tile:hover .add-icon  { color: var(--accent-green); }
.add-product-tile .add-label { font-size: var(--font-sm); color: var(--text-muted); }
.add-product-tile:hover .add-label { color: var(--accent-green); }

/* Edit details modal */
.edit-details-overlay {
  display: none;
  position: fixed;
  inset: 0;
  padding: var(--spacing-md);
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.edit-details-modal {
  background: var(--grey-700);
  border: 1px solid var(--grey-500);
  padding: var(--spacing-lg);
  max-width: 560px;
  width: 90%;
  max-height: calc(100dvh - (var(--spacing-md) * 2));
  overflow-y: auto;
  box-sizing: border-box;
  overscroll-behavior: contain;
}
.edit-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}
.edit-details-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}
.edit-details-actions {
  display: flex;
  gap: 8px;
  margin-top: var(--spacing-md);
}

/* Presale responsive */
@media (max-width: 768px) {
  .presale-form-row { grid-template-columns: 1fr; }
  .designer-layout  { grid-template-columns: 1fr; }
  .design-library-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ===================================================================
   STORE PAGE
=================================================================== */
.store-error-page    { text-align: center; padding: 80px 20px; }
.store-error-msg     { color: var(--text-muted); margin-bottom: var(--spacing-md); }
.store-page-container { max-width: 1100px; }

/* ===================================================================
   ARTICLE CTA
=================================================================== */
.article-cta         { text-align: center; margin-top: var(--spacing-lg); }
.no-results-full { grid-column: 1 / -1; }
.approval-confirmed {
  text-align: center;
  padding: 30px;
}
.approval-confirmed h3 {
  color: var(--accent-green);
  margin-bottom: 15px;
}
.approval-confirmed p {
  color: #ccc;
  line-height: 1.6;
}

/* ===================================================================
   PRODUCTS / APPAREL PAGE
=================================================================== */

.products-page {
  background: #1a1a1a url('/assets/background.png') repeat;
  min-height: 100vh;
}

.products-hero {
  background: var(--grey-800);
  border-bottom: 1px solid var(--grey-700);
}

.products-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

.products-hero .section-label { font-size: var(--font-sm); margin-bottom: 10px; }

.products-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0 0 14px 0;
  font-weight: 700;
}

.products-hero-lead {
  color: var(--grey-200);
  font-size: 18px;
  line-height: 1.5;
  max-width: 640px;
  margin: 0 0 18px;
}

.products-hero-note {
  display: inline-block;
  color: var(--grey-300);
  font-size: var(--font-sm);
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--accent-green);
}

/* Search & Filters */
.products-controls {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  background: var(--grey-800);
  border-bottom: 1px solid var(--grey-700);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 11px;
  color: var(--grey-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  background: var(--grey-700);
  border: 1px solid var(--grey-600);
  color: #fff;
  font-size: 14px;
}

.search-box input::placeholder { color: var(--grey-400); }
.search-box input:focus        { outline: none; border-color: var(--accent-green); }

.filter-select {
  padding: 10px 32px 10px 14px;
  background: var(--grey-700);
  border: 1px solid var(--grey-600);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 150px;
}

.filter-select:focus     { outline: none; border-color: var(--accent-green); }
.filter-select.has-value { border-color: var(--accent-green); background-color: rgba(152, 196, 110, 0.1); }

.results-info  { margin-left: auto; text-align: right; }
.results-count { color: #fff; font-size: 14px; font-weight: 600; }
.active-filters { color: var(--accent-green); font-size: 12px; margin-top: 2px; }

.clear-filters {
  background: none;
  border: none;
  color: var(--grey-400);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: 4px;
}

.clear-filters:hover { color: #fff; }

/* Products Grid */
.products-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

/* Product Card */
.product-card {
  background: var(--grey-800);
  border: 1px solid var(--grey-700);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-green);
}

.product-image {
  aspect-ratio: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.product-info    { padding: 20px; }

.product-brand {
  color: var(--accent-green);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.product-title {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-style {
  color: var(--grey-400);
  font-size: 13px;
  margin-bottom: 12px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-colors { display: flex; gap: 4px; }

.product-price {
  color: var(--accent-green);
  font-weight: 600;
  margin-bottom: 8px;
}

.garment-price-note {
  color: var(--grey-400);
  font-size: var(--font-sm);
  line-height: 1.5;
  margin-bottom: 12px;
}

.garment-price-table { width: 100%; border-collapse: collapse; }
.garment-price-table th, .garment-price-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--tile-outer-border);
}

.color-dot {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255,255,255,0.2);
}

.color-more {
  color: var(--grey-400);
  font-size: 12px;
  line-height: 16px;
}

/* Loading State — large spinner variant */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.loading-spinner .spinner {
  width: 50px;
  height: 50px;
  border-color: var(--grey-700);
  border-top-color: var(--accent-green);
}

/* No Results */
.no-results     { text-align: center; padding: 60px 20px; color: var(--grey-400); }
.no-results h3  { color: #fff; margin-bottom: 10px; }

/* Product Modal */
.product-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 20px;
}

.product-modal.active { display: block; }

.product-modal .modal-content {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--grey-800);
  border: 1px solid var(--grey-700);
  padding: 0;
}

.product-modal .modal-close {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: var(--grey-800);
  border: 1px solid var(--grey-700);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal .modal-close:hover { background: var(--grey-700); }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.modal-image {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  align-self: start;
  position: sticky;
  top: 0;
  aspect-ratio: 1 / 1;
}

.modal-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-details { padding: 36px 40px; }

.modal-brand {
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.modal-title {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-style {
  color: var(--grey-400);
  font-size: 15px;
  margin-bottom: 20px;
}

.modal-price-block {
  padding: 16px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--grey-700);
  border-bottom: 1px solid var(--grey-700);
}

.modal-price {
  color: var(--text-primary);
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-price-block .garment-price-note { margin-bottom: 0; }

.modal-section       { margin-bottom: 24px; }

.modal-section-title {
  color: var(--grey-300);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.color-swatches { display: flex; flex-wrap: wrap; gap: 6px; }

.color-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--grey-600);
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
}

.color-swatch:hover,
.color-swatch.selected { border-color: var(--accent-green); }

.color-swatch:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 2px; }

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

.selected-color-name {
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.size-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.size-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  background: var(--tile-inner-bg);
  border: 1px solid var(--grey-600);
}

.size-price-label {
  color: var(--grey-300);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.size-price-value {
  color: var(--text-primary);
  font-size: var(--font-base);
  font-weight: 700;
}

.modal-description {
  color: var(--grey-200);
  font-size: 14px;
  line-height: 1.6;
}

.modal-description ul { margin: 0; padding-left: 18px; }
.modal-description li { margin-bottom: 4px; }

/* Load More */
.load-more-container { text-align: center; padding: 40px 20px; }

/* Products responsive */
@media (max-width: 768px) {
  .filter-row        { flex-direction: column; align-items: stretch; }
  .filter-group      { width: 100%; }
  .filter-select     { width: 100%; min-width: unset; }
  .search-box        { min-width: unset; max-width: none; width: 100%; }

  .results-info {
    margin-left: 0;
    text-align: center;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--grey-700);
    margin-top: 5px;
  }

  .modal-body       { grid-template-columns: 1fr; }
  .modal-image      { position: static; aspect-ratio: auto; height: 300px; padding: 20px; }
  .modal-details    { padding: 24px 20px; }
  .product-modal    { padding: 76px 10px 20px; }

  .products-grid    { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .product-info     { padding: 12px; }
  .product-title    { font-size: 14px; }
  .products-hero-inner { padding: 36px 20px 28px; }
  .products-hero h1    { font-size: var(--font-xl); }
  .products-hero-lead  { font-size: var(--font-base); }
}

/* =====================================================================
   PART 2 - ADMIN-UI DESIGN SYSTEM
   ===================================================================== */
/* =====================================================================
   ADMIN UI — shared visual system for admin pages.
   Opt in with <body class="admin-ui">. Loads after styles.css.
   Sections:
     1. Tokens          6. Drawers & tabs      11. Line items
     2. Base            7. Cards & headers     12. Garment cards
     3. Typography      8. Modals              13. Quote totals & menus
     4. Form controls   9. Ticket summary      14. Responsive (900 / 768 / 640)
     5. Buttons        10. Size table
   ===================================================================== */

/* 1. TOKENS ---------------------------------------------------------- */
body.admin-ui {
    /* Charcoal grays, darkest to lightest. Only these four. */
    --ui-canvas: #1a1a1a;
    --ui-surface: #222;
    --ui-raised: #2a2a2a;
    --ui-border: #444;

    --ui-text: #fff;
    --ui-accent: #98c46e;
    --ui-danger: #d64949;
    --ui-overlay: rgba(26, 26, 26, 0.92);

    --ui-font-body: 13px;
    --ui-font-label: 13px;
    --ui-font-title: 14px;
    --ui-font-emphasis: 15px;
    --ui-font-icon: 16px;
    --ui-label-opacity: 0.6;

    --ui-control-height: 34px;
    --ui-header-height: 52px;
    --ui-pad: 20px;
    --ui-pad-inner: 14px;
    --ui-gap: 8px;
    --ui-gap-lg: 12px;

    background-color: var(--ui-canvas);
    color: var(--ui-text);
}

/* 2. BASE ------------------------------------------------------------ */
body.admin-ui,
body.admin-ui * {
    border-radius: 0 !important;
}

body.admin-ui :is(h1, h2, h3, h4, h5, h6, p, label, span, strong) {
    color: inherit;
}

body.admin-ui :is(a, .file-link, .file-name) {
    color: var(--ui-accent);
}

body.admin-ui :is(a, .file-link, .file-name):hover {
    color: var(--ui-text);
}

body.admin-ui .d-none {
    display: none !important;
}

body.admin-ui .main-nav {
    background: var(--ui-surface);
    border: 0;
}

body.admin-ui :is(.nav-links a, .nav-info-item, .nav-info-divider, .mobile-fab, .mobile-menu a) {
    color: var(--ui-text);
}

body.admin-ui :is(.nav-links a:hover, .nav-info-item, .mobile-fab:hover) {
    color: var(--ui-accent);
}

body.admin-ui .mobile-menu {
    background: var(--ui-overlay);
}

body.admin-ui .mobile-call-btn {
    background: var(--ui-accent);
    border-color: var(--ui-accent);
    color: var(--ui-canvas);
}

body.admin-ui .mobile-call-btn:hover {
    background: var(--ui-surface);
    color: var(--ui-accent);
}

body.admin-ui :is(.modal-overlay, .mobile-menu-overlay.open) {
    background: var(--ui-overlay);
}

body.admin-ui .mobile-admin-btn {
    color: var(--ui-text);
}

body.admin-ui .mobile-admin-btn svg {
    fill: currentColor;
}

body.admin-ui :is(.mobile-admin-btn.active, .mobile-admin-btn:hover) {
    color: var(--ui-accent);
}

/* 3. TYPOGRAPHY ------------------------------------------------------ */
/* Legacy styles.css sizes vary widely; these four rules are the whole type scale. */
body.admin-ui :is(.ticket-detail-page, .invoice-modal, .proof-modal-content, .po-modal-content, .ticket-field-modal, .ticket-files-panel, .admin-menu-panel, .pricing-panel, .mobile-admin-bar, .mobile-menu-content, .add-item-menu),
body.admin-ui :is(.ticket-detail-page, .invoice-modal, .proof-modal-content, .po-modal-content, .ticket-field-modal, .ticket-files-panel, .admin-menu-panel, .pricing-panel, .mobile-admin-bar, .mobile-menu-content, .add-item-menu) * {
    font-size: var(--ui-font-body) !important;
}

body.admin-ui :is(.ticket-detail-page label, .invoice-modal .form-row label, .ticket-field-modal-label, .detail-label, .line-field > span:first-child, .garment-field > span:first-child, .totals-row label, .invoice-modal .line-items-header span, .admin-menu-label, .mobile-menu-label, .pricing-table th, .fee-item .label, .multiplier-item .label) {
    color: var(--ui-text);
    font-size: var(--ui-font-label) !important;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.admin-ui :is(.ticket-detail-page label, .invoice-modal .form-row label, .ticket-field-modal-label, .detail-label, .line-field > span:first-child, .garment-field > span:first-child, .totals-row label, .admin-menu-label, .mobile-menu-label, .ticket-files-loading, .ticket-files-empty, .proof-empty, .proof-modal-label, .proof-modal-note, .proof-tile-status, .customer-home .text-muted-light, .proof-status-msg, .approve-both-note, .pricing-subtitle, .pricing-table .na, .fee-item .label, .multiplier-item .label, .presale-shop .presale-image-status) {
    opacity: var(--ui-label-opacity);
}

body.admin-ui :is(.card > h3, .option-card-header, .proof-card-header, .portal-card-header, .studio-dialog-header, .sizes-card > .collapsible-toggle, .modal-header, .modal-content:not(.invoice-modal) > h3, .ticket-field-modal-header h3, .pricing-header h2, .pricing-fees h3, .pricing-multipliers h3) {
    font-size: var(--ui-font-title) !important;
}

body.admin-ui :is(.invoice-modal .total-amount, .invoice-modal .invoice-total-bar .total-label) {
    font-size: var(--ui-font-emphasis) !important;
}

body.admin-ui :is(.detail-value, .style-info, .invoice-number, .ticket-file-row, .po-file-item, .pricing-table td, .fee-item, .multiplier-item) {
    font-weight: 400;
}

body.admin-ui :is(.row-total, .grand-total-box, .invoice-modal .total-amount, .pricing-header h2, .fee-item .value, .multiplier-item .value) {
    font-weight: 600;
}

body.admin-ui :is(.pricing-header h2, .pricing-table th, .pricing-fees h3, .pricing-multipliers h3, .row-total, .grand-total-box, .sizes-saved-msg, .availability.available) {
    color: var(--ui-accent);
}

body.admin-ui :is(.availability.unavailable, .presale-error, .grand-total-box.total-mismatch, .invoice-status-badge.void, .invoice-status-badge.uncollectible) {
    color: var(--ui-danger);
}

/* Block labels above fields (low specificity so component labels can lay themselves out). */
body.admin-ui :where(.ticket-detail-page, .invoice-modal .form-row) label {
    display: block;
    margin-bottom: 6px;
}

.presale-form,
.presale-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ui-gap-lg);
}

.presale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--ui-pad);
}

.presale-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--ui-gap-lg);
}

.presale-form :is(input:not([type="checkbox"]):not([type="color"]), select, textarea) {
    width: 100%;
    margin: 0;
}

.presale-grid > div > label {
    display: block;
    margin-bottom: var(--ui-gap);
}

.presale-consent {
    display: flex;
    align-items: flex-start;
    gap: var(--ui-gap);
    text-transform: none !important;
}

.presale-product-image {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: var(--ui-pad-inner);
}

.presale-logo {
    display: block;
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    object-position: left;
    margin-bottom: var(--ui-pad-inner);
}

/* Approved standalone public store exception: no card or site chrome.
   All overrides are scoped to this page; brand tokens are set after validation. */
body.admin-ui.presale-shop {
    --ui-canvas: var(--grey-100);
    --ui-surface: var(--grey-100);
    --ui-raised: var(--grey-100);
    --ui-text: var(--grey-800);
    --ui-border: var(--grey-800);
    --ui-accent: var(--grey-800);
    --ui-label-opacity: 1;
    background: var(--ui-canvas);
    color: var(--ui-text);
    padding-top: 0;
}

body.admin-ui.presale-shop .presale-storefront {
    padding: var(--ui-pad);
    margin: 0 auto;
}

body.admin-ui.presale-shop .presale-masthead {
    padding: var(--ui-pad) 0;
    margin-bottom: var(--ui-pad);
}

body.admin-ui.presale-shop .presale-masthead h1 {
    font-size: var(--font-xl);
    color: inherit;
    margin: 0 0 var(--ui-gap-lg);
}

body.admin-ui.presale-shop .presale-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

body.admin-ui.presale-shop .presale-product {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ui-gap);
}

body.admin-ui.presale-shop .presale-product h2 {
    font-size: var(--font-md);
    color: inherit;
    margin: var(--ui-gap) 0 0;
}

body.admin-ui.presale-shop .presale-product p {
    margin: 0;
    overflow-wrap: anywhere;
}

body.admin-ui.presale-shop .presale-product-image {
    aspect-ratio: 1;
    object-fit: contain;
    margin: 0 0 var(--ui-gap);
}

body.admin-ui.presale-shop .presale-order-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--ui-gap);
}

body.admin-ui.presale-shop .presale-order-step > :not(summary) {
    margin-top: var(--ui-gap-lg);
}

body.admin-ui.presale-shop summary {
    cursor: pointer;
}

body.admin-ui.presale-shop .presale-error {
    color: inherit;
}

body.admin-ui.presale-shop .presale-consent {
    display: flex;
}

/* 4. FORM CONTROLS --------------------------------------------------- */
/* !important beats styles.css's white input backgrounds at higher specificity. */
body.admin-ui :is(input, textarea, select) {
    background-color: var(--ui-raised) !important;
    border: 1px solid var(--ui-border);
    border-color: var(--ui-border) !important;
    box-sizing: border-box;
    color: var(--ui-text) !important;
}

body.admin-ui :is(input, select) {
    height: var(--ui-control-height);
    padding: 0 10px;
}

body.admin-ui textarea {
    min-height: 112px;
    padding: 10px 12px;
}

body.admin-ui :is(input, textarea, select):focus {
    border-color: var(--ui-accent) !important;
    box-shadow: 0 0 0 1px var(--ui-accent);
    outline: none;
}

body.admin-ui :is(input, textarea)::placeholder {
    color: var(--ui-text);
    opacity: 0.45;
}

body.admin-ui select option {
    background: var(--ui-raised);
    color: var(--ui-text);
}

body.admin-ui input[type="checkbox"] {
    accent-color: var(--ui-accent);
    height: 14px;
    margin: 0;
    padding: 0;
    width: 14px;
}

body.admin-ui input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

body.admin-ui input[type="number"]::-webkit-inner-spin-button,
body.admin-ui input[type="number"]::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

body.admin-ui .currency-input {
    display: contents;
}

body.admin-ui .currency-symbol {
    display: none;
}

/* 5. BUTTONS --------------------------------------------------------- */
button,
button *,
.btn,
.btn *,
.toggle-btn,
.toggle-btn *,
input:is([type="button"], [type="submit"], [type="reset"]),
input[type="file"]::file-selector-button {
    text-transform: none !important;
}

body.admin-ui :is(.btn, .toggle-btn) {
    align-items: center;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    box-sizing: border-box;
    color: var(--ui-text);
    cursor: pointer;
    display: inline-flex;
    font-weight: 500;
    gap: 6px;
    height: var(--ui-control-height);
    justify-content: center;
    line-height: 1;
    margin: 0;
    min-height: 0;
    padding: 0 14px;
    white-space: nowrap;
}

body.admin-ui :is(.btn:hover, .btn:focus-visible, .toggle-btn:hover, .toggle-btn.active) {
    background: var(--ui-accent);
    border-color: var(--ui-accent);
    color: var(--ui-canvas);
    outline: none;
}

/* Native file inputs: render the picker button exactly like .btn so every
   "Choose Files" control on the site matches the Create Ticket button. */
body.admin-ui input[type="file"] {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--ui-text) !important;
    cursor: pointer;
    font: inherit;
    font-size: var(--ui-font-body);
    height: auto;
    max-width: 100%;
    padding: 0;
}

body.admin-ui input[type="file"]::file-selector-button {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: 0;
    box-sizing: border-box;
    color: var(--ui-text);
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    height: var(--ui-control-height);
    line-height: 1;
    margin: 0 var(--ui-gap-lg) 0 0;
    padding: 0 14px;
}

body.admin-ui input[type="file"]:is(:hover, :focus-visible)::file-selector-button {
    background: var(--ui-accent);
    border-color: var(--ui-accent);
    color: var(--ui-canvas);
}

body.admin-ui input[type="file"]:focus-visible {
    outline: 1px solid var(--ui-text);
    outline-offset: 2px;
}

/* Menu buttons: full-width, left-aligned list items at the standard height. */
body.admin-ui :is(.admin-nav-btn, .mobile-menu-btn) {
    justify-content: flex-start;
    width: 100%;
}

/* Red square icon buttons: delete and close. */
body.admin-ui :is(.btn-delete, .btn-remove-line, .close-pricing-btn, .ticket-field-modal-close, .modal-close, .mobile-menu-close) {
    align-items: center;
    background: var(--ui-danger);
    border: 0;
    color: var(--ui-text);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: var(--ui-font-emphasis) !important;
    height: var(--ui-control-height);
    justify-content: center;
    line-height: 1;
    margin: 0;
    min-width: var(--ui-control-height);
    padding: 0;
    position: static;
    transition: none;
    width: var(--ui-control-height);
}

body.admin-ui :is(.btn-delete, .btn-remove-line, .close-pricing-btn, .ticket-field-modal-close, .modal-close, .mobile-menu-close):hover {
    background: var(--ui-danger);
    color: var(--ui-text);
    filter: brightness(1.15);
}

body.admin-ui :is(.btn-delete, .btn-remove-line, .close-pricing-btn, .ticket-field-modal-close, .modal-close, .mobile-menu-close):focus-visible {
    outline: 1px solid var(--ui-text);
    outline-offset: 2px;
}

/* Inline pencil icon next to editable values. */
body.admin-ui .edit-field-btn {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ui-accent);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 22px;
    height: 22px;
    justify-content: center;
    opacity: 1;
    padding: 0;
    width: 22px;
}

body.admin-ui .edit-field-btn:focus-visible {
    outline: 1px solid var(--ui-accent);
    outline-offset: 2px;
}

/* Button rows. */
body.admin-ui :is(.modal-actions, .po-modal-actions, .ticket-field-modal-actions, .garment-line-item-actions, .quote-actions) {
    align-items: center;
    border: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ui-gap);
}

body.admin-ui :is(.modal-actions, .po-modal-actions, .ticket-field-modal-actions) {
    justify-content: flex-end;
}

/* 6. DRAWERS & TABS -------------------------------------------------- */
body.admin-ui :is(.pricing-panel-content, .admin-menu-content, .ticket-files-panel, .mobile-admin-bar, .mobile-menu-content) {
    background: var(--ui-surface);
    border-color: var(--ui-border);
    color: var(--ui-text);
}

/* Each tab keeps its own color; all share one rollover (grow outward + brighten). */
body.admin-ui :is(.pricing-panel-tab, .ticket-files-tab, .admin-menu-tab) {
    border: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    color: var(--ui-text);
    filter: none;
    transition: width 0.15s ease, left 0.15s ease, right 0.15s ease, filter 0.15s ease;
    width: 36px;
}

body.admin-ui .pricing-panel-tab { background: var(--ui-danger); left: -36px; }
body.admin-ui .ticket-files-tab { background: var(--ui-accent); color: var(--ui-canvas); left: -36px; }
body.admin-ui .admin-menu-tab { background: var(--ui-border); right: -36px; }

body.admin-ui :is(.pricing-panel-tab, .ticket-files-tab, .admin-menu-tab):is(:hover, :focus-visible) {
    filter: brightness(1.15);
    outline: none;
    width: 44px;
}

body.admin-ui :is(.pricing-panel-tab, .ticket-files-tab):is(:hover, :focus-visible) { left: -44px; }
body.admin-ui .admin-menu-tab:is(:hover, :focus-visible) { right: -44px; }

body.admin-ui :is(.pricing-panel-tab svg, .admin-menu-tab svg) {
    fill: currentColor;
}

body.admin-ui .ticket-files-tab svg {
    fill: none;
    stroke: currentColor;
}

body.admin-ui .close-pricing-btn {
    position: absolute;
    right: 9px;
    top: 9px;
}

body.admin-ui :is(.pricing-header, .pricing-fees h3, .pricing-multipliers h3, .admin-menu-divider) {
    border: 0;
}

body.admin-ui :is(.pricing-table th, .pricing-table td, .fee-item, .multiplier-item) {
    border-color: var(--ui-border);
}

body.admin-ui :is(.pricing-table th, .pricing-table tbody tr:nth-child(even), .pricing-table tbody tr:hover, .pricing-table td:first-child, .fee-item, .multiplier-item) {
    background: var(--ui-canvas);
    color: var(--ui-text);
}

/* 7. CARDS & HEADERS ------------------------------------------------- */
body.admin-ui :is(.ticket-detail-page .card, .customer-home .card, .pricing-options-container .option-card, .modal-content) {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    box-shadow: none;
    color: var(--ui-text);
    transition: border-color 160ms ease;
}

body.admin-ui :is(.ticket-detail-page .card, .customer-home .card, .pricing-options-container .option-card) {
    padding: var(--ui-pad);
}

body.admin-ui :is(.ticket-detail-page .card, .customer-home .card, .pricing-options-container .option-card):hover {
    border-color: var(--ui-border);
}

body.admin-ui :is(.ticket-detail-page .card, .customer-home .card, .pricing-options-container .option-card, .line-items-table tr:not(.preset-addon-row), .garment-line-items .size-row):focus-within {
    border-color: var(--ui-accent);
}

/* One header style for cards and modals. */
body.admin-ui :is(.card > h3, .option-card-header, .proof-card-header, .portal-card-header, .studio-dialog-header, .sizes-card > .collapsible-toggle, .invoice-modal .modal-header, .modal-content:not(.invoice-modal) > h3, .ticket-field-modal-header) {
    align-items: center;
    background: var(--ui-canvas);
    border: 0;
    box-sizing: border-box;
    color: var(--ui-text);
    display: flex;
    font-weight: 600;
    justify-content: space-between;
    letter-spacing: 0;
    line-height: 1;
    min-height: var(--ui-header-height);
    padding: 0 var(--ui-pad);
    text-transform: uppercase;
}

/* Headers holding a close X: center the X with equal space on top, bottom, and right. */
body.admin-ui :is(.invoice-modal .modal-header, .ticket-field-modal-header, .studio-dialog-header):has(> :is(.modal-close, .ticket-field-modal-close)) {
    padding-right: calc((var(--ui-header-height) - var(--ui-control-height)) / 2);
}

body.admin-ui :is(.card > h3, .option-card-header, .proof-card-header, .portal-card-header, .sizes-card > .collapsible-toggle) {
    margin: calc(-1 * var(--ui-pad)) calc(-1 * var(--ui-pad)) var(--ui-pad);
}

body.admin-ui .modal-content:not(.invoice-modal):not(.ticket-field-modal) > h3 {
    margin: calc(-1 * var(--ui-pad)) calc(-1 * var(--ui-pad)) var(--ui-pad);
}

body.admin-ui :is(.option-card-header h4, .proof-card-header h4, .portal-card-header h4, .studio-dialog-header h2, .modal-header h3, .ticket-field-modal-header h3) {
    color: inherit;
    font: inherit;
    margin: 0;
    text-transform: inherit;
}

body.admin-ui :is(.garment-section, .detail-row-full) {
    border-bottom: 0;
    border-top: 0;
}

/* Garment groups are data containers; the nested Line Items card is the visible surface. */
body.admin-ui .ticket-detail-page .garment-group {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: var(--ui-pad) 0;
    padding: 0;
}

body.admin-ui .ticket-detail-page .garment-group > h3,
body.admin-ui .ticket-detail-page .garment-group > .garment-section:has(.quote-garments-mirror) {
    display: none;
}

body.admin-ui .ticket-detail-page .garment-group > .garment-group-remove-btn {
    position: absolute;
    right: var(--ui-gap);
    top: var(--ui-gap);
}

/* 8. MODALS ---------------------------------------------------------- */
body.admin-ui .invoice-modal {
    padding: 0;
}

body.admin-ui :is(.invoice-modal .invoice-section, .invoice-modal .line-items-header, .invoice-modal .invoice-total-bar) {
    border-color: var(--ui-border);
    color: var(--ui-text);
}

body.admin-ui .ticket-field-modal {
    max-width: min(520px, calc(100vw - 32px));
    padding: 0;
    width: 100%;
}

body.admin-ui .ticket-field-modal-body {
    display: grid;
    gap: var(--ui-gap);
    padding: var(--ui-pad);
}

body.admin-ui .ticket-field-modal-label {
    display: block;
    margin: 0;
}

body.admin-ui .ticket-field-modal-input {
    width: 100%;
}

body.admin-ui textarea.ticket-field-modal-input {
    min-height: 140px;
    resize: vertical;
}

body.admin-ui .ticket-field-modal-error {
    color: var(--ui-danger);
    margin: 0;
}

body.admin-ui .ticket-field-modal-error:empty {
    display: none;
}

body.admin-ui .ticket-field-modal-actions {
    padding: 0 var(--ui-pad) var(--ui-pad);
}

/* 9. TICKET SUMMARY -------------------------------------------------- */
body.admin-ui #ticketInfo .ticket-info-grid {
    display: grid;
    gap: var(--ui-gap-lg) 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.admin-ui #ticketInfo .detail-row {
    background: var(--ui-canvas);
    border: 1px solid var(--ui-border);
    min-height: 68px;
    min-width: 0;
    padding: 10px var(--ui-gap-lg);
    transition: border-color 160ms ease;
}

body.admin-ui #ticketInfo .detail-row:focus-within {
    border-color: var(--ui-accent);
}

body.admin-ui #ticketInfo .detail-row-job-name {
    grid-column: span 2;
}

body.admin-ui #ticketInfo .detail-row-full {
    margin: var(--ui-gap-lg) 0 0;
    min-height: 82px;
}

body.admin-ui #ticketInfo .detail-label {
    margin-bottom: 5px;
}

body.admin-ui #ticketInfo .detail-value {
    color: var(--ui-text);
    line-height: 1.4;
    min-height: 20px;
}

body.admin-ui #ticketInfo .editable-field {
    align-items: flex-start;
    cursor: pointer;
    gap: var(--ui-gap);
}

body.admin-ui #ticketInfo .editable-text {
    overflow-wrap: anywhere;
}

body.admin-ui #ticketInfo .inline-edit-input {
    flex: 1;
    min-width: 0;
}

body.admin-ui :is(.invoice-status-badge.sent, .invoice-status-badge.open, .invoice-status-badge.draft) {
    background: var(--ui-canvas);
    border-color: var(--ui-border);
    color: var(--ui-text);
}

body.admin-ui .invoice-status-badge.paid {
    background: var(--ui-canvas);
    border-color: var(--ui-accent);
    color: var(--ui-accent);
}

body.admin-ui :is(.invoice-status-badge.void, .invoice-status-badge.uncollectible) {
    background: var(--ui-canvas);
    border-color: var(--ui-danger);
}

/* 10. SIZE TABLE ----------------------------------------------------- */
body.admin-ui .size-table {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
    min-width: 610px;
    table-layout: fixed;
    width: 100%;
}

body.admin-ui .size-table :is(th, td) {
    background: var(--ui-canvas);
    border-color: var(--ui-border);
    box-sizing: border-box;
    color: var(--ui-text);
    vertical-align: middle;
}

body.admin-ui .size-table input.qty {
    border: 0;
    min-width: 0;
}

body.admin-ui .size-table input.qty:focus {
    box-shadow: inset 0 0 0 1px var(--ui-accent);
}

body.admin-ui :is(.grand-total-box, .row-total) {
    background: var(--ui-canvas);
    border-color: var(--ui-accent);
}

body.admin-ui :is(.grand-total-box.total-mismatch, .size-row.sizes-incomplete .size-table, .size-row.sizes-incomplete .qty) {
    background: var(--ui-canvas);
    border-color: var(--ui-danger);
}

/* 11. LINE ITEMS ----------------------------------------------------- */
/* Table rows and garment cards share one flex list; JS sets each item's `order`. */
body.admin-ui .pricing-options-container {
    gap: var(--ui-gap-lg);
}

body.admin-ui .line-items-list {
    display: flex;
    flex-direction: column;
}

body.admin-ui .line-items-table,
body.admin-ui .line-items-table > tbody {
    display: block;
    width: 100%;
}

body.admin-ui .line-items-list > .line-items-table,
body.admin-ui .line-items-list > .line-items-table > tbody,
body.admin-ui .line-items-list > .garment-line-items,
body.admin-ui .line-items-list > .garment-line-items > .size-rows {
    display: contents;
}

body.admin-ui .line-items-table thead,
body.admin-ui .option-card[data-option="A"] .line-items-table tr[data-garment-key] {
    display: none !important;
}

body.admin-ui .line-items-table tr:not(.preset-addon-row) {
    align-items: end;
    background: var(--ui-canvas);
    border: 1px solid var(--ui-border);
    display: grid;
    gap: var(--ui-gap-lg);
    grid-template-areas: "description qty rate total remove";
    grid-template-columns: minmax(0, 1fr) 80px 110px 110px 120px;
    margin: 0 0 var(--ui-pad-inner);
    padding: var(--ui-pad-inner);
    position: relative;
}

body.admin-ui .line-items-table tr:not(.preset-addon-row) > td {
    align-self: end;
    background: transparent;
    border: 0;
    display: block;
    margin: 0;
    min-width: 0;
    overflow: visible;
    padding: 0;
    text-align: left;
    width: auto;
}

body.admin-ui .line-items-table tr:not(.preset-addon-row) > td::before {
    content: none;
}

body.admin-ui .line-items-table tr:not(.preset-addon-row) > td:nth-child(1) { display: flex; gap: 10px; align-items: end; grid-area: description; }
body.admin-ui .line-items-table tr:not(.preset-addon-row) > td:nth-child(2) { grid-area: qty; }
body.admin-ui .line-items-table tr:not(.preset-addon-row) > td:nth-child(3) { grid-area: rate; }
body.admin-ui .line-items-table tr:not(.preset-addon-row) > td:nth-child(4) { grid-area: total; }
body.admin-ui .line-items-table tr:not(.preset-addon-row) > td.del-cell { display: flex; gap: 6px; grid-area: remove; justify-content: flex-end; }

body.admin-ui :is(.duplicate-item-btn, .duplicate-garment-btn) {
    font-size: var(--ui-font-label) !important;
    margin: 0;
    padding: 0 8px !important;
    white-space: nowrap;
}

/* Labeled field: label row above a control row. */
body.admin-ui :is(.line-field, .garment-field) {
    display: grid;
    gap: 4px;
    grid-template-rows: 14px var(--ui-control-height);
    margin: 0;
    min-width: 0;
    width: 100%;
}

body.admin-ui :is(.line-field, .garment-field) > span:first-child {
    align-self: end;
    line-height: 1;
}

body.admin-ui :is(.line-field, .garment-field) > :is(input, select, .style-picker-wrapper) {
    max-width: none;
    min-width: 0;
    width: 100%;
}

body.admin-ui .line-description-field {
    flex: 1 1 auto;
}

body.admin-ui .line-colors-field {
    flex: 0 0 68px;
}

/* Light-ink checkbox row, visually attached to the printing card above it. */
body.admin-ui .line-items-table tr.preset-addon-row {
    background: var(--ui-canvas);
    border: 1px solid var(--ui-border);
    border-top: 0;
    display: block;
    margin: calc(-1 * var(--ui-pad-inner) - 1px) 0 var(--ui-pad-inner);
    padding: 6px var(--ui-pad-inner) 10px calc(var(--ui-pad-inner) + 30px);
}

body.admin-ui .line-items-table tr.preset-addon-row > td {
    background: transparent;
    border: 0;
    display: block;
    padding: 0;
}

body.admin-ui .preset-light-ink-label {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    gap: var(--ui-gap);
    height: 24px;
    margin: 0;
    white-space: nowrap;
    width: max-content;
}

/* Alternating shades: odd = canvas, even = surface; raised inputs stay distinct on both. */
body.admin-ui :is(.line-items-table tr.alt, .garment-line-items .size-row.alt) {
    background: var(--ui-surface);
}

/* Drag handles (line items and garment cards). */
body.admin-ui .line-item-drag-handle {
    align-items: center;
    align-self: end;
    background: transparent;
    border: 0;
    color: var(--ui-text);
    cursor: grab;
    display: inline-flex;
    flex: 0 0 20px;
    font-size: var(--ui-font-icon) !important;
    height: var(--ui-control-height);
    justify-content: center;
    margin: 0;
    opacity: 0.5;
    padding: 0;
    position: static;
    transform: none;
    width: 20px;
}

body.admin-ui .line-item-drag-handle:active {
    cursor: grabbing;
}

body.admin-ui .line-item-dragging {
    opacity: 0.45;
}

/* 12. GARMENT CARDS -------------------------------------------------- */
body.admin-ui .garment-line-items .size-row {
    background: var(--ui-canvas);
    border: 1px solid var(--ui-border);
    margin: 0 0 var(--ui-pad-inner);
    padding: var(--ui-pad-inner);
    position: relative;
}

body.admin-ui .garment-line-items .size-row-header {
    align-items: end;
    display: grid;
    gap: var(--ui-gap-lg);
    grid-template-areas: "handle style color rate remove";
    grid-template-columns: 20px minmax(0, 1fr) 170px 110px max-content;
    margin: 0 0 var(--ui-pad-inner);
    padding: 0;
}

body.admin-ui .garment-line-items .garment-drag-handle { grid-area: handle; }
body.admin-ui .garment-line-items .garment-style-field { grid-area: style; }
body.admin-ui .garment-line-items .garment-color-field { grid-area: color; }
body.admin-ui .garment-line-items .garment-rate-field { grid-area: rate; }
body.admin-ui .garment-line-items .size-row-header > .btn-delete { grid-area: remove; justify-self: end; }

body.admin-ui .garment-item-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    grid-area: remove;
    justify-content: flex-end;
}

body.admin-ui .garment-line-items .style-picker-wrapper {
    display: block;
    position: relative;
}

body.admin-ui .garment-line-items .style-picker-wrapper input {
    margin: 0;
    width: 100%;
}

body.admin-ui .ticket-detail-page .style-results {
    background: var(--ui-raised);
    border: 1px solid var(--ui-border);
    color: var(--ui-text);
}

body.admin-ui .style-result:hover {
    background: var(--ui-border);
}

body.admin-ui .garment-line-items .size-table-container {
    margin: 0;
    overflow-x: auto;
}

/* 13. QUOTE TOTALS & MENUS ------------------------------------------ */
body.admin-ui .quote-actions {
    margin: var(--ui-gap-lg) 0 0;
}

body.admin-ui .quote-actions .add-item-btn {
    min-width: 144px;
}

body.admin-ui .sizes-saved-msg {
    margin: 6px 0 0;
    min-height: 16px;
}

body.admin-ui .quote-totals {
    border: 0;
    display: grid;
    gap: var(--ui-gap);
    margin: 16px 0 0 auto;
    padding: 0;
    width: min(100%, 330px);
}

body.admin-ui .quote-totals .totals-row {
    align-items: center;
    display: grid;
    gap: var(--ui-gap-lg);
    grid-template-columns: minmax(0, 1fr) 132px;
    margin: 0;
}

body.admin-ui .quote-totals .totals-row label {
    margin: 0;
}

body.admin-ui .quote-totals .totals-row :is(input, select) {
    max-width: none;
    width: 100%;
}

body.admin-ui .quote-totals .totals-row:last-child {
    color: var(--ui-accent);
}

/* Add Line Item preset menu (appended to <body>). */
body.admin-ui .add-item-menu {
    background: var(--ui-raised);
    border: 1px solid var(--ui-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 4px;
    position: absolute;
    z-index: 1000;
}

body.admin-ui .add-item-menu-option {
    background: transparent;
    border: 0;
    color: var(--ui-text);
    cursor: pointer;
    font: inherit;
    padding: var(--ui-gap) var(--ui-gap-lg);
    text-align: left;
}

body.admin-ui .add-item-menu-option:is(:hover, :focus) {
    background: var(--ui-border);
    color: var(--ui-accent);
    outline: none;
}

body.admin-ui .quote-save-feedback {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ui-gap);
    margin-left: auto;
    min-height: var(--ui-control-height);
}

body.admin-ui .quote-save-status {
    color: var(--ui-text);
    font-size: var(--ui-font-body) !important;
    opacity: var(--ui-label-opacity);
}

body.admin-ui .quote-save-status[data-state="saved"] {
    color: var(--ui-accent);
    opacity: 1;
}

body.admin-ui .quote-save-status[data-state="error"],
body.admin-ui .quote-save-status[data-state="load-error"] {
    color: var(--ui-danger);
    opacity: 1;
}

/* Standard admin pages ---------------------------------------------- */
/* Shared layout for admin pages migrated off the legacy styles.css look.
   Opt in with <body class="admin-ui admin-standard">. Dashboard, Create Ticket,
   and Ticket Details keep their own rules below and do not use this class. */
body.admin-ui.admin-standard .page-container {
    max-width: 900px;
    padding-bottom: var(--ui-pad);
    padding-top: var(--ui-pad);
}

body.admin-ui.admin-standard .page-container .card,
body.admin-ui.admin-standard .page-container .card :is(p, label, input, select, textarea, th, td, li, .btn) {
    font-size: var(--ui-font-body) !important;
}

body.admin-ui.admin-standard .page-container .card {
    backdrop-filter: none;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    box-shadow: none;
    color: var(--ui-text);
    margin-bottom: var(--ui-pad);
    padding: var(--ui-pad);
}

body.admin-ui.admin-standard .page-container .card:hover {
    border-color: var(--ui-border);
}

body.admin-ui.admin-standard .page-container .card:focus-within {
    border-color: var(--ui-accent);
}

/* First heading in a card becomes the charcoal header band. */
body.admin-ui.admin-standard .page-container .card > :is(h1, h2, h3):first-child {
    align-items: center;
    background: var(--ui-canvas);
    color: var(--ui-text);
    display: flex;
    font-size: var(--ui-font-title) !important;
    font-weight: 600;
    gap: var(--ui-gap);
    justify-content: space-between;
    letter-spacing: 0;
    line-height: 1;
    margin: calc(-1 * var(--ui-pad)) calc(-1 * var(--ui-pad)) var(--ui-pad);
    min-height: var(--ui-header-height);
    padding: 0 var(--ui-pad);
    text-transform: uppercase;
}

body.admin-ui.admin-standard .page-container .card > :is(h1, h2, h3):only-child {
    margin-bottom: calc(-1 * var(--ui-pad));
}

body.admin-ui.admin-standard .page-container .card label {
    color: var(--ui-text);
    display: block;
    font-weight: 500;
    letter-spacing: 0;
    margin: var(--ui-gap-lg) 0 6px;
    opacity: var(--ui-label-opacity);
    text-transform: uppercase;
}

body.admin-ui.admin-standard .page-container .card > :is(input, select, textarea) {
    margin: 0;
    width: 100%;
}

body.admin-ui.admin-standard .page-container .card > :is(input, select, textarea) + :is(input, select, textarea) {
    margin-top: var(--ui-gap-lg);
}

body.admin-ui.admin-standard .page-container .card .fullwidth-btn {
    width: 100%;
}

body.admin-ui.admin-standard .page-container .card > p:empty {
    display: none;
}

body.admin-ui.admin-standard .page-container .card .btn {
    margin-top: var(--ui-pad-inner);
}

body.admin-ui.admin-standard .page-container > .btn {
    margin: 0;
}

body.admin-ui.admin-standard .page-container .card table {
    border-collapse: collapse;
    width: 100%;
}

body.admin-ui.admin-standard .page-container .card :is(th, td) {
    border: 0;
    padding: 0 var(--ui-gap) var(--ui-gap) 0;
    text-align: left;
    vertical-align: middle;
}

body.admin-ui.admin-standard .page-container .card th {
    background: transparent;
    color: var(--ui-text);
    font-weight: 500;
    opacity: var(--ui-label-opacity);
    text-transform: uppercase;
}

body.admin-ui.admin-standard .page-container .card :is(th, td):last-child {
    padding-right: 0;
}

body.admin-ui.admin-standard .page-container .card td input {
    margin: 0;
    width: 100%;
}

body.admin-ui.admin-standard .page-container .totals-row {
    align-items: center;
    display: flex;
    gap: var(--ui-gap-lg);
    margin: 0 0 var(--ui-gap);
}

body.admin-ui.admin-standard .page-container .totals-row label {
    flex: 0 0 120px;
    margin: 0;
    min-width: 0;
}

body.admin-ui.admin-standard .page-container .totals-row :is(input, select) {
    flex: 1 1 auto;
    margin: 0;
    width: auto;
}

@media (max-width: 600px) {
    body.admin-ui.admin-standard .page-container .card {
        padding: var(--ui-pad-inner);
    }

    body.admin-ui.admin-standard .page-container .card > :is(h1, h2, h3):first-child {
        margin: calc(-1 * var(--ui-pad-inner)) calc(-1 * var(--ui-pad-inner)) var(--ui-pad-inner);
        padding: 0 var(--ui-pad-inner);
    }

    body.admin-ui.admin-standard .page-container .card > :is(h1, h2, h3):only-child {
        margin-bottom: calc(-1 * var(--ui-pad-inner));
    }
}

/* Create ticket ----------------------------------------------------- */
body.admin-ui.create-ticket-page .page-container {
    max-width: 900px;
    padding-bottom: var(--ui-pad);
    padding-top: var(--ui-pad);
}

body.admin-ui.create-ticket-page .create-ticket-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    box-shadow: none;
    margin: 0 auto;
    max-width: 680px;
    padding: var(--ui-pad);
}

body.admin-ui.create-ticket-page .create-ticket-heading {
    align-items: center;
    background: var(--ui-canvas);
    color: var(--ui-text);
    display: flex;
    font-size: var(--ui-font-title) !important;
    font-weight: 600;
    letter-spacing: 0;
    margin: calc(-1 * var(--ui-pad)) calc(-1 * var(--ui-pad)) var(--ui-pad);
    min-height: var(--ui-header-height);
    padding: 0 var(--ui-pad);
    text-transform: uppercase;
}

body.admin-ui.create-ticket-page #createTicketForm > label {
    color: var(--ui-text);
    display: block;
    font-size: var(--ui-font-label) !important;
    font-weight: 500;
    margin: var(--ui-gap-lg) 0 6px;
    opacity: var(--ui-label-opacity);
    text-transform: uppercase;
}

body.admin-ui.create-ticket-page #createTicketForm .form-row {
    align-items: end;
    gap: var(--ui-gap-lg);
}

body.admin-ui.create-ticket-page #createTicketForm .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    min-width: 0;
}

body.admin-ui.create-ticket-page #createTicketForm .form-group label {
    color: var(--ui-text);
    font-size: var(--ui-font-label) !important;
    font-weight: 500;
    margin: 0;
    opacity: var(--ui-label-opacity);
    text-transform: uppercase;
}

body.admin-ui.create-ticket-page #createTicketForm > :is(input, select, textarea) {
    margin: 0;
    width: 100%;
}

body.admin-ui.create-ticket-page #fileContainer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ui-gap-lg);
}

body.admin-ui.create-ticket-page .artwork-file-button {
    cursor: pointer;
    flex: 0 0 auto;
    margin: 0;
}

body.admin-ui.create-ticket-page .artwork-file-button:focus-visible {
    outline: 1px solid var(--ui-text);
    outline-offset: 2px;
}

body.admin-ui.create-ticket-page .artwork-file-names {
    color: var(--ui-text);
    font-size: var(--ui-font-body) !important;
    min-width: 0;
    overflow-wrap: anywhere;
    opacity: var(--ui-label-opacity);
}

body.admin-ui.create-ticket-page #sourceTicketNumber {
    flex: 1 1 auto;
    margin: 0;
    min-width: 0;
}

body.admin-ui.create-ticket-page #findSourceTicket {
    flex: 0 0 auto;
    margin: 0;
    width: auto;
}

body.admin-ui.create-ticket-page .fullwidth-btn {
    margin: var(--ui-pad-inner) 0 0;
    width: 100%;
}

@media (max-width: 600px) {
    body.admin-ui.create-ticket-page .create-ticket-card {
        padding: var(--ui-pad-inner);
    }

    body.admin-ui.create-ticket-page .create-ticket-heading {
        margin: calc(-1 * var(--ui-pad-inner)) calc(-1 * var(--ui-pad-inner)) var(--ui-pad-inner);
        padding: 0 var(--ui-pad-inner);
    }

    body.admin-ui.create-ticket-page #createTicketForm .form-row {
        align-items: stretch;
    }
}

/* Dashboard --------------------------------------------------------- */
body.admin-ui.dashboard-page .dashboard-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    box-shadow: none;
    max-width: none;
    padding: var(--ui-pad);
    width: 100%;
}

body.admin-ui.dashboard-page .dashboard-search-row {
    margin-bottom: var(--ui-pad-inner);
}

body.admin-ui.dashboard-page .dashboard-search-input {
    font-size: var(--ui-font-body) !important;
    width: 100%;
}

body.admin-ui.dashboard-page :is(.dashboard-loading, .dashboard-empty) {
    color: var(--ui-text);
    opacity: var(--ui-label-opacity);
}

body.admin-ui.dashboard-page .status-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ui-pad);
}

body.admin-ui.dashboard-page .status-group-header {
    color: var(--ui-text);
    font-size: var(--ui-font-title) !important;
    letter-spacing: 0;
    margin: 0 0 var(--ui-gap-lg);
    text-transform: uppercase;
}

body.admin-ui.dashboard-page .status-group-count {
    color: var(--ui-text);
    font-weight: 400;
    margin-left: var(--ui-gap);
    opacity: var(--ui-label-opacity);
}

body.admin-ui.dashboard-page .jobs-list {
    display: flex;
    flex-direction: column;
    gap: var(--ui-gap);
}

body.admin-ui.dashboard-page .jobs-list.drag-over-list {
    background: var(--ui-canvas);
    border-radius: 0;
    min-height: 60px;
    outline: 1px dashed var(--ui-accent);
    outline-offset: -2px;
}

body.admin-ui.dashboard-page .job-card {
    background: var(--ui-canvas);
    border: 1px solid var(--ui-border);
    gap: var(--ui-gap-lg);
    min-height: 56px;
    padding: var(--ui-pad-inner);
    transition: border-color 160ms ease, opacity 160ms ease;
}

body.admin-ui.dashboard-page .job-card:hover {
    background: var(--ui-canvas);
    border-color: var(--ui-accent);
}

body.admin-ui.dashboard-page .job-card.archived-job {
    border-left-color: var(--ui-border);
}

body.admin-ui.dashboard-page .job-card.has-notes {
    border-left-color: var(--ui-accent);
}

body.admin-ui.dashboard-page :is(.job-ticket, .job-customer, .job-name, .job-date) {
    color: var(--ui-text);
    font-size: var(--ui-font-body) !important;
}

body.admin-ui.dashboard-page .job-ticket {
    color: var(--ui-accent);
    font-weight: 600;
}

body.admin-ui.dashboard-page .job-label {
    color: var(--ui-text);
    font-size: var(--ui-font-label) !important;
    opacity: var(--ui-label-opacity);
    text-transform: uppercase;
}

body.admin-ui.dashboard-page .job-drag-handle {
    color: var(--ui-text);
    opacity: var(--ui-label-opacity);
}

body.admin-ui.dashboard-page .status-dropdown {
    font-size: var(--ui-font-body) !important;
    height: var(--ui-control-height) !important;
    line-height: 1 !important;
    padding: 0 30px 0 10px !important;
}

/* 13b. PUBLIC FORM CARDS --------------------------------------------- */
/* Any card that wraps a <form> on a public page (home quote, contact,
   presale contact) gets the same solid surface, labels and spacing as
   the admin Create Ticket form. Admin pages use admin-standard instead. */
body.admin-ui:not(.admin-page) .card:has(> form) {
    backdrop-filter: none;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    box-shadow: none;
    padding: 32px;
    transform: none;
}

body.admin-ui:not(.admin-page) .card:has(> form):hover {
    border-color: var(--ui-border);
    transform: none;
}

body.admin-ui:not(.admin-page) .card:has(> form):focus-within {
    border-color: var(--ui-accent);
}

body.admin-ui:not(.admin-page) .card > form label {
    color: var(--ui-text);
    display: block;
    font-size: var(--ui-font-label) !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0 0 6px;
    opacity: var(--ui-label-opacity);
    text-transform: uppercase;
}

body.admin-ui:not(.admin-page) .card > form :is(input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    font-size: 14px;
    margin: 0 0 var(--ui-pad);
    width: 100%;
}

body.admin-ui:not(.admin-page) .card > form .field-hint-wrap {
    margin: 0 0 4px;
    padding-bottom: 20px;
}

body.admin-ui:not(.admin-page) .card > form .field-hint-wrap > :is(input, select, textarea) {
    margin-bottom: 0 !important;
}

body.admin-ui:not(.admin-page) .card > form .field-hint {
    font-size: 12px;
}

body.admin-ui:not(.admin-page) .card > form .form-row {
    gap: var(--ui-pad);
    margin: 0;
}

body.admin-ui:not(.admin-page) .card > form .form-row .form-group {
    margin: 0;
    min-width: 0;
}

body.admin-ui:not(.admin-page) .card > form #fileContainer {
    display: flex;
    flex-direction: column;
    gap: var(--ui-gap);
    margin: 0 0 var(--ui-pad);
}

body.admin-ui:not(.admin-page) .card > form #addFileBtn {
    margin: 0 0 var(--ui-pad) !important;
}

body.admin-ui:not(.admin-page) .card > form button[type="submit"] {
    margin-top: var(--ui-gap) !important;
}

body.admin-ui:not(.admin-page) .card > form button[type="submit"].fullwidth-btn {
    height: 42px;
    width: 100%;
}

/* 14. RESPONSIVE ----------------------------------------------------- */
@media (max-width: 900px) {
    body.admin-ui #ticketInfo .ticket-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.admin-ui #ticketInfo .detail-row-job-name {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    body.admin-ui .line-items-table tr:not(.preset-addon-row) {
        grid-template-areas:
            "description description description"
            "qty rate total"
            "remove remove remove";
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.admin-ui .garment-line-items .size-row-header {
        grid-template-areas:
            "handle style style"
            "handle color rate"
            "remove remove remove";
        grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr);
    }

    body.admin-ui .quote-actions .add-item-btn {
        flex: 1 1 144px;
    }

    body.admin-ui .quote-totals {
        margin-left: 0;
        width: 100%;
    }

    /* styles.css turns size tables into stacked cards on mobile; keep them as scrollable tables. */
    body.admin-ui .size-table-container {
        overflow-x: auto;
    }

    body.admin-ui .size-table {
        display: table;
    }

    body.admin-ui .size-table :is(tr.size-headers, tr.size-inputs) {
        display: table-row;
    }

    body.admin-ui .size-table :is(th, td, td.row-total) {
        border: 1px solid var(--ui-border);
        display: table-cell;
        margin: 0;
        min-width: 60px;
        padding: 0;
        width: 60px;
    }

    body.admin-ui .size-table th {
        padding: 8px 6px;
    }

    body.admin-ui .size-table td::before {
        content: none;
        display: none;
    }

    body.admin-ui .size-table td.row-total {
        color: var(--ui-accent);
        font-weight: 600;
        min-width: 70px;
        padding: 0 6px;
        width: 70px;
    }
}

@media (max-width: 640px) {
    body.admin-ui #ticketInfo .ticket-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   ADMIN TICKET — PROOF BUILDER
=================================================================== */
/* Header look comes from the shared "One header style for cards and modals" rule. */
.proof-card-header .btn { margin: 0; }

.proof-empty { margin: 0; }

/* Saved proofs on the ticket page (js/ticket_files.js renderProofPreview) */
.proof-gallery { display: grid; gap: var(--ui-gap-lg); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.proof-tile { background: var(--ui-canvas); border: 1px solid var(--ui-border); display: flex; flex-direction: column; margin: 0; }
.proof-tile .proof-image { aspect-ratio: 4 / 3; border: 0; border-bottom: 1px solid var(--ui-border); margin: 0; max-height: none; object-fit: contain; width: 100%; }
.proof-tile-bar { align-items: center; display: flex; flex-wrap: wrap; gap: var(--ui-gap); padding: var(--ui-gap) var(--ui-pad-inner); text-align: left; }
.proof-tile-name { flex: 1; font-weight: 600; }
.proof-tile-status { flex-basis: 100%; font-size: var(--ui-font-label); order: 3; text-transform: uppercase; }
.proof-tile-status:empty { display: none; }
body.admin-ui .proof-tile-status.is-approved { color: var(--ui-accent); opacity: 1; }
.proof-tile-bar .btn { margin: 0; }

/* Send Proof / Send Quote file picker (js/ticket_invoice_proof.js openSendFilesDialog) */
body.admin-ui .proof-modal-content { max-width: 560px; width: 100%; }
.proof-modal-label { font-size: var(--ui-font-label); margin: var(--ui-pad-inner) 0 var(--ui-gap); text-transform: uppercase; }
.proof-file-list { border: 1px solid var(--ui-border); max-height: 50vh; overflow-y: auto; }
.proof-file-list > .proof-empty { padding: var(--ui-pad-inner); }
.proof-checkbox-label.proof-file-option { border-bottom: 1px solid var(--ui-border); padding: var(--ui-gap) var(--ui-pad-inner); }
.proof-checkbox-label.proof-file-option:last-child { border-bottom: 0; }
.proof-checkbox-label.proof-file-option:has(.proof-checkbox:checked) { background: var(--ui-raised); }
.proof-file-thumb { align-items: center; background: var(--ui-canvas); border: 1px solid var(--ui-border); display: flex; flex: 0 0 48px; font-size: var(--ui-font-label); height: 48px; justify-content: center; object-fit: contain; text-transform: uppercase; width: 48px; }
.proof-file-text { display: flex; flex-direction: column; min-width: 0; }
.proof-file-text span { font-size: var(--ui-font-label); opacity: var(--ui-label-opacity); overflow-wrap: anywhere; }
.proof-modal-note { margin: var(--ui-gap) 0 0; }
body.admin-ui .proof-modal-note.msg-error { opacity: 1; }
#proofQuoteTo { margin: var(--ui-pad-inner) 0 0; }

/* Customer portal: proof options the shop sent (js/customer_home.js loadProof) */
body.admin-ui.customer-home .proof-options-hint { margin: 0 0 var(--ui-pad-inner); }
body.admin-ui.customer-home .proof-options { display: grid; gap: var(--ui-gap-lg); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
body.admin-ui.customer-home .proof-options.is-single { grid-template-columns: 1fr; }
body.admin-ui.customer-home .proof-option { border: 1px solid var(--ui-border); display: flex; flex-direction: column; margin: 0; }
body.admin-ui.customer-home .proof-options.is-single .proof-option { border: 0; }
body.admin-ui.customer-home .proof-option.is-approved { border-color: var(--ui-accent); }
body.admin-ui.customer-home #proofContent .proof-option img { border: 0; margin: 0 auto; }
body.admin-ui.customer-home .proof-options:not(.is-single) .proof-option img { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--ui-border); max-height: none; object-fit: contain; width: 100%; }
body.admin-ui.customer-home .proof-option-file { margin: var(--ui-pad-inner); }
body.admin-ui.customer-home .proof-option-bar { align-items: center; background: var(--ui-canvas); display: flex; gap: var(--ui-gap); justify-content: space-between; margin-top: auto; padding: var(--ui-gap) var(--ui-pad-inner); }
body.admin-ui.customer-home .proof-option-pick { align-items: center; cursor: pointer; display: flex; font-weight: 600; gap: var(--ui-gap); }
body.admin-ui.customer-home .proof-option-pick input { height: 20px; margin: 0; width: 20px; }
body.admin-ui.customer-home .proof-option-status { color: var(--ui-accent); font-size: var(--ui-font-label); text-transform: uppercase; }
body.admin-ui.customer-home #proofContent > .approval-confirmed { margin: 0 0 var(--ui-pad-inner); }
