:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef3f9;
    --text: #14202f;
    --muted: #526276;
    --border: #d7e0ea;
    --primary: #ff3f3f;
    --primary-2: #ff7a3d;
    --accent: #1f7db6;
    --accent-2: #b119a8;
    --danger: #dc2626;
    --shadow: 0 18px 44px rgba(15, 35, 60, .12);
    --shadow-lg: 0 28px 70px rgba(15, 35, 60, .18);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-spring: cubic-bezier(.2, .8, .2, 1.12);
    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
    --fs-xs: .76rem;
    --fs-sm: .86rem;
    --fs-base: .96rem;
    --fs-md: 1.06rem;
    --fs-lg: 1.22rem;
    --fs-xl: 1.55rem;
    --fs-2xl: 2rem;
}

html[data-theme="dark"], html[data-theme="system"] {
    --bg: #060b13;
    --surface: #0e1827;
    --surface-2: #152337;
    --text: #f8fbff;
    --muted: #c4d0df;
    --border: #2b3d55;
    --primary: #ff4b4b;
    --primary-2: #ff9b50;
    --accent: #55b8f2;
    --accent-2: #e041b8;
    --shadow: 0 24px 60px rgba(0, 0, 0, .42);
    --shadow-lg: 0 34px 86px rgba(0, 0, 0, .55);
}

html[data-theme="orange"] {
    --bg: #fff6ef;
    --surface: #ffffff;
    --surface-2: #ffe8d7;
    --text: #221710;
    --muted: #7a5a45;
    --border: #f0c8ab;
    --primary: #e8752b;
    --primary-2: #f7a34f;
    --accent: #174d74;
}

* { box-sizing: border-box; min-width: 0; }
html { overflow-x: hidden; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(126deg, rgba(177, 25, 168, .16) 0 18%, rgba(255, 63, 63, .13) 18% 34%, rgba(255, 122, 61, .12) 34% 44%, transparent 44%),
        linear-gradient(180deg, rgba(31, 125, 182, .08), transparent 34%),
        var(--bg);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.48;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 26%),
        radial-gradient(circle at 88% 6%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 24%);
    opacity: .72;
    z-index: -1;
}

html[data-theme="dark"] body, html[data-theme="system"] body {
    background:
        linear-gradient(126deg, rgba(177, 25, 168, .28) 0 18%, rgba(255, 63, 63, .22) 18% 34%, rgba(255, 122, 61, .18) 34% 44%, transparent 44%),
        linear-gradient(180deg, #07101d 0%, var(--bg) 46%);
}

a { color: var(--primary); text-decoration: none; }
img, canvas, svg, video { max-width: 100%; }
p, h1, h2, h3, h4, h5, h6, span, small, strong, dd, dt, td, th, a, button, label { overflow-wrap: anywhere; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 292px;
    padding: 20px 18px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 20;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: transform .28s var(--ease-out), width .28s var(--ease-out), padding .28s var(--ease-out), box-shadow .28s ease;
}
.sidebar:hover { scrollbar-color: var(--primary) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: var(--primary); }
.content { flex: 1; margin-left: 292px; padding: 30px; transition: margin-left .28s var(--ease-out); animation: pageEnter .42s var(--ease-out) both; }
.sidebar-compact .sidebar { width: 96px; padding: 20px 14px; align-items: center; gap: 20px; scrollbar-width: none; scrollbar-gutter: auto; }
.sidebar-compact .sidebar::-webkit-scrollbar { width: 0; display: none; }
.sidebar-compact .content { margin-left: 96px; }
.sidebar-compact .brand-text, .sidebar-compact .sidebar-user div, .sidebar-compact .sidebar-nav span, .sidebar-compact .sidebar-bottom span, .sidebar-compact .sidebar-collapse span, .sidebar-compact .theme-cycle-btn span, .sidebar-compact .global-search-mini input { display: none; }
.sidebar-compact .sidebar:hover { width: 292px; padding: 20px 18px; align-items: stretch; scrollbar-width: thin; scrollbar-color: var(--primary) transparent; }
.sidebar-compact .sidebar:hover + .content { margin-left: 292px; }
.sidebar-compact .sidebar:hover .brand-text, .sidebar-compact .sidebar:hover .sidebar-user div, .sidebar-compact .sidebar:hover .sidebar-nav span, .sidebar-compact .sidebar:hover .sidebar-bottom span, .sidebar-compact .sidebar:hover .sidebar-collapse span, .sidebar-compact .sidebar:hover .theme-cycle-btn span { display: inline; }
.sidebar-compact .sidebar:hover .global-search-mini input { display: block; }
.sidebar-compact .sidebar:hover .sidebar-user div { display: block; }
.sidebar-compact .brand, .sidebar-compact .sidebar-collapse, .sidebar-compact .nav-link, .sidebar-compact .sidebar-bottom .btn, .sidebar-compact .theme-cycle-btn { display: grid; place-items: center; width: 64px; min-width: 64px; height: 64px; padding: 0; margin-inline: auto; gap: 0; }
.sidebar-compact .sidebar:hover .brand, .sidebar-compact .sidebar:hover .sidebar-collapse, .sidebar-compact .sidebar:hover .nav-link, .sidebar-compact .sidebar:hover .sidebar-bottom .btn, .sidebar-compact .sidebar:hover .theme-cycle-btn { display: flex; justify-content: flex-start; gap: 12px; }
.sidebar-collapse-form { margin-top: -6px; }
.sidebar-compact .sidebar:hover .brand, .sidebar-compact .sidebar:hover .sidebar-collapse, .sidebar-compact .sidebar:hover .nav-link, .sidebar-compact .sidebar:hover .sidebar-bottom .btn, .sidebar-compact .sidebar:hover .theme-cycle-btn { width: 100%; height: auto; min-height: 44px; padding: 10px 12px; margin-inline: 0; }
.sidebar-collapse-form { width: 100%; }
.sidebar-collapse { width: 100%; text-align: left; min-height: 44px; display: flex; align-items: center; gap: 10px; }
.brand { color: var(--text); display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: 1.08rem; }
.brand-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--primary), var(--primary-2)); color: #fff; }
.sidebar-compact .brand-icon { width: 56px; height: 56px; }
.sidebar-compact .sidebar:hover .brand-icon { width: 44px; height: 44px; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.sidebar-user img, .avatar-fallback { width: 42px; height: 42px; border-radius: 999px; object-fit: cover; flex: 0 0 auto; }
.sidebar-compact .sidebar-user { width: 64px; height: 64px; padding: 0; justify-content: center; }
.sidebar-compact .sidebar:hover .sidebar-user { width: 100%; height: auto; padding: 12px; justify-content: flex-start; }
.sidebar-compact .sidebar-user img, .sidebar-compact .sidebar-user .avatar-fallback { width: 52px; height: 52px; }
.sidebar-compact .sidebar:hover .sidebar-user img, .sidebar-compact .sidebar:hover .sidebar-user .avatar-fallback { width: 42px; height: 42px; }
.avatar-fallback { display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; }
.avatar-fallback.large { width: 92px; height: 92px; font-size: 2rem; }
.avatar-fallback.small { width: 38px; height: 38px; font-size: .9rem; }
.sidebar-user small { display: block; color: var(--muted); }
.access-badge { display: inline-flex; align-items: center; margin-top: 6px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary-2); font-size: .72rem; font-weight: 900; }
.theme-switcher { display: block; width: 100%; }
.theme-cycle-btn { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-weight: 800; }
.theme-cycle-btn:hover { border-color: var(--primary); color: var(--primary); }
.sidebar-compact .theme-switcher { display: flex; justify-content: center; }
.sidebar-compact .sidebar:hover .theme-switcher { display: block; }
.sidebar-nav { gap: 6px; width: 100%; align-items: stretch; }
.global-search-mini { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 8px 10px; }
.global-search-mini input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-weight: 700; }
.sidebar-compact .global-search-mini { width: 48px; justify-content: center; padding: 10px; }
.sidebar-compact .sidebar:hover .global-search-mini { width: 100%; justify-content: flex-start; padding: 8px 10px; }
.sidebar-compact .sidebar-nav { align-items: center; gap: 10px; }
.sidebar-compact .sidebar:hover .sidebar-nav { align-items: stretch; gap: 6px; }
.nav-link { position: relative; overflow: hidden; color: var(--muted); border-radius: 8px; display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: var(--fs-sm); padding: 11px 12px; min-height: 44px; transition: transform .18s var(--ease-out), background-color .18s ease, color .18s ease; }
.nav-link:hover, .nav-link:focus { color: var(--primary-2); background: color-mix(in srgb, var(--primary) 14%, transparent); transform: translateX(2px); }
.nav-link i { width: 22px; text-align: center; }
.sidebar-compact .nav-link i, .sidebar-compact .sidebar-collapse i, .sidebar-compact .theme-cycle-btn i, .sidebar-compact .sidebar-bottom .btn i { width: auto; min-width: 0; margin: 0; font-size: 1.2rem; }
.sidebar-compact .sidebar:hover .nav-link i, .sidebar-compact .sidebar:hover .sidebar-collapse i, .sidebar-compact .sidebar:hover .theme-cycle-btn i, .sidebar-compact .sidebar:hover .sidebar-bottom .btn i { width: 22px; text-align: center; }
.sidebar-compact .nav-link .badge { position: absolute; right: 8px; top: 8px; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border-radius: 999px; font-size: .72rem; }
.sidebar-compact .sidebar:hover .nav-link .badge { position: static; min-width: auto; height: auto; display: inline-flex; padding: .35em .65em; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; padding-bottom: 6px; width: 100%; }
.sidebar-compact .sidebar-bottom { justify-items: center; margin-top: 10px; }
.sidebar-compact .sidebar:hover .sidebar-bottom { justify-items: stretch; margin-top: auto; }
body.sidebar-compact.sidebar-hovered .sidebar { width: 292px; padding: 20px 18px; align-items: stretch; scrollbar-width: thin; scrollbar-color: var(--primary) transparent; }
body.sidebar-compact.sidebar-hovered .content { margin-left: 292px; }
body.sidebar-compact.sidebar-hovered .brand-text,
body.sidebar-compact.sidebar-hovered .sidebar-user div,
body.sidebar-compact.sidebar-hovered .sidebar-nav span,
body.sidebar-compact.sidebar-hovered .sidebar-bottom span,
body.sidebar-compact.sidebar-hovered .sidebar-collapse span,
body.sidebar-compact.sidebar-hovered .theme-cycle-btn span { display: inline; }
body.sidebar-compact.sidebar-hovered .global-search-mini input { display: block; }
body.sidebar-compact.sidebar-hovered .brand,
body.sidebar-compact.sidebar-hovered .sidebar-collapse,
body.sidebar-compact.sidebar-hovered .nav-link,
body.sidebar-compact.sidebar-hovered .sidebar-bottom .btn,
body.sidebar-compact.sidebar-hovered .theme-cycle-btn { display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: auto; min-height: 44px; padding: 10px 12px; margin-inline: 0; }
body.sidebar-compact.sidebar-hovered .brand-icon { width: 44px; height: 44px; }
body.sidebar-compact.sidebar-hovered .sidebar-user { width: 100%; height: auto; padding: 12px; justify-content: flex-start; }
body.sidebar-compact.sidebar-hovered .sidebar-user img,
body.sidebar-compact.sidebar-hovered .sidebar-user .avatar-fallback { width: 42px; height: 42px; }
body.sidebar-compact.sidebar-hovered .theme-switcher { display: block; }
body.sidebar-compact.sidebar-hovered .global-search-mini { width: 100%; justify-content: flex-start; padding: 8px 10px; }
body.sidebar-compact.sidebar-hovered .sidebar-nav { align-items: stretch; gap: 6px; }
body.sidebar-compact.sidebar-hovered .nav-link i,
body.sidebar-compact.sidebar-hovered .sidebar-collapse i,
body.sidebar-compact.sidebar-hovered .theme-cycle-btn i,
body.sidebar-compact.sidebar-hovered .sidebar-bottom .btn i { width: 22px; text-align: center; }
body.sidebar-compact.sidebar-hovered .nav-link .badge { position: static; min-width: auto; height: auto; display: inline-flex; padding: .35em .65em; }
body.sidebar-compact.sidebar-hovered .sidebar-bottom { justify-items: stretch; margin-top: auto; }
.tooltip { pointer-events: none; }
.btn { border-radius: 8px; font-weight: 700; position: relative; overflow: hidden; }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--primary), var(--primary-2)); border: 0; }
.btn-soft { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-soft:hover { border-color: var(--primary); color: var(--primary); }
.wms-ripple { position: absolute; border-radius: 999px; transform: scale(0); background: rgba(255, 255, 255, .38); pointer-events: none; animation: ripple .58s ease-out; }
.mobile-menu { display: none; position: fixed; top: 14px; right: 14px; z-index: 30; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(1.72rem, 2.4vw, 2.55rem); line-height: 1.08; margin: 0; letter-spacing: 0; }
.page-subtitle { margin: 8px 0 0; color: var(--muted); max-width: 760px; font-size: var(--fs-md); line-height: 1.45; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-size: var(--fs-xs); font-weight: 850; letter-spacing: .08em; margin: 0 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted); font-weight: 800; font-size: .86rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs a::after { content: ">"; margin-left: 8px; color: var(--border); }
.breadcrumbs span { color: var(--text); }
.panel, .kpi, .feature-grid article, .warehouse-card {
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.panel { position: relative; padding: 20px; overflow: hidden; animation: softRise .44s var(--ease-out) both; }
.panel::before, .kpi::before, .warehouse-card::before, .action-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent));
    opacity: 0;
    transition: opacity .22s ease;
}
.panel:hover::before, .kpi:hover::before, .warehouse-card:hover::before, .action-card:hover::before { opacity: 1; }
.panel h2 { font-family: var(--font-display); font-size: var(--fs-lg); margin: 0 0 14px; line-height: 1.18; }
.feature-grid, .kpi-grid, .dashboard-grid, .detail-grid, .unit-grid, .warehouse-grid {
    display: grid;
    gap: 16px;
}
.feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.feature-grid article { padding: 18px; text-align: center; display: grid; gap: 8px; animation: softRise .45s var(--ease-out) both; }
.feature-grid i { color: var(--accent); font-size: 2rem; }
.feature-grid span { color: var(--muted); }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; padding: 18px; animation: softRise .45s var(--ease-out) both; text-align: left; color: var(--text); }
.kpi-grid .kpi:nth-child(2), .feature-grid article:nth-child(2), .warehouse-grid .warehouse-card:nth-child(2) { animation-delay: .04s; }
.kpi-grid .kpi:nth-child(3), .feature-grid article:nth-child(3), .warehouse-grid .warehouse-card:nth-child(3) { animation-delay: .08s; }
.kpi-grid .kpi:nth-child(4), .feature-grid article:nth-child(4), .warehouse-grid .warehouse-card:nth-child(4) { animation-delay: .12s; }
.dashboard-card { border: 1px solid var(--border); cursor: pointer; transition: transform .22s var(--ease-spring), border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.dashboard-card:hover, .dashboard-card.active { transform: translateY(-4px) scale(1.01); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); box-shadow: var(--shadow-lg); }
.kpi span { color: var(--muted); font-weight: 750; font-size: var(--fs-sm); }
.kpi strong { display: block; font-family: var(--font-display); font-size: clamp(1.45rem, 1.85vw, 1.9rem); margin: 8px 0 2px; line-height: 1.1; letter-spacing: 0; }
.kpi small, .empty { color: var(--muted); }
.kpi.danger-soft { border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.kpi.warning-soft { border-color: color-mix(in srgb, var(--warning) 42%, var(--border)); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.kpi.success-soft { border-color: color-mix(in srgb, var(--success) 36%, var(--border)); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.profile-home { margin-bottom: 16px; }
.profile-home header { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile-home h2 { margin: 0; font-size: 1.25rem; }
.profile-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.profile-home-grid a { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface-2)), var(--surface-2)); }
.profile-home-grid a:hover { border-color: var(--primary); transform: translateY(-1px); }
.profile-home-grid span { color: var(--muted); font-weight: 800; }
.profile-home-grid strong { font-size: 1.3rem; }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.flow button { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; font-size: .85rem; font-weight: 800; min-height: 48px; }
.flow button:hover { border-color: var(--primary); color: var(--primary); }
.metric-line { font-size: var(--fs-md); font-weight: 800; margin: 0; line-height: 1.25; }
.mini-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-row span { min-width: 0; }
.mini-row strong { flex: 0 0 auto; }
.mini-row:last-child { border-bottom: 0; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.section-header h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 850; }
.section-header span { color: var(--muted); font-size: .9rem; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row p { margin: 4px 0; color: var(--muted); }
.list-row small { color: var(--muted); }
.list-row .actions { justify-content: flex-end; flex: 0 0 auto; }
.notification-row.unread, .import-row:hover, .supplier-row:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); margin-inline: -10px; padding-inline: 10px; border-radius: 8px; }
.decision-panel { background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--primary) 7%, var(--surface-2))); }
.decision-panel .item-list { display: grid; gap: 8px; }
.decision-panel .item-list article, .item-list.compact article { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.decision-panel .item-list span, .item-list.compact span { color: var(--muted); font-weight: 800; }
.decision-panel .item-list strong, .item-list.compact strong { font-family: var(--font-display); }
.priority-row { display: grid; grid-template-columns: minmax(0, 1fr) 116px 64px; align-items: center; gap: 12px; }
.priority-badge { display: inline-grid; place-items: center; min-width: 76px; padding: 5px 9px; border-radius: 999px; font-size: .76rem; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.priority-badge.priority-critical { color: #fff; background: var(--danger); }
.priority-badge.priority-high { color: #fff; background: var(--primary); }
.priority-badge.priority-medium { color: #3b2500; background: var(--warning); }
.priority-badge.priority-low { color: #063b27; background: color-mix(in srgb, var(--success) 55%, #fff); }
.timeline { display: grid; gap: 10px; }
.timeline article { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.timeline i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--primary)); }
.timeline strong, .timeline span { display: block; }
.timeline span, .timeline time { color: var(--muted); font-size: .84rem; }
.section-subtitle { margin: 14px 0 4px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stage-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.stage-pipeline span { display: grid; place-items: center; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-weight: 900; text-align: center; }
.stage-pipeline span.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent-2), var(--primary), var(--primary-2)); }
.checklist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checklist-grid .check-row { margin: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.compact-form { display: grid; gap: 8px; }
.unit-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.unit-card { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); display: grid; gap: 4px; }
.unit-card small { color: var(--muted); }
.enhanced-unit-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.unit-card.enhanced { gap: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--surface-2) 92%, var(--primary)), var(--surface)); }
.unit-card.enhanced header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.unit-card.enhanced header strong { display: block; font-family: var(--font-display); font-size: 1.08rem; }
.unit-card-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.unit-card-metrics div { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--surface-2); }
.unit-card-metrics span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; }
.unit-card-metrics strong { font-family: var(--font-display); font-size: 1.2rem; }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 190px 190px auto; gap: 12px; align-items: center; margin-bottom: 16px; }
.dashboard-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
.dashboard-filters .btn { min-height: 42px; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.filter-chips > span { color: var(--muted); font-weight: 800; font-size: .86rem; }
.filter-chips a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 800; font-size: .84rem; }
.filter-chips a:hover { color: var(--primary); border-color: var(--primary); }
.filter-chips a.clear { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.warehouse-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.warehouse-card { position: relative; color: var(--text); overflow: hidden; transition: transform .24s var(--ease-spring), border-color .18s ease, box-shadow .18s ease; animation: softRise .45s var(--ease-out) both; }
.warehouse-card:hover { color: var(--text); transform: translateY(-5px) scale(1.006); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.warehouse-card:hover .warehouse-cover img { transform: scale(1.045); }
.warehouse-cover { position: relative; height: 170px; background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--primary) 20%, var(--surface-2))); display: grid; place-items: center; color: var(--primary); font-size: 3rem; overflow: hidden; }
.warehouse-cover img, .hero-detail img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.warehouse-cover::after { content: ""; position: absolute; inset: auto 0 0; height: 48%; background: linear-gradient(to top, rgba(0, 0, 0, .68), transparent); pointer-events: none; }
.warehouse-cover-meta { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; display: flex; justify-content: space-between; gap: 10px; color: #fff; font-size: .95rem; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.warehouse-cover-meta span, .warehouse-cover-meta strong { background: rgba(0, 0, 0, .38); border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; padding: 4px 9px; backdrop-filter: blur(6px); }
.warehouse-body { padding: 16px; }
.warehouse-body h2 { font-size: 1.15rem; margin: 0 0 4px; color: var(--text); line-height: 1.25; }
.warehouse-body p { color: color-mix(in srgb, var(--text) 78%, var(--muted)); margin: 0 0 12px; font-weight: 600; }
.warehouse-body .card-responsible { margin-top: -4px; font-size: .86rem; color: var(--text); }
.card-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.slim { height: 8px; background: var(--surface-2); }
.progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.pagination-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0; }
.detail-grid { grid-template-columns: minmax(240px, .8fr) 1.2fr; }
.hero-detail { min-height: 280px; display: grid; place-items: center; overflow: hidden; color: var(--primary); font-size: 4rem; background: var(--surface-2); }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.specs div { background: var(--surface-2); border-radius: 8px; padding: 12px; }
.specs dt { color: var(--muted); font-size: .82rem; }
.responsible-link { font-weight: 900; display: inline-flex; align-items: center; gap: 6px; }
.responsible-link::after { content: "\f35d"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .72rem; }
.profile-detail-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(280px, 1.2fr); gap: 16px; }
.profile-card { display: flex; align-items: center; gap: 16px; }
.profile-card img { width: 92px; height: 92px; border-radius: 999px; object-fit: cover; }
.profile-card h2 { margin: 0 0 4px; }
.profile-card p { margin: 0; color: var(--muted); font-weight: 800; }
.specs dd { margin: 3px 0 0; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.enhanced-form { align-items: start; }
.form-intro {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 7%, var(--surface-2));
}
.form-intro strong { font-family: var(--font-display); }
.form-intro span, .field-help { color: var(--muted); font-size: .84rem; }
.form-field {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-2) 76%, transparent);
}
.form-field > span:first-child { display: flex; align-items: center; gap: 6px; font-weight: 850; }
.form-field.required > span:first-child::after {
    content: "Obrigatório";
    margin-left: auto;
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--primary-2);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    font-size: .68rem;
    text-transform: uppercase;
}
.field-error, .form-errors { color: var(--danger); font-weight: 800; }
.form-preview-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
    border-radius: 8px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface-2));
}
.form-preview-panel[hidden] { display: none; }
.form-preview-panel header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.form-preview-panel header small { color: var(--muted); }
.form-preview-panel div { display: grid; grid-template-columns: minmax(140px, .45fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.form-preview-panel div span { color: var(--muted); font-weight: 800; }
.form-preview-panel div strong { overflow-wrap: anywhere; }
.form-stack { display: grid; gap: 14px; }
input, select, textarea, button { font: inherit; }
.grid-full { grid-column: 1 / -1; }
.tabbed-form { display: grid; gap: 14px; }
.form-tabs { gap: 8px; }
.form-tabs .nav-link { min-height: 38px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.form-tabs .nav-link.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--border); }
label { font-weight: 700; color: var(--text); }
label span { display: block; margin-bottom: 6px; }
.form-control, .form-select { background-color: var(--surface-2); border-color: var(--border); color: var(--text); }
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--text); border-color: var(--primary); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary) 20%, transparent); }
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 82%, var(--text)); opacity: 1; }
html[data-theme="dark"] .form-control::placeholder, html[data-theme="system"] .form-control::placeholder { color: #d8e2ef; opacity: .72; }
.table small, .text-muted { color: var(--muted) !important; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row span { margin: 0; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); font-size: var(--fs-sm); vertical-align: middle; table-layout: auto; }
.table thead th { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; font-weight: 850; }
.table th, .table td { vertical-align: middle; }
.table th.actions-column, .table th:last-child:empty, .table td.table-actions { width: 1%; min-width: 150px; text-align: right; }
.table th.actions-column { white-space: nowrap; }
.user-cell { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.user-cell img { width: 38px; height: 38px; border-radius: 999px; object-fit: cover; border: 1px solid var(--border); }
.table tbody tr { transition: background-color .18s ease, transform .18s var(--ease-out); }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.tag { display: inline-flex; align-items: center; margin: 2px 4px 2px 0; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .76rem; font-weight: 800; }
.tag.success { color: #16a34a; background: color-mix(in srgb, #16a34a 12%, var(--surface)); }
.tag.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.tag.warning { color: #8a4b00; background: color-mix(in srgb, var(--warning) 16%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 36%, var(--border)); }
.sla-ok { color: #16a34a; background: color-mix(in srgb, #16a34a 12%, var(--surface)); }
.sla-warning { color: var(--primary-2); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.sla-overdue { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.sla-done { color: var(--muted); }
.dense-table { font-size: .86rem; }
.dense-table th, .dense-table td { padding: .52rem .58rem; }
.table-actions { white-space: nowrap; }
.table-actions > a, .table-actions > form, .table-actions > button { display: inline-flex; vertical-align: middle; margin: 3px 0 3px 6px; }
.table-actions form { margin: 3px 0 3px 6px; }
.table-actions .btn { min-width: 72px; justify-content: center; }
.form-hint { display: block; margin-top: 5px; color: var(--muted); font-weight: 500; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.auth-page::before {
    content: "";
    position: absolute;
    width: 72vw;
    height: 72vw;
    min-width: 560px;
    min-height: 560px;
    right: -24vw;
    top: -28vw;
    border-radius: 999px;
    background: conic-gradient(from 140deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--primary) 28%, transparent), color-mix(in srgb, var(--primary-2) 24%, transparent), transparent);
    filter: blur(8px);
    opacity: .62;
    animation: authAura 10s ease-in-out infinite alternate;
}
.auth-layout { position: relative; z-index: 1; width: min(1060px, 100%); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 18px; align-items: stretch; animation: loginShell .55s var(--ease-out) both; }
.auth-card { width: min(460px, 100%); padding: 30px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-login-card { width: 100%; min-height: 590px; display: grid; align-content: center; animation: loginCard .62s var(--ease-out) .1s both; }
.auth-card-wide { width: min(760px, 100%); }
.auth-brand { display: flex; gap: 10px; align-items: center; color: var(--primary); font-weight: 900; margin-bottom: 20px; }
.auth-brand i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--primary), var(--primary-2)); box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 18px; font-family: var(--font-display); font-size: clamp(2rem, 3vw, 2.7rem); line-height: 1; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.auth-submit { min-height: 48px; box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 26%, transparent); }
.auth-showcase { position: relative; min-height: 590px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); background: var(--surface); animation: loginMedia .66s var(--ease-out) both; }
.auth-slide { position: absolute; inset: 0; opacity: 0; transform: scale(1.04); transition: opacity .65s ease, transform 1.2s var(--ease-out); }
.auth-slide.is-active { opacity: 1; transform: scale(1); }
.auth-slide img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.04); }
.auth-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 11, 19, .08), rgba(6, 11, 19, .78)); }
.auth-slide div { position: absolute; left: 28px; right: 28px; bottom: 34px; z-index: 1; color: #fff; display: grid; gap: 8px; text-shadow: 0 3px 18px rgba(0, 0, 0, .45); }
.auth-slide span { width: fit-content; padding: 5px 10px; border-radius: 999px; background: rgba(255, 122, 61, .88); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.auth-slide strong { max-width: 620px; font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.05; }
.auth-slide-dots { position: absolute; left: 28px; bottom: 18px; z-index: 2; display: flex; gap: 7px; }
.auth-slide-dots button { width: 24px; height: 5px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .42); transition: width .28s ease, background .28s ease; }
.auth-slide-dots button.active { width: 42px; background: #fff; }
.toast-stack { position: fixed; right: 20px; top: 20px; z-index: 50; width: min(420px, calc(100vw - 40px)); }
.agent-fab { position: fixed; right: 22px; bottom: 24px; width: 56px; height: 56px; border-radius: 999px; border: 0; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow); z-index: 25; }
.agent-panel { position: fixed; right: 22px; bottom: 92px; width: min(420px, calc(100vw - 44px)); height: 620px; max-height: calc(100vh - 120px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); z-index: 25; display: none; }
.agent-panel.open { display: block; }
.agent-panel iframe { width: 100%; height: 100%; border: 0; }
.chat-shell { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: min(760px, calc(100vh - 150px)); min-height: 560px; }
.chat-history { display: grid; gap: 12px; align-content: start; overflow: auto; padding-right: 6px; scroll-behavior: smooth; }
.chat-msg { position: relative; padding: 12px 42px 12px 14px; border-radius: 8px; max-width: 78%; background: var(--surface-2); animation: rise .25s ease both; }
.chat-msg.user { justify-self: end; background: color-mix(in srgb, var(--primary) 18%, var(--surface-2)); }
.chat-msg p { margin: 4px 0 0; }
.chat-copy { position: absolute; right: 9px; top: 9px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent); opacity: .68; transition: opacity .16s ease, color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.chat-msg:hover .chat-copy, .chat-copy:focus-visible { opacity: 1; color: var(--primary); border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); transform: translateY(-1px); }
.chat-copy.copied { width: auto; padding: 0 8px; color: var(--success); border-color: color-mix(in srgb, var(--success) 46%, var(--border)); background: color-mix(in srgb, var(--success) 12%, var(--surface)); opacity: 1; }
.chat-copy.copy-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 46%, var(--border)); opacity: 1; }
.chat-copy span { font-size: .7rem; font-weight: 900; }
.copy-inline { min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: color-mix(in srgb, var(--surface) 78%, transparent); vertical-align: middle; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.copy-inline:hover, .copy-inline:focus-visible { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); transform: translateY(-1px); }
.copy-inline.copied { width: auto; padding: 0 8px; color: var(--success); border-color: color-mix(in srgb, var(--success) 46%, var(--border)); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.copy-inline.copy-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 46%, var(--border)); }
.copy-inline span { font-size: .7rem; font-weight: 900; }
.copy-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.copy-cell > span, .copy-cell > a { overflow: hidden; text-overflow: ellipsis; }
.chat-links { display: grid; gap: 6px; margin-top: 10px; }
.chat-links a { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 78%, transparent); color: var(--text); }
.chat-links a:hover { color: var(--primary); border-color: var(--primary); }
.chat-links span { color: var(--muted); font-size: .78rem; }
.chat-meta { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.chat-msg.typing p::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 3px; vertical-align: text-bottom; background: var(--primary); animation: blink .8s steps(2, start) infinite; }
.chat-form { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.voice-status { grid-column: 1 / -1; display: none; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--text); font-size: .86rem; }
.voice-status.show { display: flex; }
.voice-status i { color: var(--danger); font-size: .55rem; animation: blink .8s steps(2, start) infinite; }
.voice-status span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-btn.recording { color: #fff; background: var(--danger); border-color: var(--danger); animation: pulse .9s ease infinite; }
.embed-body { background: var(--surface); }
.embed-chat { height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; }
.embed-chat header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.embed-chat header span { color: var(--muted); }
.embed-history { padding: 12px; overflow: auto; }
.embed-form { padding: 12px; grid-template-columns: 1fr auto auto; }
.compact-form { display: grid; gap: 10px; }
.help-icon { color: var(--primary); margin-left: 6px; cursor: help; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.analytics-grid .wide { grid-column: 1 / -1; }
.chart-panel { min-height: 320px; }
.chart-panel header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.chart-panel header h2 { margin: 0; }
.chart-panel header span { color: var(--muted); font-size: .85rem; }
.chart-panel canvas { width: 100% !important; height: 250px !important; }
.dashboard-insights { margin-bottom: 16px; transition: opacity .18s ease, transform .18s ease, border-color .18s ease; }
.dashboard-insights.loading { opacity: .55; transform: translateY(2px); }
.dashboard-insights.updated { border-color: var(--primary); }
.dashboard-loading { position: relative; pointer-events: none; opacity: .72; }
.dashboard-loading::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 8px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 9%, var(--surface-2)), transparent);
    background-size: 220% 100%;
    animation: shimmer 1s ease infinite;
}
.dashboard-insights header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.dashboard-insights header h2 { margin: 0 0 4px; }
.dashboard-insights header span { color: var(--muted); }
.insight-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.insight-row { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); transition: transform .16s ease, border-color .16s ease; }
.insight-row:hover { color: var(--text); transform: translateY(-2px); border-color: var(--primary); }
.insight-row span { color: var(--muted); font-size: .84rem; }
.skeleton-line { height: 58px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), color-mix(in srgb, var(--primary) 12%, var(--surface-2)), var(--surface-2)); background-size: 220% 100%; animation: shimmer 1s ease infinite; }
.empty-state { min-height: 112px; display: grid; place-items: center; gap: 5px; text-align: center; padding: 18px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.empty-state i { color: var(--primary); font-size: 1.4rem; }
.empty-state strong { color: var(--text); }
.empty-state span { max-width: 420px; }
.empty-state.compact { min-height: 86px; padding: 12px; font-size: .88rem; }
.onboarding-panel { margin-bottom: 18px; display: flex; justify-content: space-between; gap: 18px; align-items: center; border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); }
.onboarding-panel h2 { margin-bottom: 6px; }
.onboarding-panel p { margin: 0; color: var(--muted); }
.onboarding-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.onboarding-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.onboarding-steps a { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 7px 10px; font-weight: 800; font-size: .84rem; }
.onboarding-steps a:hover { border-color: var(--primary); color: var(--primary); }
.help-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.help-card { display: grid; align-content: start; gap: 8px; }
.help-card i { color: var(--primary); font-size: 1.8rem; }
.help-card p { color: var(--muted); margin: 0; }
.help-card a { font-weight: 900; }
.tour-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tour-link-grid a { min-height: 54px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); display: flex; align-items: center; gap: 10px; font-weight: 850; }
.tour-link-grid a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.tour-link-grid i { width: 22px; text-align: center; color: var(--primary); }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 12px 14px; }
.faq-list summary { cursor: pointer; font-weight: 900; }
.faq-list p { margin: 8px 0 0; color: var(--muted); }
.search-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.search-summary { color: var(--muted); font-weight: 800; }
.search-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.search-result-row { display: grid; gap: 3px; padding: 11px 0; color: var(--text); border-bottom: 1px solid var(--border); }
.search-result-row:last-child { border-bottom: 0; }
.search-result-row:hover { color: var(--primary); }
.search-result-row span { color: var(--muted); font-size: .84rem; }
.chart-empty { display: none; min-height: 250px; place-items: center; gap: 6px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); padding: 20px; }
.chart-empty.show { display: grid; }
.chart-empty i { color: var(--primary); font-size: 1.8rem; }
.chart-empty strong { color: var(--text); }
.floating-clear-filters { position: fixed; right: 92px; bottom: 28px; z-index: 24; display: none; align-items: center; gap: 8px; border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--border)); border-radius: 999px; padding: 11px 15px; background: color-mix(in srgb, var(--danger) 11%, var(--surface)); color: var(--danger); box-shadow: var(--shadow); font-weight: 900; }
.floating-clear-filters.show:not(.d-none) { display: inline-flex; }
.floating-clear-filters:hover { transform: translateY(-2px); }
.tour-overlay { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .5); pointer-events: auto; }
.tour-spotlight { position: fixed; display: none; border: 3px solid var(--primary); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(2, 6, 23, .42), 0 18px 60px rgba(0, 0, 0, .35); pointer-events: none; z-index: 91; transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease; }
.tour-spotlight.show { display: block; }
.tour-highlight { box-shadow: none !important; }
.tour-card { position: fixed; width: min(380px, calc(100vw - 32px)); padding: 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); pointer-events: auto; z-index: 92; }
.tour-card small { color: var(--primary); font-weight: 900; text-transform: uppercase; font-size: .72rem; }
.tour-card h2 { margin: 6px 32px 8px 0; font-size: 1.2rem; }
.tour-card p { color: var(--muted); margin-bottom: 14px; }
.tour-close { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 0; border-radius: 999px; color: var(--muted); background: var(--surface-2); }
.tour-actions { display: flex; justify-content: space-between; gap: 8px; }
.compact-table { font-size: .92rem; }
.audit-diff { max-width: 520px; white-space: pre-wrap; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: .78rem; margin: 8px 0 0; }
.audit-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 10px; }
.audit-grid strong { display: block; margin-bottom: 4px; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.actions-timeline { display: grid; gap: 14px; }
.action-item { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: start; }
.action-icon { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow); }
.action-content { padding: 16px; }
.action-content header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.action-content header span { display: block; color: var(--muted); margin-top: 4px; }
.action-content time { color: var(--muted); white-space: nowrap; }
.action-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.action-meta div, .change-row { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.action-meta dt { color: var(--muted); font-size: .78rem; }
.action-meta dd { margin: 3px 0 0; font-weight: 800; }
.action-changes summary { cursor: pointer; font-weight: 900; color: var(--primary); }
.change-grid { display: grid; gap: 8px; margin-top: 10px; }
.change-row { display: grid; gap: 4px; }
.change-row span { color: var(--muted); overflow-wrap: anywhere; }
.permission-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 16px; background: var(--surface-2); font-weight: 800; }
.permission-banner.can-edit { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); color: var(--primary-2); }
.permission-banner.read-only { color: var(--muted); }
.permission-matrix { display: grid; gap: 16px; }

.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.module-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.module-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.module-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-title { margin: 0 0 12px; font-family: var(--font-display); font-size: var(--fs-md); font-weight: 850; color: var(--text); }
.item-list { display: grid; gap: 10px; }
.item-list article { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.item-list article.danger-row { border-color: color-mix(in srgb, var(--danger) 28%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, transparent); border-radius: 8px; padding: 10px; }
.item-list article:last-child { border-bottom: 0; }
.item-list strong, .item-list span { display: block; }
.item-list span { color: var(--muted); font-size: .86rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row-actions a, .item-list article > a { color: var(--primary); font-weight: 900; font-size: .84rem; }
.metric-line { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 9px 0; border-bottom: 1px solid var(--border); }
.metric-line:last-child { border-bottom: 0; }
.metric-line strong { min-width: 0; font-family: var(--font-display); font-size: var(--fs-md); line-height: 1.18; }
.metric-line span { flex: 0 0 auto; color: var(--muted); text-align: right; font-size: var(--fs-md); font-weight: 800; }

.calendar-filters { grid-template-columns: 160px minmax(170px, 1fr) minmax(170px, 1fr) minmax(160px, 1fr) auto auto; align-items: end; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 16px; }
.calendar-board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.calendar-board-head h2 { margin: 0; }
.calendar-board-head span { color: var(--muted); font-weight: 800; }
.calendar-weekdays, .calendar-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-weekdays span { color: var(--muted); font-size: .78rem; font-weight: 900; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 132px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 82%, transparent); padding: 9px; display: grid; align-content: start; gap: 6px; }
.calendar-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.calendar-day.weekend { background: color-mix(in srgb, var(--surface-2) 64%, var(--surface)); }
.calendar-day.muted { opacity: .38; background: transparent; border-style: dashed; }
.calendar-day > strong { font-family: var(--font-display); font-size: 1rem; }
.calendar-event { display: grid; gap: 1px; border-radius: 7px; padding: 6px 7px; color: var(--text); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border)); font-size: .76rem; line-height: 1.12; }
.calendar-event:hover { color: var(--primary); transform: translateY(-1px); }
.calendar-event.event-contract_expiry, .calendar-event.event-renewal { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 34%, var(--border)); }
.calendar-event.event-maintenance, .calendar-event.event-audit { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 28%, var(--border)); }
.calendar-event span { font-weight: 900; }
.calendar-event small, .calendar-empty-dot, .calendar-day em { color: var(--muted); font-size: .72rem; }
.calendar-side { display: grid; gap: 16px; align-content: start; }

.health-score { min-width: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; background: var(--surface); text-align: center; }
.health-score span { display: block; color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.health-score strong { display: block; font-family: var(--font-display); font-size: 1.65rem; }
.health-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.health-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.health-card i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--muted); }
.health-card span { color: var(--muted); font-weight: 900; font-size: .78rem; text-transform: uppercase; }
.health-card strong { display: block; font-family: var(--font-display); font-size: 1.16rem; }
.health-card small { color: var(--muted); }
.health-card.success { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.health-card.success i { background: var(--success); }
.health-card.warning { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.health-card.warning i { background: var(--warning); color: #332100; }
.health-card.danger { border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.health-card.danger i { background: var(--danger); }
.health-queue { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.health-queue div { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface-2); }
.health-queue span { display: block; color: var(--muted); font-weight: 800; font-size: .82rem; }
.health-queue strong { display: block; margin-top: 4px; font-family: var(--font-display); font-size: 1.35rem; }
.dashboard-grid > .panel > .metric-line { display: block; border-bottom: 0; padding: 0; font-family: var(--font-display); font-size: clamp(1.55rem, 2.1vw, 2.15rem); font-weight: 850; }
.routine-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.routine-card i { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--primary)); }
.routine-card div { flex: 1; min-width: 0; }
.routine-card strong, .routine-card span { display: block; }
.routine-card span { color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.flow-launcher {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.flow-launcher a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas: "icon label" "icon hint";
    gap: 2px 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-2);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.flow-launcher a:hover { color: var(--text); transform: translateY(-2px); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface-2)); }
.flow-launcher i { grid-area: icon; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.flow-launcher span { grid-area: label; font-weight: 900; }
.flow-launcher small { grid-area: hint; color: var(--muted); font-weight: 750; }
.action-card { position: relative; overflow: hidden; display: grid; gap: 12px; align-content: space-between; min-height: 245px; padding: 16px; border: 1px solid var(--border); border-left-width: 5px; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.action-card strong { display: block; margin-top: 8px; font-size: 1.05rem; }
.action-card p { margin: 8px 0 0; color: var(--muted); }
.action-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: .86rem; }
.action-card dt { color: var(--muted); font-weight: 900; }
.action-card dd { margin: 0; }
.priority-critical { border-left-color: #dc2626; }
.priority-high { border-left-color: var(--primary); }
.priority-medium { border-left-color: var(--accent-2); }
.priority-low { border-left-color: #16a34a; }
.quality-score { display: grid; place-items: center; min-width: 92px; height: 54px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--primary)); font-size: 1.2rem; }
.contract-window-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.contract-window-grid a {
    display: grid;
    gap: 6px;
    min-height: 86px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 8%, var(--surface-2)), var(--surface));
    box-shadow: var(--shadow-sm);
}
.contract-window-grid a:hover { color: var(--primary); transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.contract-window-grid span { color: var(--muted); font-weight: 900; font-size: .8rem; text-transform: uppercase; }
.contract-window-grid strong { font-family: var(--font-display); font-size: 1.45rem; line-height: 1; }
.kanban-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.kanban-column { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); min-height: 240px; }
.kanban-column h2 { display: flex; justify-content: space-between; align-items: center; margin: 0; font-size: .95rem; font-weight: 900; }
.kanban-column h2 span { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .78rem; }
.kanban-card { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); transition: transform .18s var(--ease-out), border-color .18s ease, box-shadow .18s ease; }
.kanban-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.kanban-card strong, .kanban-card span, .kanban-card a { display: block; }
.kanban-card span { color: var(--muted); font-size: .84rem; }
.kanban-card a { color: var(--primary); font-weight: 900; }
.kanban-meta, .kanban-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; justify-content: space-between; }
.kanban-meta { justify-content: flex-start; }
.kanban-footer { padding-top: 7px; border-top: 1px solid var(--border); }
.kanban-footer span { font-weight: 800; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form .form-control { max-width: 180px; }
.quick-action-inline { display: inline-flex; width: fit-content; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--primary); font-weight: 900; font-size: .78rem; }
.section-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.section-header-row h2 { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 850; }
.bi-dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bi-dashboard-grid article {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 38%),
        color-mix(in srgb, var(--surface-2) 94%, transparent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
    animation: softRise .42s var(--ease-out) both;
    transition: transform .22s var(--ease-spring), border-color .2s ease, box-shadow .2s ease;
}
.bi-dashboard-grid article:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 62%, var(--border)); box-shadow: var(--shadow-lg); }
.bi-dashboard-grid article::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent));
    opacity: .82;
}
.bi-dashboard-grid h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: var(--fs-md); font-weight: 850; color: var(--text); }
.bi-dashboard-grid .metric-line { gap: 10px; padding: 10px 0; align-items: center; }
.bi-dashboard-grid .metric-line strong { font-size: clamp(.98rem, 1vw, 1.08rem); font-weight: 800; overflow-wrap: anywhere; }
.bi-dashboard-grid .metric-line span { font-size: clamp(.96rem, 1vw, 1.08rem); color: color-mix(in srgb, var(--text) 74%, var(--muted)); white-space: nowrap; }
.bi-dashboard-grid article:nth-child(2) { animation-delay: .04s; }
.bi-dashboard-grid article:nth-child(3) { animation-delay: .08s; }
.bi-dashboard-grid article:nth-child(4) { animation-delay: .12s; }
.bi-dashboard-grid article:nth-child(5) { animation-delay: .16s; }
.bi-dashboard-grid article:nth-child(6) { animation-delay: .2s; }
.risk-card { display: grid; gap: 8px; align-content: start; }
.risk-card .big-number { width: 88px; height: 88px; border-radius: 999px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--primary)); color: #fff; font-size: 2rem; font-weight: 950; box-shadow: var(--shadow); }
.risk-card strong { font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text); }
.risk-card p { color: var(--muted); margin: 0; }
.approval-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.approval-step { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--border); border-left: 5px solid var(--muted); border-radius: 8px; background: var(--surface-2); }
.approval-step strong, .approval-step span, .approval-step small { display: block; }
.approval-step small, .approval-step p { color: var(--muted); margin: 0; }
.mobile-workflow { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.field-card { display: grid; gap: 14px; }
.field-card-head { display: flex; gap: 12px; align-items: center; }
.field-card-head i { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.field-card-head h2 { margin: 0 0 3px; }
.field-card-head span { color: var(--muted); font-weight: 750; }
.field-form input, .field-form select, .field-form textarea { min-height: 44px; }
.checklist-grid.field-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.checklist-grid.field-form .check-row {
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--surface-2);
}
.field-submit { min-height: 48px; }
.field-history-row strong { min-width: 135px; text-align: right; }
.presentation-mode .sidebar,
.presentation-mode .mobile-menu,
.presentation-mode .floating-agent,
.presentation-mode .toast-stack,
.presentation-mode .dashboard-filters,
.presentation-mode .filter-chips,
.presentation-mode .feature-grid,
.presentation-mode .profile-home,
.presentation-mode .floating-clear-filters {
    display: none !important;
}
.presentation-mode .app-shell { grid-template-columns: 1fr; }
.presentation-mode .content { padding: clamp(18px, 2.2vw, 36px); max-width: 1680px; margin-inline: auto; width: 100%; }
.presentation-mode .page-head {
    min-height: 110px;
    border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
    border-radius: 8px;
    padding: 20px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface));
}
.presentation-mode .kpi-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.presentation-mode .kpi { min-height: 132px; display: grid; align-content: center; }
.presentation-mode .kpi strong { font-size: clamp(2rem, 3vw, 3.4rem); }
.presentation-mode .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.presentation-mode .chart-panel.wide { grid-column: 1 / -1; }
.presentation-mode .panel { box-shadow: var(--shadow-lg); }
.approval-step.approved { border-left-color: #16a34a; }
.approval-step.rejected { border-left-color: #dc2626; }
.approval-step.returned { border-left-color: var(--primary); }
.approval-step.pending { border-left-color: var(--accent-2); }
.mobile-workflow { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.mobile-workflow .panel { min-height: 100%; }
.mobile-workflow input, .mobile-workflow select, .mobile-workflow textarea { min-height: 44px; }
.panel, .warehouse-card, .action-card, .kanban-card, .issue-card, .kpi, .profile-home { content-visibility: auto; contain-intrinsic-size: 1px 220px; }
.panel, .warehouse-card, .action-card, .issue-card, .quick-action, .btn { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease; }
.panel:hover, .warehouse-card:hover, .action-card:hover { box-shadow: var(--shadow-lg); }
.btn:active, .quick-action:active { transform: translateY(1px); }
.motion-enhanced .panel,
.motion-enhanced .kpi,
.motion-enhanced .warehouse-card,
.motion-enhanced .action-card,
.motion-enhanced .kanban-card,
.motion-enhanced .issue-card,
.motion-enhanced .timeline article,
.motion-enhanced .item-list article,
.motion-enhanced .profile-home-grid a,
.motion-enhanced .search-result-row {
    opacity: 0;
    transform: translateY(14px) scale(.988);
}
.motion-enhanced .motion-seen {
    opacity: 1;
    transition:
        opacity .42s var(--ease-out) var(--motion-delay, 0ms),
        transform .42s var(--ease-out) var(--motion-delay, 0ms),
        border-color .18s ease,
        box-shadow .18s ease,
        background-color .18s ease,
        color .18s ease;
}
.motion-enhanced .motion-seen:not(:hover) { transform: translateY(0) scale(1); }
.favorite-pop { animation: popIn .24s ease; }
.table-responsive { scrollbar-width: thin; scrollbar-color: var(--primary) transparent; }
.panel.table-responsive { overflow-x: auto; overflow-y: hidden; }
.table-responsive .table { margin-bottom: 0; }
.table-responsive::after { content: ""; position: sticky; right: 0; display: block; width: 36px; height: 1px; margin-left: auto; pointer-events: none; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 92%, transparent)); }
.table td[data-label] a { font-weight: 900; color: var(--primary); }

@media (max-width: 980px) {
    .module-grid.two, .module-grid.three { grid-template-columns: 1fr; }
    .bi-dashboard-grid { grid-template-columns: 1fr; }
    .section-header-row { display: grid; }
    .item-list article, .routine-card { align-items: flex-start; flex-direction: column; }
    .metric-line { display: grid; }
    .metric-line span { text-align: left; }
}
.permission-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { min-width: 230px; background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--border); border-radius: 8px; padding: 12px; box-shadow: var(--shadow); }
.kanban-column header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.kanban-column header span { min-width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 900; }
.kanban-items { display: grid; gap: 10px; }
.issue-card { color: var(--text); display: grid; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.issue-card:hover { color: var(--text); border-color: var(--primary); transform: translateY(-2px); }
.issue-card small, .issue-card time { color: var(--muted); font-size: .8rem; }
.issue-severity { width: fit-content; padding: 3px 8px; border-radius: 999px; font-size: .72rem; font-weight: 900; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.severity-high, .severity-critical { background: color-mix(in srgb, var(--danger) 16%, transparent); color: #ef4444; }
.severity-medium { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-2); }
.admin-metric-list { display: grid; gap: 10px; }
.admin-metric-list div { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 8px; background: var(--surface-2); }
.admin-metric-list span { color: var(--muted); }
.agent-dashboard { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.agent-sidebar { display: grid; align-content: start; gap: 16px; max-height: min(760px, calc(100vh - 150px)); overflow: auto; }
.agent-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.agent-metrics div { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface-2); }
.agent-metrics span { color: var(--muted); display: block; font-size: .78rem; font-weight: 800; }
.agent-metrics strong { display: block; margin-top: 4px; font-size: 1.05rem; }
.quick-actions { display: grid; gap: 10px; }
.quick-action { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 11px 12px; display: flex; align-items: center; gap: 9px; text-align: left; font-weight: 800; }
.quick-action i { width: 18px; flex: 0 0 18px; text-align: center; }
.agent-suggestions { display: grid; gap: 8px; margin-bottom: 14px; }
.agent-suggestions .quick-action { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.agent-suggestions .quick-action:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.quick-action:hover { border-color: var(--primary); color: var(--primary); }
.risk-mini-list { display: grid; gap: 8px; }
.risk-mini-list a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 9px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.risk-mini-list a:hover { color: var(--primary); border-color: var(--primary); }
.risk-mini-list strong { grid-row: span 2; align-self: center; color: var(--primary); }
.risk-mini-list span { font-weight: 900; }
.risk-mini-list small { color: var(--muted); }
.agent-chat-panel { min-height: 72vh; }
.embed-chat header div { display: grid; }
.embed-quick { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.embed-quick button, .embed-quick a { min-height: 40px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 7px 8px; font-size: .82rem; font-weight: 800; white-space: normal; display: grid; place-items: center; text-align: center; }
.embed-quick a:hover { border-color: var(--primary); color: var(--primary); }

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

@keyframes softRise {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes loginShell {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes loginMedia {
    from { opacity: 0; transform: translateX(-22px) scale(.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes loginCard {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes authAura {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(18deg) scale(1.08); }
}

@keyframes ripple {
    to { opacity: 0; transform: scale(2.4); }
}

@keyframes blink {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

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

@keyframes shimmer {
    from { background-position: 220% 0; }
    to { background-position: -220% 0; }
}

@media (max-width: 1100px) {
    .feature-grid, .kpi-grid, .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow { grid-template-columns: repeat(2, 1fr); }
    .calendar-layout { grid-template-columns: 1fr; }
    .calendar-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .content { margin-left: 0; padding: 72px 16px 24px; }
    .mobile-menu { display: inline-flex; }
    .dashboard-grid, .detail-grid, .form-grid, .filters, .profile-detail-grid, .calendar-filters { grid-template-columns: 1fr; }
    .dashboard-filters, .analytics-grid, .agent-dashboard, .search-hero, .search-results-grid { grid-template-columns: 1fr; }
    .onboarding-panel { flex-direction: column; align-items: stretch; }
    .action-meta { grid-template-columns: 1fr; }
    .action-content header { flex-direction: column; }
    .kanban-board { grid-template-columns: repeat(4, 260px); }
    .page-head { flex-direction: column; }
    .feature-grid, .kpi-grid { grid-template-columns: 1fr; }
    .help-grid { grid-template-columns: 1fr; }
    .floating-clear-filters { right: 86px; bottom: 24px; }
    .floating-clear-filters span { display: none; }
    .chat-msg { max-width: 94%; }
    .table.mobile-cards, .table.mobile-cards thead, .table.mobile-cards tbody, .table.mobile-cards tr, .table.mobile-cards th, .table.mobile-cards td,
    .table-responsive .table { min-width: 720px; }
    .table-responsive { border-radius: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .filters { gap: 10px; }
    .filters input, .filters select, .filters .btn { width: 100%; min-height: 44px; }
    .page-head .actions { width: 100%; justify-content: flex-start; }
    .page-head .actions .btn, .page-head .actions form { flex: 1 1 180px; }
    .page-head .actions form .btn { width: 100%; }
    .warehouse-grid { grid-template-columns: 1fr; }
    .agent-panel { left: 12px; right: 12px; width: auto; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-showcase { min-height: 300px; order: 2; }
    .auth-login-card { min-height: auto; }
    .calendar-weekdays { display: none; }
    .calendar-month-grid { grid-template-columns: 1fr; }
    .calendar-day { min-height: auto; }
    .health-card-grid, .health-queue, .enhanced-unit-grid { grid-template-columns: 1fr; }
    .list-row, .section-header { flex-direction: column; align-items: stretch; }
    .list-row .actions { justify-content: flex-start; }
    .decision-panel .item-list article, .item-list.compact article { grid-template-columns: 1fr auto; }
    .checklist-grid.field-form { grid-template-columns: 1fr; }
    .field-history-row { align-items: flex-start; flex-direction: column; }
    .field-history-row strong { text-align: left; }
}

@media (max-width: 640px) {
    .table.mobile-cards { min-width: 0; border-collapse: separate; border-spacing: 0 10px; }
    .table.mobile-cards thead { display: none; }
    .table.mobile-cards tbody, .table.mobile-cards tr, .table.mobile-cards td { display: block; width: 100%; }
    .table.mobile-cards tr { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
    .table.mobile-cards td { border: 0; padding: 7px 4px; }
    .table.mobile-cards td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
    .table.mobile-cards .table-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
    .table.mobile-cards td.table-actions { width: 100%; min-width: 0; text-align: left; white-space: normal; }
    .table.mobile-cards .table-actions > a, .table.mobile-cards .table-actions > form, .table.mobile-cards .table-actions > button { margin: 0; }
    .table.mobile-cards .table-actions::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
.password-field { position: relative; display: flex; align-items: stretch; }
.password-field input { width: 100%; padding-right: 48px; }
.password-field button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
}
.password-field button:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.password-field button.active { color: var(--primary-2); }

/* Design system refinements: performance-friendly UI helpers reused across modules. */
:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, white);
    outline-offset: 2px;
    border-radius: 8px;
}

.table-responsive {
    position: relative;
    max-width: 100%;
}

.table-responsive table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
    box-shadow: 0 1px 0 var(--border);
}

.table-tools {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 0 8px;
}

.table-density-toggle {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    border-radius: 8px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: .78rem;
    font-weight: 900;
}

.table-density-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
}

body[data-table-density="compact"] .table > :not(caption) > * > * {
    padding-top: .46rem;
    padding-bottom: .46rem;
}

body[data-table-density="comfortable"] .table > :not(caption) > * > * {
    padding-top: .86rem;
    padding-bottom: .86rem;
}

.row-actions,
.table-actions,
.page-head .actions {
    align-items: center;
    gap: 8px;
}

.row-actions .btn,
.table-actions .btn,
.page-head .actions .btn {
    min-width: max-content;
}

.next-action-panel {
    border-left: 4px solid var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.permission-note,
.blocked-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.blocked-note {
    color: var(--danger);
}

.empty-state .btn {
    margin-top: 8px;
}

.form-grid label span,
.compact-form label span,
.filters label span {
    color: var(--muted);
    font-weight: 800;
}

.form-error-summary {
    border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    color: var(--text);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.field-sticky-actions {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}
