/* ===== Design System Tokens ===== */
:root {
    color-scheme: light; /* force UA controls to light */

    --surface: #ffffff;
    --surface-elevated: #fafbfc;
    --border-light: #f0f2f4;
    --border: #e1e4e8;
    --text: #24292f;
    --text-secondary: #57606a;
    --text-tertiary: #6e7781;
    --accent: #0969da;
    --accent-hover: #0860ca;
    --accent-subtle: #ddf4ff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 2px 6px rgba(0,0,0,.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.08);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --space-xs: .25rem;
    --space-sm: .5rem;
    --space-md: .75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;

    --header-grad-start:#0c1240;
    --header-grad-end:#381157;
    --header-fg:#fff;
    --footer-bg:#0f1114;
    --footer-fg:#dfe3e6;
    --footer-link:#cfd6ff;
    --footer-link-hover:#8fb4ff;
}

/* ===== Container Card ===== */
.card-elevated {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.card-compact .card-body {
    padding: var(--space-lg);
}

/* ===== Header / Toolbar ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  color: var(--header-fg);
  background: linear-gradient(135deg,var(--header-grad-start),var(--header-grad-end));
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  /* safe area padding for iOS notches */
  padding-top: env(safe-area-inset-top, 0);
}

/* Toolbar inside header */
.app-toolbar {
  max-width: 1120px;
  margin: 0 auto;
  padding: .75rem clamp(.75rem, 2.5vw, 1rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.app-brand {
  display: flex; align-items: center; gap: .75rem;
  font-weight: 700;
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  letter-spacing: .2px;
}
.app-brand img { height: 28px; width: auto; }

.app-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; width: 36px; border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
}
.app-menu-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover:hover){
  .app-menu-btn:hover { background: rgba(255,255,255,.14); }
}

/* Subheader (greeting strip) */
.subheader {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.subheader-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: .5rem clamp(.75rem, 2.5vw, 1rem);
  color: var(--text-secondary);
  font-size: .95rem;
}

/* ===== Page container ===== */
.page-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(.75rem, 2.5vw, 1rem);
}

/* ===== Footer ===== */
.app-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  margin-top: 2rem;
  padding: 1rem clamp(.75rem, 2.5vw, 1rem);
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
}
.app-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: .75rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.app-footer small {
  opacity: .85;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.footer-links a {
  color: var(--footer-link);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover,
.footer-links a:focus {
  color: var(--footer-link-hover);
  text-decoration: underline;
}
@media (min-width: 768px){
  .app-footer-inner {
    grid-template-columns: 1fr auto;
    text-align: left;
    justify-content: space-between;
  }
}

/* ===== Optional: compact primary button variant ===== */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover { background-color: var(--accent-hover); border-color: var(--accent-hover); }



/* ===== Section Header ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
    border-bottom: 2px solid var(--border-light);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: -.01em;
}

/* ===== List Foundation ===== */
.enquiry-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* ===== Enquiry Row Card ===== */
.enquiry-item {
    list-style: none;
}

.enquiry-item-btn {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: all .15s cubic-bezier(.4,0,.2,1);
}

@media (hover:hover) {
    .enquiry-item-btn:hover {
        background: var(--surface-elevated);
        border-color: var(--border);
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }

        .enquiry-item-btn:hover .chevron-icon {
            transform: translateX(3px);
            color: var(--text-secondary);
        }
}

.enquiry-item-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.enquiry-item-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== Row Layout ===== */
.enquiry-row {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.enquiry-content {
    flex: 1;
    min-width: 0;
}

.enquiry-aside {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-xs);
}

/* ===== Typography ===== */
.enquiry-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.4;
}

.enquiry-preview {
    font-size: .9375rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: var(--space-xs) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.enquiry-meta {
    display: flex;
    align-items: center;
    gap: .4rem .75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.enquiry-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    max-width: 100%;
}

.enquiry-meta .meta-item .text {
    min-width: 0;
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enquiry-meta .meta-separator {
    color: var(--text-tertiary);
    opacity: .5;
}

@media (max-width: 640px) {
  .enquiry-meta .meta-item .text {
    max-width: 65vw;
  }

  .enquiry-meta .meta-separator {
    display: none; /* avoid orphaned separators on wrap */
  }
}

.enquiry-type {
    font-size: .8125rem;
    color: var(--text-tertiary);
}

.enquiry-time {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.chevron-icon {
    font-size: 1.125rem;
    color: var(--text-tertiary);
    transition: all .15s ease;
}

/* ===== Skeleton Loading ===== */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.skeleton-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.skeleton-line {
    height: .625rem;
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-elevated) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 3px;
}

    .skeleton-line + .skeleton-line {
        margin-top: var(--space-sm);
    }

    .skeleton-line.w-60 {
        width: 60%;
    }

    .skeleton-line.w-80 {
        width: 80%;
    }

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0
    }

    100% {
        background-position: -200% 0
    }
}

/* Status pill + chips */
.status-pill{padding:.125rem .5rem;font-size:.72rem;border-radius:999px;border:1px solid transparent;line-height:1.2}
.status-new{color:#0a58ca;background:#e7f1ff;border-color:#cfe2ff}
.status-inprogress{color:#055160;background:#cff4fc;border-color:#9eeaf9}
.status-onhold{color:#664d03;background:#fff3cd;border-color:#ffe69c}
.status-resolved{color:#0f5132;background:#d1e7dd;border-color:#badbcc}
.status-closed{color:#495057;background:#e9ecef;border-color:#dde2e6}

.chip{
  display:inline-flex;align-items:center;gap:.25rem;
  padding:.125rem .5rem;font-size:.75rem;border-radius:999px;border:1px solid transparent
}
.chip-tonal{background:#f5f7fa;border-color:#e9eef5;color:#5c636a}
.chip-link{text-decoration:none;color:inherit;background:#f5f7fa;border-color:#e9eef5}
.chip-link:hover{background:#eef2f8;text-decoration:none}

/* Tonal/ghost buttons used in the card */
.btn-tonal{color:#0a58ca;background:#f1f4f9;border:1px solid #e5eaf0}
.btn-tonal:hover{background:#e8edf6;border-color:#dde4ef}
.btn-ghost{color:#6c757d;background:transparent;border:1px solid transparent}
.btn-ghost:hover{color:#0969da;background:#ddf4ff}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
    font-size: .9375rem;
}

/* ===== Card Spacing ===== */
.card + .card {
    margin-top: var(--space-xl);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .card-compact .card-body {
        padding: var(--space-md);
    }

    .enquiry-item-btn {
        padding: var(--space-md);
    }

    .enquiry-row {
        gap: var(--space-md);
    }
}

/* ===== Dark Mode ===== */


/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Header inline nav (md+) */
.app-nav { display: flex; align-items: center; gap: .25rem; }
.app-nav-link {
  display: inline-flex; align-items: center; gap: .35rem;
  color: #fff; opacity: .9; text-decoration: none;
  padding: .35rem .6rem; border-radius: 8px;
}
.app-nav-link .bi { font-size: 1rem; line-height: 1; }
.app-nav-link:hover, .app-nav-link:focus { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.app-nav-link.active { background: rgba(255,255,255,.22); color: #fff; }

/* Mobile drawer (off-canvas) */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: none;                 /* hidden by default */
}
.mobile-drawer.show { display: block; }

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.mobile-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(86vw, 320px);
  background: var(--surface);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);   /* start off-screen */
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
}
.mobile-drawer.show .mobile-drawer-panel { transform: translateX(0); }

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}
.mobile-drawer-body {
  padding: .5rem .5rem 1rem .5rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.mobile-drawer-safearea { height: env(safe-area-inset-bottom, 0); }

/* Header menu button (ensure visible contrast) */
.app-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
}
@media (hover:hover){
  .app-menu-btn:hover { background: rgba(255,255,255,.14); }
}
.app-menu-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Mobile drawer quick links */
.mobile-drawer-quick { padding: .5rem .5rem 0 .5rem; display: grid; gap: .25rem; }
.mobile-nav-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: 8px;
  color: inherit; text-decoration: none;
}
.mobile-nav-link .bi { font-size: 1.05rem; }
.mobile-nav-link:hover, .mobile-nav-link:focus { background: var(--surface-elevated); text-decoration: none; }
.mobile-nav-link.active { background: var(--surface-elevated); border: 1px solid var(--border-light); }
.mobile-drawer-sep { margin: .5rem 0 .5rem; border-color: var(--border-light); }
/* Remove invalid local import (breaks CSS in browser) */
/* @import url('c:\src\weighops\weighops.web\app.css'); */

/* Make NavMenu always expanded and hide its internal toggler inside the drawer */
.mobile-drawer .navbar-toggler { display: none !important; }
.mobile-drawer .collapse,
.mobile-drawer .navbar-collapse {
  display: block !important;
  height: auto !important;
  visibility: visible !important;
}

/* Prevent accidental page scroll when drawer is open (optional) */
body.drawer-open { overflow: hidden; }

/* Icon rows for contact methods */
.icon-row {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-width: 0; /* allow text-truncate */
}
.icon-row .bi { font-size: 1rem; color: var(--text-tertiary); line-height: 1; }
.icon-link { color: inherit; text-decoration: none; max-width: 100%; }
.icon-link:hover, .icon-link:focus { text-decoration: underline; }
/* Entity overlay action buttons */
.entity-actions { align-items: center; }

.entity-actions .btn {
  border-radius: var(--radius-sm);
  padding: .35rem .6rem; /* compact, aligns with btn-sm height */
  line-height: 1.2;
}

/* Harmonize destructive outline with design tokens */
.entity-actions .btn-outline-danger {
  color: #b42318;
  border-color: #f1aeb5;
}
.entity-actions .btn-outline-danger:hover {
  color: #842029;
  background: #f8d7da;
  border-color: #f1aeb5;
}

/* Filter indicator styling */
.is-filtered { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--text);
  border: 1px solid var(--border-light);
  font-size: .85rem;
}

/* Prevent horizontal overflow on clients page (Bootstrap row inside card) */
.clients-page { overflow-x: clip; }

/* Neutralize row's negative gutters inside card bodies on small screens */
.clients-page .card-body > .row {
  margin-right: 0;
  margin-left: 0;
}

/* Ensure inputs expand and don't cause overflow */
.form-control { width: 100%; max-width: 100%; box-sizing: border-box; }
.min-w-0 { min-width: 0 !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

/* Sticky bottom page actions (mobile-first) */
:root { --page-actions-h: 56px; }

.page-actions {
  position: sticky;
  bottom: 0;
  z-index: 1044; /* below overlays (>=1050) */
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  padding: .5rem clamp(.75rem, 2.5vw, 1rem);
  padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0));
  width: 100%;
}
.page-actions-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}
