/*
 * ============================================================
 *  SNOWMAN DESIGN — HELPDESK & BUG TRACKING SYSTEM
 *  snowman.css  |  Unified Design System Stylesheet
 *  Version 2.0  |  March 2026
 * ============================================================

 *
 *  Font Awesome 6 CDN — include in your HTML <head>:
 *  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
 *
 *  Table of Contents
 *  ---------------------------------------------------------
 *   1.  Google Fonts Import
 *   2.  CSS Custom Properties (Design Tokens)
 *   3.  CSS Reset & Base Styles
 *   4.  Typography
 *   5.  Authenticated Layout (Sidebar + Top Bar + Content)
 *   6.  Unauthenticated Layout (Login / Auth Pages)
 *   7.  Cards & Content Sections
 *   8.  Stat / Summary Cards
 *   9.  Buttons
 *  10.  Form Elements
 *  11.  Tables
 *  12.  Filter / Search Bar
 *  13.  Status Badges & Pills
 *  14.  Info / Note Boxes
 *  15.  Modal Overlay & Container
 *  16.  Toast Notifications
 *  17.  Breadcrumb Navigation
 *  18.  Pagination
 *  19.  Kanban Board
 *  20.  Ticket Thread Layout
 *  21.  SLA Indicators
 *  22.  Utility Classes
 *  23.  Responsive Breakpoints
 * ============================================================
 */

/* ============================================================
   0. ALPINE.JS — PREVENT FLASH OF UNSTYLED CONTENT
      Must be at the top so it takes effect before Alpine loads.
   ============================================================ */
[x-cloak] { display: none !important; }

/* ============================================================
   1. GOOGLE FONTS IMPORT
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');


/* ============================================================
   2. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */
:root {
    /* --- Core Colour Palette --- */
    --color-navy:            #1A2E4A;
    --color-navy-mid:        #2C3E50;
    --color-navy-active:     #243B55;
    --color-navy-hover:      rgba(255, 255, 255, 0.08);

    --color-blue-primary:    #2980D4;
    --color-blue-hover:      #2171BE;
    --color-blue-light:      #D6EAF8;
    --color-blue-lighter:    #EBF5FB;

    --color-green:           #28A745;
    --color-green-light:     #D4EDDA;
    --color-green-hover:     #218838;

    --color-red:             #DC3545;
    --color-red-light:       #F8D7DA;
    --color-red-hover:       #C82333;

    --color-amber:           #FFC107;
    --color-amber-light:     #FFF3CD;
    --color-amber-dark:      #856404;

    --color-teal:            #1ABC9C;
    --color-teal-light:      #D1F2EB;
    --color-teal-hover:      #17A589;

    --color-grey-bg:         #F4F6F8;
    --color-grey-border:     #DEE2E6;
    --color-grey-light:      #F8F9FA;
    --color-grey-mid:        #ADB5BD;
    --color-grey-text:       #6C757D;
    --color-disabled:        #ADB5BD;

    --color-white:           #FFFFFF;
    --color-body-text:       #2D3748;
    --color-heading-text:    #1A2E4A;
    --color-link:            #2980D4;

    /* --- Layout Dimensions --- */
    --sidebar-width:         220px;
    --topbar-height:         56px;
    --content-padding:       24px;

    /* --- Typography Scale --- */
    --font-family:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:             'Fira Code', Consolas, 'Courier New', monospace;

    --text-xs:               0.6875rem;   /* 11px */
    --text-sm:               0.75rem;     /* 12px */
    --text-base:             0.8125rem;   /* 13px */
    --text-md:               0.875rem;    /* 14px */
    --text-lg:               1rem;        /* 16px */
    --text-xl:               1.125rem;    /* 18px */
    --text-2xl:              1.25rem;     /* 20px */
    --text-3xl:              1.5rem;      /* 24px */

    --line-height-tight:     1.25;
    --line-height-base:      1.5;
    --line-height-relaxed:   1.75;

    /* --- Shadows & Radii --- */
    --shadow-card:           0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-card-hover:     0 4px 12px rgba(0, 0, 0, 0.10);
    --shadow-modal:          0 8px 32px rgba(0, 0, 0, 0.20);
    --shadow-dropdown:       0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-toast:          0 4px 12px rgba(0, 0, 0, 0.15);

    --radius-sm:             4px;
    --radius-md:             8px;
    --radius-lg:             10px;
    --radius-xl:             12px;
    --radius-full:           9999px;

    /* --- Transitions --- */
    --transition-fast:       150ms ease;
    --transition-base:       220ms ease;
    --transition-slow:       350ms ease;

    /* --- Z-Index Stack --- */
    --z-sidebar:             100;
    --z-topbar:              200;
    --z-dropdown:            300;
    --z-modal:               400;
    --z-toast:               500;
}


/* ============================================================
   3. CSS RESET & BASE STYLES
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--line-height-base);
    color: var(--color-body-text);
    background-color: var(--color-grey-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-blue-hover);
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

hr {
    border: none;
    border-top: 1px solid var(--color-grey-border);
    margin: 16px 0;
}


/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */
h1, .h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: var(--line-height-tight);
}

h2, .h2 {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-heading-text);
    line-height: var(--line-height-tight);
}

h3, .h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-heading-text);
}

h4, .h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-heading-text);
}

h5, .h5 {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-heading-text);
}

h6, .h6 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-heading-text);
}

p {
    margin-bottom: 0.75rem;
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
}

p:last-child {
    margin-bottom: 0;
}

.text-muted {
    color: var(--color-grey-text);
    font-size: var(--text-sm);
}

.text-small {
    font-size: var(--text-sm);
}

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

code,
pre,
.mono {
    font-family: var(--font-mono);
    font-size: var(--text-base);
    color: var(--color-navy);
}

code {
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
}

pre {
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
}


/* ============================================================
   5. AUTHENTICATED LAYOUT
   ============================================================ */

/* --- App Shell Wrapper --- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--color-navy);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
}

/* Sidebar Brand / Logo Area */
.sidebar-brand {
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* Brand header row: icon + name/subtitle stacked */
.sidebar-brand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar-brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.sidebar-brand-logo-wrap:hover {
    background-color: rgba(255, 255, 255, 0.18);
    text-decoration: none;
}

.sidebar-brand-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.sidebar-brand-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.90);
    font-size: 18px;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-brand-name {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-subtitle {
    font-size: var(--text-xs);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.50);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    line-height: 1.2;
}

/* Role pill — full-width blue pill below the header row */
.sidebar-role-pill {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--color-white);
    background-color: var(--color-blue-primary);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    line-height: 1.4;
}

/* Legacy: kept for any other references */
.sidebar-role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    padding: 2px 8px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.sidebar-nav-section-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
    padding: 16px 20px 4px;
    cursor: default;
    user-select: none;
    pointer-events: none;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: var(--text-base);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    border-left: 3px solid transparent;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav-item:hover {
    background-color: var(--color-navy-hover);
    color: var(--color-white);
    text-decoration: none;
}

.sidebar-nav-item.active,
.sidebar-nav-item[aria-current="page"] {
    background-color: var(--color-navy-active);
    border-left-color: var(--color-blue-primary);
    color: var(--color-white);
}

.sidebar-nav-item .nav-icon {
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-nav-item.active .nav-icon,
.sidebar-nav-item:hover .nav-icon {
    opacity: 1;
}

/* Sidebar Badge (notification count) */
.sidebar-nav-item .nav-badge {
    margin-left: auto;
    background-color: var(--color-blue-primary);
    color: var(--color-white);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar Footer (user info) */
.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-footer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 4px 0;
    min-width: 0;
    color: rgba(255, 255, 255, 0.65);
    transition: color var(--transition-fast);
}

.sidebar-footer-user:hover {
    color: var(--color-white);
    text-decoration: none;
}

.sidebar-footer-user__text {
    display:    flex;
    flex-direction: column;
    gap:        1px;
    min-width:  0;
    overflow:   hidden;
}

.sidebar-footer-user__name {
    font-size:   var(--text-sm);
    font-weight: 700;
    color:       rgba(255, 255, 255, 0.90);
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-user__company {
    font-size:   var(--text-xs);
    font-weight: 400;
    color:       rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

/* Mobile hamburger toggle (hidden on desktop) */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-navy);
    font-size: 20px;
}

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-sidebar) - 1);
}

.sidebar-backdrop.visible {
    display: block;
}

/* ---- Top Bar ---- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-grey-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-padding);
    z-index: var(--z-topbar);
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-page-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-heading-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    white-space: nowrap;
}

.topbar-user-name {
    font-weight: 500;
    color: var(--color-body-text);
}

/* ---- Timer Toggle Control (topbar, admin only) ---- */
.timer-toggle-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-full);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
    cursor: default;
    user-select: none;
}

.timer-toggle-control--active {
    border-color: var(--color-blue-primary);
    background-color: var(--color-blue-lighter);
}

.timer-toggle-control__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-grey-text);
    white-space: nowrap;
}

.timer-toggle-control--active .timer-toggle-control__label {
    color: var(--color-blue-primary);
}

/* Pulsing status dot */
.timer-toggle-control__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--color-grey-mid);
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
}

.timer-toggle-control__dot--running {
    background-color: var(--color-amber);
    animation: timerPulse 1.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.75); }
}

.timer-toggle-control__text {
    font-size: var(--text-sm);
    font-weight: 500;
}

/* The toggle pill itself */
.timer-toggle-control__switch {
    position: relative;
    display: inline-flex;
    width: 32px;
    height: 18px;
    background-color: var(--color-grey-mid);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background-color var(--transition-base);
    outline: none;
}

.timer-toggle-control__switch:focus-visible {
    box-shadow: 0 0 0 3px rgba(41, 128, 212, 0.35);
}

.timer-toggle-control__switch--on {
    background-color: var(--color-blue-primary);
}

.timer-toggle-control__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.20);
    transition: transform var(--transition-base);
}

.timer-toggle-control__switch--on .timer-toggle-control__thumb {
    transform: translateX(14px);
}

/* Timer widget show/hide transitions */
.timer-widget-enter,
.timer-widget-leave {
    transition: opacity var(--transition-base), transform var(--transition-base);
}
.timer-widget-enter-start,
.timer-widget-leave-end {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
}
.timer-widget-enter-end,
.timer-widget-leave-start {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---- Main Content Area ---- */
.main-content {
    margin-left:      var(--sidebar-width);
    padding-top:      var(--topbar-height);
    min-height:       100vh;
    background-color: var(--color-grey-bg);
    flex:             1;
    min-width:        0;
    display:          flex;
    flex-direction:   column;
}

.page-content {
    padding: var(--content-padding);
    flex:    1; /* grows to fill available space, pushing footer down */
}

/* Page Heading Row */
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-heading-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: var(--line-height-tight);
}

.page-heading-subtitle {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    margin-top: 2px;
}

.page-heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}


/* ============================================================
   6. UNAUTHENTICATED LAYOUT (LOGIN / AUTH PAGES)
   ============================================================ */
.auth-page {
    min-height: 100vh;
    background: radial-gradient(ellipse at 30% 40%, var(--color-navy-mid) 0%, var(--color-navy) 65%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background-color: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

.auth-card-logo {
    display: block;
    max-width: 160px;
    margin: 0 auto 16px;
}

.auth-card-title {
    text-align: center;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-heading-text);
    margin-bottom: 4px;
}

.auth-card-subtitle {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    margin-bottom: 28px;
}

.auth-card-divider {
    border: none;
    border-top: 1px solid var(--color-grey-border);
    margin: 24px 0;
}

.auth-forgot-link {
    display: block;
    text-align: right;
    font-size: var(--text-sm);
    color: var(--color-blue-primary);
    margin-top: -8px;
    margin-bottom: 16px;
}

.auth-footer-text {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    margin-top: 20px;
}


/* ============================================================
   7. CARDS & CONTENT SECTIONS
   ============================================================ */
.card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-grey-border);
    box-shadow: var(--shadow-card);
    margin-bottom: 28px;
}

/* BEM card sub-elements — used by admin form pages (create/edit customer, etc.) */
.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-grey-border);
    gap: 12px;
}

.card__title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-heading-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.card__title-icon {
    color: var(--color-blue-primary);
    font-size: var(--text-base);
    opacity: 0.85;
}

.card__body {
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-grey-border);
    gap: 12px;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.card-header-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: var(--color-blue-light);
    color: var(--color-blue-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.card-header-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-heading-text);
}

.card-header-subtitle {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.card-body {
    padding: 24px;
}

.card-body-sm {
    padding: 16px 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--color-grey-border);
    background-color: var(--color-grey-light);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Two-column page layout (e.g. ticket detail) */
.page-layout-two-col {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

.page-layout-main { min-width: 0; }
.page-layout-sidebar { min-width: 0; }

/* Two-column form layout — used by Add/Edit Customer and similar form pages */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    align-items: start;
}

.two-col-layout__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.two-col-layout__main .card:last-child {
    margin-bottom: 0;
}

.two-col-layout__sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: sticky;
    top: calc(var(--topbar-height) + 16px);
}

.two-col-layout__sidebar .card:last-child {
    margin-bottom: 0;
}

@media (max-width: 1023px) {
    .two-col-layout {
        grid-template-columns: 1fr;
    }
    .two-col-layout__sidebar {
        position: static;
        order: -1;
    }
}


/* ============================================================
   8. STAT / SUMMARY CARDS
   ============================================================ */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-grey-border);
    box-shadow: var(--shadow-card);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-left: 4px solid var(--color-grey-border);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.stat-card--blue   { border-left-color: var(--color-blue-primary); }
.stat-card--green  { border-left-color: var(--color-green); }
.stat-card--red    { border-left-color: var(--color-red); }
.stat-card--amber  { border-left-color: var(--color-amber); }
.stat-card--teal   { border-left-color: var(--color-teal); }
.stat-card--navy   { border-left-color: var(--color-navy); }
.stat-card--grey   { border-left-color: var(--color-grey-mid); }

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-card--blue  .stat-card-icon { background-color: var(--color-blue-light);  color: var(--color-blue-primary); }
.stat-card--green .stat-card-icon { background-color: var(--color-green-light); color: var(--color-green); }
.stat-card--red   .stat-card-icon { background-color: var(--color-red-light);   color: var(--color-red); }
.stat-card--amber .stat-card-icon { background-color: var(--color-amber-light); color: var(--color-amber-dark); }
.stat-card--teal  .stat-card-icon { background-color: var(--color-teal-light);  color: var(--color-teal); }
.stat-card--navy  .stat-card-icon { background-color: var(--color-blue-light);  color: var(--color-navy); }
.stat-card--grey  .stat-card-icon { background-color: var(--color-grey-light);  color: var(--color-grey-mid); }

.stat-card-content { flex: 1; min-width: 0; }

.stat-card-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    font-weight: 400;
}

.stat-card-delta {
    font-size: var(--text-xs);
    font-weight: 600;
    margin-top: 4px;
}

.stat-card-delta--up   { color: var(--color-green); }
.stat-card-delta--down { color: var(--color-red); }


/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                box-shadow var(--transition-fast);
    user-select: none;
    vertical-align: middle;
}

.btn:focus-visible {
    outline: 3px solid rgba(41, 128, 212, 0.4);
    outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    padding: 5px 11px;
    font-size: var(--text-sm);
    gap: 5px;
}

.btn-lg {
    padding: 11px 22px;
    font-size: var(--text-md);
    gap: 9px;
}

.btn-xl {
    padding: 14px 28px;
    font-size: var(--text-lg);
    width: 100%;
}

/* Primary (Blue) */
.btn-primary {
    background-color: var(--color-blue-primary);
    border-color: var(--color-blue-primary);
    color: var(--color-white);
}
.btn-primary:hover {
    background-color: var(--color-blue-hover);
    border-color: var(--color-blue-hover);
    color: var(--color-white);
    text-decoration: none;
}

/* Secondary (Grey) */
.btn-secondary {
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-border);
    color: var(--color-body-text);
}
.btn-secondary:hover {
    background-color: #e2e6ea;
    border-color: #c8cdd2;
    color: var(--color-body-text);
    text-decoration: none;
}

/* Success (Green) */
.btn-success {
    background-color: var(--color-green);
    border-color: var(--color-green);
    color: var(--color-white);
}
.btn-success:hover {
    background-color: var(--color-green-hover);
    border-color: var(--color-green-hover);
    color: var(--color-white);
    text-decoration: none;
}

/* Danger (Red) */
.btn-danger {
    background-color: var(--color-red);
    border-color: var(--color-red);
    color: var(--color-white);
}
.btn-danger:hover {
    background-color: var(--color-red-hover);
    border-color: var(--color-red-hover);
    color: var(--color-white);
    text-decoration: none;
}

/* Warning (Amber) */
.btn-warning {
    background-color: var(--color-amber);
    border-color: var(--color-amber);
    color: var(--color-amber-dark);
}
.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: var(--color-amber-dark);
    text-decoration: none;
}

/* Dark (Navy-Mid) */
.btn-dark {
    background-color: var(--color-navy-mid);
    border-color: var(--color-navy-mid);
    color: var(--color-white);
}
.btn-dark:hover {
    background-color: var(--color-navy);
    border-color: var(--color-navy);
    color: var(--color-white);
    text-decoration: none;
}

/* Ghost / Outline */
.btn-ghost {
    background-color: transparent;
    border-color: var(--color-grey-border);
    color: var(--color-body-text);
}
.btn-ghost:hover {
    background-color: var(--color-grey-light);
    text-decoration: none;
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
}
.btn-outline-primary:hover {
    background-color: var(--color-blue-primary);
    color: var(--color-white);
    text-decoration: none;
}

.btn-outline-danger {
    background-color: transparent;
    border-color: var(--color-red);
    color: var(--color-red);
}
.btn-outline-danger:hover {
    background-color: var(--color-red);
    color: var(--color-white);
    text-decoration: none;
}

/* Icon-only Table Action Buttons */
.btn-icon {
    padding: 5px 7px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    line-height: 1;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-icon-view   { color: var(--color-blue-primary); }
.btn-icon-edit   { color: var(--color-amber-dark); }
.btn-icon-delete { color: var(--color-red); }
.btn-icon-teal   { color: var(--color-teal); }

.btn-icon:hover {
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-border);
    text-decoration: none;
}
.btn-icon-view:hover   { color: var(--color-blue-hover); }
.btn-icon-edit:hover   { color: #a07800; }
.btn-icon-delete:hover { color: var(--color-red-hover); }


/* ============================================================
   10. FORM ELEMENTS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-body-text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--color-red);
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--color-body-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    appearance: none;
    line-height: 1.5;
}

.form-control::placeholder {
    color: var(--color-grey-mid);
}

.form-control:hover {
    border-color: #b5bcc5;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-blue-primary);
    box-shadow: 0 0 0 3px rgba(41, 128, 212, 0.18);
    background-color: var(--color-blue-lighter);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--color-grey-light);
    color: var(--color-grey-text);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control.is-invalid {
    border-color: var(--color-red);
    box-shadow: none;
}
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18);
}

.form-control.is-valid {
    border-color: var(--color-green);
}

/* Select */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236C757D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 32px;
    cursor: pointer;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Input group (icon prefix/suffix) */
.input-group {
    display: flex;
    align-items: stretch;
    position: relative;
}

.input-group .form-control { flex: 1; min-width: 0; }

.input-group-prefix,
.input-group-suffix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    color: var(--color-grey-text);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.input-group-prefix {
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group-suffix {
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group .form-control:not(:first-child) {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group .form-control:not(:last-child) {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.form-check-input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--color-blue-primary);
    cursor: pointer;
}

.form-check-label {
    font-size: var(--text-base);
    color: var(--color-body-text);
    cursor: pointer;
    user-select: none;
}

/* Help / validation text */
.form-help  { display: block; font-size: var(--text-sm); color: var(--color-grey-text); margin-top: 4px; }
.form-error { display: block; font-size: var(--text-sm); color: var(--color-red); margin-top: 4px; }
.form-valid { display: block; font-size: var(--text-sm); color: var(--color-green); margin-top: 4px; }

/* Form grid rows */
.form-row   { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Form grid — used by customer create/edit forms */
.form-grid {
    display: grid;
    gap: 16px 20px;
}

.form-grid--two {
    grid-template-columns: 1fr 1fr;
}

.form-group--full {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .form-grid--two { grid-template-columns: 1fr; }
    .form-group--full { grid-column: 1; }
}

.form-section-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-heading-text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-grey-border);
    margin-bottom: 18px;
    margin-top: 8px;
}


/* --- Toggle Switch (form fields: portal access, weekly summary, etc.) --- */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: var(--text-base);
    color: var(--color-body-text);
    line-height: 1.4;
}

/* Hide the real checkbox but keep it accessible */
.toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* The pill track */
.toggle-slider {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 40px;
    height: 22px;
    background-color: var(--color-grey-mid);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-base);
}

/* The circular thumb */
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background-color: var(--color-white);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
    transition: transform var(--transition-base);
}

/* Checked state — slide thumb right and turn green */
.toggle-input:checked + .toggle-slider {
    background-color: var(--color-green);
}

.toggle-input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

/* Focus ring for keyboard accessibility */
.toggle-input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(41, 128, 212, 0.35);
}

/* Disabled state */
.toggle-input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-input:disabled ~ .toggle-text {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-text {
    font-size: var(--text-base);
    color: var(--color-body-text);
}


/* ============================================================
   11. TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}

table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

.data-table thead {
    background-color: var(--color-navy);
}

.data-table thead th {
    padding: 11px 14px;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-white);
    text-align: left;
    white-space: nowrap;
    border-bottom: none;
}

.data-table thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-md) 0 0; }

.data-table thead th .sort-icon {
    margin-left: 5px;
    opacity: 0.6;
    font-size: 11px;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table thead th.sortable:hover {
    background-color: rgba(255,255,255,0.08);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--color-grey-border);
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:nth-child(even) { background-color: #FAFBFC; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover   { background-color: var(--color-blue-lighter) !important; }
.data-table tbody tr.row-selected     { background-color: var(--color-blue-light) !important; }
.data-table tbody tr.row-highlighted  { background-color: #FFFBEB !important; }

.data-table tbody td {
    padding: 11px 14px;
    color: var(--color-body-text);
    vertical-align: middle;
}

.data-table tbody td.cell-link {
    color: var(--color-blue-primary);
    font-weight: 500;
    cursor: pointer;
}
.data-table tbody td.cell-link:hover {
    color: var(--color-blue-hover);
    text-decoration: underline;
}

.data-table tbody td.cell-actions {
    white-space: nowrap;
    width: 1%;
}

.data-table .col-checkbox {
    width: 36px;
    text-align: center;
}

/* Table empty state */
.table-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-grey-text);
}

.table-empty i {
    font-size: 32px;
    opacity: 0.3;
    display: block;
    margin-bottom: 10px;
}

/* Bulk action bar */
.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: var(--color-blue-light);
    border: 1px solid var(--color-blue-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bulk-action-bar-count {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-blue-primary);
}


/* ============================================================
   12. FILTER / SEARCH BAR
   ============================================================ */
.filter-bar {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-grey-border);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.filter-bar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    flex: 1;
}

.filter-bar-group label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-grey-text);
}

.filter-bar-group.filter-search {
    flex: 2;
    min-width: 200px;
}

.filter-bar-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: 1px;
}

.filter-bar-count {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    white-space: nowrap;
    align-self: center;
}


/* ============================================================
   13. STATUS BADGES & PILLS
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    line-height: 1.4;
    vertical-align: middle;
}

/* Colour variants */
.badge-success,
.badge-active,
.badge-open,
.badge-resolved,
.badge-delivered {
    background-color: var(--color-green);
    color: var(--color-white);
}

.badge-primary,
.badge-info,
.badge-new,
.badge-in-progress,
.badge-customer {
    background-color: var(--color-blue-primary);
    color: var(--color-white);
}

.badge-warning,
.badge-awaiting,
.badge-on-hold,
.badge-pending {
    background-color: var(--color-amber);
    color: var(--color-amber-dark);
}

.badge-danger,
.badge-critical,
.badge-breached,
.badge-closed-neg {
    background-color: var(--color-red);
    color: var(--color-white);
}

.badge-dark,
.badge-neutral,
.badge-admin,
.badge-agent,
.badge-deferred {
    background-color: var(--color-navy-mid);
    color: var(--color-white);
}

.badge-teal,
.badge-enhancement,
.badge-under-review {
    background-color: var(--color-teal);
    color: var(--color-white);
}

.badge-disabled,
.badge-inactive {
    background-color: var(--color-disabled);
    color: var(--color-white);
}

/* Pill shape */
.badge-pill {
    border-radius: var(--radius-full);
}

/* Priority dot badges */
.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-dot::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-dot.priority-critical { background-color: var(--color-red-light);   color: var(--color-red); }
.badge-dot.priority-critical::before { background-color: var(--color-red); }

.badge-dot.priority-high     { background-color: #FDE8CE; color: #B35A00; }
.badge-dot.priority-high::before     { background-color: #E07800; }

.badge-dot.priority-medium   { background-color: var(--color-amber-light); color: var(--color-amber-dark); }
.badge-dot.priority-medium::before   { background-color: var(--color-amber); }

.badge-dot.priority-low      { background-color: var(--color-blue-light);  color: var(--color-blue-primary); }
.badge-dot.priority-low::before      { background-color: var(--color-blue-primary); }


/* ============================================================
   14. INFO / NOTE BOXES
   ============================================================ */
.info-box {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid transparent;
    margin-bottom: 16px;
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
}

.info-box .info-box-icon {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-box .info-box-content { flex: 1; min-width: 0; }
.info-box .info-box-title { font-weight: 600; margin-bottom: 3px; }

.info-box-teal {
    background-color: var(--color-teal-light);
    border-left-color: var(--color-teal);
    color: #0e7a63;
}
.info-box-teal .info-box-icon { color: var(--color-teal); }

.info-box-blue {
    background-color: var(--color-blue-light);
    border-left-color: var(--color-blue-primary);
    color: #1a5c94;
}
.info-box-blue .info-box-icon { color: var(--color-blue-primary); }

.info-box-amber {
    background-color: var(--color-amber-light);
    border-left-color: var(--color-amber);
    color: var(--color-amber-dark);
}
.info-box-amber .info-box-icon { color: #d9a000; }

.info-box-red {
    background-color: var(--color-red-light);
    border-left-color: var(--color-red);
    color: #8c1c27;
}
.info-box-red .info-box-icon { color: var(--color-red); }

.info-box-green {
    background-color: var(--color-green-light);
    border-left-color: var(--color-green);
    color: #155724;
}
.info-box-green .info-box-icon { color: var(--color-green); }


/* ============================================================
   15. MODAL OVERLAY & CONTAINER
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 20px;
    overflow-y: auto;
}

/* Alpine.js x-cloak helper */
[x-cloak] { display: none !important; }

.modal-container {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    animation: modalSlideIn 0.2s ease;
}

.modal-container--wide { max-width: 800px; }
.modal-container--sm   { max-width: 420px; }

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background-color: var(--color-navy);
    flex-shrink: 0;
    gap: 12px;
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-white);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.70);
    font-size: 18px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.12);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--color-grey-border);
    background-color: var(--color-grey-light);
    flex-shrink: 0;
    flex-wrap: wrap;
}


/* ============================================================
   16. TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 16px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
    width: calc(100% - 32px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-toast);
    pointer-events: all;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border-left: 4px solid transparent;
    background-color: var(--color-white);
    min-width: 280px;
}

.toast.toast-dismiss {
    animation: toastSlideOut 0.25s ease forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(calc(100% + 16px)); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); max-height: 200px; }
    to   { opacity: 0; transform: translateX(calc(100% + 16px)); max-height: 0; }
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content { flex: 1; min-width: 0; }

.toast-title {
    font-size: var(--text-md);
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--color-grey-text);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-grey-mid);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: color var(--transition-fast);
    line-height: 1;
}
.toast-close:hover { color: var(--color-body-text); }

.toast-success { border-left-color: var(--color-green); }
.toast-success .toast-icon,
.toast-success .toast-title { color: var(--color-green); }

.toast-error   { border-left-color: var(--color-red); }
.toast-error .toast-icon,
.toast-error .toast-title   { color: var(--color-red); }

.toast-warning { border-left-color: var(--color-amber); }
.toast-warning .toast-icon  { color: #d9a000; }
.toast-warning .toast-title { color: var(--color-amber-dark); }

.toast-info    { border-left-color: var(--color-blue-primary); }
.toast-info .toast-icon,
.toast-info .toast-title    { color: var(--color-blue-primary); }


/* ============================================================
   17. BREADCRUMB NAVIGATION
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 16px;
    padding: 0;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
}

.breadcrumb-item a {
    color: var(--color-blue-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.breadcrumb-item a:hover {
    color: var(--color-blue-hover);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--color-body-text);
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 9px;
    color: var(--color-grey-mid);
    margin: 0 8px;
    display: inline-block;
}


/* ============================================================
   18. PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-grey-border);
}

.pagination-info {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-links li a,
.pagination-links li span,
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    color: var(--color-body-text);
    text-decoration: none;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    cursor: pointer;
    user-select: none;
}

.pagination-links li a:hover,
.page-link:hover {
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-mid);
    text-decoration: none;
}

.pagination-links li.active a,
.pagination-links li.active span,
.page-link.active {
    background-color: var(--color-blue-primary);
    border-color: var(--color-blue-primary);
    color: var(--color-white);
}

.pagination-links li.disabled a,
.pagination-links li.disabled span,
.page-link.disabled {
    color: var(--color-grey-mid);
    pointer-events: none;
    cursor: default;
}


/* ============================================================
   19. KANBAN BOARD
   ============================================================ */
.kanban-board {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.kanban-column {
    flex-shrink: 0;
    width: 280px;
    background-color: var(--color-grey-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-grey-border);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--topbar-height) - var(--content-padding) * 2 - 60px);
}

.kanban-column-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-grey-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-top: 3px solid transparent;
}

.kanban-column--backlog  .kanban-column-header { border-top-color: var(--color-grey-mid); }
.kanban-column--todo     .kanban-column-header { border-top-color: var(--color-blue-primary); }
.kanban-column--progress .kanban-column-header { border-top-color: var(--color-amber); }
.kanban-column--review   .kanban-column-header { border-top-color: var(--color-teal); }
.kanban-column--done     .kanban-column-header { border-top-color: var(--color-green); }
.kanban-column--closed   .kanban-column-header { border-top-color: var(--color-red); }
.kanban-column--deferred .kanban-column-header { border-top-color: var(--color-navy-mid); }

.kanban-column-title {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-heading-text);
}

.kanban-column-count {
    background-color: var(--color-grey-border);
    color: var(--color-grey-text);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: 1px 7px;
    min-width: 22px;
    text-align: center;
}

.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-grey-border) transparent;
}

.kanban-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: grab;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
    user-select: none;
}

.kanban-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    box-shadow: var(--shadow-modal);
    transform: rotate(1.5deg) scale(1.02);
}

.kanban-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.kanban-card-id {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-grey-text);
    white-space: nowrap;
}

.kanban-card-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-body-text);
    line-height: 1.4;
    margin-bottom: 8px;
}

.kanban-card-title a {
    color: inherit;
    text-decoration: none;
}
.kanban-card-title a:hover {
    color: var(--color-blue-primary);
    text-decoration: none;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kanban-card-product {
    font-size: var(--text-xs);
    color: var(--color-grey-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.kanban-card-assignee {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--color-blue-light);
    color: var(--color-blue-primary);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kanban-drop-target {
    border: 2px dashed var(--color-blue-primary);
    background-color: var(--color-blue-lighter);
    border-radius: var(--radius-sm);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    color: var(--color-blue-primary);
}


/* ============================================================
   20. TICKET THREAD LAYOUT
   ============================================================ */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reply-item {
    display: flex;
    gap: 12px;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-grey-border);
}
.reply-item:last-child { border-bottom: none; }

/* Internal note */
.reply-item--internal {
    background-color: #FFFDF0;
    border-left: 3px solid var(--color-amber);
    padding-left: 16px;
    padding-right: 16px;
    margin-left: -1px;
    margin-right: -1px;
}

.reply-item--internal .reply-header-note-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-amber-dark);
    background-color: var(--color-amber-light);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* System / audit event */
.reply-item--system {
    background-color: transparent;
    gap: 8px;
    padding: 10px 0;
}

.reply-item--system .reply-avatar {
    width: 28px;
    height: 28px;
    background-color: var(--color-grey-light);
    color: var(--color-grey-text);
}

.reply-item--system .reply-body {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    font-style: italic;
}

/* Avatar */
.reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-navy);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    user-select: none;
}

.reply-avatar--agent    { background-color: var(--color-navy); }
.reply-avatar--customer { background-color: var(--color-blue-primary); }
.reply-avatar--system   { background-color: var(--color-grey-light); color: var(--color-grey-text); }

.reply-content { flex: 1; min-width: 0; }

.reply-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.reply-author {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-heading-text);
}

.reply-role-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    background-color: var(--color-navy-mid);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.reply-timestamp {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    margin-left: auto;
    white-space: nowrap;
}

.reply-body {
    font-size: var(--text-base);
    color: var(--color-body-text);
    line-height: var(--line-height-relaxed);
}
.reply-body p:last-child { margin-bottom: 0; }

/* Attachments in thread */
.reply-attachments {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reply-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--color-body-text);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.reply-attachment-item:hover {
    background-color: var(--color-blue-light);
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
    text-decoration: none;
}

.reply-attachment-item i {
    font-size: 14px;
    color: var(--color-blue-primary);
}

.reply-attachment-size {
    color: var(--color-grey-text);
    font-size: var(--text-xs);
}

/* Reply composer */
.reply-composer {
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.reply-composer-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-grey-border);
    background-color: var(--color-grey-light);
}

.reply-composer-tab {
    padding: 10px 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-grey-text);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.reply-composer-tab.active {
    color: var(--color-blue-primary);
    border-bottom-color: var(--color-blue-primary);
    background-color: var(--color-white);
}

.reply-composer-tab.tab-internal.active {
    color: var(--color-amber-dark);
    border-bottom-color: var(--color-amber);
}

.reply-composer-body {
    padding: 16px;
    background-color: var(--color-white);
}

.reply-composer-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--color-grey-border);
    background-color: var(--color-grey-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.reply-composer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Collision detection warning */
.collision-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: var(--color-amber-light);
    border: 1px solid var(--color-amber);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: var(--text-sm);
    color: var(--color-amber-dark);
}


/* ============================================================
   21. SLA INDICATORS
   ============================================================ */
.sla-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sla-bar-wrapper {
    flex: 1;
    height: 6px;
    background-color: var(--color-grey-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.sla-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.sla-bar--green { background-color: var(--color-green); }
.sla-bar--amber { background-color: var(--color-amber); }
.sla-bar--red   { background-color: var(--color-red); }

.sla-label {
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.sla-label--green   { color: var(--color-green); }
.sla-label--amber   { color: var(--color-amber-dark); }
.sla-label--red     { color: var(--color-red); }
.sla-label--breached { color: var(--color-red); text-transform: uppercase; letter-spacing: 0.04em; }

/* Compact SLA badge for table rows */
.sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.sla-badge--ok      { background-color: var(--color-green-light); color: var(--color-green); }
.sla-badge--warning { background-color: var(--color-amber-light); color: var(--color-amber-dark); }
.sla-badge--breached {
    background-color: var(--color-red-light);
    color: var(--color-red);
    animation: sla-pulse 2s ease-in-out infinite;
}

@keyframes sla-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* SLA alert panel */
.sla-alert-list { display: flex; flex-direction: column; gap: 0; }

.sla-alert-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--color-grey-border);
    flex-wrap: wrap;
}
.sla-alert-row:last-child { border-bottom: none; }

.sla-alert-ticket {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-blue-primary);
    white-space: nowrap;
    min-width: 80px;
}

.sla-alert-subject {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-body-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sla-alert-time {
    font-size: var(--text-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.sla-alert-row--warning .sla-alert-time  { color: var(--color-amber-dark); }
.sla-alert-row--breached .sla-alert-time { color: var(--color-red); }


/* ============================================================
   22. UTILITY CLASSES
   ============================================================ */
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-none { display: none; }
.d-grid { display: grid; }

.flex-col  { flex-direction: column; }
.flex-row  { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1    { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.align-center  { align-items: center; }
.align-start   { align-items: flex-start; }
.align-end     { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }

.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-navy    { color: var(--color-navy); }
.text-primary { color: var(--color-blue-primary); }
.text-success { color: var(--color-green); }
.text-danger  { color: var(--color-red); }
.text-warning { color: var(--color-amber-dark); }
.text-teal    { color: var(--color-teal); }
.text-muted   { color: var(--color-grey-text); }
.text-white   { color: var(--color-white); }

.mt-0  { margin-top: 0; }     .mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }   .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }  .mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

.mb-0  { margin-bottom: 0; }    .mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }  .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.p-0  { padding: 0; }    .p-8  { padding: 8px; }
.p-12 { padding: 12px; } .p-16 { padding: 16px; }
.p-20 { padding: 20px; } .p-24 { padding: 24px; }

.w-100  { width: 100%; }
.w-auto { width: auto; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.divider {
    border: none;
    border-top: 1px solid var(--color-grey-border);
    margin: 16px 0;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--color-blue-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner--white { border-color: rgba(255,255,255,0.3); border-top-color: var(--color-white); }
.spinner--sm { width: 14px; height: 14px; }
.spinner--lg { width: 32px; height: 32px; border-width: 3px; }

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

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { font-size: 48px; color: var(--color-grey-border); margin-bottom: 16px; }
.empty-state-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-heading-text);
    margin-bottom: 8px;
}
.empty-state-desc {
    font-size: var(--text-md);
    color: var(--color-grey-text);
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: var(--line-height-relaxed);
}

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--color-grey-border);
    align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.activity-icon--blue  { background-color: var(--color-blue-light);  color: var(--color-blue-primary); }
.activity-icon--green { background-color: var(--color-green-light); color: var(--color-green); }
.activity-icon--amber { background-color: var(--color-amber-light); color: var(--color-amber-dark); }
.activity-icon--red   { background-color: var(--color-red-light);   color: var(--color-red); }
.activity-icon--teal  { background-color: var(--color-teal-light);  color: var(--color-teal); }
.activity-icon--grey  { background-color: var(--color-grey-light);  color: var(--color-grey-text); }

.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: var(--text-sm); color: var(--color-body-text); line-height: 1.45; }
.activity-text a { font-weight: 500; }
.activity-time { font-size: var(--text-xs); color: var(--color-grey-text); margin-top: 2px; white-space: nowrap; }

/* CSAT star rating */
.csat-stars { display: flex; gap: 4px; align-items: center; }
.csat-star {
    font-size: 20px;
    cursor: pointer;
    color: var(--color-grey-border);
    transition: color var(--transition-fast);
}
.csat-star.active,
.csat-star:hover { color: var(--color-amber); }

/* Vote button */
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    color: var(--color-grey-text);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.vote-btn:hover {
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
    text-decoration: none;
}
.vote-btn.voted {
    background-color: var(--color-blue-light);
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
}

/* Dropdown menu */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    min-width: 180px;
    z-index: var(--z-dropdown);
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    font-size: var(--text-base);
    color: var(--color-body-text);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover { background-color: var(--color-grey-light); text-decoration: none; }
.dropdown-item i { width: 14px; text-align: center; color: var(--color-grey-text); }
.dropdown-item--danger { color: var(--color-red); }
.dropdown-item--danger:hover { background-color: var(--color-red-light); }
.dropdown-divider { border: none; border-top: 1px solid var(--color-grey-border); margin: 4px 0; }

/* Page tabs */
.page-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-grey-border);
    margin-bottom: 20px;
    gap: 0;
    overflow-x: auto;
}

.page-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-grey-text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.page-tab:hover { color: var(--color-body-text); text-decoration: none; }
.page-tab.active { color: var(--color-blue-primary); border-bottom-color: var(--color-blue-primary); font-weight: 600; }
.page-tab .tab-count {
    background-color: var(--color-grey-light);
    color: var(--color-grey-text);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    padding: 1px 6px;
}
.page-tab.active .tab-count { background-color: var(--color-blue-light); color: var(--color-blue-primary); }

/* Ticket sidebar fields */
.ticket-sidebar-field {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-grey-border);
}
.ticket-sidebar-field:last-child { border-bottom: none; }

.ticket-sidebar-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-grey-text);
    margin-bottom: 4px;
}

.ticket-sidebar-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-body-text);
}

/* Announcement banner */
.announcement-banner {
    background-color: var(--color-blue-light);
    border: 1px solid var(--color-blue-primary);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.announcement-banner--warning {
    background-color: var(--color-amber-light);
    border-color: var(--color-amber);
}
.announcement-banner-icon {
    font-size: 16px;
    color: var(--color-blue-primary);
    flex-shrink: 0;
    margin-top: 1px;
}
.announcement-banner--warning .announcement-banner-icon { color: var(--color-amber-dark); }


/* ============================================================
   23. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ---- Tablet: 768px – 1023px ---- */
@media (max-width: 1023px) {
    :root {
        --content-padding: 16px;
    }

    .page-layout-two-col {
        grid-template-columns: 1fr;
    }

    .page-layout-sidebar {
        order: -1;
    }

    .stat-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr 1fr;
    }

    .kanban-column {
        width: 250px;
    }
}

/* ---- Mobile: < 768px ---- */
@media (max-width: 767px) {
    :root {
        --content-padding: 12px;
        --topbar-height: 52px;
    }

    /* Sidebar collapses off-screen */
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        box-shadow: none;
    }

    .sidebar.sidebar--open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-heading-actions {
        width: 100%;
    }

    .card-header {
        flex-wrap: wrap;
    }

    .table-wrapper {
        margin-left: calc(-1 * var(--content-padding));
        margin-right: calc(-1 * var(--content-padding));
        border-radius: 0;
    }

    .data-table {
        min-width: 600px;
    }

    .form-row-2,
    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar-group {
        width: 100%;
        min-width: unset;
    }

    .filter-bar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .stat-cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .auth-card {
        padding: 28px 24px;
    }

    /* Modal slides up from bottom on mobile */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-container {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
    }

    .reply-item {
        flex-direction: column;
        gap: 8px;
    }

    .reply-header {
        flex-wrap: wrap;
    }

    .reply-timestamp {
        margin-left: 0;
        width: 100%;
    }

    .page-layout-two-col {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    /* Kanban stacks vertically on mobile */
    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        width: 100%;
        max-height: none;
    }

    /* Toast at bottom on mobile */
    .toast-container {
        top: auto;
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }
}

/* ---- Small mobile: < 480px ---- */
@media (max-width: 479px) {
    .stat-cards-grid {
        grid-template-columns: 1fr;
    }

    .page-tab {
        padding: 8px 12px;
        font-size: var(--text-sm);
    }

    .btn-xl {
        padding: 12px 20px;
        font-size: var(--text-base);
    }
}

/* ---- Print ---- */
@media print {
    .sidebar,
    .topbar,
    .toast-container,
    .reply-composer,
    .filter-bar,
    .page-heading-actions,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding-top: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }
}

/* ============================================================
   24. COMPANY MODULE — sd- component styles
   ============================================================ */

/* ---- Page header row ---- */
.sd-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sd-page-header__left { display: flex; flex-direction: column; gap: 4px; }
.sd-page-header__title { font-size: 1.375rem; font-weight: 700; color: var(--color-navy); margin: 0; display: flex; align-items: center; gap: 10px; }
.sd-page-header__icon { color: var(--color-blue-primary); font-size: 1.1rem; }
.sd-page-header__subtitle { font-size: .8125rem; color: var(--color-grey-text); margin: 0; }
.sd-page-header__actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ---- Back link ---- */
.sd-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--color-blue-primary); text-decoration: none; margin-bottom: 2px; }
.sd-back-link:hover { text-decoration: underline; }

/* ---- Filter bar ---- */
.sd-filter-bar { margin-bottom: 16px; padding: 16px 20px; }
.sd-filter-bar__inner { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sd-filter-bar__field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.sd-filter-bar__field--search { min-width: 220px; flex: 1; }
.sd-filter-bar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-filter-bar__count { font-size: .8125rem; color: var(--color-grey-text); white-space: nowrap; margin-left: 4px; }
.sd-input-icon-wrap { position: relative; }
.sd-input-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--color-grey-text); font-size: .8125rem; pointer-events: none; }

/* ---- Company logo thumb ---- */
.sd-table__company-cell { display: flex; align-items: center; gap: 10px; }
.sd-company-logo-thumb { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; border: 1px solid var(--color-grey-border); background: #fff; flex-shrink: 0; }
.sd-company-logo-thumb--placeholder { display: inline-flex; align-items: center; justify-content: center; color: var(--color-grey-text); font-size: .875rem; }

/* ---- Domain tags ---- */
.sd-tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.sd-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: .75rem; font-weight: 500; background: var(--color-blue-lighter, #EBF5FB); color: var(--color-blue-primary); border: 1px solid var(--color-blue-light, #D6EAF8); white-space: nowrap; }
.sd-tag--removable { padding-right: 4px; }
.sd-tag__remove { background: none; border: none; cursor: pointer; padding: 0 2px; color: var(--color-blue-primary); display: inline-flex; align-items: center; font-size: .6875rem; opacity: .7; border-radius: 2px; transition: opacity .15s; }
.sd-tag__remove:hover { opacity: 1; color: var(--color-red); }

/* ---- Tag input ---- */
.sd-tag-input-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--color-grey-border); border-radius: 6px; background: #fff; min-height: 42px; cursor: text; transition: border-color .15s, box-shadow .15s; }
.sd-tag-input-wrap:focus-within { border-color: var(--color-blue-primary); box-shadow: 0 0 0 3px rgba(41,128,212,.2); }
.sd-tag-input__field { border: none; outline: none; background: transparent; font-size: .875rem; color: var(--color-body-text); flex: 1; min-width: 120px; padding: 2px 0; }

/* ---- Table helpers ---- */
.sd-table__id { color: var(--color-grey-text); font-size: .8125rem; }
.sd-table__link { color: var(--color-blue-primary); text-decoration: none; font-weight: 500; }
.sd-table__link:hover { text-decoration: underline; }
.sd-table__muted { color: var(--color-grey-text); }
.sd-table__agent { display: inline-flex; align-items: center; gap: 5px; font-size: .8125rem; }
.sd-table__agent-icon { color: var(--color-grey-text); font-size: .75rem; }
.sd-table__count { font-weight: 600; color: var(--color-navy); }
.sd-table__actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ---- Icon-only action buttons ---- */
.sd-btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 5px; border: none; cursor: pointer; font-size: .8125rem; text-decoration: none; transition: filter .15s; }
.sd-btn-icon--blue  { background: var(--color-blue-primary); color: #fff; }
.sd-btn-icon--red   { background: var(--color-red); color: #fff; }
.sd-btn-icon--amber { background: #FFC107; color: #212529; }
.sd-btn-icon--green { background: var(--color-green); color: #fff; }
.sd-btn-icon:hover { filter: brightness(90%); }
.sd-inline-form { display: inline-flex; }

/* ---- Empty state ---- */
.sd-empty-state { padding: 48px 24px; text-align: center; color: var(--color-grey-text); }
.sd-empty-state--sm { padding: 32px 24px; }
.sd-empty-state__icon { font-size: 2.5rem; opacity: .3; margin-bottom: 12px; display: block; }
.sd-empty-state__title { font-size: 1rem; font-weight: 600; color: var(--color-navy); margin: 0 0 6px; }
.sd-empty-state__text { font-size: .875rem; margin: 0; }
.sd-empty-state__text a { color: var(--color-blue-primary); }
.sd-pagination-wrap { padding: 16px 20px; border-top: 1px solid var(--color-grey-border); }

/* ---- Two-column layout ---- */
.sd-layout-with-sidebar { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.sd-layout-with-sidebar__main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.sd-layout-with-sidebar__sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }

/* ---- Company header card ---- */
.sd-company-header-card__inner { display: flex; gap: 20px; align-items: flex-start; padding: 20px; }
.sd-company-header-card__logo { width: 80px; height: 80px; object-fit: contain; border-radius: 8px; border: 1px solid var(--color-grey-border); background: #fff; padding: 4px; }
.sd-company-header-card__logo-placeholder { width: 80px; height: 80px; border-radius: 8px; border: 1px solid var(--color-grey-border); background: var(--color-grey-bg); display: flex; align-items: center; justify-content: center; color: var(--color-grey-text); font-size: 2rem; }
.sd-company-header-card__info { flex: 1; min-width: 0; }
.sd-company-header-card__name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sd-company-header-card__name { font-size: 1.375rem; font-weight: 700; color: var(--color-navy); margin: 0; }

/* ---- Definition list ---- */
.sd-definition-list { display: grid; gap: 12px; }
.sd-definition-list--inline { grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); }
.sd-definition-list--stacked { grid-template-columns: 1fr; }
.sd-definition-list__item { display: flex; flex-direction: column; gap: 3px; }
.sd-definition-list dt { font-size: .75rem; font-weight: 600; color: var(--color-grey-text); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 5px; }
.sd-definition-list dd { font-size: .875rem; color: var(--color-body-text); margin: 0; }

/* ---- Tabs ---- */
.sd-tabs { display: flex; border-bottom: 1px solid var(--color-grey-border); padding: 0 4px; gap: 2px; overflow-x: auto; }
.sd-tab { padding: 12px 18px; font-size: .8125rem; font-weight: 500; color: var(--color-grey-text); background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.sd-tab:hover { color: var(--color-navy); }
.sd-tab--active { color: var(--color-blue-primary); border-bottom-color: var(--color-blue-primary); }
.sd-tab-panel { padding: 20px 24px; }
.sd-tab-panel__footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--color-grey-border); }

/* ---- Quick actions sidebar ---- */
.sd-quick-actions { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; }
.sd-btn--full { width: 100%; justify-content: center; }
.sd-stats-list { display: grid; gap: 0; }

/* Danger zone card body padding */
.sd-card--danger-zone form { padding: 0 20px 16px; }

/* Sidebar card actions-between-forms spacing */
.sd-card--danger-zone form + form { margin-top: 0; }
.sd-card--danger-zone form.sd-danger-zone__form--spaced { margin-bottom: 10px; }

/* Table column width helpers */
.sd-table__th--id,
.sd-table__td--id { width: 80px; }
.sd-table__th--right,
.sd-table__td--right { text-align: right; }
.sd-stats-list__item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-grey-border); }
.sd-stats-list__item:last-child { border-bottom: none; }
.sd-stats-list dt { font-size: .8125rem; color: var(--color-grey-text); }
.sd-stats-list dd { font-size: 1rem; font-weight: 700; color: var(--color-navy); margin: 0; }

/* ---- Danger zone ---- */
.sd-card--danger-zone { border-color: var(--color-red); }
.sd-card__heading--danger { color: var(--color-red) !important; }
.sd-danger-zone__text { font-size: .8125rem; color: var(--color-grey-text); margin-bottom: 12px; padding: 12px 20px 0; }
.sd-card__heading { display: flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 600; color: var(--color-navy); padding: 14px 20px; margin-bottom: 0; border-bottom: 1px solid var(--color-grey-border); }
.sd-card__heading i { color: var(--color-navy-mid); font-size: .9rem; }

/* ---- Misc helpers ---- */
.sd-note-box { background: var(--color-blue-lighter, #EBF5FB); border-left: 3px solid var(--color-blue-primary); padding: 10px 14px; border-radius: 4px; font-size: .875rem; color: var(--color-body-text); white-space: pre-wrap; }
.sd-code { font-family: 'Fira Code', monospace; font-size: .8125rem; background: var(--color-grey-bg); padding: 2px 6px; border-radius: 4px; color: var(--color-navy-mid); }
.sd-muted { color: var(--color-grey-text); }
.sd-link { color: var(--color-blue-primary); text-decoration: none; }
.sd-link:hover { text-decoration: underline; }

/* ---- Validation alert ---- */
.sd-alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 6px; margin-bottom: 20px; font-size: .875rem; }
.sd-alert--error { background: #FFF5F5; border: 1px solid var(--color-red); color: var(--color-red); }
.sd-alert__icon { flex-shrink: 0; margin-top: 1px; }
.sd-alert__list { margin: 6px 0 0; padding-left: 16px; color: var(--color-body-text); }

/* ---- Form layout ---- */
.sd-form-layout { display: flex; flex-direction: column; gap: 20px; }
.sd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sd-form-row--toggles { grid-template-columns: 1fr; gap: 16px; }
.sd-form-group { display: flex; flex-direction: column; gap: 6px; }
.sd-form-group--full { grid-column: 1 / -1; }
.sd-form-actions { display: flex; gap: 10px; align-items: center; padding: 20px 24px; border-top: 1px solid var(--color-grey-border); margin-top: 8px; }
.sd-label { display: block; font-weight: 600; font-size: .8125rem; color: var(--color-body-text); margin-bottom: 2px; }
.sd-label--required::after { content: ' *'; color: var(--color-red); }
.sd-help-text { font-size: .75rem; color: var(--color-grey-text); margin: 0 0 6px; }
.sd-field-error { font-size: .75rem; color: var(--color-red); display: flex; align-items: center; gap: 4px; margin: 0; }
.sd-input, .sd-select, .sd-textarea { width: 100%; border: 1px solid var(--color-grey-border); border-radius: 6px; padding: 8px 12px; font-size: .875rem; background: #fff; color: var(--color-body-text); font-family: inherit; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.sd-input--icon-left { padding-left: 32px; }
.sd-input:focus, .sd-select:focus, .sd-textarea:focus { outline: none; border-color: var(--color-blue-primary); box-shadow: 0 0 0 3px rgba(41,128,212,.2); }
.sd-input--error, .sd-input--error:focus { border-color: var(--color-red); background: #FFF5F5; }
.sd-textarea { resize: vertical; min-height: 90px; }

/* ---- File upload ---- */
.sd-file-upload-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sd-file-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.sd-file-upload-label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px dashed var(--color-grey-border); border-radius: 6px; cursor: pointer; font-size: .8125rem; color: var(--color-blue-primary); background: var(--color-blue-lighter, #EBF5FB); transition: background .15s, border-color .15s; }
.sd-file-upload-label:hover { background: var(--color-blue-light, #D6EAF8); border-color: var(--color-blue-primary); }
.sd-logo-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; border: 1px solid var(--color-grey-border); padding: 4px; background: #fff; }

/* ---- Toggle switch ---- */
.sd-toggle-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--color-grey-border); background: #fff; transition: background .15s; }
.sd-toggle-label:hover { background: var(--color-blue-lighter, #EBF5FB); }
.sd-toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.sd-toggle-track { width: 40px; height: 22px; border-radius: 11px; background: #ADB5BD; flex-shrink: 0; margin-top: 1px; position: relative; transition: background .2s; }
.sd-toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sd-toggle-input:checked + .sd-toggle-track { background: var(--color-green); }
.sd-toggle-input:checked + .sd-toggle-track::after { transform: translateX(18px); }
.sd-toggle-input:focus + .sd-toggle-track { box-shadow: 0 0 0 3px rgba(41,128,212,.3); }
.sd-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.sd-toggle-text__title { font-size: .875rem; font-weight: 600; color: var(--color-body-text); }
.sd-toggle-text__desc { font-size: .75rem; color: var(--color-grey-text); line-height: 1.4; }

/* ---- sd-btn variants ---- */
.sd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 16px; border-radius: 6px; font-size: .8125rem; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap; transition: filter .15s, box-shadow .15s; font-family: inherit; }
.sd-btn:hover { filter: brightness(92%); color: inherit; }
.sd-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(41,128,212,.3); }
.sd-btn--primary { background: var(--color-blue-primary); color: #fff; }
.sd-btn--secondary { background: #6C757D; color: #fff; }
.sd-btn--success { background: var(--color-green); color: #fff; }
.sd-btn--danger { background: var(--color-red); color: #fff; }
.sd-btn--warning { background: #FFC107; color: #212529; }
.sd-btn--dark { background: var(--color-navy-mid); color: #fff; }
.sd-btn--ghost { background: transparent; color: var(--color-blue-primary); border-color: var(--color-blue-primary); }
.sd-btn--sm { padding: 5px 10px; font-size: .75rem; }
.sd-btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.65); }
.sd-btn--outline-light:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.9); color: #fff; }

/* Logout button — used on white topbar, always visible */
.sd-btn--logout { background: var(--color-grey-bg); color: var(--color-navy); border-color: var(--color-grey-border); }
.sd-btn--logout:hover { background: #e2e6ea; border-color: #b0b6bf; color: var(--color-navy); filter: none; }

/* ---- sd-badge variants ---- */
.sd-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; line-height: 1.4; }
.sd-badge--success { background: var(--color-green); color: #fff; }
.sd-badge--inactive { background: #ADB5BD; color: #fff; }
.sd-badge--dark { background: var(--color-navy-mid); color: #fff; }
.sd-badge--info { background: var(--color-blue-primary); color: #fff; }
.sd-badge--danger { background: var(--color-red); color: #fff; }
.sd-badge--teal { background: #20C997; color: #fff; }
.sd-badge--warning { background: #FFC107; color: #212529; }
.sd-badge--super { background: var(--color-navy); color: #fff; }
.sd-badge--admin { background: var(--color-navy-mid); color: #fff; }
.sd-badge--agent { background: var(--color-blue-primary); color: #fff; }
.sd-badge--customer { background: var(--color-green); color: #fff; }

/* Sidebar header role badge — full width row below logo+brand */
.sd-sidebar__header > .sd-badge {
    display: block;
    width: 100%;
    text-align: center;
    border-radius: 4px;
    padding: 3px 0;
    font-size: 0.6875rem;
}

/* ── Role pill — matches customer portal style, role-specific colours ── */
.sd-role-pill {
    display: block;
    width: 100%;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.4;
    transition: opacity 0.15s;
}

/* Super Admin — deep purple/violet to stand out as highest privilege */
.sd-role-pill--super-admin {
    background: #6D28D9;
    color: #fff;
}

/* Agent Admin — rich teal/dark-cyan, distinct from both super and agent */
.sd-role-pill--agent-admin {
    background: #0D7377;
    color: #fff;
}

/* Agent — steel blue, clearly lower than admin tiers */
.sd-role-pill--agent {
    background: #2980D4;
    color: #fff;
}

/* Customer — green (matches existing portal pill in the screenshot) */
.sd-role-pill--customer {
    background: #16A34A;
    color: #fff;
}

/* ---- Card no-pad / sd-table ---- */
.sd-card--no-pad { padding: 0; overflow: hidden; }
.sd-table-wrap { overflow-x: auto; }
.sd-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.sd-table thead tr { background: var(--color-navy); color: #fff; }
.sd-table thead th { padding: 10px 13px; text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.sd-table tbody tr:nth-child(even) { background: var(--color-grey-bg); }
.sd-table tbody tr:hover { background: var(--color-blue-lighter, #EBF5FB); }
.sd-table tbody td { padding: 10px 13px; border-bottom: 1px solid var(--color-grey-border); vertical-align: middle; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .sd-layout-with-sidebar { grid-template-columns: 1fr; }
    .sd-layout-with-sidebar__sidebar { position: static; }
}
@media (max-width: 768px) {
    .sd-form-row { grid-template-columns: 1fr; }
    .sd-filter-bar__inner { flex-direction: column; }
    .sd-filter-bar__field, .sd-filter-bar__field--search { min-width: 100%; width: 100%; }
    .sd-page-header { flex-direction: column; }
    .sd-company-header-card__inner { flex-direction: column; }
    .sd-definition-list--inline { grid-template-columns: 1fr; }
}

/* ── Ticket layout (two-column) ───────────────────────────────────────── */
.ticket-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

.ticket-layout--portal {
    grid-template-columns: 1fr 240px;
}

@media (max-width: 900px) {
    .ticket-layout,
    .ticket-layout--portal {
        grid-template-columns: 1fr;
    }
    .ticket-sidebar {
        order: -1;
    }
}

/* ── Thread container ─────────────────────────────────────────────────── */
.ticket-thread {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.thread-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 32px 0;
}

/* ── Thread item (shared) ─────────────────────────────────────────────── */
.thread-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.thread-avatar {
    flex-shrink: 0;
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2980D4;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.avatar--agent  { background: #1A2E4A; }
.avatar--customer { background: #2980D4; }

.thread-content {
    flex: 1;
    min-width: 0;
}

.thread-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.thread-time {
    color: #999;
    font-size: 12px;
}

.thread-body {
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.65;
    color: #333;
    word-break: break-word;
}

/* Public reply */
.thread-item--public .thread-body {
    border-color: #d4e4f5;
    background: #f8fbff;
}

/* Agent reply (portal) */
.thread-item--agent .thread-body {
    background: #f4f6f8;
    border-color: #dde3ea;
}

/* Internal note */
.thread-item--internal .thread-body {
    background: #fffbea;
    border-color: #f0d070;
    border-left: 4px solid #f0c040;
}

/* ── Attachment list (inside thread item) ─────────────────────────────── */
.attachment-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f4f6f8;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.attachment-icon {
    font-size: 18px;
    color: #2980D4;
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.attachment-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    color: #999;
    font-size: 11px;
}

.attachment-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── File drop zone ───────────────────────────────────────────────────── */
.file-drop-zone {
    border: 2px dashed #c5d0dc;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}

.file-drop-zone:hover,
.file-drop-zone--active {
    background: #eef4fb;
    border-color: #2980D4;
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #667;
    font-size: 14px;
    pointer-events: none;
}

.file-drop-label i {
    font-size: 28px;
    color: #2980D4;
}

/* ── File preview list ────────────────────────────────────────────────── */
.file-preview-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f4f6f8;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.file-preview-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.file-preview-size {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

/* ── Toggle (internal note switch) ───────────────────────────────────── */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.toggle-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #f0c040;
    cursor: pointer;
}

.toggle-text {
    color: #555;
}

/* Tint form background when internal note is selected */
.reply-form--internal textarea {
    background: #fffbea !important;
    border-color: #f0d070 !important;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar-card .card-header {
    font-size: 14px;
}

.sidebar-body {
    padding: 12px 16px;
}

.sidebar-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
}

.sidebar-field:last-child {
    border-bottom: none;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-value {
    font-size: 14px;
    color: #333;
}

.sidebar-control .form-select--sm {
    padding: 5px 8px;
    font-size: 13px;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid #eef0f3;
    margin: 4px 0;
}

.sidebar-inline-form {
    margin: 0;
}

/* ── SLA indicators ───────────────────────────────────────────────────── */
.sla-indicator {
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sla-indicator--ok       { color: #28A745; }
.sla-indicator--met      { color: #28A745; }
.sla-indicator--breached { color: #DC3545; }
.sla-indicator--warning  { color: #e67e22; }

/* ── Tab nav ──────────────────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--color-grey-border);
    padding: 0 4px;
    gap: 2px;
    background-color: var(--color-white);
    overflow-x: auto;
}

/* BEM variant used by all tabbed views across the system */
.tab-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 11px 16px;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-grey-text);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-nav__btn:hover {
    color: var(--color-body-text);
    background-color: var(--color-grey-light);
}

.tab-nav__btn--active {
    color: var(--color-blue-primary);
    border-bottom-color: var(--color-blue-primary);
    font-weight: 600;
}

.tab-nav__btn i {
    font-size: 11px;
    opacity: 0.75;
}

.tab-nav__btn--active i {
    opacity: 1;
}

.tab-nav__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 1px 6px;
    background-color: var(--color-grey-light);
    color: var(--color-grey-text);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.5;
}

.tab-nav__btn--active .tab-nav__count {
    background-color: var(--color-blue-light);
    color: var(--color-blue-primary);
}

/* Legacy flat alias — kept for backward compat with any older templates */
.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #667;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--color-blue-primary); }

.tab-btn--active {
    color: var(--color-blue-primary);
    border-bottom-color: var(--color-blue-primary);
}

/* ── Audit / linked issue rows ────────────────────────────────────────── */
.audit-row {
    display: flex;
    gap: 12px;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid #f4f6f8;
    color: #555;
}

.audit-time  { color: #999; white-space: nowrap; }
.audit-user  { font-weight: 500; }
.audit-action { flex: 1; }

.linked-issue-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #f4f6f8;
}

/* ── Page header row ──────────────────────────────────────────────────── */
.page-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge--lg {
    font-size: 13px;
    padding: 5px 12px;
}

/* ── Info box (neutral/closed ticket notice) ──────────────────────────── */
.info-box {
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box--neutral {
    background: #f4f6f8;
    border-left: 4px solid #aab;
    color: #555;
}

/* ============================================================
   25. SD COMPONENT SYSTEM  (config pages, layout, modals)
   ============================================================ */

/* ── 25.1 Layout shell ───────────────────────────────────────────────── */
.sd-layout {
    display: flex;
    min-height: 100vh;
    background: #F4F6F8;
}

/* ── 25.2 Sidebar ────────────────────────────────────────────────────── */
.sd-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #1A2E4A;
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
}

.sd-sidebar__header {
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sd-sidebar__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sd-sidebar__logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.sd-sidebar__logo-fallback {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #2980D4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sd-sidebar__logo-icon {
    color: #fff;
    font-size: 18px;
}

.sd-sidebar__brand {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.sd-sidebar__company {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sd-sidebar__portal-name {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.3;
}

.sd-sidebar__nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sd-sidebar__footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sd-sidebar__user {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sd-sidebar__user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2980D4;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sd-sidebar__user-name {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .sd-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sd-sidebar--open {
        transform: translateX(0);
    }
}

/* ── 25.3 Main content area ──────────────────────────────────────────── */
.sd-main {
    margin-left: 220px;
    padding-top: 56px;
    min-height: 100vh;
    flex: 1;
    min-width: 0;
    width: calc(100% - 220px);
    max-width: none;
    display: flex;
    flex-direction: column; /* enables footer to stick to bottom via flex layout */
}

@media (max-width: 768px) {
    .sd-main {
        margin-left: 0;
        width: 100%;
    }
}

/* ── 25.4 Top bar ────────────────────────────────────────────────────── */
.sd-topbar {
    position: fixed;
    top: 0;
    left: 220px;
    right: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    z-index: 100;
}

@media (max-width: 768px) {
    .sd-topbar {
        left: 0;
    }
}

.sd-topbar__menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #555;
    display: none;
    line-height: 1;
}

@media (max-width: 768px) {
    .sd-topbar__menu-toggle {
        display: flex;
        align-items: center;
    }
}

.sd-topbar__title {
    font-size: 16px;
    font-weight: 600;
    color: #1A2E4A;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-topbar__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.sd-topbar__user-name {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.sd-topbar__logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* ── 25.5 Content wrapper ────────────────────────────────────────────── */
.sd-content {
    padding: 24px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    flex: 1; /* grows to fill available space, pushing footer to bottom */
}

/* ── 25.6 Sidebar navigation ─────────────────────────────────────────── */
.sd-nav-group {
    margin-bottom: 4px;
}

.sd-nav-group__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 12px 16px 4px;
    display: block;
}

.sd-nav-group__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sd-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.sd-nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.sd-nav-link--active {
    background: rgba(41,128,212,0.2);
    color: #fff;
    font-weight: 600;
}

.sd-nav-link--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #2980D4;
    border-radius: 0 2px 2px 0;
}

.sd-nav-link__icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.sd-nav-link--active .sd-nav-link__icon {
    opacity: 1;
}

/* ── 25.7 Config sub-navigation ──────────────────────────────────────── */
.sd-config-nav {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.sd-config-nav__list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.sd-config-nav__item {
    flex-shrink: 0;
}

.sd-config-nav__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    border-right: 1px solid #e1e4e8;
    border-bottom: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.sd-config-nav__link:hover {
    background: #f4f6f8;
    color: #1A2E4A;
}

.sd-config-nav__link--active {
    color: #2980D4;
    border-bottom-color: #2980D4;
    font-weight: 600;
    background: #f0f6ff;
}

.sd-config-nav__icon {
    font-size: 13px;
    opacity: 0.75;
}

.sd-config-nav__link--active .sd-config-nav__icon {
    opacity: 1;
}

/* ── 25.8 Card component ─────────────────────────────────────────────── */
.sd-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.sd-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e1e4e8;
    gap: 10px;
    flex-wrap: wrap;
}

.sd-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #1A2E4A;
    margin: 0;
}

.sd-card__subtitle {
    font-size: 12px;
    color: #888;
    margin: 2px 0 0;
}

.sd-card__body {
    padding: 24px;
}

.sd-card__body--flush {
    padding: 0;
}

.sd-card__footer {
    padding: 12px 20px;
    border-top: 1px solid #e1e4e8;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.sd-card__footer--right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

/* ── 25.9 Config table ───────────────────────────────────────────────── */
.sd-table--config {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sd-table__head {
    background: #1A2E4A;
}

.sd-table__th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    border: none;
}

.sd-table__th--drag {
    width: 36px;
    padding-left: 12px;
    padding-right: 4px;
}

.sd-table__th--center {
    text-align: center;
}

.sd-table__th--actions {
    text-align: right;
    width: 120px;
}

.sd-table__body tr {
    border-bottom: 1px solid #eef0f3;
    transition: background 0.1s;
}

.sd-table__body tr:hover {
    background: #f8f9fa;
}

.sd-table__body tr:last-child {
    border-bottom: none;
}

.sd-table__row--ghost {
    opacity: 0.45;
    outline: 2px dashed #2980D4;
    outline-offset: -2px;
    background: #f0f6ff !important;
}

.sd-table__td {
    padding: 11px 14px;
    vertical-align: middle;
    color: #333;
    border: none;
}

.sd-table__td--drag {
    padding-left: 12px;
    padding-right: 4px;
    width: 36px;
}

.sd-table__td--bold {
    font-weight: 600;
    color: #1A2E4A;
}

.sd-table__td--muted {
    color: #888;
}

.sd-table__td--center {
    text-align: center;
}

.sd-table__td--actions {
    text-align: right;
    white-space: nowrap;
    padding-right: 14px;
}

.sd-table__td--nowrap {
    white-space: nowrap;
}

.sd-table__td--empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
    font-size: 13px;
}

.sd-table__td--truncate {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 25.10 Drag handle ───────────────────────────────────────────────── */
.sd-drag-handle {
    cursor: grab;
    color: #bbb;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 3px;
    transition: color 0.1s, background 0.1s;
    user-select: none;
}

.sd-drag-handle:hover {
    color: #888;
    background: #f0f0f0;
}

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

/* ── 25.11 Colour picker components ──────────────────────────────────── */
.sd-colour-picker-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sd-colour-picker {
    width: 38px;
    height: 38px;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: none;
    flex-shrink: 0;
}

.sd-colour-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
}

.sd-colour-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.sd-input--colour-hex {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    width: 96px;
    text-transform: uppercase;
}

.sd-colour-preview {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
    display: inline-block;
}

.sd-colour-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sd-colour-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.12);
    display: inline-block;
    flex-shrink: 0;
}

.sd-colour-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
}

/* ── 25.12 Badge additions ───────────────────────────────────────────── */
.sd-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    line-height: 1.6;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.sd-badge--primary {
    background: #2980D4;
    color: #fff;
}

.sd-badge--success {
    background: #28A745;
    color: #fff;
}

.sd-badge--danger {
    background: #DC3545;
    color: #fff;
}

.sd-badge--neutral {
    background: #6C757D;
    color: #fff;
}

.sd-badge--warning {
    background: #FFC107;
    color: #212529;
    text-shadow: none;
}

.sd-badge--light {
    background: #e9ecef;
    color: #495057;
    text-shadow: none;
}

/* ── Action outcome pill colours (used in Email Processing Log) ── */
.sd-badge--green {
    background: #28A745;
    color: #fff;
}

.sd-badge--blue {
    background: #2980D4;
    color: #fff;
}

.sd-badge--amber {
    background: #F0A800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.sd-badge--muted {
    background: #6C757D;
    color: #fff;
    text-shadow: none;
}

.sd-badge--red {
    background: #DC3545;
    color: #fff;
}

/* ── Total count badge (card header, e.g. Email Processing Log) ── */
.sd-badge--navy {
    background: #1A2E4A;
    color: #fff;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    text-shadow: none;
}

/* ── 25.13 Count badges ──────────────────────────────────────────────── */
.sd-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.sd-count--linked {
    background: #e8f1fb;
    color: #1a5fa8;
}

.sd-count--zero {
    background: #f0f1f3;
    color: #aaa;
    font-weight: 500;
}

/* ── 25.14 Action group ──────────────────────────────────────────────── */
.sd-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

/* ── 25.15 Modal ─────────────────────────────────────────────────────── */
.sd-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 40, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 24px;
    z-index: 400;
    overflow-y: auto;
}

.sd-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    animation: sd-modal-in 0.2s ease;
    flex-shrink: 0;
}

@keyframes sd-modal-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sd-modal__header {
    background: #1A2E4A;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}

.sd-modal__title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.sd-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}

.sd-modal__close:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.sd-modal__form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sd-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.sd-modal__footer {
    padding: 14px 20px;
    border-top: 1px solid #e1e4e8;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ── 25.16 Checkbox components ───────────────────────────────────────── */
.sd-checkbox {
    width: 15px;
    height: 15px;
    accent-color: #2980D4;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.sd-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sd-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.12s;
    border: 1px solid #e1e4e8;
}

.sd-checkbox-label:hover {
    background: #f4f6f8;
}

.sd-checkbox-label__text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

.sd-checkbox-label__text strong {
    display: block;
    font-weight: 600;
    color: #1A2E4A;
    margin-bottom: 1px;
}

.sd-checkbox-label__text span {
    color: #777;
    font-size: 12px;
}

/* ── 25.17 Form field additions ──────────────────────────────────────── */
.sd-label__hint {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin-left: 6px;
}

.sd-field-hint {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    line-height: 1.4;
    display: block;
}

.sd-form-group--half {
    grid-column: span 1;
}

/* ── 25.18 Alert additions ───────────────────────────────────────────── */
.sd-alert {
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.sd-alert--success {
    background: #d4edda;
    border-color: #b8dfc4;
    color: #155724;
}

.sd-alert--danger {
    background: #f8d7da;
    border-color: #f1aeb5;
    color: #721c24;
}

.sd-alert--warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.sd-alert--info {
    background: #d1ecf1;
    border-color: #b8d8dc;
    color: #0c5460;
}

/* ── 25.19 Save order feedback ───────────────────────────────────────── */
.sd-save-feedback {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #28A745;
    font-weight: 600;
    margin-right: 8px;
}

/* ── 25.20 Page header helpers ───────────────────────────────────────── */
.sd-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.sd-page-header__left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sd-page-header__title {
    font-size: 20px;
    font-weight: 700;
    color: #1A2E4A;
    margin: 0;
}

.sd-page-header__subtitle {
    font-size: 13px;
    color: #777;
    margin: 0;
}

/* ── 25.21 Button additions ──────────────────────────────────────────── */
.sd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

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

.sd-btn--primary {
    background: #2980D4;
    color: #fff;
    border-color: #2272bd;
}

.sd-btn--primary:hover:not(:disabled) {
    background: #1e6ab8;
    border-color: #1a5ea6;
}

.sd-btn--secondary {
    background: #fff;
    color: #1A2E4A;
    border-color: #cfd3da;
}

.sd-btn--secondary:hover:not(:disabled) {
    background: #f4f6f8;
    border-color: #b0b6bf;
}

.sd-btn--success {
    background: #28A745;
    color: #fff;
    border-color: #20903b;
}

.sd-btn--success:hover:not(:disabled) {
    background: #218838;
}

.sd-btn--danger {
    background: #DC3545;
    color: #fff;
    border-color: #bd2130;
}

.sd-btn--danger:hover:not(:disabled) {
    background: #c82333;
}

.sd-btn--dark {
    background: #2d4258;
    color: #fff;
    border-color: #2d4258;
}

.sd-btn--dark:hover:not(:disabled) {
    background: #3d5166;
    border-color: #3d5166;
    color: #fff;
    text-decoration: none;
}

.sd-btn--ghost {
    background: transparent;
    color: #2980D4;
    border-color: transparent;
}

.sd-btn--ghost:hover:not(:disabled) {
    background: #f0f6ff;
    border-color: #c9dff7;
}

.sd-btn--outline {
    background: #fff;
    color: #1A2E4A;
    border-color: #c5cdd8;
}

.sd-btn--outline:hover:not(:disabled) {
    background: #f4f6f8;
    border-color: #9aaab8;
    color: #1A2E4A;
    text-decoration: none;
}

.sd-btn--xs {
    padding: 3px 8px;
    font-size: 11px;
    gap: 4px;
}

.sd-btn--sm {
    padding: 5px 10px;
    font-size: 12px;
}

.sd-btn--icon {
    padding: 6px 8px;
    min-width: 32px;
    justify-content: center;
}

/* ── 25.22 Utility: screen-reader only ───────────────────────────────── */
.sd-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── 25.23 SLA time display ──────────────────────────────────────────── */
.sd-time-display {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
}

.sd-time-display--none {
    color: #bbb;
    font-style: italic;
}

/* ============================================================
   SECTION 26 — REPORTING & ANALYTICS MODULE  (v2.0 § 11.4)
   ============================================================ */

/* ── 26.1 Report index cards grid ───────────────────────────────────── */
.sd-report-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
}

.sd-report-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
    cursor: pointer;
}

.sd-report-card:hover {
    box-shadow: 0 4px 16px rgba(26,46,74,0.12);
    border-color: #2980D4;
    transform: translateY(-2px);
}

.sd-report-card__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.sd-report-card__icon--blue   { background: #2980D4; }
.sd-report-card__icon--green  { background: #28A745; }
.sd-report-card__icon--purple { background: #7C3AED; }
.sd-report-card__icon--teal   { background: #0D9488; }
.sd-report-card__icon--yellow { background: #D97706; }
.sd-report-card__icon--red    { background: #DC3545; }
.sd-report-card__icon--navy   { background: #1A2E4A; }

.sd-report-card__body {
    flex: 1;
    min-width: 0;
}

.sd-report-card__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1A2E4A;
    line-height: 1.3;
}

.sd-report-card__desc {
    margin: 0;
    font-size: 0.825rem;
    color: #6b7280;
    line-height: 1.5;
}

.sd-report-card__arrow {
    flex-shrink: 0;
    color: #c0ccd8;
    font-size: 0.85rem;
    transition: color 0.18s ease, transform 0.18s ease;
}

.sd-report-card:hover .sd-report-card__arrow {
    color: #2980D4;
    transform: translateX(3px);
}

/* ── 26.2 Report filter bar ─────────────────────────────────────────── */
.sd-report-filters {
    margin-bottom: 1.25rem;
}

/*
 * The form uses flexbox so fields wrap naturally but never stretch
 * to fill empty space (which caused the huge gaps with auto-fit grid).
 * Each field takes only as much width as it needs (or the max-width cap).
 */
.sd-report-filters__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 20px 24px;
    box-sizing: border-box;
    width: 100%;
}

/* Every field group: stack label above control, fixed width */
.sd-report-filters__form .sd-form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 0 0 auto;           /* do NOT grow or shrink */
    width: 175px;             /* consistent fixed width for all fields */
}

/* Date inputs — slightly narrower than select fields */
.sd-report-filters__form .sd-form-group:has(.sd-input--date) {
    width: 155px;
}

/* Outcome / other single-select dropdowns can be a little wider */
.sd-report-filters__form .sd-form-group:has(.sd-select) {
    width: 190px;
}

/* Action group: buttons sit inline, vertically aligned with controls */
.sd-form-group--action {
    display: flex;
    flex-direction: row !important;  /* override column default */
    align-items: flex-end !important;
    gap: 8px;
    width: auto !important;          /* don't use fixed 175px */
    flex: 0 0 auto;
    padding-bottom: 0;
    margin-top: auto;                /* push down to baseline if label above other fields */
}

/* Labels inside filter bar */
.sd-report-filters__form .sd-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-grey-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0;
    white-space: nowrap;
}

/* Reset button colour — teal/secondary so it contrasts with Apply (blue) */
.sd-btn--reset {
    background: #0D9488;
    color: #fff;
    border-color: #0b7b71;
}
.sd-btn--reset:hover:not(:disabled) {
    background: #0b7b71;
    border-color: #097066;
    color: #fff;
    text-decoration: none;
    filter: none;
}

/* On tablet: allow fields to stretch across 2 columns */
@media (max-width: 900px) {
    .sd-report-filters__form .sd-form-group,
    .sd-report-filters__form .sd-form-group:has(.sd-input--date),
    .sd-report-filters__form .sd-form-group:has(.sd-select) {
        flex: 1 1 calc(50% - 8px);
        width: auto;
    }
    .sd-form-group--action {
        flex: 1 1 100%;
        width: 100% !important;
        justify-content: flex-end;
    }
}

/* On mobile: all fields full width, stacked */
@media (max-width: 600px) {
    .sd-report-filters__form {
        padding: 16px;
        gap: 12px;
    }
    .sd-report-filters__form .sd-form-group,
    .sd-report-filters__form .sd-form-group:has(.sd-input--date),
    .sd-report-filters__form .sd-form-group:has(.sd-select) {
        flex: 1 1 100%;
        width: 100%;
    }
    .sd-form-group--action {
        flex: 1 1 100%;
        width: 100% !important;
    }
    .sd-form-group--action .sd-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ── 26.3 Chart containers ───────────────────────────────────────────── */
.sd-report-chart-card {
    margin-bottom: 1.25rem;
}

.sd-report-chart-wrap {
    position: relative;
    width: 100%;
    max-height: 380px;
}

.sd-report-chart-wrap canvas {
    max-height: 380px;
}

.sd-report-chart-wrap--short canvas {
    max-height: 260px;
}

/* Two-column chart layout */
.sd-report-charts-row {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.sd-report-chart-card--grow  { /* takes remaining space — default */ }
.sd-report-chart-card--fixed { /* width governed by grid column */ }

@media (max-width: 1100px) {
    .sd-report-charts-row {
        grid-template-columns: 1fr;
    }
}

/* ── 26.4 SLA compliance colour classes ─────────────────────────────── */
.sd-compliance {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 52px;
    text-align: center;
}

.sd-compliance--green { background: rgba(40,167,69,0.12);  color: #1a7a35; border: 1px solid rgba(40,167,69,0.25); }
.sd-compliance--amber { background: rgba(255,193,7,0.15);  color: #8a6400; border: 1px solid rgba(255,193,7,0.35); }
.sd-compliance--red   { background: rgba(220,53,69,0.12);  color: #9e1e2c; border: 1px solid rgba(220,53,69,0.25); }
.sd-compliance--none  { background: rgba(0,0,0,0.05);      color: #9ca3af; border: 1px solid rgba(0,0,0,0.1);     }

/* Colour swatch used in legend */
.sd-compliance--swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
}

/* ── 26.5 SLA legend row ────────────────────────────────────────────── */
.sd-sla-legend {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.825rem;
    color: #555;
}

.sd-sla-legend__item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── 26.6 Breadcrumb ─────────────────────────────────────────────────── */
.sd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.sd-breadcrumb__link {
    color: #2980D4;
    text-decoration: none;
}

.sd-breadcrumb__link:hover {
    text-decoration: underline;
}

.sd-breadcrumb__sep {
    font-size: 0.65rem;
    color: #c0ccd8;
}

.sd-breadcrumb__current {
    color: #6b7280;
}

/* ── 26.7 CSAT star rating in stat card ─────────────────────────────── */
.sd-stat-card__sub {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ── 26.8 CSAT comment cell ─────────────────────────────────────────── */
.sd-table__cell--comment {
    max-width: 360px;
}

.sd-csat-comment {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
    color: #444;
    font-size: 0.85rem;
}

/* ── 26.9 Email log flag icons ───────────────────────────────────────── */
.sd-table__cell--flags {
    white-space: nowrap;
    text-align: center;
}

.sd-flag-icon {
    font-size: 0.85rem;
    margin: 0 2px;
    cursor: help;
}

.sd-flag-icon--blue  { color: #2980D4; }
.sd-flag-icon--green { color: #28A745; }
.sd-flag-icon--teal  { color: #0D9488; }
.sd-flag-icon--red   { color: #DC3545; }

.sd-table__cell--email {
    max-width: 200px;
}

.sd-table__cell--subject {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 26.10 Stat grid variants ───────────────────────────────────────── */

/* Base stat grid (used by email-log and other reports with 4-6 cards) */
.sd-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 1.25rem;
}

.sd-stat-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.sd-stat-grid--1 {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .sd-stat-grid--3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* sd-stat-card inner layout (used in report stat grids) */
.sd-stat-card {
    background: #fff;
    border: 1px solid var(--color-grey-border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-left: 4px solid var(--color-grey-border);
}

.sd-stat-card--blue   { border-left-color: var(--color-blue-primary); }
.sd-stat-card--green  { border-left-color: var(--color-green); }
.sd-stat-card--red    { border-left-color: var(--color-red); }
.sd-stat-card--amber  { border-left-color: var(--color-amber); }
.sd-stat-card--teal   { border-left-color: var(--color-teal); }
.sd-stat-card--warning { border-left-color: var(--color-amber); }

.sd-stat-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.sd-stat-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-grey-text);
    line-height: 1.3;
}

.sd-stat-card__value {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--color-navy);
    line-height: 1;
}

.sd-stat-card__sub {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--color-grey-text);
}

.sd-stat-card__icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--color-grey-bg);
    color: var(--color-grey-text);
}

.sd-stat-card--blue   .sd-stat-card__icon-wrap { background: var(--color-blue-light);  color: var(--color-blue-primary); }
.sd-stat-card--green  .sd-stat-card__icon-wrap { background: var(--color-green-light); color: var(--color-green); }
.sd-stat-card--red    .sd-stat-card__icon-wrap { background: var(--color-red-light);   color: var(--color-red); }
.sd-stat-card--amber  .sd-stat-card__icon-wrap { background: var(--color-amber-light); color: var(--color-amber-dark); }
.sd-stat-card--teal   .sd-stat-card__icon-wrap { background: var(--color-teal-light);  color: var(--color-teal); }
.sd-stat-card--warning .sd-stat-card__icon-wrap { background: var(--color-amber-light); color: var(--color-amber-dark); }

/* ── 26.11 Avatar initials inline ───────────────────────────────────── */
.sd-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e5eaf2;
    color: #1A2E4A;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── 26.12 Dot swatch in priority column ────────────────────────────── */
.sd-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── 26.13 Table row separator ──────────────────────────────────────── */
.sd-table__row--sep td {
    border-top: 2px solid #e5edf5;
}

/* ── 26.14 Coloured badges for CSAT warning ─────────────────────────── */
.sd-badge--warning {
    background: rgba(255,193,7,0.15);
    color: #8a6400;
    border: 1px solid rgba(255,193,7,0.35);
}

.sd-badge--purple {
    background: rgba(124,58,237,0.12);
    color: #5b21b6;
    border: 1px solid rgba(124,58,237,0.25);
}

/* ── 26.15 Compact table variant ─────────────────────────────────────── */
.sd-table--compact td,
.sd-table--compact th {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
}

.sd-table__sub {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 1px;
}

/* ============================================================
   27. SD-TOAST NOTIFICATIONS  (used by partials/toast.blade.php)
   ============================================================ */

/*
 * Fixed top-right container. pointer-events:none on the wrapper
 * so only the toast cards themselves are clickable.
 */
.sd-toast-container {
    position: fixed;
    top: calc(var(--topbar-height, 56px) + 12px);
    right: 16px;
    z-index: var(--z-toast, 500);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
    width: calc(100% - 32px);
}

/*
 * Individual toast card.
 * overflow:hidden is required so the progress bar is clipped cleanly.
 */
.sd-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 18px;
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-toast, 0 4px 12px rgba(0,0,0,.15));
    pointer-events: all;
    border-left: 4px solid transparent;
    background-color: var(--color-white, #fff);
    overflow: hidden;
}

/* ── Alpine enter/leave transition classes ── */
.sd-toast-enter        { transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16,1,0.3,1); }
.sd-toast-enter-start  { opacity: 0; transform: translateX(calc(100% + 16px)); }
.sd-toast-enter-end    { opacity: 1; transform: translateX(0); }
.sd-toast-leave        { transition: opacity 0.3s ease, transform 0.3s ease; }
.sd-toast-leave-start  { opacity: 1; transform: translateX(0); }
.sd-toast-leave-end    { opacity: 0; transform: translateX(calc(100% + 16px)); }

/* ── Icon ── */
.sd-toast__icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Message text ── */
.sd-toast__message {
    font-size: var(--text-sm, 0.875rem);
    line-height: 1.45;
    color: var(--color-body-text, #2D3748);
    flex: 1;
    margin: 0;
}

/*
 * Close button — HIDDEN.
 * The toast dismisses automatically after 4 s; no X button needed.
 */
.sd-toast__close {
    display: none !important;
}

/*
 * Progress bar — shrinks from 100% to 0% over 4 seconds,
 * matching the Alpine auto-dismiss timer.
 */
.sd-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
    animation: sdToastProgress 4s linear forwards;
    transform-origin: left center;
}

@keyframes sdToastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ── Colour variants ── */
.sd-toast--success {
    border-left-color: var(--color-green, #28A745);
}
.sd-toast--success .sd-toast__icon    { color: var(--color-green, #28A745); }
.sd-toast--success .sd-toast__progress { background-color: var(--color-green, #28A745); }

.sd-toast--error {
    border-left-color: var(--color-red, #DC3545);
}
.sd-toast--error .sd-toast__icon    { color: var(--color-red, #DC3545); }
.sd-toast--error .sd-toast__progress { background-color: var(--color-red, #DC3545); }

.sd-toast--warning {
    border-left-color: var(--color-amber, #FFC107);
}
.sd-toast--warning .sd-toast__icon    { color: var(--color-amber-dark, #856404); }
.sd-toast--warning .sd-toast__progress { background-color: var(--color-amber, #FFC107); }

.sd-toast--info {
    border-left-color: var(--color-blue-primary, #2980D4);
}
.sd-toast--info .sd-toast__icon    { color: var(--color-blue-primary, #2980D4); }
.sd-toast--info .sd-toast__progress { background-color: var(--color-blue-primary, #2980D4); }

/* Mobile: stack at bottom */
@media (max-width: 767px) {
    .sd-toast-container {
        top: auto;
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }
}

/* ============================================================
   28. FLASH ALERT — AUTO-DISMISS
   ============================================================ */

/*
 * Smooth auto-dismiss for inline sd-alert flash banners.
 * The animation fades opacity out first (0–60%), then collapses
 * height, padding and margin (60–100%) so the page content below
 * slides up gradually rather than jumping.
 */
@keyframes sdAlertDismiss {
    0%   { opacity: 1; max-height: 80px; margin-bottom: 16px; padding-top: 12px; padding-bottom: 12px; }
    60%  { opacity: 0; max-height: 80px; margin-bottom: 16px; padding-top: 12px; padding-bottom: 12px; }
    100% { opacity: 0; max-height: 0;    margin-bottom: 0;    padding-top: 0;    padding-bottom: 0;    overflow: hidden; }
}

.sd-alert--autodismiss {
    animation: sdAlertDismiss 0.6s ease 4s forwards;
    overflow: hidden;
}

/* ============================================================
   29. SD-STAT-LIST  (Email Config sidebar queue stats widget)
   ============================================================ */

/*
 * Compact key-value list used in sidebar cards (e.g. Email Queue Stats).
 * Mirrors the sd-stat-card visual language but stacks vertically so it
 * fits neatly inside the narrow sidebar column.
 */

.sd-stat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sd-stat-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #eef0f3;
    font-size: 0.8125rem;
    transition: background 0.12s;
}

.sd-stat-list__item:last-child {
    border-bottom: none;
}

.sd-stat-list__item:hover {
    background: #f8f9fa;
}

/* Highlighted total row */
.sd-stat-list__item--total {
    background: #f4f6f8;
    font-weight: 600;
}

.sd-stat-list__item--total:hover {
    background: #eef1f5;
}

/* Label (left side) */
.sd-stat-list__label {
    color: #4a5568;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.sd-stat-list__item--total .sd-stat-list__label {
    color: #1A2E4A;
    font-weight: 700;
}

/* Value (right side) — base style */
.sd-stat-list__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1A2E4A;
    white-space: nowrap;
    min-width: 28px;
    text-align: right;
    line-height: 1;
}

/* Colour variants — match sd-stat-card accent colours */
.sd-stat-list__value--blue   { color: var(--color-blue-primary, #2980D4); }
.sd-stat-list__value--green  { color: var(--color-green,         #28A745); }
.sd-stat-list__value--amber  { color: var(--color-amber-dark,    #856404); }
.sd-stat-list__value--red    { color: var(--color-red,           #DC3545); }
.sd-stat-list__value--teal   { color: var(--color-teal,          #1ABC9C); }

/* Pill badge variant — draws a small coloured bubble around the number */
.sd-stat-list__value--pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8125rem;
}

.sd-stat-list__value--blue.sd-stat-list__value--pill  { background: var(--color-blue-light,  #D6EAF8); }
.sd-stat-list__value--green.sd-stat-list__value--pill { background: var(--color-green-light, #D4EDDA); }
.sd-stat-list__value--amber.sd-stat-list__value--pill { background: var(--color-amber-light, #FFF3CD); }
.sd-stat-list__value--red.sd-stat-list__value--pill   { background: var(--color-red-light,   #F8D7DA); }

/* ============================================================
   30. SD — DESIGN SYSTEM COMPONENTS (Admin UI)
       Form elements, layout primitives, and page-level
       components used across all admin views.
   ============================================================ */

/* ── 30.1  Input Group (text input + appended button/addon) ── */
/*
 * Usage:
 *   <div class="sd-input-group">
 *     <input class="sd-input sd-input-group__input">
 *     <button class="sd-input-group__btn">…</button>
 *   </div>
 */
.sd-input-group {
    display: flex;
    align-items: stretch;
}

.sd-input-group .sd-input,
.sd-input-group__input {
    flex: 1;
    min-width: 0;
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Keep error border visible on the right when in a group */
.sd-input-group .sd-input--error,
.sd-input-group__input.sd-input--error {
    border-right: 1px solid var(--color-red);
}

.sd-input-group__btn {
    flex-shrink: 0;
    padding: 0 12px;
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    color: var(--color-grey-text);
    font-size: var(--text-base);
    line-height: 1;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sd-input-group__btn:hover {
    background-color: #e2e6ea;
    color: var(--color-body-text);
}

.sd-input-group__btn:focus-visible {
    outline: 3px solid rgba(41, 128, 212, 0.4);
    outline-offset: 1px;
    z-index: 1;
    position: relative;
}

/* Text/icon addon (non-interactive) */
.sd-input-group__addon {
    flex-shrink: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    color: var(--color-grey-text);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.sd-input-group__addon--prefix {
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.sd-input-group__addon--prefix + .sd-input,
.sd-input-group__addon--prefix + .sd-input-group__input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-right: 1px solid var(--color-grey-border);
}


/* ── 30.2  Toggle Switch ──────────────────────────────────── */
/*
 * Usage:
 *   <div class="sd-toggle-row">
 *     <label class="sd-toggle" for="myToggle">
 *       <input type="hidden"   name="myField" value="0">
 *       <input type="checkbox" id="myToggle" name="myField" value="1" class="sd-toggle__input">
 *       <span class="sd-toggle__slider" aria-hidden="true"></span>
 *     </label>
 *     <div class="sd-toggle-row__label">
 *       <span class="sd-toggle-row__title">Feature name</span>
 *       <span class="sd-toggle-row__desc">Helper text explaining the toggle.</span>
 *     </div>
 *   </div>
 */

/* Outer wrapper: toggle + label side-by-side */
.sd-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* The <label> element that wraps the checkbox and slider */
.sd-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

/* Hide the real checkbox visually but keep it accessible */
.sd-toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

/* The sliding track */
.sd-toggle__slider {
    position: absolute;
    inset: 0;
    background-color: var(--color-grey-mid);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-base);
}

/* The circular knob */
.sd-toggle__slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--color-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform var(--transition-base);
}

/* Checked state: blue track, knob slides right */
.sd-toggle__input:checked + .sd-toggle__slider {
    background-color: var(--color-blue-primary);
}

.sd-toggle__input:checked + .sd-toggle__slider::after {
    transform: translateX(20px);
}

/* Focus ring (keyboard nav) */
.sd-toggle__input:focus-visible + .sd-toggle__slider {
    outline: 3px solid rgba(41, 128, 212, 0.4);
    outline-offset: 2px;
}

/* Label text block (sits to the right of the toggle) */
.sd-toggle-row__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sd-toggle-row__title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-heading-text);
    line-height: 1.3;
}

.sd-toggle-row__desc {
    font-size: var(--text-base);
    color: var(--color-grey-text);
    line-height: 1.4;
}

/* Legacy aliases — kept for backwards compat with any existing blades */
.sd-toggle-wrap           { display: flex; align-items: center; gap: 12px; }
.sd-toggle-label          { display: flex; flex-direction: column; gap: 2px; }
.sd-toggle-label__title   { font-size: var(--text-md); font-weight: 600; color: var(--color-heading-text); line-height: 1.3; }
.sd-toggle-label__desc    { font-size: var(--text-base); color: var(--color-grey-text); line-height: 1.4; }

/* ============================================================
   31. EMAIL LOG — DETAIL PANEL & ROW STYLES
   ============================================================ */

/* Danger row highlight (error outcomes) */
.sd-table__row--danger {
    background-color: #fff5f5 !important;
}
.sd-table__row--danger:hover {
    background-color: #fee2e2 !important;
}

/* Detail panel inside expandable row */
.sd-table__td--detail {
    padding: 0 !important;
    background-color: #f8f9fa;
    border-top: none;
}

.sd-detail-panel {
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 2px solid #e1e4e8;
}

.sd-detail-panel__row {
    display: flex;
    gap: 12px;
    font-size: 0.8125rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.sd-detail-panel__label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    min-width: 160px;
    flex-shrink: 0;
}

.sd-detail-panel__row--danger .sd-detail-panel__label {
    color: var(--color-red);
}

.sd-detail-panel__row--danger span:last-child {
    color: #7a1a25;
    font-family: var(--font-mono);
    font-size: 0.775rem;
    word-break: break-all;
}

.sd-code-inline {
    font-family: var(--font-mono);
    font-size: 0.775rem;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    color: #333;
    word-break: break-all;
}

/* ============================================================
   32. FOOTER BAR
   ============================================================ */

.sd-footer {
    width: 100%;
    background-color: var(--color-navy, #1a2b4a);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 24px;
    flex-shrink: 0;
}

.sd-footer__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: var(--text-xs, 0.75rem);
    color: rgba(255, 255, 255, 0.55);
}

.sd-footer__app-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.01em;
}

.sd-footer__version {
    color: rgba(255, 255, 255, 0.55);
}

.sd-footer__copyright {
    color: rgba(255, 255, 255, 0.55);
}

.sd-footer__divider {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.6rem;
    line-height: 1;
}

/* Guest layout footer adjustment */
.sd-guest-body .sd-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: rgba(15, 28, 56, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ============================================================
   END OF SNOWMAN DESIGN — snowman.css  (v2.0)
   ============================================================ */


/* ============================================================
   33. CMS — VARIABLE ALIASES & COMPATIBILITY TOKENS
   Maps the older variable names used by CMS module CSS files
   (conversation-thread, file-management, portal-files, tasks,
   responsive-accessibility) to the canonical design tokens
   defined in section 2 above.
   ============================================================ */
:root {
    /* Colour aliases */
    --color-primary:          #2980D4;
    --color-primary-dark:     #2171BE;
    --color-primary-light:    #EBF5FB;
    --color-success:          #28A745;
    --color-danger:           #DC3545;
    --color-warning:          #FFC107;
    --color-navy-dark:        #132238;
    --color-navy-light:       #243d5e;

    /* Neutral aliases */
    --color-bg:               #F4F6F8;
    --color-card:             #FFFFFF;
    --color-border:           #DEE2E6;
    --color-text:             #2D3748;
    --color-text-muted:       #6C757D;
    --color-text-light:       #ADB5BD;
    --color-text-primary:     #1A2E4A;
    --color-text-secondary:   #4A5568;
    --color-surface:          #F8F9FA;

    /* Font alias */
    --font-sans:              'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Shadow aliases */
    --shadow-sm:              0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:              0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:              0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);

    /* Misc aliases */
    --radius-card:            8px;
    --radius-btn:             6px;
    --transition-sidebar:     0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing scale (used by conversation-thread & tasks modules) */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
}


/* ============================================================
   34. CMS — AUTH PAGE LOGIN CLASSES
   The CMS admin login (resources/views/auth/admin/login.blade.php)
   uses these class names. They map onto the navy-background
   login-card layout already established in section 6 above.
   ============================================================ */

/* Body & outer wrapper (set by auth/layout.blade.php) */
.auth-body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 30% 40%, var(--color-navy-mid) 0%, var(--color-navy) 65%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
}

/* .auth-card is already defined in section 6 — no duplication needed */

/* Logo block */
.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo-img {
    display: block;
    max-width: 160px;
    height: auto;
    margin: 0 auto;
}

/* Page heading & sub-heading */
.auth-heading {
    text-align: center;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-heading-text);
    margin-bottom: 4px;
}

.auth-subheading {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    margin-bottom: 28px;
}

/* form-input — CMS name for the design-system .form-control */
.form-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--color-body-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast),
                background-color var(--transition-fast);
    appearance: none;
    line-height: 1.5;
}

.form-input::placeholder { color: var(--color-grey-mid); }
.form-input:hover        { border-color: #b5bcc5; }

.form-input:focus {
    outline: none;
    border-color: var(--color-blue-primary);
    box-shadow: 0 0 0 3px rgba(41, 128, 212, 0.18);
    background-color: var(--color-blue-lighter);
}

.form-input:disabled,
.form-input[readonly] {
    background-color: var(--color-grey-light);
    color: var(--color-grey-text);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-input.is-invalid {
    border-color: var(--color-red);
    box-shadow: none;
}
.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18);
}

/* Full-width button (login submit) */
.btn-full {
    width: 100%;
    justify-content: center;
}

/* Remember-me row */
.form-check-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

/* Alert / flash message boxes */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    margin-bottom: 18px;
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
}

/* Single-dash variants (legacy auth pages) */
.alert-success,
.alert--success {
    background-color: var(--color-green-light);
    border-color: #b8dfc4;
    border-left-color: var(--color-green);
    color: #155724;
}

.alert-danger,
.alert--danger {
    background-color: var(--color-red-light);
    border-color: #f1aeb5;
    border-left-color: var(--color-red);
    color: #721c24;
}

.alert-warning,
.alert--warning {
    background-color: var(--color-amber-light);
    border-color: var(--color-amber);
    border-left-color: var(--color-amber);
    color: var(--color-amber-dark);
}

.alert-info,
.alert--info {
    background-color: var(--color-blue-light);
    border-color: #b8d4f4;
    border-left-color: var(--color-blue-primary);
    color: #1a5c94;
}

.alert-list,
.alert__list {
    margin: 6px 0 0;
    padding-left: 18px;
    list-style: disc;
    font-size: var(--text-base);
}

.alert-list li,
.alert__list li { margin-bottom: 3px; }

/* Forgot-password / footer link */
.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-link {
    font-size: var(--text-sm);
    color: var(--color-blue-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.auth-link:hover {
    color: var(--color-blue-hover);
    text-decoration: underline;
}

/* Auth form group spacing */
.auth-form .form-group { margin-bottom: 18px; }

/* Mobile tweaks for the auth card */
@media (max-width: 479px) {
    .auth-card   { padding: 28px 20px; }
    .auth-wrapper { padding: 0 8px; }
}


/* ============================================================
   END OF SNOWMAN DESIGN CMS — snowman.css  (v2.1)
   ============================================================ */


/* ============================================================
   35. CMS — CONVERSATION THREAD MODULE
   (merged from conversation-thread.css — now redundant)
   ============================================================ */

.conversation-thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
}

.conversation-thread__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
}

.conversation-thread__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-navy, #1A2E4A);
    margin: 0;
}

.conversation-thread__subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted, #6C757D);
    margin: 0;
}

.conversation-thread__messages {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
    max-height: 520px;
    overflow-y: auto;
    padding: var(--space-2, 0.5rem) 0;
    scroll-behavior: smooth;
}

.conversation-thread__empty {
    text-align: center;
    color: var(--color-text-muted, #6C757D);
    padding: var(--space-8, 2rem) 0;
    font-size: 0.9375rem;
}

.conversation-message {
    display: flex;
    gap: var(--space-3, 0.75rem);
    align-items: flex-start;
}

.conversation-message--own {
    flex-direction: row-reverse;
}

.conversation-message__avatar {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--color-primary, #2980D4);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    line-height: 1;
}

.conversation-message--customer .conversation-message__avatar { background-color: var(--color-success, #28A745); }
.conversation-message--own      .conversation-message__avatar { background-color: var(--color-navy, #1A2E4A); }
.conversation-message--note     .conversation-message__avatar { background-color: #856404; }

.conversation-message__body {
    flex: 1;
    min-width: 0;
    max-width: 82%;
}

.conversation-message--own .conversation-message__body { align-items: flex-end; }

.conversation-message__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
    font-size: 0.8125rem;
}

.conversation-message--own .conversation-message__meta { flex-direction: row-reverse; }

.conversation-message__sender { font-weight: 600; color: var(--color-navy, #1A2E4A); }
.conversation-message__you    { font-weight: 400; color: var(--color-text-muted, #6C757D); font-size: 0.75rem; }

.conversation-message__time {
    font-size: 0.75rem;
    color: var(--color-text-muted, #6C757D);
    margin-left: auto;
}

.conversation-message--own .conversation-message__time { margin-left: 0; margin-right: auto; }

.conversation-message__content {
    background: var(--color-surface, #F4F6F8);
    border: 1px solid var(--color-border, #DEE2E6);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text, #212529);
    word-break: break-word;
}

.conversation-message--admin .conversation-message__content { background: #fff; border-color: var(--color-border, #DEE2E6); }
.conversation-message--own   .conversation-message__content { background: var(--color-primary-light, #EBF4FF); border-color: var(--color-primary, #2980D4); }
.conversation-message--note  .conversation-message__content { background: #fffbea; border-color: #f0d060; }

.badge--note {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #f0d060;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15em 0.45em;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge--admin {
    background-color: var(--color-primary-light, #EBF4FF);
    color: var(--color-primary, #2980D4);
    border: 1px solid var(--color-primary, #2980D4);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15em 0.45em;
    border-radius: 0.25rem;
}

.badge--customer {
    background-color: #d1f0da;
    color: #155724;
    border: 1px solid #c3e6cb;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15em 0.45em;
    border-radius: 0.25rem;
}

.conversation-thread__type-toggle {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 0.75rem);
}

.toggle-btn {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--color-border, #DEE2E6);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    background: #fff;
    color: var(--color-text-muted, #6C757D);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
    margin-right: 0.35rem;
}

.toggle-btn--active {
    background: var(--color-primary, #2980D4);
    border-color: var(--color-primary, #2980D4);
    color: #fff;
    font-weight: 600;
}

.conversation-compose {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 0.75rem);
    padding-top: var(--space-4, 1rem);
    border-top: 1px solid var(--color-border, #DEE2E6);
    margin-top: var(--space-2, 0.5rem);
}

.conversation-compose__editor { width: 100%; }

.conversation-compose__hint {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6C757D);
    margin: 0;
}

.conversation-compose__hint code {
    font-size: 0.8125rem;
    background: var(--color-surface, #F4F6F8);
    padding: 0.1em 0.3em;
    border-radius: 0.2rem;
    border: 1px solid var(--color-border, #DEE2E6);
}

.conversation-compose__actions { display: flex; justify-content: flex-end; }

@media (max-width: 600px) {
    .conversation-message__body { max-width: 95%; }
    .conversation-message--own  { flex-direction: column-reverse; align-items: flex-end; }
    .conversation-message:not(.conversation-message--own) { flex-direction: column; }
    .conversation-message__time { margin-left: 0; }
}


/* ============================================================
   36. CMS — FILE MANAGEMENT MODULE
   (merged from file_management_additions.css — now redundant)
   ============================================================ */

.file-name-cell { display: flex; align-items: center; gap: 10px; }

.file-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #E8F0FE;
    color: #2980D4;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.file-type-icon.file-type-pdf  { background: #FDECEC; color: #DC3545; }
.file-type-icon.file-type-jpg,
.file-type-icon.file-type-jpeg,
.file-type-icon.file-type-png,
.file-type-icon.file-type-gif,
.file-type-icon.file-type-webp { background: #EAF9EE; color: #28A745; }
.file-type-icon.file-type-ai,
.file-type-icon.file-type-eps,
.file-type-icon.file-type-svg  { background: #FFF3E0; color: #E65100; }
.file-type-icon.file-type-zip,
.file-type-icon.file-type-rar  { background: #F3E5F5; color: #7B1FA2; }
.file-type-icon.file-type-doc,
.file-type-icon.file-type-docx { background: #E3F2FD; color: #1565C0; }
.file-type-icon.file-type-xls,
.file-type-icon.file-type-xlsx { background: #E8F5E9; color: #2E7D32; }

.file-display-name { font-weight: 500; color: #1A2E4A; word-break: break-word; }

.download-restricted { display: inline-flex; align-items: center; gap: 5px; color: #6C757D; font-size: 13px; }
.download-restricted-label { font-weight: 500; }

.restriction-notice-row td { background: #FFFBF2; padding-top: 0; border-top: none; }

.restriction-notice {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 8px 12px;
    background: #FFF3CD;
    border: 1px solid #FFEEBA;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    line-height: 1.5;
}
.restriction-notice svg { flex-shrink: 0; margin-top: 1px; color: #E6A817; }

.upload-received-badge { display: inline-flex; align-items: center; gap: 4px; }

.upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 32px 24px;
    border: 2px dashed #C8D6E5;
    border-radius: 8px;
    background: #F8FAFD;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    outline: none;
    text-align: center;
}
.upload-zone:hover,
.upload-zone:focus-visible    { border-color: #2980D4; background: #EEF5FD; }
.upload-zone--drag-over       { border-color: #2980D4; background: #E8F2FD; box-shadow: 0 0 0 3px rgba(41,128,212,0.15); }
.upload-zone--has-file        { border-style: solid; border-color: #28A745; background: #F0FBF3; }
.upload-zone__input           { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; pointer-events: none; }
.upload-zone__icon            { width: 48px; height: 48px; color: #2980D4; margin-bottom: 12px; }
.upload-zone__label           { margin: 0 0 4px; font-size: 15px; color: #1A2E4A; }
.upload-zone__hint            { margin: 0; font-size: 12px; color: #6C757D; }
.upload-zone__selected        { display: flex; align-items: center; gap: 12px; }
.upload-zone__selected-icon   { width: 36px; height: 36px; color: #28A745; flex-shrink: 0; }
.upload-zone__file-info       { text-align: left; flex: 1; min-width: 0; }
.upload-zone__file-name       { margin: 0 0 2px; font-weight: 600; font-size: 14px; color: #1A2E4A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-zone__file-size       { margin: 0; font-size: 12px; color: #6C757D; }
.upload-zone__clear-btn       { flex-shrink: 0; width: 28px; height: 28px; padding: 4px; border: none; border-radius: 4px; background: transparent; color: #6C757D; cursor: pointer; transition: background 0.1s, color 0.1s; }
.upload-zone__clear-btn:hover { background: #F8D7DA; color: #DC3545; }

.compare-selector-form  { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.compare-selector-group { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; }
.compare-selector-label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #1A2E4A; white-space: nowrap; margin: 0; }
.compare-selector-swap  { flex-shrink: 0; }

.version-panel-tag    { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.version-panel-tag--a { background: #E3F2FD; color: #1565C0; border: 1.5px solid #1565C0; }
.version-panel-tag--b { background: #E8F5E9; color: #2E7D32; border: 1.5px solid #2E7D32; }

.compare-grid { display: grid; grid-template-columns: 1fr 40px 1fr; align-items: start; gap: 0; }

@media (max-width: 900px) {
    .compare-grid    { grid-template-columns: 1fr; }
    .compare-divider { display: flex; justify-content: center; padding: 8px 0; }
}

.compare-panel        { background: #FFFFFF; border: 1px solid #DEE2E6; border-radius: 8px; overflow: hidden; }
.compare-panel--a     { border-top: 3px solid #1565C0; }
.compare-panel--b     { border-top: 3px solid #2E7D32; }

.compare-panel__header  { display: flex; align-items: center; gap: 8px; padding: 16px 20px 12px; border-bottom: 1px solid #F0F0F0; }
.compare-panel__title   { margin: 0; font-size: 16px; font-weight: 700; color: #1A2E4A; }
.compare-panel__meta    { padding: 16px 20px; border-bottom: 1px solid #F0F0F0; }

.meta-list          { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.meta-list__row     { display: flex; gap: 8px; font-size: 13px; }
.meta-list__row dt  { flex: 0 0 120px; color: #6C757D; font-weight: 500; }
.meta-list__row dd  { margin: 0; color: #1A2E4A; font-weight: 400; word-break: break-word; }

.compare-panel__preview {
    padding: 16px 20px;
    background: repeating-conic-gradient(#F0F0F0 0% 25%, #FFFFFF 0% 50%) 0 0 / 20px 20px;
    border-bottom: 1px solid #F0F0F0;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.compare-panel__image { max-width: 100%; max-height: 480px; object-fit: contain; border-radius: 2px; box-shadow: 0 2px 12px rgba(0,0,0,0.12); }

.compare-panel__no-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    text-align: center;
    border-bottom: 1px solid #F0F0F0;
    background: #F8FAFD;
    min-height: 160px;
}
.no-preview-icon  { width: 48px; height: 48px; color: #ADB5BD; margin-bottom: 12px; }
.no-preview-label { margin: 0 0 4px; font-weight: 600; font-size: 14px; color: #495057; }
.no-preview-hint  { margin: 0; font-size: 12px; color: #6C757D; }

.compare-panel__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 20px; }

.compare-divider        { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 60px; }
.compare-divider__label { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #E9ECEF; font-size: 11px; font-weight: 700; color: #6C757D; }

.compare-image-stats       { display: flex; flex-wrap: wrap; gap: 24px; }
.compare-image-stat        { display: flex; flex-direction: column; gap: 2px; }
.compare-image-stat__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #6C757D; }
.compare-image-stat__value { font-size: 15px; font-weight: 600; color: #1A2E4A; }

.version-compare-bar         { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 0 16px; border-bottom: 1px solid #F0F0F0; margin-bottom: 16px; }
.version-compare-bar__fields { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-compare-bar__vs     { font-size: 12px; font-weight: 700; color: #6C757D; padding: 0 2px; }
.version-compare-bar__same-warning { margin: 0; font-size: 12px; color: #DC3545; }

.form-control--inline         { width: auto; min-width: 160px; }
.form-group--inline           { display: flex; align-items: center; gap: 8px; margin: 0; }
.form-group--inline .form-label { margin: 0; white-space: nowrap; font-size: 13px; }

.btn--disabled     { opacity: 0.55; pointer-events: none; }
.align-self-center { align-self: center; }
.ms-2              { margin-left: 8px; }
.icon-xs           { width: 14px; height: 14px; display: inline-block; vertical-align: middle; }
.icon-sm           { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }


/* ============================================================
   37. CMS — PORTAL FILES MODULE
   (merged from portal_files_css_additions.css — now redundant)
   ============================================================ */

.file-detail-wrapper { position: relative; }

.file-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .file-detail-grid { grid-template-columns: 1fr; }
}

.file-meta-header { display: flex; gap: 1rem; align-items: flex-start; }

.file-icon-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: var(--color-bg, #F4F6F8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-meta-info   { flex: 1; min-width: 0; }
.file-meta-name   { font-size: 1.125rem; font-weight: 600; color: var(--color-navy, #1A2E4A); margin: 0 0 .4rem; word-break: break-word; }
.file-meta-tags   { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .35rem; }
.file-meta-sub    { font-size: .8125rem; color: var(--color-text-muted, #6C757D); margin: 0; }

.file-description {
    border-top: 1px solid var(--color-border, #E0E4EA);
    padding-top: 1rem;
    font-size: .9375rem;
    line-height: 1.7;
    color: var(--color-text, #2C3E50);
}

.download-limit-notice { display: flex; align-items: center; gap: .35rem; font-size: .8125rem; color: var(--color-primary, #2980D4); }

.approval-stages { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding-bottom: .25rem; }

.approval-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    min-width: 0;
}

.approval-stage__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border, #E0E4EA);
    border: 2px solid var(--color-border, #E0E4EA);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    color: #fff;
    transition: background .2s, border-color .2s;
}

.approval-stage--done .approval-stage__dot     { background: var(--color-success, #28A745); border-color: var(--color-success, #28A745); }
.approval-stage--active .approval-stage__dot   { background: var(--color-primary, #2980D4); border-color: var(--color-primary, #2980D4); box-shadow: 0 0 0 4px rgba(41,128,212,.15); }
.approval-stage--rejected .approval-stage__dot { background: var(--color-danger, #DC3545);  border-color: var(--color-danger, #DC3545);  box-shadow: 0 0 0 4px rgba(220,53,69,.15); }

.approval-stage__label { font-size: .7rem; color: var(--color-text-muted, #6C757D); text-align: center; margin-top: .4rem; white-space: nowrap; }
.approval-stage--active .approval-stage__label,
.approval-stage--done   .approval-stage__label { font-weight: 600; color: var(--color-navy, #1A2E4A); }

.approval-stage__connector { position: absolute; top: 14px; left: calc(50% + 14px); right: calc(-50% + 14px); height: 2px; background: var(--color-border, #E0E4EA); z-index: 0; }
.approval-stage__connector--done { background: var(--color-success, #28A745); }

.approval-action-buttons { display: flex; gap: .75rem; flex-wrap: wrap; }
.card--success-state     { border: 1.5px solid var(--color-success, #28A745); }
.success-icon-wrap       { color: var(--color-success, #28A745); display: flex; justify-content: center; }

.version-list { list-style: none; margin: 0; padding: 0; }
.version-list__item { display: flex; align-items: center; justify-content: space-between; padding: .65rem 1rem; border-bottom: 1px solid var(--color-border, #E0E4EA); gap: .75rem; }
.version-list__item:last-child   { border-bottom: none; }
.version-list__item--current     { background: rgba(41,128,212,.04); }
.version-list__meta              { display: flex; flex-direction: column; gap: .2rem; }
.version-list__badge             { font-weight: 600; font-size: .875rem; display: flex; align-items: center; gap: .35rem; }
.version-list__date,
.version-list__size              { font-size: .775rem; }

.approval-log-list { list-style: none; margin: 0; padding: 0; }
.approval-log-list__item { display: flex; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--color-border, #E0E4EA); align-items: flex-start; }
.approval-log-list__item:last-child { border-bottom: none; }
.approval-log-list__dot             { width: 10px; height: 10px; border-radius: 50%; margin-top: .3rem; flex-shrink: 0; background: var(--color-border, #E0E4EA); }
.approval-log-list__dot--approved      { background: var(--color-success, #28A745); }
.approval-log-list__dot--rejected      { background: var(--color-danger,  #DC3545); }
.approval-log-list__dot--client_review { background: var(--color-warning, #F59E0B); }
.approval-log-list__dot--final         { background: var(--color-primary, #2980D4); }
.approval-log-list__content  { flex: 1; min-width: 0; }
.approval-log-list__action   { font-weight: 600; font-size: .875rem; color: var(--color-navy, #1A2E4A); }
.approval-log-list__who      { font-size: .8125rem; margin-left: .3rem; }
.approval-log-list__comment  { font-size: .8125rem; color: var(--color-text-muted, #6C757D); margin: .2rem 0 0; font-style: italic; }
.approval-log-list__time     { display: block; margin-top: .15rem; }

.filter-tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--color-border, #E0E4EA); flex-wrap: wrap; }

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-text-muted, #6C757D);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.filter-tab:hover        { color: var(--color-primary, #2980D4); }
.filter-tab--active      { color: var(--color-primary, #2980D4); border-bottom-color: var(--color-primary, #2980D4); font-weight: 600; }
.filter-tab__count       { background: var(--color-bg, #F4F6F8); color: var(--color-text-muted, #6C757D); border-radius: 10px; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; min-width: 1.4rem; text-align: center; line-height: 1.6; }
.filter-tab__count--danger { background: var(--color-danger, #DC3545); color: #fff; }

.version-history-row td           { background: #FAFBFC; }
.version-history-panel            { padding: .75rem 1.25rem 1rem; }
.version-history-panel__title     { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted, #6C757D); margin: 0 0 .5rem; }
.version-history-table            { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.version-history-table th         { font-weight: 600; color: var(--color-text-muted, #6C757D); padding: .3rem .5rem; text-align: left; border-bottom: 1px solid var(--color-border, #E0E4EA); }
.version-history-table td         { padding: .4rem .5rem; border-bottom: 1px solid var(--color-border, #E0E4EA); }
.version-history-table tr:last-child td { border-bottom: none; }
.version-history-table__row--current td { background: rgba(41,128,212,.04); font-weight: 500; }

.file-drop-zone {
    position: relative;
    border: 2px dashed var(--color-border, #E0E4EA);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.file-drop-zone:hover,
.file-drop-zone--active  { border-color: var(--color-primary, #2980D4); background: rgba(41,128,212,.04); }
.file-drop-zone--has-file { border-color: var(--color-success, #28A745); background: rgba(40,167,69,.04); }
.file-drop-zone__input   { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop-zone__content { pointer-events: none; }
.file-drop-zone__browse  { color: var(--color-primary, #2980D4); cursor: pointer; text-decoration: underline; pointer-events: auto; }

.upload-success-state { text-align: center; padding: 1.5rem 1rem; }
.upload-success-icon  { color: var(--color-success, #28A745); margin-bottom: .75rem; display: flex; justify-content: center; }
.upload-success-title { font-size: 1.125rem; font-weight: 600; color: var(--color-navy, #1A2E4A); margin: 0 0 .5rem; }
.upload-success-text  { color: var(--color-text-muted, #6C757D); font-size: .9375rem; margin: 0 0 1.5rem; }

.upload-status-label[data-status="received"]           { color: var(--color-text-muted, #6C757D); }
.upload-status-label[data-status="under_review"]       { color: var(--color-warning, #F59E0B); }
.upload-status-label[data-status="ready_for_download"] { color: var(--color-success, #28A745); }
.upload-status-label[data-status="action_required"]    { color: var(--color-danger, #DC3545); font-weight: 600; }

.file-link       { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--color-navy, #1A2E4A); font-weight: 500; }
.file-link:hover { color: var(--color-primary, #2980D4); text-decoration: underline; }

.badge--pulse { animation: badge-pulse 2s ease-in-out infinite; }
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }

.badge--version { background: var(--color-navy, #1A2E4A); color: #fff; font-family: monospace; font-size: .7rem; padding: .15rem .45rem; border-radius: 4px; }
.badge--xs      { font-size: .65rem; padding: .1rem .35rem; }

.data-table__row--highlight    { background: rgba(245,158,11,.05) !important; }
.data-table__row--highlight td { border-left: 3px solid var(--color-warning, #F59E0B); }

.nav-link .badge--danger { background: var(--color-danger, #DC3545); color: #fff; font-size: .65rem; padding: .1rem .4rem; border-radius: 8px; font-weight: 700; vertical-align: middle; margin-left: .35rem; }

.transition-expand   { overflow: hidden; animation: expand .2s ease-out; }
.transition-collapse { overflow: hidden; animation: collapse .15s ease-in; }
@keyframes expand   { from { opacity:0; max-height:0; }   to { opacity:1; max-height:600px; } }
@keyframes collapse { from { opacity:1; }                 to { opacity:0; } }

.toast-enter { animation: toast-in  .25s ease-out; }
.toast-leave { animation: toast-out .2s  ease-in;  }
@keyframes toast-in  { from { transform: translateY(1rem); opacity:0; } to { transform: translateY(0); opacity:1; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }


/* ============================================================
   38. CMS — TASKS MODULE
   (merged from snowman-tasks.css — now redundant)
   ============================================================ */

.task-list-header {
    display: grid;
    grid-template-columns: 24px 32px 1fr 100px 80px 48px 100px 56px 56px 96px;
    align-items: center;
    padding: 0 12px 6px;
    border-bottom: 1px solid #e0e4e9;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
}

.task-list { display: flex; flex-direction: column; }

.task-row {
    display: grid;
    grid-template-columns: 24px 32px 1fr 100px 80px 48px 100px 56px 56px 96px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.1s;
    cursor: default;
}
.task-row:hover         { background: #f8f9fb; }
.task-row--parent       { font-weight: 500; }
.task-row--sub          { background: #fafbfc; grid-template-columns: 24px 18px 32px 1fr 100px 80px 48px 100px 56px 56px 96px; padding-left: 28px; }
.task-row--completed    { opacity: 0.65; }
.task-row--dragging     { opacity: 0.4; box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.task-row--over         { background: #e8f0fe; outline: 2px dashed #2980D4; outline-offset: -2px; }

.task-row__grip         { color: #ced4da; cursor: grab; display: flex; align-items: center; justify-content: center; }
.task-row__grip:active  { cursor: grabbing; }
.task-row__grip--sub    { padding-left: 4px; }

.task-complete-btn      { background: none; border: none; padding: 0; cursor: pointer; line-height: 0; display: flex; align-items: center; justify-content: center; }
.task-complete-btn:hover rect { stroke: #28A745; }
.task-complete-btn--done rect { fill: #28A745; stroke: #28A745; }

.task-name-link             { color: #1A2E4A; text-decoration: none; font-size: 13px; display: inline; }
.task-name-link:hover       { color: #2980D4; text-decoration: underline; }
.task-name-link--strikethrough { text-decoration: line-through; color: #6c757d; }
.task-name-link--sub        { font-weight: 400; font-size: 12.5px; }

.task-subtask-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #495057;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: 6px;
}

.task-row__indent-icon  { display: flex; align-items: center; justify-content: center; color: #adb5bd; }
.task-row__actions      { display: flex; align-items: center; gap: 4px; }

.task-list__empty   { padding: 32px 16px; text-align: center; color: #6c757d; font-size: 14px; }
.task-list__empty a { color: #2980D4; }

.avatar         { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; flex-shrink: 0; background: #2980D4; color: #fff; }
.avatar--sm     { width: 28px; height: 28px; font-size: 12px; }
.avatar--xs     { width: 22px; height: 22px; font-size: 10px; }
.avatar--blue       { background: #2980D4; }
.avatar--empty      { background: #ced4da; color: #6c757d; }
.avatar--unassigned { background: #e9ecef; color: #6c757d; font-size: 14px; }

.toggle-btn__track  { display: block; width: 36px; height: 20px; background: #ced4da; border-radius: 10px; position: relative; transition: background 0.2s; }
.toggle-btn--on .toggle-btn__track { background: #28A745; }
.toggle-btn__thumb  { display: block; width: 14px; height: 14px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.toggle-btn--on .toggle-btn__thumb { left: 19px; }

.btn-icon--edit:hover   { background: #e8f0fe; color: #2980D4; border-color: #ccdcf5; }
.btn-icon--add:hover    { background: #d1e7dd; color: #28A745; border-color: #b6d8c6; }
.btn-icon--delete:hover { background: #f8d7da; color: #DC3545; border-color: #f1b8bc; }

.form-row--2col         { grid-template-columns: 1fr 1fr; }
.form-group--narrow     { max-width: 200px; }
.form-group--required .form-label::after { content: ' *'; color: #DC3545; }
.form-label__hint       { font-weight: 400; color: #6c757d; font-size: 12px; }
.form-control--error    { border-color: #DC3545; }
.form-control--sm       { padding: 5px 8px; font-size: 12px; }
.form-select            { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.form-select--sm        { padding: 5px 24px 5px 8px; font-size: 12px; background-position: right 8px center; }
.form-error             { display: block; font-size: 12px; color: #DC3545; margin-top: 4px; }
.form-hint              { display: block; font-size: 12px; color: #6c757d; margin-top: 4px; }

.form-check-card            { border-radius: 6px; padding: 12px 14px; border: 1px solid #ced4da; background: #fff; }
.form-check-card--prominent { border-color: #ffc107; background: #fffef2; }
.form-check-text            { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.form-check-hint            { font-size: 12px; color: #6c757d; font-weight: 400; line-height: 1.5; }

.linked-email-card          { border: 1px solid #ccdcf5; border-radius: 6px; background: #f0f5fc; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.linked-email-card__header  { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.linked-email-card__icon    { color: #2980D4; flex-shrink: 0; }
.linked-email-card__meta    { display: flex; gap: 16px; font-size: 12px; color: #6c757d; }
.linked-email-card__actions { display: flex; gap: 8px; }

.link-email-expander          { margin-top: 8px; }
.link-email-expander__toggle  { font-size: 13px; color: #2980D4; cursor: pointer; font-weight: 500; }
.link-email-expander__body    { margin-top: 10px; }

.data-table tfoot td        { font-weight: 600; background: #f8f9fb; border-top: 2px solid #e0e4e9; }
.data-table--compact th,
.data-table--compact td     { padding: 6px 8px; }

.detail-layout          { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: flex-start; }
.detail-layout__main    { display: flex; flex-direction: column; gap: 16px; }
.detail-layout__sidebar { display: flex; flex-direction: column; gap: 16px; }

.task-detail__title-row     { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.task-detail__name          { font-size: 20px; font-weight: 700; color: #1A2E4A; margin: 0; line-height: 1.3; }
.task-detail__name--completed { text-decoration: line-through; color: #6c757d; }
.task-detail__badges        { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.task-detail__parent-link   { font-size: 12px; color: #6c757d; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.task-detail__parent-link a { color: #2980D4; }
.task-detail__description   { padding: 16px 0; }
.task-detail__no-description { font-size: 13px; padding: 12px 0; }

.sub-task-list      { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.sub-task-item      { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 5px; font-size: 13px; }
.sub-task-item:hover { background: #f8f9fb; }
.sub-task-item--done { opacity: 0.6; }
.sub-task-item a     { color: #1A2E4A; text-decoration: none; flex: 1; }
.sub-task-item a:hover { color: #2980D4; text-decoration: underline; }

.sub-task-item__status-dot              { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sub-task-item__status-dot--to_do       { background: #6c757d; }
.sub-task-item__status-dot--in_progress { background: #2980D4; }
.sub-task-item__status-dot--in_review   { background: #fd7e14; }
.sub-task-item__status-dot--blocked     { background: #DC3545; }
.sub-task-item__status-dot--done        { background: #28A745; }

.detail-list    { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 13px; margin: 0; }
.detail-list dt { color: #6c757d; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; padding-top: 2px; }
.detail-list dd { color: #343a40; margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.email-preview              { padding: 4px 0; }
.email-preview__meta        { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #495057; padding-bottom: 12px; border-bottom: 1px solid #e0e4e9; margin-bottom: 12px; }
.email-preview__body        { max-height: 300px; overflow-y: auto; font-size: 13px; line-height: 1.6; }
.email-preview__body--text  { background: #f8f9fb; border-radius: 4px; padding: 12px; font-family: monospace; white-space: pre-wrap; word-break: break-word; }

.content-card               { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden; }
.content-card__header       { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e0e4e9; gap: 12px; flex-wrap: wrap; }
.content-card__title        { font-size: 16px; font-weight: 700; color: #1A2E4A; margin: 0; }
.content-card__subtitle     { font-size: 13px; color: #6c757d; margin: 2px 0 0; }
.content-card--form         { padding: 0; }
.content-card--form > form  { padding: 20px; }
.content-card--form .alert  { margin: 16px 20px 0; }
.content-card--sidebar .content-card__title { font-size: 14px; padding: 12px 16px; border-bottom: 1px solid #e0e4e9; }
.content-card--sidebar .detail-list         { padding: 12px 16px; }

.page-header                    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-header__breadcrumb        { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6c757d; }
.page-header__breadcrumb a      { color: #2980D4; text-decoration: none; }
.page-header__breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep                 { color: #ced4da; }
.page-header__actions           { display: flex; align-items: center; gap: 8px; }

.alert--success { background: #d1e7dd; color: #0a4b27; border: 1px solid #b6d8c6; }
.alert--danger  { background: #f8d7da; color: #842029; border: 1px solid #f1b8bc; }
.alert__list    { margin: 0; padding-left: 18px; }

.btn--sm              { padding: 6px 12px; font-size: 12px; }
.btn--primary         { background: #2980D4; color: #fff; border-color: #2572bc; }
.btn--primary:hover   { background: #2168b5; box-shadow: 0 2px 6px rgba(41,128,212,0.35); color: #fff; text-decoration: none; }
.btn--secondary       { background: #fff; color: #495057; border-color: #ced4da; }
.btn--secondary:hover { background: #f8f9fb; border-color: #adb5bd; color: #495057; text-decoration: none; }
.btn--danger-outline       { background: #fff; color: #DC3545; border-color: #DC3545; }
.btn--danger-outline:hover { background: #f8d7da; color: #DC3545; text-decoration: none; }
.btn--primary-outline       { background: #fff; color: #2980D4; border-color: #2980D4; }
.btn--primary-outline:hover { background: #d0e8fb; color: #2980D4; text-decoration: none; }

.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid #e0e4e9; margin-top: 8px; }

.prose            { font-size: 14px; line-height: 1.65; color: #343a40; }
.prose h1, .prose h2, .prose h3 { color: #1A2E4A; margin-top: 1.2em; }
.prose a          { color: #2980D4; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose table      { border-collapse: collapse; width: 100%; }
.prose table th, .prose table td { border: 1px solid #dee2e6; padding: 6px 10px; }
.prose table th   { background: #f8f9fb; font-weight: 600; }

.text-strikethrough { text-decoration: line-through; }

@media (max-width: 1024px) {
    .task-list-header,
    .task-row { grid-template-columns: 24px 32px 1fr 90px 70px 40px 90px 52px 52px 80px; gap: 6px; }
    .task-row--sub { grid-template-columns: 24px 16px 32px 1fr 90px 70px 40px 90px 52px 52px 80px; }
    .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .form-row--2col { grid-template-columns: 1fr; }
    .task-list-header { display: none; }
    .task-row,
    .task-row--sub { grid-template-columns: 24px 32px 1fr auto auto; gap: 6px; }
    .task-row__status, .task-row__priority, .task-row__due,
    .task-row__customer-visible, .task-row__hours { display: none; }
    .kanban-board { flex-direction: column; }
    .kanban-col   { flex: none; width: 100%; min-width: 0; max-height: none; }
}


/* ============================================================
   39. CMS — RESPONSIVE & ACCESSIBILITY MODULE
   (merged from snowman_responsive_accessibility.css — now redundant)
   WCAG 2.1 AA (Portal) / Level A (Admin)
   ============================================================ */

/* ---- Skip to main content (WCAG 2.4.1) ---- */
.skip-to-main {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 24px;
    background: var(--color-blue-primary);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0 0 var(--radius-btn) var(--radius-btn);
    text-decoration: none;
    white-space: nowrap;
    transition: top var(--transition-base);
    border: 2px solid var(--color-white);
}
.skip-to-main:focus { top: 0; outline: 3px solid var(--color-white); outline-offset: 2px; }

/* ---- Global focus styles (WCAG 2.4.7) ---- */
*:focus { outline: none; }
*:focus-visible { outline: 3px solid var(--color-blue-primary); outline-offset: 2px; border-radius: 3px; }

.sidebar *:focus-visible,
.topbar *:focus-visible,
.nav-item *:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }

button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible { outline: 3px solid var(--color-blue-primary); outline-offset: 2px; border-radius: var(--radius-btn); }

input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 3px solid var(--color-blue-primary); outline-offset: 0; border-color: var(--color-blue-primary); box-shadow: 0 0 0 3px rgba(41,128,212,0.18); border-radius: 4px; }

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible { outline: 3px solid var(--color-blue-primary); outline-offset: 3px; }

a:focus-visible { outline: 3px solid var(--color-blue-primary); outline-offset: 2px; border-radius: 2px; text-decoration: underline; }

/* ---- Colour contrast overrides (WCAG 1.4.3) ---- */
.text-muted, .form-text, .hint-text { color: #6B7280; }
.badge-secondary, .tag-secondary    { background-color: #E9ECEF; color: #595F69; }
::placeholder                        { color: #737B88; opacity: 1; }

.field-error .form-control {
    border-color: var(--color-red);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23DC3545' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

.field-success .form-control {
    border-color: var(--color-green);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2328A745' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

/* ---- Form error messages (WCAG 1.3.1, 3.3.1) ---- */
.form-error-message {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-red);
    line-height: 1.4;
}
.form-error-message::before { content: "⚠ "; speak: never; }

.form-label .required-indicator { color: var(--color-red); margin-left: 2px; }
.form-label.required::after     { content: " *"; color: var(--color-red); font-weight: 700; }

/* ---- Table accessibility (WCAG 1.3.1) ---- */
.data-table caption {
    caption-side: top;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary, #4A5568);
    padding: 0 0 10px 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table th[scope="col"] {
    background: #F0F4F8;
    color: var(--color-text-primary, #1A2E4A);
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--color-border, #DEE2E6);
    white-space: nowrap;
}

.data-table th[scope="row"] { font-weight: 600; color: var(--color-text-primary, #1A2E4A); text-align: left; padding: 10px 14px; }

/* ---- Modal accessibility (WCAG 2.1.1) ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26,46,74,0.55);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-backdrop[aria-hidden="true"] { display: none; }

.modal-dialog {
    background: var(--color-white);
    border-radius: var(--radius-card, 8px);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1050;
    -webkit-overflow-scrolling: touch;
}
.modal-dialog:focus { outline: none; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--color-border, #DEE2E6);
}
.modal-title     { font-size: 1.125rem; font-weight: 700; color: var(--color-text-primary, #1A2E4A); margin: 0; }
.modal-close-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--color-border, #DEE2E6); border-radius: 6px; background: transparent; cursor: pointer; color: var(--color-text-secondary, #4A5568); transition: background var(--transition-base), color var(--transition-base); flex-shrink: 0; }
.modal-close-btn:hover { background: #F0F4F8; color: var(--color-text-primary, #1A2E4A); }
.modal-body   { padding: 20px 24px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--color-border, #DEE2E6); }

/* ---- App layout shell ---- */
.app-layout   { display: flex; min-height: 100vh; background: var(--color-bg, #F4F6F8); }
.main-wrapper { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left var(--transition-sidebar); }

.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--color-border, #DEE2E6);
    border-radius: var(--radius-btn, 6px);
    cursor: pointer;
    color: var(--color-text-primary, #1A2E4A);
    flex-shrink: 0;
    transition: background var(--transition-base);
}
.hamburger-btn:hover { background: #F0F4F8; }
.hamburger-btn svg   { width: 20px; height: 20px; pointer-events: none; }

/* ---- Sidebar nav elements ---- */
.sidebar-logo     { display: flex; align-items: center; gap: 10px; padding: 0 20px; height: var(--topbar-height); border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; text-decoration: none; overflow: hidden; }
.sidebar-logo-text { font-size: 1.0625rem; font-weight: 700; color: var(--color-white); white-space: nowrap; line-height: 1.2; }
.sidebar-logo-sub  { font-size: 0.6875rem; font-weight: 400; color: rgba(255,255,255,0.55); white-space: nowrap; display: block; }

.nav-section-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4); padding: 14px 20px 6px; white-space: nowrap; overflow: hidden; }
.nav-item          { display: block; padding: 0 10px; margin-bottom: 2px; position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: rgba(255,255,255,0.72);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--transition-base), color var(--transition-base);
    overflow: hidden;
}
.nav-link:hover  { background: rgba(255,255,255,0.1); color: var(--color-white); }
.nav-link.active { background: rgba(41,128,212,0.3); color: var(--color-white); font-weight: 600; }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 24px; background: var(--color-blue-primary); border-radius: 0 3px 3px 0; }
.nav-link svg      { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-link-text     { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-badge         { background: var(--color-blue-primary); color: white; font-size: 0.6875rem; font-weight: 700; padding: 2px 6px; border-radius: 10px; flex-shrink: 0; min-width: 20px; text-align: center; }

/* ---- Tablet (768–1023px): icon-only sidebar ---- */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar.icon-only { width: var(--sidebar-collapsed, 60px); }
    .main-wrapper.sidebar-icon-only { margin-left: var(--sidebar-collapsed, 60px); }

    .sidebar.icon-only .nav-link-text,
    .sidebar.icon-only .nav-section-label,
    .sidebar.icon-only .sidebar-logo-text,
    .sidebar.icon-only .sidebar-logo-sub,
    .sidebar.icon-only .nav-badge { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }

    .sidebar.icon-only .nav-link        { justify-content: center; padding: 12px; gap: 0; }
    .sidebar.icon-only .nav-link svg    { width: 20px; height: 20px; opacity: 1; }
    .sidebar.icon-only .sidebar-logo    { justify-content: center; padding: 0 10px; }
    .sidebar.icon-only .nav-link        { position: relative; }
    .sidebar.icon-only .nav-link::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(var(--sidebar-collapsed, 60px) + 8px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--color-navy-dark, #132238);
        color: white;
        font-size: 0.8125rem;
        font-weight: 500;
        padding: 6px 10px;
        border-radius: 5px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s ease;
        z-index: 300;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    .sidebar.icon-only .nav-link:hover::after { opacity: 1; }

    .sidebar-collapse-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 8px 10px;
        padding: 8px;
        background: rgba(255,255,255,0.08);
        border: none;
        border-radius: 6px;
        color: rgba(255,255,255,0.6);
        cursor: pointer;
        transition: background var(--transition-base);
        width: calc(100% - 20px);
    }
    .sidebar-collapse-btn:hover { background: rgba(255,255,255,0.14); color: white; }

    .form-grid-2col { grid-template-columns: 1fr !important; }
    .main-content   { padding: 20px; }
    .gantt-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gantt-inner     { min-width: 900px; }
    .timesheet-chart-wrapper { height: 240px !important; }
}

/* ---- Mobile (<768px) ---- */
@media (max-width: 767px) {
    .hamburger-btn          { display: flex; }
    .sidebar                { transform: translateX(-100%); width: var(--sidebar-width); }
    .sidebar.is-open        { transform: translateX(0); }
    .sidebar-backdrop       { display: block; }
    .sidebar-backdrop[hidden] { display: none; }
    .main-wrapper           { margin-left: 0; }
    .topbar                 { padding: 0 16px; }
    .topbar-title           { font-size: 1rem; }
    .timer-widget-floating  { display: none !important; }
    .timer-widget-inline    { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(41,128,212,0.08); border: 1px solid rgba(41,128,212,0.2); border-radius: var(--radius-btn); font-size: 0.8125rem; font-weight: 600; color: var(--color-blue-primary); margin-left: auto; }
    .timer-widget-inline .timer-display { font-family: 'Courier New', monospace; font-size: 0.875rem; letter-spacing: 0.04em; }
    .main-content           { padding: 16px; }
    .page-header            { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header-actions    { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
    .page-header-actions .btn { flex: 1; justify-content: center; min-width: 120px; }
    .card-grid-3col, .card-grid-2col { grid-template-columns: 1fr !important; }
    .form-grid-2col, .form-grid-3col { grid-template-columns: 1fr !important; }

    .table-responsive-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-card, 8px);
        box-shadow: var(--shadow-card);
        background: linear-gradient(to right, white 30%, rgba(255,255,255,0)) left, linear-gradient(to right, rgba(255,255,255,0), white 70%) right, radial-gradient(farthest-side at 0 50%, rgba(26,46,74,0.1), transparent) left, radial-gradient(farthest-side at 100% 50%, rgba(26,46,74,0.1), transparent) right;
        background-repeat: no-repeat;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }
    .table-responsive-wrapper .data-table { min-width: 640px; }

    .table-stacked .data-table thead { display: none; }
    .table-stacked .data-table,
    .table-stacked .data-table tbody,
    .table-stacked .data-table tr,
    .table-stacked .data-table td { display: block; width: 100%; }
    .table-stacked .data-table tr { background: var(--color-white); border: 1px solid var(--color-border, #DEE2E6); border-radius: var(--radius-card, 8px); margin-bottom: 10px; padding: 12px; box-shadow: var(--shadow-card); }
    .table-stacked .data-table td { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #F0F4F8; font-size: 0.875rem; }
    .table-stacked .data-table td:last-child { border-bottom: none; }
    .table-stacked .data-table td::before { content: attr(data-label); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted, #6C757D); flex-shrink: 0; margin-right: 12px; padding-top: 1px; }

    .timesheet-layout        { grid-template-columns: 1fr !important; }
    .timesheet-chart-wrapper { height: 200px !important; }
    .gantt-container         { overflow-x: auto; -webkit-overflow-scrolling: touch; cursor: grab; }
    .gantt-container:active  { cursor: grabbing; }
    .gantt-inner             { min-width: 700px; zoom: 0.85; -moz-transform: scale(0.85); -moz-transform-origin: top left; }
    .stats-grid              { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .modal-backdrop          { align-items: flex-end; padding: 0; }
    .modal-dialog            { max-width: 100%; border-radius: var(--radius-card, 8px) var(--radius-card, 8px) 0 0; max-height: 92vh; }
    .toast-container         { right: 12px; left: 12px; bottom: 16px; max-width: 100%; width: auto; }
    .pagination              { flex-wrap: wrap; justify-content: center; gap: 4px; }
    .pagination-label        { display: none; }
    .tabs                    { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-item                { white-space: nowrap; }
    .filter-bar              { flex-direction: column; align-items: stretch; }
    .filter-bar .form-control, .filter-bar .btn, .filter-bar select { width: 100%; }
    .breadcrumb              { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
    .breadcrumb-item:not(:last-child):not(:first-child) { display: none; }
    .breadcrumb-item:first-child::after { content: ' / …'; color: var(--color-text-muted, #6C757D); }
}

/* ---- Extra small (<480px) ---- */
@media (max-width: 479px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar     { padding: 0 12px; }
    .main-content { padding: 12px; }
    .card       { border-radius: 6px; }
    .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
}

/* ---- Reduced motion (WCAG 2.3.3) ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .sidebar { transition: none; }
    .toast   { animation: none; }
}

/* ---- High contrast mode (WCAG 1.4.11) ---- */
@media (forced-colors: active) {
    .btn, .form-control, .card, .nav-link.active { forced-color-adjust: auto; }
    .form-control { border: 2px solid ButtonText; }
    .btn-primary  { border: 2px solid ButtonText; }
    *:focus-visible { outline: 3px solid Highlight; outline-offset: 2px; }
}

/* ---- Print (accessibility module additions) ---- */
@media print {
    .hamburger-btn, .timer-widget-floating, .timer-widget-inline,
    .page-header-actions .btn:not(.btn-print) { display: none !important; }
    .main-wrapper  { margin-left: 0 !important; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
    a[href^="#"]::after, a[href^="javascript:"]::after { content: ""; }
}


/* ============================================================
   40. CMS - DASHBOARD PAGE
   Admin dashboard: stat grid, page header, quick actions,
   activity feed. Classes used by admin/dashboard.blade.php
   ============================================================ */

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: var(--line-height-tight);
    margin: 0 0 4px;
}

.page-subtitle {
    font-size: var(--text-md);
    color: var(--color-grey-text);
    margin: 0;
}

.page-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    white-space: nowrap;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-card--blue  .stat-card__icon { background: var(--color-blue-light);  color: var(--color-blue-primary); }
.stat-card--green .stat-card__icon { background: var(--color-green-light); color: var(--color-green); }
.stat-card--amber .stat-card__icon { background: var(--color-amber-light); color: var(--color-amber-dark); }
.stat-card--teal  .stat-card__icon { background: var(--color-teal-light);  color: var(--color-teal); }
.stat-card--red   .stat-card__icon { background: var(--color-red-light);   color: var(--color-red); }

.stat-card__body {
    flex: 1;
    min-width: 0;
}

.stat-card__number {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card__unit {
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--color-grey-text);
    margin-left: 2px;
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    font-weight: 500;
}

.stat-card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--color-grey-light);
    color: var(--color-grey-text);
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
    align-self: center;
}

.stat-card__link:hover {
    background: var(--color-blue-light);
    color: var(--color-blue-primary);
    text-decoration: none;
}

.section-heading {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 12px;
}

.quick-actions {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
}

.quick-actions__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.quick-action-btn--primary {
    background: var(--color-blue-primary);
    color: var(--color-white);
}
.quick-action-btn--primary:hover {
    background: var(--color-blue-hover);
    box-shadow: 0 2px 8px rgba(41,128,212,0.3);
    color: var(--color-white);
    text-decoration: none;
}

.quick-action-btn--green {
    background: var(--color-green);
    color: var(--color-white);
}
.quick-action-btn--green:hover {
    background: var(--color-green-hover);
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
    color: var(--color-white);
    text-decoration: none;
}

.quick-action-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.activity-section {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
}

.activity-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--color-grey-text);
}

.activity-empty__icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.4;
}

.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-grey-border);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-item__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: var(--color-grey-light);
    color: var(--color-grey-text);
}

.activity-item__icon--customer  { background: var(--color-blue-light);  color: var(--color-blue-primary); }
.activity-item__icon--project   { background: var(--color-teal-light);  color: var(--color-teal); }
.activity-item__icon--invoice   { background: var(--color-amber-light); color: var(--color-amber-dark); }
.activity-item__icon--file      { background: var(--color-green-light); color: var(--color-green); }

.activity-item__body {
    flex: 1;
    min-width: 0;
}

.activity-item__description {
    font-size: var(--text-base);
    color: var(--color-body-text);
    margin: 0 0 3px;
}

.activity-item__link {
    color: var(--color-body-text);
    text-decoration: none;
}

.activity-item__link:hover {
    color: var(--color-blue-primary);
    text-decoration: underline;
}

.activity-item__customer {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-item__time {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .stat-grid { grid-template-columns: 1fr; }
    .quick-actions__row { flex-direction: column; }
    .quick-action-btn { justify-content: center; }
    .dashboard-page { gap: 16px; }
}


/* ============================================================
   42. CMS — ADD/EDIT CUSTOMER FORM
   Card padding, spacing, two-col layout, form grid,
   and validation alert styles for create/edit pages.
   ============================================================ */

/* ── Increase card bottom margin for more breathing room ── */
.card { margin-bottom: 28px; }

/* ── BEM card sub-elements (card__header / card__body) ── */
.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-grey-border);
    gap: 12px;
}

.card__title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-heading-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.card__title-icon {
    color: var(--color-blue-primary);
    font-size: var(--text-base);
    opacity: 0.85;
}

.card__body {
    padding: 24px;
}

/* ── Two-column form layout (main + sidebar) ── */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    align-items: start;
}

.two-col-layout__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.two-col-layout__main .card:last-child {
    margin-bottom: 0;
}

.two-col-layout__sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: sticky;
    top: calc(var(--topbar-height) + 16px);
}

.two-col-layout__sidebar .card:last-child {
    margin-bottom: 0;
}

@media (max-width: 1023px) {
    .two-col-layout {
        grid-template-columns: 1fr;
    }
    .two-col-layout__sidebar {
        position: static;
        order: -1;
    }
}

/* ── Two-column form field grid ── */
.form-grid {
    display: grid;
    gap: 16px 20px;
}

.form-grid--two {
    grid-template-columns: 1fr 1fr;
}

.form-group--full {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .form-grid--two { grid-template-columns: 1fr; }
    .form-group--full { grid-column: 1; }
}

/* ── Validation alert (BEM double-dash variants) ── */
.alert--danger {
    background-color: var(--color-red-light);
    border: 1px solid #f1aeb5;
    border-left: 4px solid var(--color-red);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #721c24;
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
}

.alert--success {
    background-color: var(--color-green-light);
    border: 1px solid #b8dfc4;
    border-left: 4px solid var(--color-green);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #155724;
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
}

.alert__list {
    margin: 6px 0 0;
    padding-left: 18px;
    list-style: disc;
    font-size: var(--text-base);
}

.alert__list li { margin-bottom: 3px; }

/* ── Button block modifier ── */
.btn--block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* ── Save Customer button group ── */
.save-customer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Form label hint & form hint text ── */
.form-label__hint {
    font-weight: 400;
    color: var(--color-grey-text);
    font-size: var(--text-sm);
    margin-left: 4px;
}

.form-hint {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    margin-top: 4px;
}

/* ── Input group prefix (£ symbol) ── */
.input-group__prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--color-grey-text);
    font-size: var(--text-base);
    white-space: nowrap;
}

.input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Toggle group (checkbox + slider) ── */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-body-text);
}

.toggle-input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-blue-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-text {
    color: var(--color-body-text);
}

/* ── Portal user expandable fields ── */
.portal-user-fields {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-grey-border);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Page header (breadcrumb + title + actions) ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-header__left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-header__title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Breadcrumb (create/edit pages) ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
}

.breadcrumb__link {
    color: var(--color-blue-primary);
    text-decoration: none;
}

.breadcrumb__link:hover { text-decoration: underline; }

.breadcrumb__sep {
    margin: 0 6px;
    color: var(--color-grey-mid);
}

.breadcrumb__current {
    color: var(--color-body-text);
    font-weight: 500;
}

/* ============================================================
   END SECTION 42
   ============================================================ */


/* ============================================================
   41. CMS — CUSTOMER LIST PAGE FIXES
   Fixes for admin/customers/index.blade.php:
     • .filter-bar__group / __group--grow / __group--actions  (BEM aliases)
     • .input-with-icon  (search box with magnifying-glass icon)
     • .card--flush      (borderless/padless card wrapper)
     • .form-select      (styled select dropdowns in filter bar)
   ============================================================ */

/* ── 41.1  card--flush ──────────────────────────────────────────
   The filter bar is wrapped in <div class="card card--flush mb-4">.
   card--flush removes the card's own padding/margin so the
   filter-bar inside provides all its own spacing.  Without this
   modifier the card renders as a visible blank panel between the
   filter bar and the results table (the red-arrow panel).
   ──────────────────────────────────────────────────────────── */
.card--flush {
    padding: 0;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* ── 41.2  filter-bar__group  (BEM aliases for the filter bar) ──
   The blade uses  .filter-bar__group  but the legacy CSS defines
   only  .filter-bar-group  (single-hyphen).  These aliases wire
   the BEM names used in the template to the same layout rules.
   ──────────────────────────────────────────────────────────── */
.filter-bar__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    flex: 1;
}

/* Grow modifier — used on the search field so it takes more space */
.filter-bar__group--grow {
    flex: 2;
    min-width: 220px;
}

/* Actions group — holds the Filter / Clear buttons, no grow */
.filter-bar__group--actions {
    display: flex;
    flex-direction: row;    /* force buttons side by side */
    align-items: center;    /* buttons centred within their own row */
    gap: 8px;               /* gap between Filter and Clear buttons */
    flex-shrink: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;      /* never allow them to wrap onto a second line */
    align-self: flex-end;   /* anchor to the bottom of the filter-bar row so
                               buttons line up with the bottom of the inputs/
                               selects, ignoring the labels above them */
}

/* filter-bar row: align all groups to the bottom of the row so that
   items with labels (inputs, selects) and items without labels
   (the actions group) share the same bottom edge — i.e. the
   bottom of every control lines up regardless of whether a
   visible label sits above it. */
.filter-bar {
    align-items: flex-end;
    gap: 12px;   /* consistent 12px gap between ALL groups */
}

/* When no filters are active, show Clear as muted/disabled style */
.filter-bar__clear--inactive {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}

/* ── 41.3  input-with-icon  (magnifying-glass prefix on search) ─
   Wraps the <input> in a relative container and positions the
   Font Awesome icon as an absolute inset element so the icon
   appears inside the left edge of the text box.
   ──────────────────────────────────────────────────────────── */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-with-icon__icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-grey-text);
    font-size: var(--text-sm);
    pointer-events: none;   /* click passes through to the input */
    z-index: 1;
}

/* Widen the search input and add left padding to clear the icon */
.input-with-icon .form-control {
    width: 100%;
    padding-left: 32px;     /* space for the magnifying-glass */
    min-width: 260px;       /* wider than the default filter field */
}

/* ── 41.4  form-select  (styled <select> in the filter bar) ─────
   The dropdowns use class="form-select" which is Bootstrap-style.
   Alias it to the design-system form-control so they receive the
   same border, radius, height and chevron background as every
   other select in the app.
   ──────────────────────────────────────────────────────────── */
.form-select {
    display: block;
    width: 100%;
    padding: 8px 32px 8px 10px;
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--color-body-text);
    background-color: var(--color-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236C757D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    appearance: none;
    line-height: 1.5;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:hover  { border-color: #b5bcc5; }

.form-select:focus {
    outline: none;
    border-color: var(--color-blue-primary);
    box-shadow: 0 0 0 3px rgba(41, 128, 212, 0.18);
    background-color: var(--color-blue-lighter);
}

/* ── 41.5  btn--primary / btn--sm  (BEM double-dash aliases) ───
   The Filter button uses class="btn btn--primary btn--sm".
   These aliases map the double-dash BEM modifiers onto the
   existing single-dash utility classes defined in section 9.
   ──────────────────────────────────────────────────────────── */
.btn--primary {
    background-color: var(--color-blue-primary);
    border-color: var(--color-blue-primary);
    color: var(--color-white);
}
.btn--primary:hover {
    background-color: var(--color-blue-hover);
    border-color: var(--color-blue-hover);
    color: var(--color-white);
    text-decoration: none;
}

.btn--secondary {
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-border);
    color: var(--color-body-text);
}
.btn--secondary:hover {
    background-color: #e2e6ea;
    border-color: #c8cdd2;
    color: var(--color-body-text);
    text-decoration: none;
}

.btn--ghost {
    background-color: transparent;
    border-color: var(--color-grey-border);
    color: var(--color-body-text);
}
.btn--ghost:hover {
    background-color: var(--color-grey-light);
    text-decoration: none;
}

.btn--sm {
    padding: 5px 11px;
    font-size: var(--text-sm);
    gap: 5px;
}

/* ── 41.6  Responsive tidy-up ───────────────────────────────── */
@media (max-width: 767px) {
    .filter-bar__group,
    .filter-bar__group--grow {
        width: 100%;
        min-width: unset;
    }
    .filter-bar__group--actions {
        width: 100%;
        justify-content: flex-end;
    }
    .input-with-icon .form-control {
        min-width: unset;
    }
}

/* ============================================================
   END OF SNOWMAN DESIGN CMS — snowman.css  (v2.2)
   ============================================================ */

/* ============================================================
   50. INPUT WITH INSET BUTTON (password show/hide toggle)
   Used on any password field that needs a reveal button
   sitting flush inside the right edge of the input.
   ============================================================ */

/*
 * Wrapper — makes the input fill the container while the
 * absolute-positioned button overlaps the right edge.
 *
 * Usage:
 *   <div class="input-icon-wrap">
 *     <input class="form-control input-icon-wrap__input" type="password">
 *     <button class="input-icon-wrap__btn" type="button">…</button>
 *   </div>
 */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-icon-wrap__input {
    /* Make room on the right for the icon button */
    padding-right: 2.5rem !important;
    flex: 1;
    min-width: 0;
}

.input-icon-wrap__btn {
    position: absolute;
    right: 1px;          /* inside the border */
    top: 1px;
    bottom: 1px;
    width: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--color-grey-text);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    z-index: 2;
    flex-shrink: 0;
}

.input-icon-wrap__btn:hover {
    color: var(--color-body-text);
    background-color: var(--color-grey-light);
}

.input-icon-wrap__btn:focus-visible {
    outline: 2px solid var(--color-blue-primary);
    outline-offset: -2px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============================================================
   END SECTION 50
   ============================================================ */


/* ============================================================
   40. CMS — DASHBOARD PAGE
   Admin dashboard: stat grid, page header, quick actions,
   activity feed. Classes used by admin/dashboard.blade.php
   ============================================================ */

/* ── Page header (title + date/meta) ───────────────────────── */
.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header__text {}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: var(--line-height-tight);
    margin: 0 0 4px;
}

.page-subtitle {
    font-size: var(--text-md);
    color: var(--color-grey-text);
    margin: 0;
}

.page-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    white-space: nowrap;
}

/* ── Stat grid ──────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Override .stat-card children for the CMS dashboard layout */
.stat-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-card--blue  .stat-card__icon { background: var(--color-blue-light);  color: var(--color-blue-primary); }
.stat-card--green .stat-card__icon { background: var(--color-green-light); color: var(--color-green); }
.stat-card--amber .stat-card__icon { background: var(--color-amber-light); color: var(--color-amber-dark); }
.stat-card--teal  .stat-card__icon { background: var(--color-teal-light);  color: var(--color-teal); }
.stat-card--red   .stat-card__icon { background: var(--color-red-light);   color: var(--color-red); }

.stat-card__body {
    flex: 1;
    min-width: 0;
}

.stat-card__number {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card__unit {
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--color-grey-text);
    margin-left: 2px;
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    font-weight: 500;
}

.stat-card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--color-grey-light);
    color: var(--color-grey-text);
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
    align-self: center;
}

.stat-card__link:hover {
    background: var(--color-blue-light);
    color: var(--color-blue-primary);
    text-decoration: none;
}

/* ── Section heading ────────────────────────────────────────── */
.section-heading {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 12px;
}

/* ── Quick actions ──────────────────────────────────────────── */
.quick-actions {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
}

.quick-actions__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.quick-action-btn--primary {
    background: var(--color-blue-primary);
    color: var(--color-white);
}
.quick-action-btn--primary:hover {
    background: var(--color-blue-hover);
    box-shadow: 0 2px 8px rgba(41,128,212,0.3);
    color: var(--color-white);
    text-decoration: none;
}

.quick-action-btn--green {
    background: var(--color-green);
    color: var(--color-white);
}
.quick-action-btn--green:hover {
    background: var(--color-green-hover);
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
    color: var(--color-white);
    text-decoration: none;
}

.quick-action-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Activity feed ──────────────────────────────────────────── */
.activity-section {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
}

.activity-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--color-grey-text);
}

.activity-empty__icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.4;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-grey-border);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-item__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: var(--color-grey-light);
    color: var(--color-grey-text);
}

.activity-item__icon--customer  { background: var(--color-blue-light);  color: var(--color-blue-primary); }
.activity-item__icon--project   { background: var(--color-teal-light);  color: var(--color-teal); }
.activity-item__icon--invoice   { background: var(--color-amber-light); color: var(--color-amber-dark); }
.activity-item__icon--file      { background: var(--color-green-light); color: var(--color-green); }

.activity-item__body {
    flex: 1;
    min-width: 0;
}

.activity-item__description {
    font-size: var(--text-base);
    color: var(--color-body-text);
    margin: 0 0 3px;
}

.activity-item__link {
    color: var(--color-body-text);
    text-decoration: none;
}

.activity-item__link:hover {
    color: var(--color-blue-primary);
    text-decoration: underline;
}

.activity-item__customer {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-item__time {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

/* ── Dashboard responsive ───────────────────────────────────── */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .stat-grid { grid-template-columns: 1fr; }
    .quick-actions__row { flex-direction: column; }
    .quick-action-btn { justify-content: center; }
    .dashboard-page { gap: 16px; }
}


/* ============================================================
   43. CMS — CUSTOMER SHOW PAGE COMPONENTS
   Tab navigation, stat cards, detail lists, modals,
   page header variants, and empty states for the
   customer detail view (admin/customers/show.blade.php).
   ============================================================ */

/* ── Tab navigation bar ───────────────────────────────────────── */
.tab-nav {
    display: flex;
    align-items: center;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 6px;
    margin-bottom: 24px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: wrap;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-grey-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
    line-height: 1.4;
}

.tab-nav__btn:hover {
    color: var(--color-body-text);
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-border);
    text-decoration: none;
}

.tab-nav__btn--active {
    color: var(--color-blue-primary);
    background-color: var(--color-blue-light);
    border-color: var(--color-blue-primary);
    font-weight: 600;
}

.tab-nav__btn--active:hover {
    background-color: var(--color-blue-light);
    color: var(--color-blue-primary);
}

.tab-nav__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 1px 5px;
    background-color: rgba(0,0,0,0.08);
    color: inherit;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.5;
}

.tab-nav__btn--active .tab-nav__count {
    background-color: var(--color-blue-primary);
    color: var(--color-white);
}

/* ── Page header variants ─────────────────────────────────────────── */
.page-header__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-header__subtitle {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    margin: 2px 0 0;
}

.page-header__link {
    color: var(--color-blue-primary);
    text-decoration: none;
}
.page-header__link:hover { text-decoration: underline; }

/* ── Stat cards row (customer show overview) ────────────────────────── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-cards .stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.stat-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-card__icon--blue   { background-color: var(--color-blue-light);  color: var(--color-blue-primary); }
.stat-card__icon--teal   { background-color: var(--color-teal-light);  color: var(--color-teal); }
.stat-card__icon--amber  { background-color: var(--color-amber-light); color: var(--color-amber-dark); }
.stat-card__icon--green  { background-color: var(--color-green-light); color: var(--color-green); }
.stat-card__icon--purple { background-color: #F3E8FF; color: #7C3AED; }
.stat-card__icon--red    { background-color: var(--color-red-light);   color: var(--color-red); }

.stat-card__body { flex: 1; min-width: 0; }

.stat-card__value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    font-weight: 400;
}

@media (max-width: 1100px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .stat-cards { grid-template-columns: 1fr; }
}

/* ── Detail list (key/value pairs) ────────────────────────────────── */
.detail-list {
    display: grid;
    gap: 0;
}

.detail-list--two-col {
    grid-template-columns: 180px 1fr;
}

.detail-list dt {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-grey-text);
    padding: 10px 0;
    border-bottom: 1px solid var(--color-grey-border);
    display: flex;
    align-items: center;
}

.detail-list dd {
    font-size: var(--text-base);
    color: var(--color-body-text);
    padding: 10px 0 10px 16px;
    border-bottom: 1px solid var(--color-grey-border);
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-list dt:last-of-type,
.detail-list dd:last-of-type {
    border-bottom: none;
}

/* ── Empty state variants ──────────────────────────────────────────── */
.empty-state--sm {
    padding: 32px 24px;
    text-align: center;
    color: var(--color-grey-text);
}

.empty-state__icon-sm {
    font-size: 32px;
    opacity: 0.3;
    display: block;
    margin-bottom: 10px;
}

.empty-state__body {
    font-size: var(--text-base);
    color: var(--color-grey-text);
    margin: 6px 0 16px;
}

/* ── Badge size variants ─────────────────────────────────────────────── */
.badge--lg  { font-size: var(--text-sm);  padding: 5px 12px; }
.badge--sm  { font-size: var(--text-xs);  padding: 2px 7px; }
.badge--secondary { background-color: var(--color-grey-light); color: var(--color-body-text); border: 1px solid var(--color-grey-border); }
.badge--info      { background-color: var(--color-blue-primary); color: var(--color-white); }
.badge--warning   { background-color: var(--color-amber); color: var(--color-amber-dark); }

/* ── Modal (Add Portal User) ────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 20px;
}

.modal__dialog {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background-color: var(--color-navy);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    gap: 12px;
    flex-shrink: 0;
}

.modal__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal__close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.70);
    font-size: 18px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
    line-height: 1;
}
.modal__close:hover {
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.12);
}

.modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--color-grey-border);
    background-color: var(--color-grey-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-shrink: 0;
}

/* ── Meta list (sidebar ID/counts card) ───────────────────────────────── */
.meta-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
}

.meta-list__term {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-grey-text);
    padding: 8px 12px 8px 0;
    border-bottom: 1px solid var(--color-grey-border);
}

.meta-list__desc {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-heading-text);
    padding: 8px 0;
    border-bottom: 1px solid var(--color-grey-border);
    margin: 0;
    text-align: right;
}

.meta-list__term:last-of-type,
.meta-list__desc:last-of-type {
    border-bottom: none;
}

/* ── Card muted variant ────────────────────────────────────────────────── */
.card--muted {
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-border);
}

.card--info {
    background-color: var(--color-blue-lighter);
    border-color: var(--color-blue-light);
}

.card__title-count {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-grey-text);
    margin-left: 6px;
}

/* ── Table helpers used by show page ────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.data-table__th { padding: 10px 14px; font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-white); background-color: var(--color-navy); text-align: left; white-space: nowrap; }
.data-table__th:first-child { border-radius: var(--radius-md) 0 0 0; }
.data-table__th:last-child  { border-radius: 0 var(--radius-md) 0 0; }
.data-table__th--number { text-align: right; }
.data-table__th--actions { width: 1%; white-space: nowrap; text-align: right; }
.data-table__row { border-bottom: 1px solid var(--color-grey-border); transition: background-color var(--transition-fast); }
.data-table__row:last-child { border-bottom: none; }
.data-table__row:hover { background-color: var(--color-blue-lighter) !important; }
.data-table__row--muted { opacity: 0.65; }
.data-table__td { padding: 11px 14px; color: var(--color-body-text); vertical-align: middle; }
.data-table__td--number { text-align: right; }
.data-table__td--actions { white-space: nowrap; text-align: right; width: 1%; }
.data-table__td--id { color: var(--color-grey-text); font-size: var(--text-sm); width: 60px; }
.data-table__primary-link { color: var(--color-body-text); font-weight: 500; text-decoration: none; }
.data-table__primary-link:hover { color: var(--color-blue-primary); text-decoration: underline; }
.data-table__link { color: var(--color-blue-primary); text-decoration: none; }
.data-table__link:hover { text-decoration: underline; }
.data-table__meta { display: block; font-size: var(--text-xs); color: var(--color-grey-text); margin-top: 2px; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Action buttons group ──────────────────────────────────────────────── */
.action-buttons { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    font-size: 13px;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
}

.btn-icon:hover { background-color: var(--color-grey-light); border-color: var(--color-grey-border); text-decoration: none; }
.btn-icon--view       { color: var(--color-blue-primary); }
.btn-icon--edit       { color: var(--color-amber-dark); }
.btn-icon--delete     { color: var(--color-red); }
.btn-icon--deactivate { color: var(--color-amber-dark); }
.btn-icon--activate   { color: var(--color-green); }
.btn-icon--default    { color: var(--color-grey-text); }
.btn-icon--view:hover       { color: var(--color-blue-hover); }
.btn-icon--edit:hover       { color: #a07800; }
.btn-icon--delete:hover     { color: var(--color-red-hover); }

/* ── Inline edit form ───────────────────────────────────────────────────── */
.inline-edit-form {
    padding: 12px;
    background-color: var(--color-grey-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-grey-border);
    margin-top: 8px;
}

.form-grid--three { grid-template-columns: 1fr 1fr auto; }
.form-group--actions { display: flex; align-items: flex-end; gap: 6px; }
.form-control--sm { padding: 5px 10px; font-size: var(--text-sm); }
.form-label--sm { font-size: var(--text-sm); }

/* ── Card footer ───────────────────────────────────────────────────────── */
.card__footer {
    padding: 12px 24px;
    border-top: 1px solid var(--color-grey-border);
    background-color: var(--color-grey-light);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Utility spacing used by show page ────────────────────────────────── */
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.d-inline { display: inline !important; }
.text-center { text-align: center !important; }
.text-warning { color: var(--color-amber-dark) !important; }
.text-muted   { color: var(--color-grey-text) !important; }
.text-primary { color: var(--color-blue-primary) !important; }
.font-medium  { font-weight: 500 !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ── Btn teal variant (Send Test Summary) ───────────────────────────────── */
.btn--teal {
    background-color: var(--color-teal);
    border-color: var(--color-teal);
    color: var(--color-white);
}
.btn--teal:hover {
    background-color: var(--color-teal-hover);
    border-color: var(--color-teal-hover);
    color: var(--color-white);
    text-decoration: none;
}

/* ── Btn warning variant (Deactivate) ──────────────────────────────────── */
.btn--warning {
    background-color: var(--color-amber);
    border-color: var(--color-amber);
    color: var(--color-amber-dark);
}
.btn--warning:hover {
    background-color: #e0a800;
    color: var(--color-amber-dark);
    text-decoration: none;
}

/* ============================================================
   END SECTION 43
   ============================================================ */


/* ============================================================
   44. TIMER WIDGET
   Fixed bottom-right floating timer panel.
   ============================================================ */

.timer-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 1000;
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.timer-widget--running {
    border-color: var(--color-green);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 0 2px var(--color-green);
}

.timer-widget--paused {
    border-color: var(--color-amber);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 0 2px var(--color-amber);
}

.timer-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background-color: var(--color-navy);
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.timer-widget__title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--color-white);
    font-size: var(--text-sm);
    font-weight: 600;
}

.timer-widget__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-grey-border);
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
}

.timer-widget__status-dot--running { background-color: var(--color-green); }
.timer-widget__status-dot--paused  { background-color: var(--color-amber); }

.timer-widget__collapse-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    margin-left: auto;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}
.timer-widget__collapse-btn:hover { color: var(--color-white); }

.timer-widget__body {
    padding: 14px;
    max-height: 500px;
    overflow-y: auto;
}

.timer-widget__elapsed {
    text-align: center;
    padding: 12px 0 8px;
}

.timer-widget__time {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-heading-text);
    letter-spacing: 0.05em;
    display: block;
    line-height: 1;
}

.timer-widget__status-label {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-amber-dark);
    letter-spacing: 0.1em;
    margin-top: 4px;
}

.timer-widget__controls {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 8px 0 4px;
    flex-wrap: wrap;
}

.timer-widget__btn { flex: 1; justify-content: center; }

.timer-widget__field { margin-bottom: 10px; }

.timer-widget__label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-grey-text);
    margin-bottom: 4px;
}

.timer-widget__label-optional {
    font-weight: 400;
    color: var(--color-grey-text);
}

.timer-widget__search-wrap { position: relative; }

.timer-widget__input {
    width: 100%;
    padding: 7px 10px;
    font-size: var(--text-sm);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    color: var(--color-body-text);
    outline: none;
    box-sizing: border-box;
}
.timer-widget__input:focus {
    border-color: var(--color-blue-primary);
    box-shadow: 0 0 0 2px var(--color-blue-light);
}

.timer-widget__search-icon {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-grey-text);
    font-size: 12px;
    pointer-events: none;
}

.timer-widget__job-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-card);
    z-index: 50;
    max-height: 180px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
}

.timer-widget__job-result {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-grey-border);
    font-size: var(--text-sm);
}
.timer-widget__job-result:last-child { border-bottom: none; }
.timer-widget__job-result:hover, .timer-widget__job-result:focus {
    background-color: var(--color-blue-lighter);
    outline: none;
}

.timer-widget__job-name { display: block; font-weight: 500; color: var(--color-body-text); }
.timer-widget__job-customer { display: block; font-size: var(--text-xs); color: var(--color-grey-text); }

.timer-widget__selected-job {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    background-color: var(--color-blue-light);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: var(--text-sm);
}

.timer-widget__selected-job-label { flex: 1; color: var(--color-blue-primary); font-weight: 500; }

.timer-widget__clear-job {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-grey-text);
    padding: 0 2px;
    font-size: 11px;
    line-height: 1;
}
.timer-widget__clear-job:hover { color: var(--color-red); }

.timer-widget__context {
    padding: 8px 0 4px;
    border-bottom: 1px solid var(--color-grey-border);
    margin-bottom: 8px;
}

.timer-widget__context-job {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-body-text);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer-widget__context-task,
.timer-widget__context-desc {
    font-size: var(--text-xs);
    color: var(--color-grey-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer-widget__loading {
    text-align: center;
    padding: 8px 0;
    color: var(--color-grey-text);
    font-size: var(--text-sm);
}

.timer-widget__error {
    font-size: var(--text-xs);
    color: var(--color-red);
    text-align: center;
    margin: 6px 0 0;
    padding: 0;
}

.timer-widget__select { padding-right: 28px; }

/* ============================================================
   END SECTION 44
   ============================================================ */

/* ============================================================
   45. SYSTEM SETTINGS PAGE
   ============================================================ */

/* --- Overall layout: tabs on top, panel below --- */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Panel area sits directly below the tab strip */
.settings-layout > [role="tabpanel"] {
    background-color: var(--color-grey-bg);
    padding-top: 20px;
}

/* --- Form grid (two-column responsive) --- */
.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid--two {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid--two .form-group--full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-grid--two {
        grid-template-columns: 1fr;
    }
    .form-grid--two .form-group--full {
        grid-column: 1;
    }
}

/* --- Sensitive field (masked password / secret) --- */
.sensitive-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background-color: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
}

.sensitive-field__mask {
    flex: 1;
    font-family: var(--font-mono);
    font-size: var(--text-md);
    color: var(--color-grey-text);
    letter-spacing: 0.15em;
    user-select: none;
}

/* --- Code block (artisan command reference) --- */
.code-block {
    background-color: var(--color-navy);
    color: #e2e8f0;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.7;
    overflow-x: auto;
}

.code-block code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* --- Card muted variant --- */
.card--muted {
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-border);
    box-shadow: none;
}

/* --- Optional label tag --- */
.form-label__optional {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-grey-text);
    margin-left: 4px;
}

/* --- Toggle switch (checkbox styled as a pill toggle) --- */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background-color: var(--color-grey-mid);
    border-radius: var(--radius-full);
    flex-shrink: 0;
    transition: background-color var(--transition-base);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background-color: var(--color-white);
    border-radius: 50%;
    transition: transform var(--transition-base);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-switch {
    background-color: var(--color-blue-primary);
}

.toggle-input:checked + .toggle-switch::after {
    transform: translateX(18px);
}

.toggle-input:focus-visible + .toggle-switch {
    outline: 2px solid var(--color-blue-primary);
    outline-offset: 2px;
}

.toggle-text {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-body-text);
}

/* --- Branding upload rows (used in Branding settings tab) --- */
.branding-upload-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.branding-upload-preview {
    flex-shrink: 0;
    width: 100px;
    height: 80px;
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    background-color: var(--color-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.branding-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.branding-preview-img--favicon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.branding-preview-placeholder {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.3);
}

.branding-upload-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.branding-file-input {
    display: block;
    width: 100%;
    padding: 7px 10px;
    font-size: var(--text-base);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    color: var(--color-body-text);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.branding-file-input:hover {
    border-color: var(--color-blue-primary);
}

.branding-file-input:focus {
    outline: none;
    border-color: var(--color-blue-primary);
    box-shadow: 0 0 0 3px rgba(41, 128, 212, 0.18);
}

.branding-file-input.form-control--error {
    border-color: var(--color-red);
}

.branding-clear-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--text-sm);
    color: var(--color-red);
    cursor: pointer;
    margin-top: 2px;
}

.branding-clear-label input[type="checkbox"] {
    accent-color: var(--color-red);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

@media (max-width: 640px) {
    .branding-upload-row {
        flex-direction: column;
    }
    .branding-upload-preview {
        width: 80px;
        height: 64px;
    }
}

/* --- Automation rules toggle (used in Automation Rules admin page) --- */
.automation-row--disabled td {
    opacity: 0.55;
}

.automation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: var(--font-family);
}

.automation-toggle:disabled {
    cursor: wait;
    opacity: 0.7;
}

.automation-toggle__track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    border-radius: var(--radius-full);
    background-color: var(--color-grey-mid);
    transition: background-color var(--transition-base);
    flex-shrink: 0;
}

.automation-toggle--on .automation-toggle__track {
    background-color: var(--color-green);
}

.automation-toggle__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--color-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform var(--transition-base);
}

.automation-toggle--on .automation-toggle__thumb {
    transform: translateX(18px);
}

.automation-toggle__label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-grey-text);
    min-width: 60px;
}

.automation-toggle--on .automation-toggle__label {
    color: var(--color-green);
}

/* --- Email template editor (token list, mono textarea) --- */
.form-control--mono {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    resize: vertical;
}

.token-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.token-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.token-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--color-blue-primary);
    text-align: left;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    width: 100%;
}

.token-copy-btn:hover {
    background-color: var(--color-blue-lighter);
    border-color: var(--color-blue-primary);
}

.token-copy-btn--copied {
    background-color: var(--color-green-light);
    border-color: var(--color-green);
    color: var(--color-green);
}

.token-copy-icon {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.6;
}

.token-description {
    font-size: var(--text-xs);
    color: var(--color-grey-text);
    padding-left: 4px;
}

/* Definition list used in template info sidebar */
.info-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    font-size: var(--text-sm);
}

.info-dl dt {
    font-weight: 600;
    color: var(--color-grey-text);
    white-space: nowrap;
}

.info-dl dd {
    color: var(--color-body-text);
    margin: 0;
}

/* ============================================================
   END SECTION 45
   ============================================================ */

/* ============================================================
   46. TIME LOG CALENDAR
   ============================================================ */

/* --- Container --- */
.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Toolbar --- */
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 12px;
}

.calendar-toolbar__left,
.calendar-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- View Toggle (Month / Week) --- */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-toggle__btn {
    padding: 5px 14px;
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--color-white);
    border: none;
    cursor: pointer;
    color: var(--color-grey-text);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    line-height: 1.4;
}

.view-toggle__btn + .view-toggle__btn {
    border-left: 1px solid var(--color-grey-border);
}

.view-toggle__btn--active {
    background: var(--color-navy);
    color: var(--color-white);
}

.view-toggle__btn:not(.view-toggle__btn--active):hover {
    background: var(--color-grey-light);
    color: var(--color-body-text);
}

/* --- Calendar title (March 2026) --- */
.calendar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-heading-text);
    margin: 0;
    min-width: 140px;
    text-align: center;
}

/* --- Period summary chips --- */
.calendar-period-summary {
    display: flex;
    gap: 6px;
    align-items: center;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
}

.summary-chip--total {
    background: var(--color-grey-light);
    color: var(--color-body-text);
    border: 1px solid var(--color-grey-border);
}

.summary-chip--billable {
    background: var(--color-green-light);
    color: var(--color-green);
    border: 1px solid var(--color-green);
}

/* --- Loading spinner --- */
.calendar-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-grey-text);
    font-size: var(--text-sm);
}

.spinner {
    display: inline-block;
    border: 2px solid var(--color-grey-border);
    border-top-color: var(--color-blue-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner--sm {
    width: 16px;
    height: 16px;
}

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

/* --- User switcher inline form --- */
.form-group--inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group--inline .form-label {
    margin: 0;
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-grey-text);
}

.form-control--sm {
    padding: 4px 8px;
    font-size: var(--text-sm);
    height: auto;
    min-width: 140px;
}

/* ─────────────────────────────────────────────────────────
   MONTH VIEW GRID
───────────────────────────────────────────────────────── */

.calendar-grid {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 2px solid var(--color-grey-border);
}

.calendar-header-cell {
    padding: 8px 10px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-grey-text);
    text-align: center;
    background: var(--color-grey-light);
}

.calendar-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--color-grey-border);
    min-height: 100px;
}

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

/* --- Day cell --- */
.calendar-day {
    border-right: 1px solid var(--color-grey-border);
    padding: 6px;
    min-height: 100px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day:hover {
    background: var(--color-blue-lighter);
}

.calendar-day--other-month {
    background: var(--color-grey-light);
    opacity: 0.6;
}

.calendar-day--other-month:hover {
    background: var(--color-grey-light);
    opacity: 0.8;
}

.calendar-day--weekend {
    background: #FAFBFC;
}

.calendar-day--today {
    background: var(--color-blue-lighter);
}

.calendar-day--today:hover {
    background: #DCF0FB;
}

.calendar-day--has-logs {
    background: var(--color-white);
}

/* --- Day header (number + total) --- */
.calendar-day__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.calendar-day__number {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-grey-text);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.calendar-day__number--today {
    background: var(--color-blue-primary);
    color: var(--color-white);
    font-weight: 700;
}

.calendar-day__total {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-blue-primary);
    background: var(--color-blue-light);
    padding: 1px 5px;
    border-radius: var(--radius-full);
}

/* --- Day events --- */
.calendar-day__events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.calendar-day__add-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    padding: 2px 4px;
    font-size: 10px;
    color: var(--color-grey-mid);
    background: none;
    border: 1px dashed var(--color-grey-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 2px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.calendar-day:hover .calendar-day__add-btn {
    display: flex;
}

.calendar-day__add-btn:hover {
    color: var(--color-blue-primary);
    border-color: var(--color-blue-primary);
}

/* ─────────────────────────────────────────────────────────
   CALENDAR EVENTS (shared by month + week)
───────────────────────────────────────────────────────── */

.calendar-event {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    transition: filter var(--transition-fast);
    gap: 4px;
}

.calendar-event:hover {
    filter: brightness(0.93);
}

.calendar-event--billed {
    opacity: 0.6;
}

.calendar-event__customer {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.calendar-event__hours {
    font-weight: 700;
    flex-shrink: 0;
}

/* Week-view event extras */
.calendar-event--week {
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 8px;
    gap: 2px;
    margin-bottom: 4px;
}

.calendar-event__job {
    font-size: 10px;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.calendar-event__desc {
    font-size: 10px;
    opacity: 0.75;
    white-space: normal;
    line-height: 1.3;
}

/* --- Event colour classes --- */
.event--blue   { background: #DBEAFE; color: #1D4ED8; }
.event--green  { background: #D1FAE5; color: #065F46; }
.event--purple { background: #EDE9FE; color: #5B21B6; }
.event--orange { background: #FFEDD5; color: #9A3412; }
.event--teal   { background: #CCFBF1; color: #115E59; }
.event--pink   { background: #FCE7F3; color: #9D174D; }
.event--indigo { background: #E0E7FF; color: #3730A3; }
.event--amber  { background: #FEF3C7; color: #92400E; }

/* ─────────────────────────────────────────────────────────
   WEEK VIEW
───────────────────────────────────────────────────────── */

.calendar-week-view {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

.calendar-week-col {
    border-right: 1px solid var(--color-grey-border);
    display: flex;
    flex-direction: column;
}

.calendar-week-col:last-child {
    border-right: none;
}

.calendar-week-col--today {
    background: var(--color-blue-lighter);
}

.calendar-week-col--weekend {
    background: var(--color-grey-light);
}

.calendar-week-col__header {
    padding: 10px 8px;
    border-bottom: 2px solid var(--color-grey-border);
    background: var(--color-grey-light);
    text-align: center;
    cursor: pointer;
}

.calendar-week-col--today .calendar-week-col__header {
    background: var(--color-blue-lighter);
}

.calendar-week-col__day-name {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-grey-text);
}

.calendar-week-col__day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-body-text);
    margin: 2px auto;
}

.calendar-week-col__day-num--today {
    background: var(--color-blue-primary);
    color: var(--color-white);
    font-weight: 700;
}

.calendar-week-col__total {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--color-blue-primary);
}

.calendar-week-col__events {
    flex: 1;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
}

/* ─────────────────────────────────────────────────────────
   LEGEND
───────────────────────────────────────────────────────── */

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 14px;
    margin-top: 8px;
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.calendar-legend__label {
    font-weight: 600;
    color: var(--color-grey-text);
}

.calendar-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-body-text);
}

.calendar-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Dot colours mirror event colours */
.event--blue   .calendar-legend__dot,
.calendar-legend__dot.event--blue   { background: #1D4ED8; }
.event--green  .calendar-legend__dot,
.calendar-legend__dot.event--green  { background: #065F46; }
.event--purple .calendar-legend__dot,
.calendar-legend__dot.event--purple { background: #5B21B6; }
.event--orange .calendar-legend__dot,
.calendar-legend__dot.event--orange { background: #9A3412; }
.event--teal   .calendar-legend__dot,
.calendar-legend__dot.event--teal   { background: #115E59; }
.event--pink   .calendar-legend__dot,
.calendar-legend__dot.event--pink   { background: #9D174D; }
.event--indigo .calendar-legend__dot,
.calendar-legend__dot.event--indigo { background: #3730A3; }
.event--amber  .calendar-legend__dot,
.calendar-legend__dot.event--amber  { background: #92400E; }

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .calendar-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-header-row,
    .calendar-week-row {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .calendar-day {
        min-height: 60px;
        padding: 3px;
    }

    .calendar-event__hours {
        display: none;
    }

    .calendar-week-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

/* ============================================================
   END SECTION 46
   ============================================================ */

/* ============================================================
   47. TIME LOGS INDEX — SUMMARY BAR, FILTERS, BULK ACTIONS
   ============================================================ */

/* --- Summary bar (stat cards row) --- */
.summary-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.summary-bar__item {
    flex: 1 1 160px;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    gap: .25rem;
    border-top: 3px solid var(--color-navy);
}

.summary-bar__item--billable     { border-top-color: var(--color-green); }
.summary-bar__item--non-billable { border-top-color: var(--color-grey-mid); }
.summary-bar__item--value        { border-top-color: var(--color-blue-primary); }

.summary-bar__label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-grey-text);
}

.summary-bar__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-heading-text);
}

/* --- Filter card --- */
.card--filters {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.card--filters .filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.filter-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding-top: .25rem;
}

/* --- Bulk action bar --- */
.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    background: var(--color-amber-light);
    border: 1px solid var(--color-amber);
    border-radius: var(--radius-sm);
    padding: .625rem 1rem;
    margin-bottom: .75rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-amber-dark);
}

.bulk-action-bar .form-control--sm {
    padding: 4px 8px;
    font-size: var(--text-sm);
    height: auto;
    min-width: 160px;
}

.bulk-rate-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-prefix {
    font-weight: 600;
    color: var(--color-grey-text);
}

/* --- Billed row tint --- */
.row--billed td {
    opacity: .7;
    font-style: italic;
}

/* ============================================================
   END SECTION 47
   ============================================================ */

/* ============================================================
   48. TIME LOG FORM — LOG TIME / EDIT TIME
   ============================================================ */

/* --- Page back link --- */
.page-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-blue-primary);
    text-decoration: none;
    margin-bottom: .375rem;
}

.page-back:hover {
    text-decoration: underline;
}

/* --- Form section (Context / Time Details / Description) --- */
.form-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-grey-border);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section__title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 1rem 0;
    padding-bottom: .625rem;
    border-bottom: 2px solid var(--color-grey-border);
}

/* --- Form grid --- */
.form-grid {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .form-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .form-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .form-grid--4,
    .form-grid--3,
    .form-grid--2 { grid-template-columns: 1fr; }
}

/* --- Form label modifiers --- */
.form-label--required::after {
    content: ' *';
    color: var(--color-red);
    font-weight: 700;
}

.form-label__optional {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-grey-text);
    margin-left: 4px;
}

.form-label__hint {
    display: inline-flex;
    align-items: center;
    color: var(--color-grey-mid);
    vertical-align: middle;
    margin-left: 4px;
    cursor: help;
}

.form-label__hint:hover {
    color: var(--color-blue-primary);
}

/* --- Input group (prefix / suffix) --- */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-prefix,
.input-group .input-suffix {
    display: flex;
    align-items: center;
    padding: 0 .625rem;
    background: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    color: var(--color-grey-text);
    font-weight: 600;
    font-size: var(--text-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.input-group .input-prefix {
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .input-suffix {
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    flex: 1;
    min-width: 0;
}

/* --- Toggle switch (Billable?) --- */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem 0;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* Hide the hidden "off" input entirely */
.toggle input[type="hidden"] {
    display: none;
}

.toggle__slider {
    position: absolute;
    inset: 0;
    background: var(--color-grey-mid);
    border-radius: 24px;
    cursor: pointer;
    transition: background-color var(--transition-base);
}

.toggle__slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    top: 3px;
    left: 3px;
    transition: transform var(--transition-base);
}

.toggle input[type="checkbox"]:checked + .toggle__slider {
    background: var(--color-green);
}

.toggle input[type="checkbox"]:checked + .toggle__slider::before {
    transform: translateX(20px);
}

.toggle input[type="checkbox"]:focus-visible + .toggle__slider {
    outline: 2px solid var(--color-blue-primary);
    outline-offset: 2px;
}

.toggle__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-body-text);
    user-select: none;
}

/* --- Calculated Amount display --- */
.amount-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-grey-border);
    background: var(--color-grey-light);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-heading-text);
    min-height: 42px;
}

.amount-display--active {
    background: var(--color-green-light);
    border-color: var(--color-green);
    color: var(--color-green);
}

.amount-display--inactive {
    opacity: .5;
}

.amount-display__currency {
    font-size: .875rem;
    font-weight: 600;
    align-self: flex-start;
    margin-top: 3px;
}

.amount-display__value {
    font-size: 1.375rem;
    font-weight: 700;
}

/* --- Form error state --- */
.form-group--error .form-control,
.form-group--error .form-select {
    border-color: var(--color-red);
}

.form-error {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-red);
    margin-top: .25rem;
}

/* --- Form actions bar (Save / Cancel) --- */
.form-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-grey-border);
    background: var(--color-grey-light);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ============================================================
   END SECTION 48
   ============================================================ */

/* ============================================================
   49. PROJECTS INDEX — STAT ROW, FILTER BAR, BUDGET BAR
   ============================================================ */

/* --- Stat row (side-by-side cards) --- */
.stat-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.stat-card {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

.stat-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card__icon--blue   { background: var(--color-blue-light);  color: var(--color-blue-primary); }
.stat-card__icon--green  { background: var(--color-green-light); color: var(--color-green); }
.stat-card__icon--amber  { background: var(--color-amber-light); color: var(--color-amber-dark); }
.stat-card__icon--red    { background: var(--color-red-light);   color: var(--color-red); }
.stat-card__icon--teal   { background: var(--color-teal-light);  color: var(--color-teal); }

.stat-card__body {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.stat-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: 1.2;
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-grey-text);
    white-space: nowrap;
}

/* --- Filter bar (horizontal pill row) --- */
.card--flush {
    padding: 0;
    overflow: hidden;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .875rem 1.25rem;
}

.filter-bar__group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.filter-bar__group--grow {
    flex: 1 1 220px;
}

.filter-bar__group--actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    min-width: auto;
    margin-left: auto;
}

/* --- Search input with icon --- */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon__icon {
    position: absolute;
    left: .75rem;
    color: var(--color-grey-mid);
    font-size: var(--text-sm);
    pointer-events: none;
    z-index: 1;
}

.input-with-icon .form-control {
    padding-left: 2.25rem;
}

/* --- Budget mini progress bar --- */
.budget-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.progress {
    width: 100%;
    background: var(--color-grey-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress--xs  { height: 6px; }
.progress--sm  { height: 8px; }
.progress--md  { height: 12px; }

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar--primary { background: var(--color-blue-primary); }
.progress-bar--success { background: var(--color-green); }
.progress-bar--warning { background: var(--color-amber); }
.progress-bar--danger  { background: var(--color-red); }

.budget-mini__label {
    font-size: var(--text-xs);
    color: var(--color-grey-text);
    white-space: nowrap;
}

/* --- Utility: mb-4 --- */
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-2 { margin-bottom: .5rem !important; }

/* ============================================================
   END SECTION 49
   ============================================================ */

/* ============================================================
   50. USER AVATAR COMPONENT
       .avatar              — base element (apply alongside size modifier)
       .avatar-sm           — 32px  (topbar, sidebar footer, task cards)
       .avatar-md           — 48px  (dropdowns, comment threads)
       .avatar-lg           — 96px  (profile page)
       .avatar--photo       — renders uploaded image
       .avatar--initials    — renders initials on blue circle (fallback)
       .avatar-wrap         — positioned container used on profile page
       .avatar-edit-overlay — hover overlay with camera icon
       .avatar-remove       — 'Remove photo' text link below circle
   ============================================================ */

/* --- Base circle --- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    font-family: var(--font-family);
    font-weight: 600;
    line-height: 1;
    user-select: none;
    vertical-align: middle;
    position: relative;          /* needed so overlay positions correctly */
}

/* --- Size variants: set explicit dimensions on both base + size class --- */
.avatar-sm {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 13px;
}

.avatar-md {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 16px;
}

.avatar-lg {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    font-size: 36px;
}

/* --- Photo state: fills the circle with the image --- */
.avatar--photo {
    background: var(--color-grey-border); /* placeholder colour while loading */
    /* Belt-and-braces clip: border-radius alone clips in all modern browsers,
       clip-path ensures no sub-pixel bleed in WebKit/Blink on HiDPI screens. */
    clip-path: circle(50%);
}

.avatar--photo img {
    /* Fill the circle using the flex container dimensions.
       Do NOT use position:absolute — it bypasses overflow:hidden in some
       nginx-served WebKit builds. Let the img fill the flex box naturally. */
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
}

/* --- Initials state: blue background, white centred text --- */
.avatar--initials {
    background-color: var(--color-blue-primary);
    color: #ffffff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --- Profile page: positioned wrapper for upload overlay --- */
.avatar-wrap {
    position: relative;
    display: inline-block;
}

/* --- Hover overlay: camera icon only, shown on hover ---
   The label/button row below the circle handles the click action.
   Overlay is purely a visual cue. --- */
.avatar-edit-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.40);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;  /* click passes through to the label below */
    color: #ffffff;
    font-size: 22px;
}

.avatar-wrap:hover .avatar-edit-overlay {
    opacity: 1;
}

/* --- Action row below the avatar circle on the profile page --- */
.avatar-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

/* ============================================================
   END SECTION 50
   ============================================================ */
/* ============================================================
   51. PAGINATION
       Used by: vendor.pagination.snowman & partials.pagination
       Rendered via $collection->links('...') calls throughout
       admin list pages and the communications timeline.
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 12px 0;
    font-size: var(--text-sm);
}

.pagination__info {
    color: var(--color-grey-text);
    font-size: var(--text-sm);
}

.pagination__list {
    display: flex;
    align-items: center;
    gap: 3px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-grey-border);
    background-color: var(--color-white);
    color: var(--color-body-text);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--transition-fast),
                border-color var(--transition-fast),
                color var(--transition-fast);
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

.pagination__link:hover {
    background-color: var(--color-blue-light);
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
    text-decoration: none;
}

/* Active / current page */
.pagination__item--active .pagination__link {
    background-color: var(--color-blue-primary);
    border-color: var(--color-blue-primary);
    color: var(--color-white);
    cursor: default;
    pointer-events: none;
}

/* Disabled (prev on page 1, next on last page, ellipsis) */
.pagination__item--disabled .pagination__link {
    color: var(--color-grey-mid);
    background-color: var(--color-grey-light);
    border-color: var(--color-grey-border);
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive: stack on very small screens */
@media (max-width: 480px) {
    .pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   END SECTION 51
   ============================================================ */

/* ============================================================
   52. CUSTOMER PORTAL — DASHBOARD & SHARED COMPONENTS
       Used by: portal/dashboard.blade.php and all portal pages
   ============================================================ */

/* ─── Portal Welcome Banner ────────────────────────────────── */
.portal-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--color-blue-primary, #2980D4) 0%, #1e6bb5 100%);
    border-radius: var(--radius-lg, 10px);
    color: #fff;
}

.portal-welcome__heading {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
}

.portal-welcome__sub {
    font-size: 14px;
    margin: 0;
    opacity: .85;
}

.portal-welcome__date {
    font-size: 13px;
    opacity: .8;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ─── Stat Cards Grid ───────────────────────────────────────── */
.portal-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .portal-stat-grid { grid-template-columns: 1fr; }
}

.portal-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius-lg, 10px);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border: 1px solid var(--color-grey-border, #E2E8F0);
    transition: box-shadow .15s;
}

.portal-stat-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.1); }

.portal-stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.portal-stat-card--blue  .portal-stat-card__icon { background: #EBF3FB; color: #2980D4; }
.portal-stat-card--teal  .portal-stat-card__icon { background: #E8FAF5; color: #1ABC9C; }
.portal-stat-card--amber .portal-stat-card__icon { background: #FFF8E1; color: #F59E0B; }
.portal-stat-card--red   .portal-stat-card__icon { background: #FEF2F2; color: #DC3545; }

.portal-stat-card__number {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-body-text, #1A2E4A);
    line-height: 1;
    margin-bottom: 4px;
}

.portal-stat-card__unit {
    font-size: 16px;
    font-weight: 500;
    opacity: .6;
}

.portal-stat-card__label {
    font-size: 13px;
    color: var(--color-grey-text, #6B7280);
    font-weight: 500;
}

/* ─── Dashboard Content Grid ────────────────────────────────── */
.portal-content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 960px) {
    .portal-content-grid {
        grid-template-columns: 1fr;
    }
    .portal-content-grid__aside { order: -1; }
}

/* ─── Activity Feed ─────────────────────────────────────────── */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-grey-border, #E2E8F0);
}

.activity-item:last-child { border-bottom: none; }

.activity-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.activity-item__icon--project { background: #EBF3FB; color: #2980D4; }
.activity-item__icon--file    { background: #E8FAF5; color: #1ABC9C; }
.activity-item__icon--message { background: #F0F4FF; color: #6366F1; }
.activity-item__icon--invoice { background: #FFF8E1; color: #F59E0B; }
.activity-item__icon--default { background: #F4F6F8; color: #8A9BB0; }

.activity-item__body {
    flex: 1;
    min-width: 0;
}

.activity-item__description {
    font-size: 14px;
    color: var(--color-body-text, #1A2E4A);
    margin: 0 0 2px;
    line-height: 1.45;
}

.activity-item__link {
    color: inherit;
    text-decoration: none;
}
.activity-item__link:hover { color: var(--color-blue-primary, #2980D4); text-decoration: underline; }

.activity-item__time {
    font-size: 12px;
    color: var(--color-grey-text, #6B7280);
    white-space: nowrap;
    flex-shrink: 0;
}

.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--color-grey-text, #6B7280);
    gap: 12px;
}

.activity-empty__icon {
    font-size: 36px;
    opacity: .4;
}

/* ─── Quick Links ───────────────────────────────────────────── */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .12s;
    color: var(--color-body-text, #1A2E4A);
}

.quick-link:hover { background: var(--color-grey-light, #F4F6F8); text-decoration: none; }
.quick-link--highlight { background: #FFF8E1; }
.quick-link--highlight:hover { background: #FFF0C0; }

.quick-link__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.quick-link__icon--blue  { background: #EBF3FB; color: #2980D4; }
.quick-link__icon--teal  { background: #E8FAF5; color: #1ABC9C; }
.quick-link__icon--amber { background: #FFF8E1; color: #F59E0B; }
.quick-link__icon--red   { background: #FEF2F2; color: #DC3545; }

.quick-link__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.quick-link__text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-body-text, #1A2E4A);
}

.quick-link__text small {
    font-size: 12px;
    color: var(--color-grey-text, #6B7280);
}

.quick-link__arrow {
    font-size: 12px;
    color: var(--color-grey-mid, #A0AEC0);
    flex-shrink: 0;
}

/* ─── Content Card base (if not already defined) ────────────── */
.content-card {
    background: #fff;
    border: 1px solid var(--color-grey-border, #E2E8F0);
    border-radius: var(--radius-lg, 10px);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}

.content-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-grey-border, #E2E8F0);
}

.content-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-body-text, #1A2E4A);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-card__body {
    padding: 20px;
}

.content-card--compact .content-card__body { padding: 12px 16px; }
.content-card--no-pad  .content-card__body { padding: 0; }

/* ─── Page Header ───────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header__left { display: flex; flex-direction: column; gap: 4px; }
.page-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-body-text, #1A2E4A);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--color-grey-text, #6B7280);
    margin: 0;
}

.page-subtitle__range {
    font-weight: 600;
    color: var(--color-blue-primary, #2980D4);
}

/* ============================================================
   END SECTION 52
   ============================================================ */

/* ============================================================
   53. CMS — CUSTOMER PORTAL PROJECT PAGES
       Used by: portal/projects/index.blade.php
                portal/projects/show.blade.php
   ============================================================ */

/* ─── Tabs Component ────────────────────────────────────────
   .tabs            Wrapper (handles overflow on mobile)
   .tabs__nav       Horizontal button row
   .tabs__tab       Individual tab button
   .tabs__tab--active  Active state
   .tabs__panel     Content panel (shown/hidden by Alpine)
   ──────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tabs__nav {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    border-bottom: 2px solid var(--color-grey-border);
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
}
.tabs__nav::-webkit-scrollbar { display: none; }

.tabs__tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: var(--text-md, 0.875rem);
    font-weight: 500;
    color: var(--color-grey-text);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}
.tabs__tab:hover {
    color: var(--color-body-text);
    background: var(--color-grey-light);
}
.tabs__tab--active {
    color: var(--color-blue-primary);
    border-bottom-color: var(--color-blue-primary);
    font-weight: 600;
    background: transparent;
}

.tabs__panel {
    animation: tabFadeIn 0.15s ease;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Progress Bar (BEM container + fill) ──────────────────
   The portal views use .progress-bar as the track container
   and .progress-bar__fill as the coloured fill bar.
   ──────────────────────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-grey-border);
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.progress-bar__fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
    min-width: 2px;
}

.progress-bar__fill--primary { background: var(--color-blue-primary); }
.progress-bar__fill--success { background: var(--color-green); }
.progress-bar__fill--warning { background: var(--color-amber); }
.progress-bar__fill--danger  { background: var(--color-red); }

/* ─── Progress Label Row ────────────────────────────────────
   Sits above the progress bar: label on left, value on right.
   ──────────────────────────────────────────────────────────── */
.progress-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
.progress-label-row__text {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
    font-weight: 500;
}
.progress-label-row__value {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-body-text);
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Badge additions (BEM variants) ───────────────────────
   badge--* mirrors the existing badge-* convention for portal.
   ──────────────────────────────────────────────────────────── */
.badge--success  { background: var(--color-green-light);  color: #155724; }
.badge--info     { background: var(--color-blue-light);   color: #0c4a8a; }
.badge--warning  { background: var(--color-amber-light);  color: var(--color-amber-dark); }
.badge--danger   { background: var(--color-red-light);    color: #721c24; }
.badge--secondary{ background: var(--color-grey-border);  color: var(--color-grey-text); }
.badge--primary  { background: var(--color-blue-lighter); color: var(--color-blue-primary); }

.badge--xs {
    font-size: 10px;
    padding: 1px 5px;
    line-height: 1.5;
}

.badge--count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    background: var(--color-grey-border);
    color: var(--color-grey-text);
    line-height: 1;
}

/* ─── Badge status slugs (project/job status) ──────────────── */
.badge--status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    text-transform: capitalize;
    letter-spacing: 0.01em;
}
/* Slug-based colours applied via Str::slug($project->status) */
.badge--active,
.badge--in-progress  { background: #EBF5FF; color: #1565C0; }
.badge--completed,
.badge--done         { background: var(--color-green-light); color: #155724; }
.badge--on-hold,
.badge--paused       { background: var(--color-amber-light); color: var(--color-amber-dark); }
.badge--cancelled,
.badge--archived     { background: var(--color-grey-border); color: var(--color-grey-text); }
.badge--blocked      { background: var(--color-red-light);   color: #721c24; }
.badge--planning,
.badge--draft        { background: #F3E8FF; color: #6B21A8; }

/* ─── Empty State (BEM variant) ────────────────────────────── */
.empty-state__title {
    font-size: var(--text-lg, 1rem);
    font-weight: 600;
    color: var(--color-heading-text);
    margin: 0 0 6px;
}
.empty-state__body {
    font-size: var(--text-md, 0.875rem);
    color: var(--color-grey-text);
    margin: 0;
    max-width: 380px;
}

/* ─── Filter Chips (project list status filter) ─────────────
   Horizontal scrollable row of pill buttons.
   ──────────────────────────────────────────────────────────── */
.portal-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-grey-border);
    background: var(--color-white);
    font-size: var(--text-sm, 0.75rem);
    font-weight: 500;
    color: var(--color-grey-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}
.filter-chip:hover {
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
    background: var(--color-blue-lighter);
}
.filter-chip--active {
    background: var(--color-blue-primary);
    border-color: var(--color-blue-primary);
    color: #fff;
    font-weight: 600;
}
.filter-chip--active:hover {
    background: var(--color-blue-hover);
    border-color: var(--color-blue-hover);
    color: #fff;
}
.filter-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    background: rgba(0,0,0,.1);
    line-height: 1;
}
.filter-chip--active .filter-chip__count { background: rgba(255,255,255,.25); }

/* ─── Project Cards Grid ────────────────────────────────────
   Responsive masonry-style card grid for the project list.
   ──────────────────────────────────────────────────────────── */
.project-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}

@media (max-width: 640px) {
    .project-cards-grid { grid-template-columns: 1fr; }
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.project-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.project-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.project-card__name {
    font-size: var(--text-lg, 1rem);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.project-card__section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
}
.project-card__meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.project-card__meta-icon {
    font-size: 11px;
    opacity: .7;
}

.project-card__footer {
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid var(--color-grey-border);
    display: flex;
    justify-content: flex-end;
}

/* ─── Project Hero Card (detail page header) ────────────────
   Sits above the tabs on the project show page.
   ──────────────────────────────────────────────────────────── */
.project-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 24px;
}

.project-hero__info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.project-hero__name {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 2px;
    line-height: 1.25;
}

.project-hero__manager {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 4px;
    border-top: 1px solid var(--color-grey-border);
}

.project-hero__progress {
    padding-top: 4px;
}

/* ─── Job Accordion (Jobs & Tasks tab) ──────────────────────
   Collapsible panels, one per customer-visible job.
   ──────────────────────────────────────────────────────────── */
.job-accordion {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.job-accordion__item {
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-white);
}

.job-accordion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    background: var(--color-grey-light);
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: var(--text-md, 0.875rem);
    font-weight: 600;
    color: var(--color-body-text);
    transition: background var(--transition-fast);
}
.job-accordion__header:hover { background: #EBEEF2; }

.job-accordion__header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.job-accordion__header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.job-accordion__chevron {
    font-size: 11px;
    color: var(--color-grey-text);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}
.job-accordion__chevron--open { transform: rotate(90deg); }

.job-accordion__name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-accordion__task-count {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    font-weight: 400;
    white-space: nowrap;
}

.job-accordion__date {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.job-accordion__body {
    border-top: 1px solid var(--color-grey-border);
    background: var(--color-white);
}

.job-accordion__empty {
    color: var(--color-grey-text);
    font-style: italic;
}

/* ─── Task List (inside job accordion) ──────────────────────
   Simple checklist-style rows.
   ──────────────────────────────────────────────────────────── */
.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.task-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--color-grey-border);
    font-size: var(--text-md, 0.875rem);
    transition: background var(--transition-fast);
}
.task-list__item:last-child { border-bottom: none; }
.task-list__item:hover { background: var(--color-grey-light); }
.task-list__item--done { opacity: .7; }

.task-list__status-icon {
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1;
    color: var(--color-grey-mid);
}

.task-list__name {
    flex: 1;
    min-width: 0;
    color: var(--color-body-text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-list__name--done {
    text-decoration: line-through;
    color: var(--color-grey-text);
    font-weight: 400;
}

.task-list__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-list__due {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* ─── Milestones List (overview tab) ────────────────────────
   Simple icon-list of project milestones.
   ──────────────────────────────────────────────────────────── */
.milestones-list {
    border-top: 1px solid var(--color-grey-border);
    padding-top: 16px;
    margin-top: 4px;
}

.milestones-list__title {
    font-size: var(--text-md, 0.875rem);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.milestone-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-md, 0.875rem);
    color: var(--color-body-text);
}
.milestone-item--done {
    color: var(--color-grey-text);
}
.milestone-item--done .milestone-item__name {
    text-decoration: line-through;
}

.milestone-item__icon {
    font-size: 15px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}
.milestone-item__name {
    flex: 1;
    font-weight: 500;
}
.milestone-item__date {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Breadcrumb link (portal pages) ───────────────────────── */
.breadcrumb-link {
    color: var(--color-blue-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-md, 0.875rem);
    transition: color var(--transition-fast);
}
.breadcrumb-link:hover {
    color: var(--color-blue-hover);
    text-decoration: underline;
}

/* ─── Utility helpers used on portal pages ─────────────────── */
.text-success { color: var(--color-green)   !important; }
.text-danger  { color: var(--color-red)     !important; }
.text-warning { color: var(--color-amber)   !important; }
.text-info    { color: var(--color-blue-primary) !important; }
.text-muted   { color: var(--color-grey-text)    !important; }
.text-sm      { font-size: var(--text-sm, 0.75rem) !important; }
.text-xs      { font-size: var(--text-xs, 0.6875rem) !important; }
.text-right   { text-align: right !important; }
.font-medium  { font-weight: 500 !important; }
.mt-1         { margin-top: 0.25rem !important; }
.mt-2         { margin-top: 0.5rem !important; }
.mt-4         { margin-top: 1.5rem !important; }
.ms-1         { margin-left: 0.25rem !important; }
.ms-2         { margin-left: 0.5rem !important; }
.p-3          { padding: 0.75rem !important; }
.p-4          { padding: 1.5rem !important; }

/* ─── Portal project responsive overrides ──────────────────── */
@media (max-width: 768px) {
    .project-hero { padding: 16px; }
    .project-hero__name { font-size: 18px; }
    .project-hero__meta { gap: 8px 16px; }
    .project-hero__info { flex-direction: column; }

    .tabs__tab { padding: 8px 10px; font-size: var(--text-sm); }

    .job-accordion__header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .job-accordion__header-right { justify-content: flex-start; }

    .task-list__meta { flex-direction: column; align-items: flex-end; gap: 3px; }

    .filter-chips { gap: 4px; }
    .filter-chip  { padding: 4px 10px; }
}

/* ============================================================
   END SECTION 53
   ============================================================ */

/* ============================================================
   54. CMS — CUSTOMER PORTAL TIMESHEET PAGE
       Used by: portal/timesheets/index.blade.php
   ============================================================ */

/* ─── Page wrapper ───────────────────────────────────────────── */
.portal-timesheets {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ─── Filter bar additions ─────────────────────────────────── */
.filter-bar__form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}
.filter-bar__label {
    display: block;
    font-size: var(--text-xs, 0.6875rem);
    font-weight: 600;
    color: var(--color-grey-text);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.filter-bar__group--apply {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: auto;
    margin-left: auto;
    flex-shrink: 0;
    padding-bottom: 0;
    align-self: flex-end;
}

/* ─── Summary stat strip ──────────────────────────────────────
   Horizontal row of 4 KPI tiles above the table.
   ──────────────────────────────────────────────────────────── */
.timesheet-summary-strip {
    display: flex;
    align-items: stretch;
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.timesheet-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    text-align: center;
}

.timesheet-stat--divider {
    flex: none;
    width: 1px;
    background: var(--color-grey-border);
    padding: 0;
    margin: 12px 0;
}

.timesheet-stat__value {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: 1;
    margin-bottom: 4px;
}

.timesheet-stat__unit {
    font-size: 14px;
    font-weight: 500;
    opacity: .55;
}

.timesheet-stat__label {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ─── View toggle (Table / Charts) ────────────────────────────
   Pill-style toggle; overrides the existing .view-toggle.
   ──────────────────────────────────────────────────────────── */
.view-toggle {
    display: inline-flex;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-grey-border);
    background: var(--color-white);
    box-shadow: var(--shadow-card);
    align-self: flex-start;
}

.view-toggle__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    font-size: var(--text-md, 0.875rem);
    font-weight: 500;
    color: var(--color-grey-text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}
.view-toggle__btn:hover { background: var(--color-grey-light); color: var(--color-body-text); }
.view-toggle__btn--active {
    background: var(--color-blue-primary);
    color: #fff;
    font-weight: 600;
}
.view-toggle__btn--active:hover { background: var(--color-blue-hover); }

/* ─── Charts grid ─────────────────────────────────────────────
   Two-column layout; wide card spans full width.
   ──────────────────────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.charts-grid__card--wide {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    padding: 16px 20px 20px;
}

.chart-container--bar {
    min-height: 220px;
}

.chart-container--pie {
    max-width: 320px;
    margin: 0 auto;
    padding: 16px 20px 24px;
}

.content-card__subtitle {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
    margin: 0;
}

/* ─── Timesheet project group (accordion) ────────────────────
   Outer collapsible: one per project.
   ──────────────────────────────────────────────────────────── */
.ts-project-group {
    border-bottom: 1px solid var(--color-grey-border);
}
.ts-project-group:last-child { border-bottom: none; }

.ts-project-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 13px 20px;
    background: var(--color-grey-light);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}
.ts-project-group__header:hover { background: #E9ECF0; }

.ts-project-group__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-md, 0.875rem);
    font-weight: 700;
    color: var(--color-heading-text);
}

.ts-project-group__chevron {
    font-size: 11px;
    color: var(--color-grey-text);
    transition: transform var(--transition-fast);
}
.rotate-180 { transform: rotate(180deg); }

.ts-project-group__meta {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
    white-space: nowrap;
}

/* ─── Job sub-group (inner accordion) ─────────────────────────
   Inner collapsible: one per job within a project.
   ──────────────────────────────────────────────────────────── */
.ts-job-group {
    border-top: 1px solid var(--color-grey-border);
}
.ts-job-group:first-child { border-top: none; }

.ts-job-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 20px 9px 36px;
    background: #FAFBFC;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}
.ts-job-group__header:hover { background: #F0F3F6; }

.ts-job-group__title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--text-sm, 0.75rem);
    font-weight: 600;
    color: var(--color-body-text);
}

.ts-job-group__chevron {
    font-size: 10px;
    color: var(--color-grey-text);
    transition: transform var(--transition-fast);
}
.rotate-90 { transform: rotate(90deg); }

.ts-job-group__subtotal {
    font-size: var(--text-sm, 0.75rem);
    font-weight: 600;
    color: var(--color-body-text);
    white-space: nowrap;
}

/* ─── Timesheet table ─────────────────────────────────────────
   Dense data table; indented variant for inside job groups.
   ──────────────────────────────────────────────────────────── */
.ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm, 0.75rem);
}

.ts-table--indented { background: #FDFDFE; }

.ts-table thead tr {
    background: var(--color-white);
    border-top: 1px solid var(--color-grey-border);
    border-bottom: 2px solid var(--color-grey-border);
}

.ts-table th {
    padding: 7px 12px 7px 20px;
    font-size: var(--text-xs, 0.6875rem);
    font-weight: 700;
    color: var(--color-grey-text);
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    white-space: nowrap;
}

.ts-table__row td { border-bottom: 1px solid #F0F3F6; }
.ts-table__row:last-child td { border-bottom: none; }
.ts-table__row--no-charge { background: #FFFEF5; }

.ts-table__cell {
    padding: 8px 12px 8px 20px;
    vertical-align: middle;
    color: var(--color-body-text);
}

.ts-table__cell--date  { white-space: nowrap; color: var(--color-grey-text); }
.ts-table__cell--hours { font-weight: 600; text-align: right; white-space: nowrap; }
.ts-table__cell--type  { text-align: center; white-space: nowrap; }
.ts-table__cell--task  { font-weight: 500; }
.ts-table__cell--desc  { color: var(--color-grey-text); }

.ts-task-name--none { color: var(--color-grey-mid); font-style: italic; }

.ts-table .ts-table__subtotal td {
    padding: 7px 12px 7px 20px;
    background: var(--color-grey-light);
    border-top: 1px solid var(--color-grey-border);
    font-size: var(--text-xs, 0.6875rem);
    font-weight: 700;
    color: var(--color-grey-text);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ts-table__cell--subtotal      { text-align: right; color: var(--color-body-text); }
.ts-table__cell--subtotal-label { color: var(--color-grey-text); }

/* Column widths */
.ts-table__col-date  { width: 100px; }
.ts-table__col-task  { width: 160px; }
.ts-table__col-hours { width: 70px; }
.ts-table__col-type  { width: 90px; }

/* ─── Grand total footer ──────────────────────────────────────── */
.ts-grand-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    background: var(--color-navy);
    color: #fff;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.ts-grand-total__label {
    font-size: var(--text-sm, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .7;
}

.ts-grand-total__cols {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.ts-grand-total__item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.ts-grand-total__item-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .65;
}

.ts-grand-total__item-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.ts-grand-total__item-value--green { color: #5EDE8A; }
.ts-grand-total__item-value--amber { color: #FFD97D; }

/* ─── Badge colour additions (timesheet-specific) ──────────────
   Adds missing badge variants referenced by the timesheets view.
   ──────────────────────────────────────────────────────────── */
.badge--blue  { background: var(--color-blue-light);  color: #0c4a8a; }
.badge--green { background: var(--color-green-light); color: #155724; }
.badge--grey  { background: var(--color-grey-border); color: var(--color-grey-text); }
.badge--sm    { font-size: 10px; padding: 2px 7px; }

/* ─── btn--outline (download buttons) ─────────────────────────── */
.btn--outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-blue-primary);
    background: transparent;
    color: var(--color-blue-primary);
    font-size: var(--text-md, 0.875rem);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    line-height: 1.4;
    white-space: nowrap;
}
.btn--outline:hover {
    background: var(--color-blue-primary);
    color: #fff;
    text-decoration: none;
}

/* ─── Alpine fade transition helpers ──────────────────────────── */
.fade-enter-active {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.fade-enter-from {
    opacity: 0;
    transform: translateY(4px);
}
.fade-enter-to {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Timesheet responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    .charts-grid { grid-template-columns: 1fr; }
    .charts-grid__card--wide { grid-column: 1; }
}

@media (max-width: 768px) {
    .timesheet-summary-strip { flex-wrap: wrap; }
    .timesheet-stat--divider { display: none; }
    .timesheet-stat { flex: 0 0 50%; border-bottom: 1px solid var(--color-grey-border); }

    .ts-table th, .ts-table__cell { padding-left: 12px; padding-right: 8px; }
    .ts-job-group__header { padding-left: 16px; }
    .ts-table__col-desc { display: none; }

    .filter-bar__form { flex-direction: column; align-items: stretch; }
    .filter-bar__group--apply { margin-left: 0; }
}

/* ============================================================
   END SECTION 54
   ============================================================ */

/* ============================================================
   55. ADMIN PROJECT SHOW PAGE
       Used by: admin/projects/show.blade.php
   ============================================================ */

/* ─── Page Header ───────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-header__left  { flex: 1; min-width: 0; }
.page-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.page-header__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.page-header__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0;
    line-height: 1.25;
}
.page-header__subtitle {
    font-size: var(--text-md, 0.875rem);
    color: var(--color-grey-text);
    margin: 4px 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.page-header__link {
    color: var(--color-blue-primary);
    text-decoration: none;
    font-weight: 500;
}
.page-header__link:hover { text-decoration: underline; }

/* ─── Tab Navigation ────────────────────────────────────────── */
.tab-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    border-bottom: 2px solid var(--color-grey-border);
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: var(--text-md, 0.875rem);
    font-weight: 500;
    color: var(--color-grey-text);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-nav__btn:hover {
    color: var(--color-body-text);
    background: var(--color-grey-light);
}
.tab-nav__btn--active {
    color: var(--color-blue-primary);
    font-weight: 600;
    border-bottom-color: var(--color-blue-primary);
}
.tab-nav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-blue-light);
    color: var(--color-blue-primary);
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
}

/* ─── Two-column layout (overview tab) ──────────────────────── */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}
.two-col-layout__main    { min-width: 0; }
.two-col-layout__sidebar { min-width: 0; }

@media (max-width: 960px) {
    .two-col-layout { grid-template-columns: 1fr; }
}

/* ─── Detail list (key → value pairs) ───────────────────────── */
.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    margin: 0;
    padding: 0;
}
.detail-list--two-col {
    grid-template-columns: 160px 1fr;
}
.detail-list__term {
    padding: 8px 16px 8px 0;
    font-size: var(--text-sm, 0.75rem);
    font-weight: 600;
    color: var(--color-grey-text);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--color-grey-border);
    display: flex;
    align-items: center;
}
.detail-list__desc {
    padding: 8px 0;
    font-size: var(--text-md, 0.875rem);
    color: var(--color-body-text);
    border-bottom: 1px solid var(--color-grey-border);
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.detail-list__term:last-of-type,
.detail-list__desc:last-of-type {
    border-bottom: none;
}

/* ─── Mini stat list (sidebar quick-stats) ──────────────────── */
.mini-stat-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}
.mini-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mini-stat__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-heading-text);
    line-height: 1;
}
.mini-stat__label {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ─── Card header variants ───────────────────────────────────── */
.card__header--with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.card__title-icon {
    font-size: 14px;
    opacity: .75;
    margin-right: 2px;
}
.card__title-count {
    font-size: var(--text-sm, 0.75rem);
    font-weight: 500;
    color: var(--color-grey-text);
    margin-left: 4px;
}
.card__body--compact { padding: 14px 20px; }
.card__body--flush   { padding: 0; }
.card__body--bordered-top {
    border-top: 1px solid var(--color-grey-border);
    padding: 16px 20px;
}

/* ─── Progress bars ──────────────────────────────────────────── */
.progress {
    width: 100%;
    height: 8px;
    background: var(--color-grey-border);
    border-radius: 4px;
    overflow: hidden;
}
.progress--xs  { height: 5px; }
.progress--md  { height: 10px; }

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    background: var(--color-blue-primary);
}
.progress-bar--primary { background: var(--color-blue-primary); }
.progress-bar--warning  { background: var(--color-amber); }
.progress-bar--danger   { background: var(--color-red); }

/* ─── Budget indicator bar (above tabs) ─────────────────────── */
.budget-indicator-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    align-items: center;
}
.budget-indicator {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.budget-indicator__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.budget-indicator__label {
    font-size: var(--text-sm, 0.75rem);
    font-weight: 600;
    color: var(--color-grey-text);
    display: flex;
    align-items: center;
    gap: 5px;
}
.budget-indicator__values {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-body-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Budget tab — breakdown grid ───────────────────────────── */
.budget-breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .budget-breakdown-grid { grid-template-columns: 1fr; }
}

/* ─── Budget stat list (definition-style rows) ──────────────── */
.budget-stat-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.budget-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--color-grey-border);
    font-size: var(--text-md, 0.875rem);
    color: var(--color-body-text);
}
.budget-stat:last-child { border-bottom: none; }
.budget-stat dt {
    font-weight: 500;
    color: var(--color-body-text);
    display: flex;
    align-items: center;
    gap: 5px;
}
.budget-stat dd {
    font-weight: 600;
    color: var(--color-heading-text);
    margin: 0;
    text-align: right;
}
.budget-stat--indent  { padding-left: 20px; }
.budget-stat--divider { border-top: 2px solid var(--color-grey-border); margin-top: 4px; }
.budget-stat--positive dd { color: var(--color-green); }
.budget-stat--danger  dt,
.budget-stat--danger  dd { color: var(--color-red); }
.budget-stat--warning dt,
.budget-stat--warning dd { color: var(--color-amber); }

/* ─── Budget progress block ─────────────────────────────────── */
.budget-progress-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.budget-progress-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ─── Job tree (Jobs & Tasks tab) ───────────────────────────── */
.job-tree {
    display: flex;
    flex-direction: column;
}
.job-tree__job {
    border-bottom: 1px solid var(--color-grey-border);
}
.job-tree__job:last-child { border-bottom: none; }

.job-tree__job-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-grey-light);
    transition: background var(--transition-fast);
}
.job-tree__job-header:hover { background: #EBEEF2; }

.job-tree__toggle {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-grey-text);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    font-size: 11px;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.job-tree__toggle:hover { background: var(--color-grey-border); color: var(--color-body-text); }

.job-tree__job-icon {
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.job-tree__job-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.job-tree__job-name {
    font-size: var(--text-md, 0.875rem);
    font-weight: 600;
    color: var(--color-heading-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.job-tree__job-name:hover { text-decoration: underline; }

.job-tree__job-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.job-tree__progress { flex-shrink: 0; }
.job-tree__hours {
    font-size: var(--text-sm, 0.75rem);
    white-space: nowrap;
}
.job-tree__due {
    font-size: var(--text-sm, 0.75rem);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.job-tree__job-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.job-tree__job-header:hover .job-tree__job-actions { opacity: 1; }

.job-tree__tasks {
    background: var(--color-white);
    border-top: 1px solid var(--color-grey-border);
}

/* ─── Task row (inside job tree) ─────────────────────────────── */
.task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px 9px 44px;
    border-bottom: 1px solid var(--color-grey-border);
    font-size: var(--text-md, 0.875rem);
    transition: background var(--transition-fast);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: #FAFBFC; }
.task-row--child { padding-left: 68px; }

.task-row__name {
    flex: 1;
    font-weight: 500;
    color: var(--color-body-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-row__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Button icon variants ───────────────────────────────────── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-icon--xs  { width: 24px; height: 24px; font-size: 11px; }
.btn-icon--view { background: var(--color-blue-light);  color: var(--color-blue-primary); }
.btn-icon--edit { background: #FFF3CD; color: #856404; }
.btn-icon--add  { background: var(--color-green-light); color: #155724; }
.btn-icon--view:hover { background: var(--color-blue-primary); color: #fff; }
.btn-icon--edit:hover { background: #FFCB05; color: #5a4200; }
.btn-icon--add:hover  { background: var(--color-green); color: #fff; }

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--color-grey-text);
    gap: 12px;
}
.empty-state--sm { padding: 36px 24px; }
.empty-state__icon-sm {
    font-size: 32px;
    opacity: .3;
    display: block;
    margin-bottom: 4px;
}
.empty-state__body {
    font-size: var(--text-md, 0.875rem);
    color: var(--color-grey-text);
    margin: 0;
    line-height: 1.5;
}
.empty-state__body a {
    color: var(--color-blue-primary);
    text-decoration: none;
    font-weight: 500;
}
.empty-state__body a:hover { text-decoration: underline; }

/* ─── Conversation thread ───────────────────────────────────── */
.conversation-thread {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.conversation-message {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-grey-border);
}
.conversation-message:last-child { border-bottom: none; }

.conversation-message__avatar { flex-shrink: 0; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-blue-primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}
.avatar--sm { width: 34px; height: 34px; font-size: 13px; }

.conversation-message__body  { flex: 1; min-width: 0; }
.conversation-message__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.conversation-message__author {
    font-size: var(--text-md, 0.875rem);
    font-weight: 600;
    color: var(--color-heading-text);
}
.conversation-message__time {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
}
.conversation-message__content {
    font-size: var(--text-md, 0.875rem);
    color: var(--color-body-text);
    line-height: 1.6;
}

/* ─── Conversation compose form ─────────────────────────────── */
.conversation-compose-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-md, 0.875rem);
    color: var(--color-body-text);
    cursor: pointer;
}
.form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Gantt chart wrapper ───────────────────────────────────── */
.gantt-wrapper {
    position: relative;
    width: 100%;
    min-height: 160px;
}
.gantt-wrapper canvas {
    width: 100% !important;
}

/* ─── Rich text content ─────────────────────────────────────── */
.rich-text {
    font-size: var(--text-md, 0.875rem);
    color: var(--color-body-text);
    line-height: 1.65;
}
.rich-text p  { margin: 0 0 0.75em; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { padding-left: 20px; margin: 0 0 0.75em; }

/* ─── Spacing utilities (used on show page) ─────────────────── */
.mb-4 { margin-bottom: 1.5rem !important; }
.ml-1 { margin-left: 0.25rem !important; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 960px) {
    .tab-nav__btn { padding: 9px 12px; font-size: var(--text-sm, 0.75rem); }
    .job-tree__job-header { flex-wrap: wrap; }
    .job-tree__job-meta   { flex-wrap: wrap; gap: 6px; }
    .job-tree__job-actions { opacity: 1; }
}
@media (max-width: 768px) {
    .page-header { flex-direction: column; }
    .budget-indicator-row { flex-direction: column; gap: 16px; }
    .budget-breakdown-grid { grid-template-columns: 1fr; }
    .mini-stat-list { grid-template-columns: 1fr 1fr; }
    .detail-list--two-col { grid-template-columns: 130px 1fr; }
}

/* ============================================================
   END SECTION 55
   ============================================================ */

/* ============================================================
   SECTION 56 — PORTAL PROJECT SHOW: TABS + CONVERSATION
   Classes used by portal/projects/show.blade.php and
   portal/projects/partials/conversation.blade.php.
   ============================================================ */

/* ─── Portal tab container ───────────────────────────────────── */
.tabs {
    display: flex;
    flex-direction: column;
}

/* ─── Portal tab nav bar ─────────────────────────────────────── */
.tabs__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    border-bottom: 2px solid var(--color-grey-border);
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.tabs__nav::-webkit-scrollbar { display: none; }

.tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: var(--text-md, 0.875rem);
    font-weight: 500;
    color: var(--color-grey-text);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tabs__tab:hover {
    color: var(--color-body-text);
    background: var(--color-grey-light);
}
.tabs__tab--active {
    color: var(--color-blue-primary);
    font-weight: 600;
    border-bottom-color: var(--color-blue-primary);
}

/* ─── Portal tab content panels ─────────────────────────────── */
.tabs__panel {
    padding: 24px;
    border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
}
/* When the panel is also a .card the card already has border-radius;
   reset internal padding to match card__body convention */
.tabs__panel.card {
    border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
    padding: 24px;
    margin-top: 0;
}
/* Flush panels (e.g. Gantt, job accordion) override padding */
.tabs__panel.card.p-0 { padding: 0; }

/* ─── Empty state icon + title (portal/show variants) ───────── */
.empty-state__icon {
    font-size: 48px;
    opacity: 0.25;
    display: block;
    margin-bottom: 4px;
    text-align: center;
}
.empty-state__title {
    font-size: var(--text-lg, 1rem);
    font-weight: 600;
    color: var(--color-grey-text);
    margin: 0;
    text-align: center;
}

/* ─── Portal project hero card ──────────────────────────────── */
.project-hero {
    padding: 20px 24px;
}
.project-hero__info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.project-hero__name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 4px;
}
.project-hero__manager {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.project-hero__meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}
.project-hero__progress {
    margin-top: 4px;
}
.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.meta-item__label {
    font-size: var(--text-xs, 0.6875rem);
    font-weight: 600;
    color: var(--color-grey-text);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.meta-item__value {
    font-size: var(--text-md, 0.875rem);
    font-weight: 600;
    color: var(--color-heading-text);
}

/* ─── Portal job accordion ───────────────────────────────────── */
.job-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.job-accordion__item {
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
}
.job-accordion__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-grey-light);
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast);
    flex-wrap: wrap;
}
.job-accordion__header:hover { background: #EBEEF2; }
.job-accordion__header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.job-accordion__header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.job-accordion__chevron {
    font-size: 11px;
    color: var(--color-grey-text);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}
.job-accordion__chevron--open { transform: rotate(90deg); }
.job-accordion__name {
    font-size: var(--text-md, 0.875rem);
    font-weight: 600;
    color: var(--color-heading-text);
}
.job-accordion__date {
    font-size: var(--text-sm, 0.75rem);
    display: flex;
    align-items: center;
    gap: 4px;
}
.job-accordion__task-count { font-size: var(--text-sm, 0.75rem); }
.job-accordion__body { border-top: 1px solid var(--color-grey-border); }
.job-accordion__empty { color: var(--color-grey-text); }

/* ─── Portal task list (inside accordion) ───────────────────── */
.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.task-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-grey-border);
    font-size: var(--text-md, 0.875rem);
}
.task-list__item:last-child { border-bottom: none; }
.task-list__item--done { opacity: 0.65; }
.task-list__status-icon { flex-shrink: 0; font-size: 16px; }
.task-list__name {
    flex: 1;
    font-weight: 500;
    color: var(--color-body-text);
    min-width: 0;
}
.task-list__name--done {
    text-decoration: line-through;
    color: var(--color-grey-text);
}
.task-list__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.task-list__due {
    font-size: var(--text-sm, 0.75rem);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Conversation thread (portal) ──────────────────────────── */
.conversation-thread__header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-grey-border);
}
.conversation-thread__title {
    font-size: var(--text-lg, 1rem);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 4px;
}
.conversation-thread__subtitle {
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
    margin: 0;
}
.conversation-thread__messages {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 480px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
}
.conversation-thread__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--color-grey-text);
    font-size: var(--text-md, 0.875rem);
    gap: 8px;
}

/* ─── Portal conversation message bubbles ───────────────────── */
.conversation-message__meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.conversation-message__sender {
    font-size: var(--text-md, 0.875rem);
    font-weight: 600;
    color: var(--color-heading-text);
}
.conversation-message__you {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    font-weight: 400;
}
.conversation-message--own .conversation-message__avatar {
    background: var(--color-teal);
}
.conversation-message--admin .conversation-message__avatar {
    background: var(--color-navy);
}

/* ─── Conversation compose (portal) ────────────────────────── */
.conversation-compose {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-grey-border);
    margin-top: 8px;
}
.conversation-compose__editor { display: flex; flex-direction: column; gap: 4px; }
.conversation-compose__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ─── Portal milestones list ─────────────────────────────────── */
.milestones-list {
    margin-top: 20px;
}
.milestones-list__title {
    font-size: var(--text-md, 0.875rem);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.milestone-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.milestone-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--color-grey-border);
    font-size: var(--text-md, 0.875rem);
}
.milestone-item:last-child { border-bottom: none; }
.milestone-item--done .milestone-item__name {
    text-decoration: line-through;
    color: var(--color-grey-text);
}
.milestone-item__icon { flex-shrink: 0; }
.milestone-item__name { flex: 1; font-weight: 500; color: var(--color-body-text); }
.milestone-item__date { font-size: var(--text-sm, 0.75rem); flex-shrink: 0; }

/* ─── Portal filter bar (projects index) ────────────────────── */
.portal-filter-bar { margin-bottom: 20px; }
.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--color-grey-border);
    background: var(--color-white);
    font-size: var(--text-sm, 0.75rem);
    font-weight: 500;
    color: var(--color-grey-text);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.filter-chip:hover {
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
}
.filter-chip--active {
    border-color: var(--color-blue-primary);
    background: var(--color-blue-light);
    color: var(--color-blue-primary);
    font-weight: 600;
}
.filter-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--color-grey-border);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-body-text);
}
.filter-chip--active .filter-chip__count {
    background: var(--color-blue-primary);
    color: #fff;
}

/* ─── Portal project cards grid ─────────────────────────────── */
.project-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.project-card {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md, 8px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.project-card:hover {
    border-color: var(--color-blue-primary);
    box-shadow: 0 4px 16px rgba(41, 128, 212, 0.1);
}
.project-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.project-card__name {
    font-size: var(--text-md, 0.875rem);
    font-weight: 700;
    color: var(--color-heading-text);
    margin: 0;
    flex: 1;
    min-width: 0;
}
.project-card__section { display: flex; flex-direction: column; gap: 6px; }
.project-card__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.project-card__meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-sm, 0.75rem);
    color: var(--color-grey-text);
}
.project-card__meta-icon {
    font-size: 12px;
    color: var(--color-grey-mid);
}
.project-card__footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--color-grey-border);
}

/* ─── Progress label row (above progress bars) ──────────────── */
.progress-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: var(--text-sm, 0.75rem);
    margin-bottom: 4px;
}
.progress-label-row__text  { color: var(--color-grey-text); }
.progress-label-row__value { color: var(--color-body-text); font-weight: 600; }

/* ─── Portal badge status modifiers (used by StatusHelper) ───── */
.badge--outline {
    background: transparent;
    border: 1.5px solid var(--color-grey-border);
    color: var(--color-grey-text);
}
.badge--primary {
    background: var(--color-blue-light);
    color: var(--color-blue-primary);
}
.badge--status {
    font-size: var(--text-xs, 0.6875rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 8px;
}

/* ─── Portal card animation ──────────────────────────────────── */
@keyframes card-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card-fade-in { animation: card-fade-in 0.2s ease forwards; }

/* ─── Responsive portal ──────────────────────────────────────── */
@media (max-width: 768px) {
    .project-cards-grid { grid-template-columns: 1fr; }
    .tabs__tab { padding: 8px 10px; font-size: var(--text-sm, 0.75rem); }
    .project-hero__meta { gap: 12px; }
    .tabs__panel, .tabs__panel.card { padding: 16px; }
}

/* ─── Project conversation attachments ─────────────────────── */
.conv-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.conv-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--color-grey-light);
    border: 1px solid var(--color-grey-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-body-text);
    text-decoration: none;
    transition: background var(--transition-fast);
    max-width: 260px;
}
.conv-attachment-chip:hover {
    background: var(--color-blue-light);
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
}
.conv-attachment-chip__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-attachment-chip__size {
    opacity: .6;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Staged file chips (before send) ───────────────────────── */
.conv-staged-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.conv-staged-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--color-blue-lighter);
    border: 1px solid var(--color-blue-light);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-navy);
    max-width: 240px;
}
.conv-staged-chip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-staged-chip__remove {
    background: none;
    border: none;
    color: var(--color-grey-text);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 13px;
    flex-shrink: 0;
}
.conv-staged-chip__remove:hover { color: var(--color-red); }

/* ============================================================
   END SECTION 56
   ============================================================ */

/* ============================================================
   57. CONVERSATION BUBBLES — iMessage-style layout
       Admin project conversation thread.
       Customer messages: left. Admin messages: right.
   ============================================================ */

/* ── Thread container ────────────────────────────────────── */
.conversation-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

/* ── Base message row ────────────────────────────────────── */
.conversation-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 90%;
    border-bottom: none;
    margin-bottom: 0;
}

/* ── Customer messages — left aligned ────────────────────── */
.conversation-message--customer {
    align-self: flex-start;
    flex-direction: row;
}

/* ── Admin messages — right aligned ─────────────────────── */
.conversation-message--admin {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* ── Avatar circle ───────────────────────────────────────── */
.conversation-message__avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--color-navy);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-bottom: 2px;
}

/* ── Bubble (body wrapper) ───────────────────────────────── */
.conversation-message__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

/* ── Meta row (name + time) ──────────────────────────────── */
.conversation-message__meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 4px;
    margin-bottom: 2px;
}
.conversation-message--admin .conversation-message__meta {
    justify-content: flex-end;
}
.conversation-message__sender {
    font-size: var(--text-sm, 0.75rem);
    font-weight: 600;
    color: var(--color-heading-text);
}
.conversation-message__time {
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
}

/* ── Bubble content box ──────────────────────────────────── */
.conversation-message__content {
    padding: 10px 14px;
    font-size: var(--text-md, 0.875rem);
    line-height: 1.55;
    color: var(--color-body-text);
    border: 1px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

/* Customer bubble: left-side sharp corner */
.conversation-message--customer .conversation-message__content {
    background: var(--color-blue-lighter);
    border-color: var(--color-blue-light);
    border-radius: 4px 18px 18px 18px;
}
.conversation-message--customer .conversation-message__avatar {
    background: var(--color-blue-primary);
}

/* Admin visible-to-customer bubble: green, right-side sharp corner */
.conversation-message--admin:not(.conversation-message--admin-note) .conversation-message__content {
    background: #D4EDDA;
    border-color: #B8DACC;
    border-radius: 18px 4px 18px 18px;
}
.conversation-message--admin:not(.conversation-message--admin-note) .conversation-message__avatar {
    background: #28A745;
}
.conversation-message--admin:not(.conversation-message--admin-note) .conversation-message__sender {
    color: #1A5E2A;
}

/* Admin internal note bubble: yellow, right-side sharp corner */
.conversation-message--admin-note .conversation-message__content {
    background: var(--color-amber-light);
    border-color: #F0C44A;
    border-radius: 18px 4px 18px 18px;
}
.conversation-message--admin-note .conversation-message__avatar {
    background: var(--color-amber-dark);
}

/* ── Internal note label pill ────────────────────────────── */
.conversation-message__note-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs, 0.6875rem);
    font-weight: 600;
    color: var(--color-amber-dark);
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(133, 100, 4, 0.2);
    padding: 1px 8px;
    border-radius: 10px;
}

/* ============================================================
   PORTAL OVERRIDES — iMessage layout for customer portal
   Scoped to .cms-portal-body to avoid affecting admin.
   From the customer's perspective:
     - Their own messages (--own)  → right, blue
     - Agent / admin messages      → left, green
   ============================================================ */

/* Messages container needs gap (the portal uses __messages, not __thread) */
.cms-portal-body .conversation-thread__messages {
    gap: 10px;
    padding-bottom: 4px;
    padding-right: 20px;
}

/* Portal: agent messages go LEFT (reverse of admin default) */
.cms-portal-body .conversation-message--admin {
    align-self: flex-start;
    flex-direction: row;
}
.cms-portal-body .conversation-message--admin .conversation-message__content {
    border-radius: 4px 18px 18px 18px;
}
.cms-portal-body .conversation-message--admin .conversation-message__meta {
    justify-content: flex-start;
}

/* Portal: own (customer) messages go RIGHT */
.cms-portal-body .conversation-message--own {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.cms-portal-body .conversation-message--own .conversation-message__content {
    border-radius: 18px 4px 18px 18px;
}
.cms-portal-body .conversation-message--own .conversation-message__meta {
    justify-content: flex-end;
}

/* Portal: other customer messages (not own) go LEFT */
.cms-portal-body .conversation-message--customer:not(.conversation-message--own) {
    align-self: flex-start;
    flex-direction: row;
}
.cms-portal-body .conversation-message--customer:not(.conversation-message--own) .conversation-message__content {
    border-radius: 4px 18px 18px 18px;
}

/* ── Legend bar ─────────────────────────────────────────── */
.conv-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-grey-border);
    margin-top: 4px;
}
.conv-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-xs, 0.6875rem);
    color: var(--color-grey-text);
    font-weight: 500;
}
.conv-legend__item--customer i { color: var(--color-blue-primary); }
.conv-legend__item--admin    i { color: #28A745; }
.conv-legend__item--note     i { color: var(--color-amber-dark); }

/* ============================================================
   END SECTION 57
   ============================================================ */

/* ============================================================
   SECTION 58 — PORTAL INVOICE ADDITIONS
   New badge variants and portal-invoice-specific overrides.
   ============================================================ */

/* Remittance Received badge (purple) */
.badge--purple {
    background-color: #ede9fe;
    color:            #6d28d9;
    border:           1px solid #c4b5fd;
}

/* badge--remittance_received alias (used by admin status badge--{{ $invoice->status }}) */
.badge--remittance_received {
    background-color: #ede9fe;
    color:            #6d28d9;
    border:           1px solid #c4b5fd;
}

/* Portal invoice stat grid — 3-column variant */
.portal-stat-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Portal stat card — red variant for overdue */
.portal-stat-card--red {
    border-top: 4px solid var(--color-danger, #dc3545);
}
.portal-stat-card--red .portal-stat-card__icon {
    background: rgba(220, 53, 69, 0.12);
    color: var(--color-danger, #dc3545);
}
.portal-stat-card--red .portal-stat-card__number {
    color: var(--color-danger, #dc3545);
}

/* Table row warning tint (overdue invoices) */
tr.table-row--warning td {
    background-color: #fff9f0;
}

/* ============================================================
   END SECTION 58
   ============================================================ */

/* ============================================================
   SECTION 59 — PORTAL DASHBOARD ACTIVITY FEED PADDING
   Increases horizontal and vertical padding on each activity
   row so entries have more breathing room.
   ============================================================ */

.activity-item {
    padding: 14px 20px;
}

/* ============================================================
   END SECTION 59
   ============================================================ */

/* ============================================================
   SECTION 60 — FILE TREE (project & customer file tabs)
   Shared styles for folder tree, file rows, inline upload
   drop zone used in project show and customer show views.
   ============================================================ */

/* ── Folder container ─────────────────────────────────────── */
.project-folder {
    border-bottom: 1px solid var(--border-color, #E8ECF0);
}
.project-folder:last-child { border-bottom: none; }

.project-folder__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--color-bg-subtle, #F8F9FB);
    transition: background 0.12s;
}
.project-folder__header:hover {
    background: var(--color-bg-hover, #EEF1F5);
}
.project-folder__toggle {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #6B7280);
    padding: 0;
    border-radius: 3px;
    transition: background 0.12s, color 0.12s;
}
.project-folder__toggle:hover {
    background: var(--color-primary-light, #dbeafe);
    color: var(--color-primary, #2980D4);
}
.project-folder__icon {
    flex-shrink: 0;
    color: #f59e0b;
    font-size: 0.9rem;
}
.project-folder__name {
    flex: 1;
    font-weight: 600;
    font-size: var(--text-sm, 0.875rem);
    color: var(--text-primary, #1A2E4A);
}
.project-folder__count { flex-shrink: 0; }
.project-folder__actions {
    flex-shrink: 0;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.project-folder__header:hover .project-folder__actions { opacity: 1; }
.project-folder__empty {
    padding: 10px 20px 10px 58px;
    font-size: var(--text-sm, 0.875rem);
    color: var(--text-muted, #6B7280);
    font-style: italic;
    border-bottom: 1px solid var(--border-color-light, #F0F2F5);
}
.project-folder__section-label {
    padding: 6px 20px;
    font-size: var(--text-xs, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #6B7280);
    background: #FAFBFC;
    border-bottom: 1px solid var(--border-color-light, #F0F2F5);
}

/* ── Individual file row ──────────────────────────────────── */
.project-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color-light, #F0F2F5);
    transition: background 0.12s;
}
.project-file-row:last-child { border-bottom: none; }
.project-file-row--indented { padding-left: 52px; }
.project-file-row:hover { background: var(--color-bg-subtle, #F8F9FB); }

.project-file-row__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--color-bg-hover, #EEF1F5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--color-primary, #2980D4);
}

.project-file-row__info {
    flex: 1;
    min-width: 0;
}
.project-file-row__name {
    display: block;
    font-size: var(--text-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-primary, #1A2E4A);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
    margin-bottom: 3px;
}
.project-file-row__name:hover {
    color: var(--color-primary, #2980D4);
    text-decoration: underline;
}
.project-file-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs, 0.75rem);
    color: var(--text-muted, #6B7280);
}

.project-file-row__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.project-file-row:hover .project-file-row__actions { opacity: 1; }

/* ── btn-link ─────────────────────────────────────────────── */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-primary, #2980D4);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
}
.btn-link:hover { color: var(--color-primary-dark, #1a6aab); }

/* ── Inline file drop zone ────────────────────────────────── */
.file-drop-zone {
    position: relative;
    border: 2px dashed var(--border-color, #d1d5db);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--color-bg-subtle, #f9fafb);
}
.file-drop-zone:hover,
.file-drop-zone--active {
    border-color: var(--color-primary, #2980D4);
    background: #f0f7ff;
}
.file-drop-zone--filled {
    border-color: var(--color-success, #28a745);
    background: #f0fdf4;
}
.file-drop-zone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.file-drop-zone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}
.file-drop-zone__icon { font-size: 2rem; color: var(--text-muted, #9ca3af); }
.file-drop-zone__text { font-weight: 600; color: var(--text-primary, #1A2E4A); margin: 0; font-size: var(--text-sm, 0.875rem); }
.file-drop-zone__hint { font-size: var(--text-xs, 0.75rem); color: var(--text-muted, #9ca3af); margin: 0; }

/* Compact variant for inline upload panels */
.file-drop-zone--compact {
    padding: 10px 12px;
    min-height: 56px;
}
.file-drop-zone--compact .file-drop-zone__inner {
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
}
.file-drop-zone--compact .file-drop-zone__icon { font-size: 1rem; flex-shrink: 0; }
.file-drop-zone--compact .file-drop-zone__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.file-drop-zone--compact .file-drop-zone__hint { white-space: nowrap; }

/* ============================================================
   END SECTION 60
   ============================================================ */

/* ============================================================
   SECTION 61 — TAB PANEL TOP SPACING
   Adds consistent breathing room between the tab nav bar
   and the content below it across all tabbed pages.
   ============================================================ */

[role="tabpanel"] {
    margin-top: 1.25rem;
}

/* ============================================================
   END SECTION 61
   ============================================================ */

/* ============================================================
   SECTION 62 — FOLDER MODAL
   Self-contained classes for the Create Folder modal used
   in the project and customer Files tabs. Uses .folder-modal-*
   to avoid conflicts with the existing .modal system.
   ============================================================ */

.folder-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.folder-modal-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.folder-modal-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #1A2E4A;
    color: #fff;
    flex-shrink: 0;
}

.folder-modal-box__title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-modal-box__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.folder-modal-box__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.folder-modal-box__body {
    padding: 1.25rem;
    flex: 1;
}

.folder-modal-box__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #E8ECF0;
    background: #f8f9fb;
    flex-shrink: 0;
}

/* ============================================================
   END SECTION 62
   ============================================================ */

/* ============================================================
   SECTION 63 — APPROVAL FLOW (BRANCHING DIAGRAM)
   Used on the portal file detail page to show the approval
   pipeline with a red "Changes Requested" branch off
   the "Your Review" node.
   ============================================================ */

.approval-flow {
    width: 100%;
    overflow: visible;
}

/* Horizontal track holding all nodes + connectors */
.approval-flow__track {
    display: flex;
    align-items: flex-start;
    padding-bottom: 80px; /* room for the rejection branch below Your Review */
}

/* ── Individual stage node ────────────────────────────────── */
.af-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    flex-shrink: 0;
}

/* ── Horizontal connector line between nodes ──────────────── */
.af-connector {
    flex: 1;
    height: 2px;
    background: var(--border-color, #E2E8F0);
    margin-top: 13px;      /* aligns with the vertical centre of the 26px dot */
    min-width: 16px;
    transition: background 0.2s;
}
.af-connector--done {
    background: var(--color-success, #28a745);
}

/* ── Stage dot ────────────────────────────────────────────── */
.af-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #D1D5DB);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.af-node--done .af-dot {
    background: var(--color-success, #28a745);
    border-color: var(--color-success, #28a745);
}
.af-node--active .af-dot {
    background: var(--color-primary, #2980D4);
    border-color: var(--color-primary, #2980D4);
    box-shadow: 0 0 0 4px rgba(41, 128, 212, 0.18);
}

/* ── Stage label ──────────────────────────────────────────── */
.af-label {
    font-size: 0.68rem;
    color: var(--text-muted, #6B7280);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
    line-height: 1.3;
    max-width: 72px;
}
.af-node--done .af-label   { color: #1a7a35; }
.af-node--active .af-label { color: var(--color-primary, #2980D4); font-weight: 700; }

/* ── Rejection branch (hangs from Your Review node) ──────── */
.af-branch {
    position: absolute;
    top: 26px;             /* immediately below the dot */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.22;
    transition: opacity 0.25s;
    pointer-events: none;
}
.af-branch--active {
    opacity: 1;
    pointer-events: auto;
}

/* Vertical drop line */
.af-branch__vline {
    width: 2px;
    height: 28px;
    background: var(--color-danger, #dc3545);
    transition: background 0.2s;
}

/* Rejection dot */
.af-branch__dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(220, 53, 69, 0.35);
    background: #fff7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(220, 53, 69, 0.35);
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.af-branch--active .af-branch__dot {
    border-color: var(--color-danger, #dc3545);
    background: var(--color-danger, #dc3545);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.18);
}

/* Rejection label */
.af-branch__label {
    margin-top: 5px;
    font-size: 0.68rem;
    color: rgba(220, 53, 69, 0.4);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
    max-width: 80px;
    transition: color 0.2s, font-weight 0.2s;
}
.af-branch--active .af-branch__label {
    color: var(--color-danger, #dc3545);
    font-weight: 700;
}

/* ============================================================
   END SECTION 63
   ============================================================ */

/* ============================================================
   SECTION 64 — Customer Files Tab: project-grouped tree
   Classes: .cu-proj-section, .cu-proj-section__hdr,
            .cu-proj-section__icon, .cu-proj-section__name,
            .cu-proj-section__count, .project-folder--indented
   ============================================================ */

/* ── Project section wrapper ──────────────────────────────────────────── */
.cu-proj-section {
    border-bottom: 2px solid var(--color-grey-border, #DEE2E6);
}
.cu-proj-section:last-child {
    border-bottom: none;
}

/* ── Project header row ──────────────────────────────────────────── */
.cu-proj-section__hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--color-grey-bg, #F4F6F8);
    border-bottom: 1px solid var(--color-grey-border, #DEE2E6);
    border-left: 4px solid var(--color-blue-primary, #2980D4);
    min-height: 46px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.cu-proj-section__hdr--muted {
    background: var(--color-grey-light, #F8F9FA);
    border-left-color: var(--color-grey-mid, #ADB5BD);
}

/* ── Toggle chevron ────────────────────────────────────────────── */
.cu-proj-section__hdr .project-folder__toggle {
    color: var(--color-grey-mid, #ADB5BD);
    font-size: 11px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.cu-proj-section__hdr .project-folder__toggle:hover {
    color: var(--color-blue-primary, #2980D4);
}

/* ── Project icon ─────────────────────────────────────────────── */
.cu-proj-section__icon {
    font-size: 13px;
    color: var(--color-blue-primary, #2980D4);
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}
.cu-proj-section__hdr--muted .cu-proj-section__icon {
    color: var(--color-grey-mid, #ADB5BD);
}

/* ── Project name link ─────────────────────────────────────────── */
.cu-proj-section__name {
    font-weight: 600;
    font-size: var(--text-md, 0.875rem);
    color: var(--color-heading-text, #1A2E4A);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
    flex-shrink: 1;
}
a.cu-proj-section__name:hover {
    color: var(--color-blue-primary, #2980D4);
    text-decoration: underline;
}
span.cu-proj-section__name {
    color: var(--color-grey-text, #6C757D);
    font-weight: 500;
}

/* ── Badges in header ───────────────────────────────────────────── */
.cu-proj-section__count {
    flex-shrink: 0;
}

/* Push action buttons to the far right */
.cu-proj-section__hdr .project-folder__actions {
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Indented folder rows inside a project section ───────────────────── */
.project-folder--indented .project-folder__header {
    padding-left: 32px;
    background: var(--color-white, #FFFFFF);
}
.project-folder--indented .project-folder__header:hover {
    background: var(--color-grey-light, #F8F9FA);
}
.project-folder--indented .project-folder__empty {
    padding-left: 72px;
}
/* File rows inside indented folders get extra indent via the existing row padding */

/* ============================================================
   END SECTION 64
   ============================================================ */

/* ============================================================
   SECTION 65 — Portal Folder Tree
   Classes: .portal-folder-section, .portal-files-table-wrap,
            .portal-folder-section__label-row
   Used on: /portal/files (All tab) and /portal/projects/{id}?tab=files
   ============================================================ */

.portal-folder-section {
    border-bottom: 1px solid var(--color-grey-border, #DEE2E6);
}
.portal-folder-section:last-child {
    border-bottom: none;
}

/* ── Folder header row ──────────────────────────────────────────── */
.portal-folder-section__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-grey-bg, #F4F6F8);
    border-bottom: 1px solid var(--color-grey-border, #DEE2E6);
    border-left: 3px solid var(--color-blue-primary, #2980D4);
    min-height: 42px;
    cursor: default;
}

/* ── Toggle button ────────────────────────────────────────────── */
.portal-folder-section__toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-grey-mid, #ADB5BD);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    font-size: 11px;
}
.portal-folder-section__toggle:hover {
    color: var(--color-blue-primary, #2980D4);
}

/* ── Chevron rotation ───────────────────────────────────────────── */
.portal-folder-section__chevron {
    transition: transform 0.2s ease;
}
.portal-folder-section__chevron--closed {
    transform: rotate(-90deg);
}

/* ── Folder icon ─────────────────────────────────────────────── */
.portal-folder-section__icon {
    color: var(--color-amber, #FFC107);
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Folder name ─────────────────────────────────────────────── */
.portal-folder-section__name {
    font-weight: 600;
    font-size: var(--text-md, 0.875rem);
    color: var(--color-heading-text, #1A2E4A);
    flex: 1;
}

/* ── File count badge ──────────────────────────────────────────── */
.portal-folder-section__count {
    flex-shrink: 0;
}

/* ── Empty folder message ────────────────────────────────────────── */
.portal-folder-section__empty {
    padding: 14px 20px 14px 44px;
    font-size: var(--text-sm, 0.875rem);
    color: var(--color-grey-text, #6C757D);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── "Unfiled" label row between folders and unfiled files ────────────── */
.portal-folder-section__label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--color-grey-light, #F8F9FA);
    border-top: 1px solid var(--color-grey-border, #DEE2E6);
    border-bottom: 1px solid var(--color-grey-border, #DEE2E6);
    font-size: var(--text-xs, 0.6875rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-grey-text, #6C757D);
}

/* ── File table inside folder (remove top border as folder header provides separation) ── */
.portal-files-table-wrap .data-table thead tr th {
    background: var(--color-white, #fff);
    border-top: none;
}
.portal-files-table-wrap .data-table {
    margin: 0;
}

/* ============================================================
   END SECTION 65
   ============================================================ */

/* ============================================================
   SECTION 66 — Portal Dashboard Activity Feed
   Classes: .activity-feed, .activity-item
   Used on: /portal/dashboard
   ============================================================ */

.activity-feed {
    padding-bottom: 8px;
}

.activity-item {
    display:       flex;
    align-items:   center;
    gap:           14px;
    padding:       12px 20px;
    border-bottom: 1px solid var(--color-grey-border);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 16px;
}

.activity-item__icon {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           32px;
    height:          32px;
    border-radius:   var(--radius-full);
    flex-shrink:     0;
    font-size:       13px;
    background:      var(--color-grey-light);
    color:           var(--color-grey-text);
}

.activity-item__icon--file    { background: #E8F5E9; color: #2E7D32; }
.activity-item__icon--project { background: var(--color-blue-lighter); color: var(--color-blue-primary); }
.activity-item__icon--message { background: var(--color-teal-light); color: var(--color-teal); }
.activity-item__icon--invoice { background: var(--color-amber-light); color: var(--color-amber-dark); }

.activity-item__body {
    flex:     1;
    min-width: 0;
}

.activity-item__description {
    margin:      0;
    font-size:   var(--text-base);
    color:       var(--color-body-text);
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

.activity-item__link {
    color:           inherit;
    text-decoration: none;
}

.activity-item__link:hover {
    color:           var(--color-blue-primary);
    text-decoration: underline;
}

.activity-item__time {
    flex-shrink: 0;
    font-size:   var(--text-sm);
    color:       var(--color-grey-text);
    white-space: nowrap;
}

.activity-empty {
    padding:    40px 24px;
    text-align: center;
    color:      var(--color-grey-text);
}

.activity-empty__icon {
    font-size:     2rem;
    margin-bottom: 12px;
    display:       block;
    opacity:       0.4;
}

/* ============================================================
   END SECTION 67
   ============================================================ */

/* ============================================================
   SECTION 67 — Portal Dashboard: Video card & Unread messages
   ============================================================ */

/* ── Welcome video dismiss button ────────────────────────────────────────── */
.portal-welcome-video-card__dismiss {
    margin-left:  auto;
    flex-shrink:  0;
    color:        var(--color-grey-text);
    font-size:    var(--text-sm);
    display:      inline-flex;
    align-items:  center;
    gap:          5px;
}

.portal-welcome-video-card__dismiss:hover {
    color: var(--color-body-text);
}

/* ── Welcome video embed ─────────────────────────────────────────────────── */
.portal-video-wrap {
    position:       relative;
    padding-bottom: 52%;
    height:         0;
    overflow:       hidden;
    border-radius:  0 0 var(--radius-lg) var(--radius-lg);
    background:     #000;
}

.portal-video-frame {
    position: absolute;
    top:      0;
    left:     0;
    width:    100%;
    height:   100%;
    border:   0;
}

/* ── Unread count badge (in card header) ─────────────────────────────────── */
.unread-badge {
    display:          inline-flex;
    align-items:      center;
    justify-content:  center;
    min-width:        22px;
    height:           22px;
    padding:          0 7px;
    border-radius:    var(--radius-full);
    background-color: var(--color-red);
    color:            var(--color-white);
    font-size:        var(--text-xs);
    font-weight:      700;
    margin-left:      8px;
    flex-shrink:      0;
}

/* ── Red stat card variant ───────────────────────────────────────────────── */
.portal-stat-card--red {
    border-top: 3px solid var(--color-red);
}
.portal-stat-card--red .portal-stat-card__icon {
    background-color: var(--color-red-light);
    color:            var(--color-red);
}

/* ── Unread message item ─────────────────────────────────────────────────── */
.unread-msg-item {
    border-bottom: 1px solid var(--color-grey-border);
    transition:    background-color var(--transition-fast);
}

.unread-msg-item:last-child {
    border-bottom: none;
}

.unread-msg-item__header {
    display:     flex;
    align-items: center;
    justify-content: space-between;
    gap:         16px;
    padding:     14px 20px;
    cursor:      pointer;
    user-select: none;
}

.unread-msg-item__header:hover {
    background-color: var(--color-grey-light);
}

.unread-msg-item__meta {
    display:     flex;
    align-items: center;
    gap:         12px;
    flex:        1;
    min-width:   0;
    flex-wrap:   wrap;
}

.unread-msg-item__type {
    display:       inline-flex;
    align-items:   center;
    gap:           5px;
    font-size:     var(--text-xs);
    font-weight:   700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding:       3px 8px;
    border-radius: var(--radius-full);
    flex-shrink:   0;
}

.unread-msg-item__type--general {
    background-color: var(--color-blue-lighter);
    color:            var(--color-blue-primary);
}

.unread-msg-item__type--project {
    background-color: var(--color-teal-light);
    color:            var(--color-teal);
}

.unread-msg-item__project {
    font-size:     var(--text-sm);
    font-weight:   600;
    color:         var(--color-heading-text);
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
    max-width:     220px;
}

.unread-msg-item__sender {
    font-size:  var(--text-sm);
    font-weight: 500;
    color:      var(--color-body-text);
    white-space: nowrap;
}

.unread-msg-item__time {
    font-size:  var(--text-sm);
    color:      var(--color-grey-text);
    white-space: nowrap;
    margin-left: auto;
}

.unread-msg-item__actions {
    display:     flex;
    align-items: center;
    gap:         8px;
    flex-shrink: 0;
}

.unread-msg-item__expand-btn i {
    transition: transform var(--transition-fast);
}

.unread-msg-item__body {
    padding:          0 20px 16px;
    border-top:       1px solid var(--color-grey-border);
    background-color: var(--color-grey-light);
}

.unread-msg-item__content {
    padding:    16px 0 12px;
    font-size:  var(--text-base);
    line-height: var(--line-height-relaxed);
    color:      var(--color-body-text);
    max-height: 320px;
    overflow-y: auto;
}

.unread-msg-item__footer {
    display:     flex;
    align-items: center;
    gap:         8px;
    padding-top: 12px;
    border-top:  1px solid var(--color-grey-border);
}

.app-footer {
    display:          flex;
    align-items:      center;
    justify-content:  center;
    padding:          10px 24px;
    background-color: var(--color-navy);
    color:            rgba(255, 255, 255, 0.55);
    font-size:        0.6875rem;
    letter-spacing:   0.02em;
    text-align:       center;
    flex-shrink:      0;
    border-top:       1px solid rgba(255, 255, 255, 0.08);
}

.app-footer__separator {
    margin:  0 8px;
    opacity: 0.35;
}

/* ============================================================
   END SECTION 66
   ============================================================ */

/* ============================================================
   SECTION 68 — Conversation & message bubble avatar photo support
   Adds photo rendering to .conversation-message__avatar and
   .msg-bubble__avatar when an uploaded avatar image is present.
   ============================================================ */

.conversation-message__avatar {
    overflow: hidden;
}

.conversation-message__avatar--photo {
    background: transparent !important;
}

.conversation-message__avatar img,
.msg-bubble__avatar img {
    width:         100%;
    height:        100%;
    object-fit:    cover;
    display:       block;
    border-radius: 50%;
}

/* ============================================================
   END SECTION 68
   ============================================================ */

/* ============================================================
   SECTION 69 — Time Log: billed cell with invoice status badge
   ============================================================ */

/* Stack the invoice-number badge and status badge vertically */
.billed-cell {
    display:        flex;
    flex-direction: column;
    align-items:    flex-start;
    gap:            3px;
}

/* Purple variant for remittance_received status */
.badge--purple {
    background-color: #6f42c1;
    color:            #fff;
}

/* Ensure the col-billed column has enough width */
.data-table .col-billed {
    min-width: 130px;
}

/* ============================================================
   END SECTION 69
   ============================================================ */

/* ============================================================
   SECTION 70 — Invoice Time Log Picker panel
   Used on /admin/invoices/create and /admin/invoices/{id}/edit
   ============================================================ */

/* Picker card collapsible body states */
.tl-picker-card { overflow: hidden; }

/* Empty / status messages */
.tl-picker-empty {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             10px;
    padding:         2.5rem 1.5rem;
    color:           #6b7280;
    font-size:       0.9rem;
    text-align:      center;
    background:      #fafafa;
    border-top:      1px solid #f0f0f0;
}
.tl-picker-empty p { margin: 0; max-width: 420px; }

/* Loading spinner */
.tl-spinner {
    width:            22px;
    height:           22px;
    border:           3px solid #e5e7eb;
    border-top-color: #1A2E4A;
    border-radius:    50%;
    animation:        tl-spin 0.7s linear infinite;
    flex-shrink:      0;
}
@keyframes tl-spin { to { transform: rotate(360deg); } }

/* Toolbar above the picker table */
.tl-picker-toolbar {
    display:         flex;
    align-items:     center;
    gap:             12px;
    padding:         10px 14px;
    background:      #f4f6f8;
    border-top:      1px solid #e5e7eb;
    border-bottom:   1px solid #e5e7eb;
    flex-wrap:       wrap;
}

.tl-check-all-label {
    display:         flex;
    align-items:     center;
    gap:             6px;
    font-size:       0.82rem;
    font-weight:     600;
    color:           #374151;
    cursor:          pointer;
    user-select:     none;
}
.tl-check-all-label input[type="checkbox"] { cursor: pointer; }

.tl-toolbar-count {
    font-size:   0.82rem;
    color:       #374151;
    font-weight: 600;
}

.tl-add-btn {
    margin-left: auto;
    display:     flex;
    align-items: center;
    gap:         5px;
}
.tl-add-btn:disabled {
    opacity: 0.45;
    cursor:  not-allowed;
}

/* Scrollable picker table wrapper */
.tl-picker-table-wrap {
    overflow-x: auto;
    max-height: 340px;
    overflow-y: auto;
}

/* Picker table */
.tl-picker-table {
    width:            100%;
    border-collapse:  collapse;
    font-size:        0.84rem;
}
.tl-picker-table th {
    position:         sticky;
    top:              0;
    background:       #f4f6f8;
    padding:          7px 10px;
    font-size:        0.72rem;
    text-transform:   uppercase;
    letter-spacing:   0.04em;
    color:            #6b7280;
    border-bottom:    1px solid #e5e7eb;
    white-space:      nowrap;
    z-index:          1;
}
.tl-picker-table td {
    padding:        6px 10px;
    border-bottom:  1px solid #f0f0f0;
    vertical-align: middle;
}
.tl-picker-table tbody tr:hover { background: #f0f7ff; }

/* Selected row highlight */
.tl-row-selected,
.tl-row-selected:hover { background: #dbeeff !important; }

/* Column sizing */
.tl-col-chk   { width: 36px; text-align: center; }
.tl-col-date  { width: 100px; white-space: nowrap; }
.tl-col-proj  { width: 20%; }
.tl-col-desc  { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-col-num   { width: 80px; text-align: right; white-space: nowrap; }

/* ============================================================
   END SECTION 70
   ============================================================ */

/* ============================================================
   SECTION 71 — Calendar Integration Settings
   settings/_calendar_integration.blade.php
   ============================================================ */

/* ── Connect My Calendar CTA banner ─────────────────────────────────────── */
.calendar-auth-cta {
    display:       flex;
    align-items:   center;
    gap:           16px;
    padding:       16px 20px;
    background:    #f0f7ff;
    border:        1px solid #bfdbfe;
    border-radius: var(--radius-md, 8px);
}

.calendar-auth-cta__icon {
    flex-shrink:  0;
    width:        44px;
    height:       44px;
    border-radius: 50%;
    background:   #dbeafe;
    display:      flex;
    align-items:  center;
    justify-content: center;
    color:        #2563eb;
    font-size:    1.2rem;
}

.calendar-auth-cta__content {
    flex: 1;
}

.calendar-auth-cta__heading {
    font-weight: 600;
    font-size:   0.9rem;
    color:       var(--color-text, #1a2e4a);
    margin:      0 0 2px;
}

.calendar-auth-cta__body {
    font-size: 0.82rem;
    color:     #6b7280;
    margin:    0;
}

.calendar-auth-cta__action {
    flex-shrink: 0;
}

/* ── Per-user status grid ────────────────────────────────────────────────── */
.calendar-user-grid {
    border:        1px solid #e5e7eb;
    border-radius: var(--radius-md, 8px);
    overflow:      hidden;
}

.calendar-user-grid__header {
    display:              grid;
    grid-template-columns: 1fr 130px 130px 130px 160px;
    gap:                  0 12px;
    padding:              8px 16px;
    background:           #f9fafb;
    border-bottom:        1px solid #e5e7eb;
    font-size:            0.72rem;
    font-weight:          600;
    text-transform:       uppercase;
    letter-spacing:       0.04em;
    color:                #6b7280;
}

.calendar-user-grid__row {
    display:              grid;
    grid-template-columns: 1fr 130px 130px 130px 160px;
    gap:                  0 12px;
    padding:              12px 16px;
    align-items:          center;
    border-bottom:        1px solid #f0f0f0;
    transition:           background 0.15s;
}

.calendar-user-grid__row:last-child { border-bottom: none; }
.calendar-user-grid__row:hover      { background: #f9fafb; }

.calendar-user-grid__user {
    display:     flex;
    align-items: center;
    gap:         10px;
}

.calendar-user-grid__name {
    display:     block;
    font-weight: 500;
    font-size:   0.875rem;
    color:       var(--color-text, #1a2e4a);
}

.calendar-user-grid__email {
    display:   block;
    font-size: 0.78rem;
    color:     #6b7280;
}

.calendar-user-grid__status,
.calendar-user-grid__authorised,
.calendar-user-grid__synced {
    font-size: 0.82rem;
    color:     #6b7280;
}

.calendar-user-grid__actions {
    display:   flex;
    gap:       6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.calendar-user-grid__empty {
    padding:    32px 16px;
    text-align: center;
    color:      #9ca3af;
    font-size:  0.875rem;
}

.calendar-user-grid__empty i {
    display:     block;
    font-size:   1.5rem;
    margin-bottom: 8px;
    color:       #d1d5db;
}

/* Responsive — collapse to vertical cards below 900 px */
@media (max-width: 900px) {
    .calendar-user-grid__header {
        display: none;
    }

    .calendar-user-grid__row {
        grid-template-columns: 1fr 1fr;
        grid-template-rows:    auto auto auto;
        row-gap: 6px;
        padding: 14px 16px;
    }

    .calendar-user-grid__user    { grid-column: 1 / -1; }
    .calendar-user-grid__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ============================================================
   END SECTION 71
   ============================================================ */

/* ============================================================
   SECTION 72 — Calendar Event Blocks + Meeting Modal
   P8-04: calendar event display, filter toggle, legend,
   meeting detail modal, pending meetings dashboard widget.
   ============================================================ */

/* ── Calendar event filter toggle ───────────────────────────────────── */

.cal-filter-toggle {
    display:        flex;
    align-items:    center;
    gap:            0;
    border:         1px solid var(--color-border, #e2e8f0);
    border-radius:  6px;
    overflow:       hidden;
}

.cal-filter-toggle__btn {
    padding:          6px 14px;
    font-size:        0.82rem;
    font-weight:      500;
    border:           none;
    background:       #fff;
    color:            var(--color-text-muted, #6b7280);
    cursor:           pointer;
    transition:       background 0.15s, color 0.15s;
    border-right:     1px solid var(--color-border, #e2e8f0);
    white-space:      nowrap;
}

.cal-filter-toggle__btn:last-child  { border-right: none; }
.cal-filter-toggle__btn:hover       { background: #f8fafc; color: var(--color-primary, #1a2e4a); }

.cal-filter-toggle__btn--active {
    background:  var(--color-primary, #1a2e4a);
    color:       #fff;
}

.cal-filter-toggle__btn--active:hover {
    background:  var(--color-primary-dark, #122039);
    color:       #fff;
}

/* ── Calendar legend row ─────────────────────────────────────────────── */

.calendar-legend-row {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         12px 20px;
    padding:     8px 4px;
    border-top:  1px solid var(--color-border, #e2e8f0);
    margin-top:  6px;
    font-size:   0.8rem;
    color:       var(--color-text-muted, #6b7280);
}

.cal-legend-entry {
    display:     flex;
    align-items: center;
    gap:         6px;
    font-size:   0.8rem;
    color:       var(--color-text, #1a2e4a);
}

.cal-legend-swatch {
    display:       inline-block;
    width:         12px;
    height:        12px;
    border-radius: 3px;
    flex-shrink:   0;
}

/* Teams swatch — solid teal */
.cal-legend-swatch--teams    { background: #1ABC9C; }

/* Regular calendar event swatch — navy border, light fill */
.cal-legend-swatch--cal-event {
    background:  #eef2ff;
    border:      2px solid #1a2e4a;
}

/* Customer colour swatches (mirrors .event-- classes) */
.event--blue-swatch   { background: #3b82f6; }
.event--green-swatch  { background: #10b981; }
.event--purple-swatch { background: #8b5cf6; }
.event--orange-swatch { background: #f97316; }
.event--teal-swatch   { background: #14b8a6; }
.event--pink-swatch   { background: #ec4899; }
.event--indigo-swatch { background: #6366f1; }
.event--amber-swatch  { background: #f59e0b; }

/* ── Calendar event blocks (cal_events type) ─────────────────────────── */

.cal-event-block {
    display:        flex;
    flex-direction: column;
    gap:            2px;
    width:          100%;
    padding:        4px 6px;
    border-radius:  4px;
    border:         none;
    text-align:     left;
    cursor:         pointer;
    font-size:      0.75rem;
    line-height:    1.3;
    transition:     opacity 0.15s, filter 0.15s;
    box-sizing:     border-box;
    margin-bottom:  2px;
}

.cal-event-block:hover  { opacity: 0.85; filter: brightness(0.97); }

/* Teams meeting — teal background, white text */
.cal-event-block--teams {
    background:  #1ABC9C;
    color:       #fff;
}

/* Regular calendar event — light blue-grey bg, navy border */
.cal-event-block--regular {
    background:  #eef2ff;
    color:       #1a2e4a;
    border:      1px solid #1a2e4a;
}

.cal-event-block__icon {
    font-size: 0.7rem;
    opacity:   0.85;
}

.cal-event-block__time-row {
    display:     flex;
    align-items: center;
    gap:         4px;
    font-size:   0.7rem;
    opacity:     0.85;
}

.cal-event-block__title {
    font-weight:   600;
    overflow:      hidden;
    white-space:   nowrap;
    text-overflow: ellipsis;
    max-width:     100%;
}

.cal-event-block__duration {
    font-size: 0.7rem;
    opacity:   0.9;
}

.cal-event-block__project {
    font-size:     0.7rem;
    overflow:      hidden;
    white-space:   nowrap;
    text-overflow: ellipsis;
    opacity:       0.85;
}

.cal-event-block__unlinked {
    font-size:   0.65rem;
    padding:     1px 5px;
    margin-top:  2px;
    align-self:  flex-start;
    line-height: 1.4;
}

/* ── Meeting Detail Modal ────────────────────────────────────────────── */

.meeting-modal-overlay {
    position:        fixed;
    inset:           0;
    background:      rgba(0, 0, 0, 0.45);
    z-index:         1100;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         20px;
}

.meeting-modal {
    background:    #fff;
    border-radius: 10px;
    width:         100%;
    max-width:     640px;
    max-height:    92vh;
    overflow-y:    auto;
    box-shadow:    0 20px 60px rgba(0, 0, 0, 0.2);
    display:       flex;
    flex-direction: column;
}

.meeting-modal__loading {
    display:        flex;
    align-items:    center;
    gap:            12px;
    padding:        40px 32px;
    color:          var(--color-text-muted, #6b7280);
    justify-content: center;
}

.meeting-modal__fetch-error {
    margin: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.meeting-modal__title-row {
    display:     flex;
    align-items: center;
    gap:         10px;
    flex:        1;
    min-width:   0;
}

.meeting-modal__teams-badge {
    display:       inline-flex;
    align-items:   center;
    gap:           4px;
    background:    #1ABC9C;
    color:         #fff;
    font-size:     0.72rem;
    font-weight:   600;
    padding:       3px 8px;
    border-radius: 4px;
    white-space:   nowrap;
    flex-shrink:   0;
}

/* Detail rows grid */
.meeting-modal__details {
    display:               grid;
    grid-template-columns: 140px 1fr;
    gap:                   8px 16px;
    margin-bottom:         20px;
}

.meeting-modal__detail-row {
    display:  contents;
}

.meeting-modal__detail-label {
    font-size:   0.82rem;
    font-weight: 600;
    color:       var(--color-text-muted, #6b7280);
    padding-top: 2px;
}

.meeting-modal__detail-value {
    font-size: 0.88rem;
    color:     var(--color-text, #1a2e4a);
}

.meeting-modal__teams-link {
    display:     inline-flex;
    align-items: center;
    gap:         6px;
    color:       #1ABC9C;
    font-size:   0.88rem;
    font-weight: 500;
    text-decoration: none;
}
.meeting-modal__teams-link:hover { text-decoration: underline; }

/* Attendee chips */
.meeting-modal__attendees {
    display:   flex;
    flex-wrap: wrap;
    gap:       4px;
}

.meeting-modal__attendee-chip {
    display:       inline-block;
    background:    #f1f5f9;
    border:        1px solid #e2e8f0;
    border-radius: 20px;
    padding:       2px 10px;
    font-size:     0.78rem;
    color:         var(--color-text, #1a2e4a);
}

/* Time log summary box */
.meeting-modal__timelog-summary {
    background:    #f0fdf4;
    border:        1px solid #bbf7d0;
    border-radius: 8px;
    padding:       14px 16px;
    margin-bottom: 16px;
}

.meeting-modal__timelog-row {
    display:     flex;
    align-items: center;
    gap:         12px;
    flex-wrap:   wrap;
    margin-bottom: 6px;
}

.meeting-modal__timelog-duration {
    font-size:   1.1rem;
    font-weight: 700;
    color:       var(--color-text, #1a2e4a);
}

.meeting-modal__timelog-rate {
    font-size: 0.85rem;
    color:     #059669;
    font-weight: 500;
}

.meeting-modal__timelog-meta {
    display:     flex;
    align-items: center;
    gap:         6px;
    font-size:   0.82rem;
    color:       var(--color-text-muted, #6b7280);
    margin-bottom: 4px;
}

.meeting-modal__unlinked-warning {
    margin-bottom: 16px;
}

.meeting-modal__divider {
    border:     none;
    border-top: 1px solid var(--color-border, #e2e8f0);
    margin:     0 0 20px;
}

/* Link section */
.meeting-modal__section-title {
    font-size:     0.9rem;
    font-weight:   600;
    color:         var(--color-text, #1a2e4a);
    margin:        0 0 14px;
    display:       flex;
    align-items:   center;
    gap:           6px;
}

.meeting-modal__link-section .form-group {
    margin-bottom: 12px;
}

.meeting-modal__billable-row {
    gap: 12px;
    margin-bottom: 16px;
}

.meeting-modal__actions {
    display:     flex;
    align-items: center;
    gap:         10px;
    flex-wrap:   wrap;
}

/* ── Pending Meetings Dashboard Section ──────────────────────────────── */

.pending-meetings-section {
    background:    #fff;
    border:        1px solid #fde68a;
    border-left:   4px solid #f59e0b;
    border-radius: 8px;
    padding:       20px 24px;
    margin-bottom: 28px;
}

.section-subheading {
    font-size:     0.875rem;
    color:         var(--color-text-muted, #6b7280);
    margin:        -8px 0 16px;
}

.pending-meetings-list {
    display:        flex;
    flex-direction: column;
    gap:            8px;
}

.pending-meeting-item {
    display:        flex;
    align-items:    center;
    gap:            14px;
    padding:        10px 14px;
    background:     #fffbeb;
    border:         1px solid #fde68a;
    border-radius:  6px;
}

.pending-meeting-item__icon {
    font-size:  1.1rem;
    flex-shrink: 0;
    width:       24px;
    text-align:  center;
}

.pending-meeting-item__body {
    flex:           1;
    min-width:      0;
    display:        flex;
    flex-direction: column;
    gap:            2px;
}

.pending-meeting-item__title {
    font-size:     0.9rem;
    font-weight:   600;
    color:         var(--color-text, #1a2e4a);
    overflow:      hidden;
    white-space:   nowrap;
    text-overflow: ellipsis;
}

.pending-meeting-item__meta {
    font-size: 0.8rem;
    color:     var(--color-text-muted, #6b7280);
}

.pending-meeting-item__action {
    flex-shrink: 0;
}

/* Amber button variant */
.btn--amber {
    background:   #f59e0b;
    color:        #fff;
    border-color: #f59e0b;
}
.btn--amber:hover {
    background:   #d97706;
    border-color: #d97706;
}

/* Responsive */
@media (max-width: 600px) {
    .meeting-modal__details {
        grid-template-columns: 1fr;
    }
    .meeting-modal__detail-label {
        font-weight: 700;
        margin-bottom: -4px;
    }
    .pending-meeting-item {
        flex-wrap: wrap;
    }
    .pending-meeting-item__action {
        width: 100%;
    }
    .cal-filter-toggle {
        flex-wrap: wrap;
    }
}

/* ============================================================
   END SECTION 72
   ============================================================ */
