/* =========================================================
   ZYXAN HRMS - DESIGN SYSTEM
   Single source of truth for all custom pages.
   Palette derived from the zyxan-hrms UI prototype:
   warm gold (#FFBA03), deep navy (#14161F), warm off-white.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");


/* ---------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------- */

:root {

    /* ---- palette: brand ---- */

    --zyxan-gold-500: #FFBA03;
    --zyxan-gold-400: #FFCC3F;
    --zyxan-gold-600: #E6A700;
    --zyxan-gold-700: #B37A00;
    --zyxan-gold-050: #FFF3D6;

    --zyxan-navy-900: #14161F;
    --zyxan-navy-800: #1C1F2B;
    --zyxan-navy-700: #252938;
    --zyxan-navy-600: #333849;

    /* ---- palette: neutrals ---- */

    --zyxan-bg: #FAF9F6;
    --zyxan-white: #FFFFFF;
    --zyxan-line: #EAE6DC;

    --zyxan-ink-900: #16171F;
    --zyxan-ink-600: #5C5D68;
    --zyxan-ink-400: #96979E;

    /* ---- palette: semantic status ---- */

    --zyxan-green: #28A879;
    --zyxan-amber: #D98E2B;
    --zyxan-red: #D6544A;
    --zyxan-blue: #4E7AC7;

    /* soft (tinted) backgrounds + readable text for the same status colours */

    --zyxan-success-soft: #E4F4EE;
    --zyxan-success-text: #1E7A56;

    /* ---- semantic aliases (used across components) ---- */

    --zyxan-primary: var(--zyxan-gold-500);
    --zyxan-primary-hover: var(--zyxan-gold-600);
    --zyxan-primary-soft: var(--zyxan-gold-050);
    --zyxan-primary-text: var(--zyxan-ink-900);

    --zyxan-background: var(--zyxan-bg);
    --zyxan-surface: var(--zyxan-white);
    --zyxan-border: var(--zyxan-line);

    --zyxan-text: var(--zyxan-ink-900);
    --zyxan-text-secondary: var(--zyxan-ink-600);
    --zyxan-text-muted: var(--zyxan-ink-400);

    --zyxan-success: var(--zyxan-green);
    --zyxan-warning: var(--zyxan-amber);
    --zyxan-danger: var(--zyxan-red);
    --zyxan-info: var(--zyxan-blue);

    /* ---- app shell ---- */

    --zyxan-sidebar-width: 250px;
    --zyxan-sidebar-collapsed-width: 72px;
    --zyxan-topbar-height: 64px;
    --zyxan-sidebar-bg: var(--zyxan-navy-900);

    /* ---- typography ---- */

    --zyxan-font-heading: 'Manrope', 'Inter', ui-sans-serif, system-ui, sans-serif;
    --zyxan-font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;

    --zyxan-fs-xs: 11px;
    --zyxan-fs-sm: 12.5px;
    --zyxan-fs-md: 13.5px;
    --zyxan-fs-lg: 15px;
    --zyxan-fs-xl: 17px;
    --zyxan-fs-2xl: 20px;
    --zyxan-fs-3xl: 26px;

    /* ---- spacing ---- */

    --zyxan-space-1: 4px;
    --zyxan-space-2: 8px;
    --zyxan-space-3: 12px;
    --zyxan-space-4: 16px;
    --zyxan-space-5: 20px;
    --zyxan-space-6: 24px;
    --zyxan-space-8: 32px;

    /* ---- radius ---- */

    --zyxan-radius-sm: 9px;
    --zyxan-radius-md: 12px;
    --zyxan-radius-lg: 14px;
    --zyxan-radius-pill: 999px;

    /* ---- shadows ---- */

    --zyxan-shadow-sm:
        0 1px 2px rgba(20, 22, 31, 0.06),
        0 2px 8px rgba(20, 22, 31, 0.05);
    --zyxan-shadow-md:
        0 4px 10px rgba(20, 22, 31, 0.08),
        0 1px 2px rgba(20, 22, 31, 0.05);
    --zyxan-shadow-lg:
        0 12px 28px rgba(20, 22, 31, 0.14);

    /* ---- motion ---- */

    --zyxan-ease: cubic-bezier(0.4, 0, 0.2, 1);

}


/* ---------------------------------------------------------
   2. BASE
   --------------------------------------------------------- */

.zyxan-app,
.zyxan-app * {
    font-family: var(--zyxan-font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.zyxan-app {
    color: var(--zyxan-text);
}


/* ---------------------------------------------------------
   HIDE FRAPPE'S GLOBAL SIDEBAR ON ZYXAN PAGES
   (body[data-route] is set by Frappe's router; pages in the
   zyxan-* namespace use the custom .zyxan-sidebar instead, so
   the default workspace sidebar must not show or take up space.)
   --------------------------------------------------------- */

body[data-route^="zyxan-"] > .body-sidebar-container {
    display: none !important;
}

body[data-route^="zyxan-"] .main-section {
    width: 100%;
}


/* =========================================================
   APP SHELL (sidebar + topbar + content)
   ========================================================= */

.zyxan-app {

    min-height: 100vh;

    display: grid;

    grid-template-columns:
        var(--zyxan-sidebar-collapsed-width)
        minmax(0, 1fr);

    grid-template-rows:
        var(--zyxan-topbar-height)
        minmax(0, 1fr);

    grid-template-areas:
        "sidebar topbar"
        "sidebar content";

    background: var(--zyxan-background);

    transition: grid-template-columns 0.4s var(--zyxan-ease);

}


.zyxan-app.sidebar-expanded {

    grid-template-columns:
        var(--zyxan-sidebar-width)
        minmax(0, 1fr);

}


/* ---------------------------------------------------------
   SIDEBAR
   --------------------------------------------------------- */

.zyxan-sidebar {

    grid-area: sidebar;

    height: 100vh;

    position: sticky;

    top: 0;

    background: var(--zyxan-sidebar-bg);

    color: #ffffff;

    overflow: hidden;

    z-index: 20;

}


.zyxan-sidebar-inner {

    height: 100%;

    display: flex;

    flex-direction: column;

    padding: 22px 16px;

}


/* ---- brand ---- */

.zyxan-sidebar-brand {

    height: 42px;

    flex: 0 0 auto;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 0;

    padding: 0;

    margin-bottom: 26px;

    transition:

        justify-content 0.35s var(--zyxan-ease),
        gap 0.35s var(--zyxan-ease),
        padding 0.35s var(--zyxan-ease);

}

.zyxan-app.sidebar-expanded .zyxan-sidebar-brand {

    justify-content: flex-start;

    gap: 10px;

    padding: 0 8px;

}


.zyxan-brand-mark {

    width: 32px;

    height: 32px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    background: var(--zyxan-primary);

    color: var(--zyxan-primary-text);

    font-family: var(--zyxan-font-heading);

    font-weight: 800;

    font-size: 15px;

}


.zyxan-brand-name {

    font-family: var(--zyxan-font-heading);

    font-size: 17px;

    font-weight: 800;

    white-space: nowrap;

}


/* ---- section title + menu item and user are centered
        while collapsed and slide back when expanded ---- */


/* ---- sections & menu ---- */

/* ---- scrolling menu region ----
   The sidebar is height:100vh / overflow:hidden, so a menu taller than the
   viewport was clipped and unreachable. Only the menu list scrolls here:
   the brand, Settings and the user box are flex-shrink:0 and stay pinned. */

.zyxan-sidebar-scroll {

    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;

    overscroll-behavior: contain;

    scrollbar-width: thin;

    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;

}

.zyxan-sidebar-scroll::-webkit-scrollbar {

    width: 6px;

}

.zyxan-sidebar-scroll::-webkit-scrollbar-track {

    background: transparent;

}

.zyxan-sidebar-scroll::-webkit-scrollbar-thumb {

    background: rgba(255, 255, 255, 0.22);

    border-radius: 3px;

}

.zyxan-sidebar-scroll::-webkit-scrollbar-thumb:hover {

    background: rgba(255, 255, 255, 0.35);

}


.zyxan-sidebar-section {

    margin-bottom: 12px;

}


.zyxan-sidebar-section-title {

    padding: 14px 12px 8px;

    font-size: var(--zyxan-fs-xs);

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.06em;

    color: rgba(255, 255, 255, 0.35);

}


.zyxan-sidebar-menu {

    display: flex;

    flex-direction: column;

    gap: 2px;

}


.zyxan-sidebar-item {

    width: 100%;

    min-height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 0;

    padding: 10px 0;

    border-radius: var(--zyxan-radius-sm);

    color: rgba(255, 255, 255, 0.68);

    text-decoration: none;

    font-size: var(--zyxan-fs-md);

    font-weight: 500;

    transition:

        background 0.15s var(--zyxan-ease),
        color 0.15s var(--zyxan-ease),
        padding 0.35s var(--zyxan-ease),
        justify-content 0.35s var(--zyxan-ease),
        gap 0.35s var(--zyxan-ease);

}

.zyxan-app.sidebar-expanded .zyxan-sidebar-item {

    justify-content: flex-start;

    gap: 11px;

    padding: 10px 12px;

}


.zyxan-sidebar-item:hover {

    background: rgba(255, 255, 255, 0.06);

    color: #ffffff;

}

.zyxan-sidebar-item:focus-visible {

    outline: none;

    box-shadow: inset 0 0 0 2px var(--zyxan-primary);

}


.zyxan-sidebar-item.active {

    background: rgba(255, 186, 3, 0.16);

    color: #ffffff;

}

.zyxan-sidebar-item.active .zyxan-sidebar-icon {

    color: var(--zyxan-primary);

}


.zyxan-sidebar-icon {

    width: 18px;

    height: 18px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 16px;

}


.zyxan-sidebar-settings {

    flex: 0 0 auto;

    margin-top: 8px;

    margin-bottom: 0;

}


/* ---- sidebar user ---- */

.zyxan-sidebar-user {

    flex: 0 0 auto;

    margin-top: auto;

    padding: 14px 0;

    border-top: 1px solid rgba(255, 255, 255, 0.08);

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 0;

    transition:

        justify-content 0.35s var(--zyxan-ease),
        gap 0.35s var(--zyxan-ease),
        padding 0.35s var(--zyxan-ease);

}

.zyxan-app.sidebar-expanded .zyxan-sidebar-user {

    justify-content: flex-start;

    gap: 10px;

    padding: 14px 12px;

}


.zyxan-user-avatar {

    width: 34px;

    height: 34px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--zyxan-primary);

    color: var(--zyxan-primary-text);

    object-fit: cover;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 13px;

    font-weight: 700;

}


.zyxan-user-info {

    min-width: 0;

}


.zyxan-user-name {

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    color: #ffffff;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


.zyxan-user-role {

    font-size: var(--zyxan-fs-xs);

    color: rgba(255, 255, 255, 0.45);

}

/* no designation: no empty line, the name centres beside the avatar */
.zyxan-user-role:empty {

    display: none;

}

/* ---------------------------------------------------------
   TOPBAR
   --------------------------------------------------------- */

.zyxan-topbar {

    grid-area: topbar;

    height: var(--zyxan-topbar-height);

    background: var(--zyxan-surface);

    border-bottom: 1px solid var(--zyxan-border);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 26px;

    position: sticky;

    top: 0;

    z-index: 10;

}


.zyxan-topbar-right {

    display: flex;

    align-items: center;

    gap: 12px;

}


.zyxan-topbar-button {

    width: 36px;

    height: 36px;

    border: 1px solid var(--zyxan-border);

    border-radius: var(--zyxan-radius-sm);

    background: var(--zyxan-surface);

    display: flex;

    align-items: center;

    justify-content: center;

    position: relative;

    color: var(--zyxan-text-secondary);

    cursor: pointer;

    transition:

        background 0.15s var(--zyxan-ease),
        color 0.15s var(--zyxan-ease),
        border-color 0.15s var(--zyxan-ease);

}

.zyxan-topbar-button[hidden] {

    display: none;

}

.zyxan-topbar-button:hover {

    background: var(--zyxan-background);

    color: var(--zyxan-text);

}

.zyxan-topbar-button:focus-visible {

    outline: none;

    box-shadow: 0 0 0 3px rgba(255, 186, 3, 0.35);

}


.zyxan-notification-dot {

    position: absolute;

    width: 7px;

    height: 7px;

    border-radius: 50%;

    top: 7px;

    right: 7px;

    background: var(--zyxan-danger);

}


/* bell count badge (zyxan-topbar.js) */

.zyxan-notif-count {

    position: absolute;

    top: -6px;

    right: -6px;

    min-width: 18px;

    height: 18px;

    padding: 0 5px;

    border-radius: var(--zyxan-radius-pill);

    border: 2px solid var(--zyxan-surface);

    background: var(--zyxan-danger);

    color: #fff;

    font-size: 10.5px;

    font-weight: 700;

    line-height: 14px;

    text-align: center;

    font-variant-numeric: tabular-nums;

    pointer-events: none;

}


.zyxan-notif-count[hidden] {

    display: none;

}


/* ---- notification dropdown ---- */

.zyxan-notif-wrap {

    position: relative;

}


.zyxan-notif-dropdown {

    position: absolute;

    top: calc(100% + 10px);

    right: 0;

    width: 320px;

    max-width: calc(100vw - 40px);

    background: var(--zyxan-surface);

    border: 1px solid var(--zyxan-border);

    border-radius: var(--zyxan-radius-md);

    box-shadow: var(--zyxan-shadow-lg);

    overflow: hidden;

    z-index: 30;

}


.zyxan-notif-header {

    padding: 12px 16px;

    border-bottom: 1px solid var(--zyxan-border);

    font-size: var(--zyxan-fs-sm);

    font-weight: 700;

    color: var(--zyxan-text);

}


.zyxan-notif-list {

    max-height: 340px;

    overflow-y: auto;

}


.zyxan-notif-item {

    padding: 12px 16px;

    border-bottom: 1px solid var(--zyxan-border);

    font-size: var(--zyxan-fs-sm);

    color: var(--zyxan-text);

    cursor: pointer;

    transition: background 0.12s var(--zyxan-ease);

}

.zyxan-notif-item:last-child {

    border-bottom: none;

}

.zyxan-notif-item:hover {

    background: var(--zyxan-background);

}


.zyxan-notif-empty {

    padding: 24px 16px;

    text-align: center;

    color: var(--zyxan-text-muted);

    font-size: var(--zyxan-fs-sm);

}


.zyxan-topbar-user {

    display: flex;

    align-items: center;

    gap: 9px;

    padding-left: 14px;

    border-left: 1px solid var(--zyxan-border);

}


.zyxan-topbar-avatar {

    width: 32px;

    height: 32px;

    border-radius: 50%;

    background: var(--zyxan-primary);

    color: var(--zyxan-primary-text);

    object-fit: cover;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 12.5px;

    font-weight: 700;

}


.zyxan-topbar-user-name {

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    color: var(--zyxan-text);

}

/* Employee ID under the name */
.zyxan-topbar-user-id {

    margin-top: 1px;

    font-size: var(--zyxan-fs-xs);

    font-weight: 500;

    color: var(--zyxan-text-muted);

    line-height: 1.2;

}


/* ---------------------------------------------------------
   SEARCH (topbar + page toolbars)
   --------------------------------------------------------- */

.zyxan-search {

    width: 280px;

    max-width: 100%;

    height: 38px;

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 0 12px;

    background: var(--zyxan-background);

    border: 1px solid var(--zyxan-border);

    border-radius: var(--zyxan-radius-sm);

    transition:

        border-color 0.15s var(--zyxan-ease),
        box-shadow 0.15s var(--zyxan-ease),
        background 0.15s var(--zyxan-ease);

}

.zyxan-search:focus-within {

    background: var(--zyxan-surface);

    border-color: var(--zyxan-primary);

    box-shadow: 0 0 0 2px var(--zyxan-primary-soft);

}


.zyxan-search-icon {

    color: var(--zyxan-text-muted);

    font-size: 18px;

}


.zyxan-search input {

    width: 100%;

    border: none;

    outline: none;

    background: transparent;

    font-size: var(--zyxan-fs-md);

    color: var(--zyxan-text);

}

.zyxan-search input::placeholder {

    color: var(--zyxan-text-muted);

}


/* ---------------------------------------------------------
   CONTENT
   --------------------------------------------------------- */

.zyxan-content {

    grid-area: content;

    min-width: 0;

    padding: 28px 30px 30px;

}


/* ---------------------------------------------------------
   SLIDE-OPEN SIDEBAR (hover / focus)
   Text is hidden while collapsed and fades in on expand.
   --------------------------------------------------------- */

.zyxan-brand-name,
.zyxan-sidebar-section-title,
.zyxan-sidebar-text,
.zyxan-user-info {

    max-width: 0;

    overflow: hidden;

    white-space: nowrap;

    opacity: 0;

    visibility: hidden;

    transition:

        max-width 0.35s var(--zyxan-ease),
        opacity 0.25s var(--zyxan-ease),
        visibility 0s linear 0.35s;

}


.zyxan-app.sidebar-expanded .zyxan-brand-name,
.zyxan-app.sidebar-expanded .zyxan-sidebar-section-title,
.zyxan-app.sidebar-expanded .zyxan-sidebar-text,
.zyxan-app.sidebar-expanded .zyxan-user-info {

    max-width: 160px;

    opacity: 1;

    visibility: visible;

    transition:

        max-width 0.35s var(--zyxan-ease) 0.1s,
        opacity 0.25s var(--zyxan-ease) 0.12s,
        visibility 0s;

}



/* =========================================================
   PAGE LAYOUT & TYPOGRAPHY
   ========================================================= */

/* .zyxan-page {

    /* max-width: 1240px; */

/* } */


.zyxan-page-header {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: var(--zyxan-space-6);

    flex-wrap: wrap;

}


.zyxan-page-actions {

    display: flex;

    align-items: center;

    gap: 10px;

}


.zyxan-h1 {

    margin: 0;

    font-family: var(--zyxan-font-heading);

    font-size: var(--zyxan-fs-3xl);

    font-weight: 800;

    letter-spacing: -0.02em;

    line-height: 1.25;

    color: var(--zyxan-text);

}


.zyxan-h2 {

    margin: 0;

    font-family: var(--zyxan-font-heading);

    font-size: var(--zyxan-fs-2xl);

    font-weight: 700;

    line-height: 1.3;

    color: var(--zyxan-text);

}


.zyxan-h3 {

    margin: 0;

    font-family: var(--zyxan-font-heading);

    font-size: var(--zyxan-fs-xl);

    font-weight: 700;

    color: var(--zyxan-text);

}


.zyxan-h4 {

    margin: 0;

    font-size: var(--zyxan-fs-lg);

    font-weight: 700;

    color: var(--zyxan-text);

}


.zyxan-text-muted {

    margin: 5px 0 0;

    font-size: var(--zyxan-fs-md);

    color: var(--zyxan-text-muted);

}


.zyxan-text-secondary {

    color: var(--zyxan-text-secondary);

}


.zyxan-toolbar {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: var(--zyxan-space-4);

    flex-wrap: wrap;

}



/* =========================================================
   BUTTONS
   ========================================================= */

.zyxan-btn {
    width:fit-content;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    min-height: 38px;

    padding: 8px 16px;

    border-radius: var(--zyxan-radius-sm);

    border: 1px solid transparent;

    font-family: inherit;

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    line-height: 1.2;

    cursor: pointer;

    white-space: nowrap;

    user-select: none;

    text-decoration: none;

    transition:

        background 0.15s var(--zyxan-ease),
        border-color 0.15s var(--zyxan-ease),
        color 0.15s var(--zyxan-ease),
        box-shadow 0.15s var(--zyxan-ease);

}

.zyxan-btn:focus-visible {

    outline: none;

    box-shadow: 0 0 0 3px rgba(255, 186, 3, 0.35);

}

.zyxan-btn:active {

    transform: translateY(1px);

}

.zyxan-btn:disabled,
.zyxan-btn[disabled] {

    opacity: 0.55;

    cursor: not-allowed;

    transform: none;

}

.zyxan-btn > * {

    pointer-events: none;

}


/* ---- variants ---- */

.zyxan-btn-primary {

    background: var(--zyxan-primary);

    border-color: var(--zyxan-primary);

    color: var(--zyxan-primary-text);

}

.zyxan-btn-primary:hover {

    background: var(--zyxan-primary-hover);

    border-color: var(--zyxan-primary-hover);

}

.zyxan-btn-primary:active {

    background: var(--zyxan-gold-700);

    border-color: var(--zyxan-gold-700);

}


.zyxan-btn-outline {

    background: var(--zyxan-surface);

    border-color: var(--zyxan-line);

    color: var(--zyxan-text);

}

.zyxan-btn-outline:hover {

    background: var(--zyxan-background);

    border-color: #DCD6C8;

}

.zyxan-btn-outline:active {

    background: #F0EDE4;

}


.zyxan-btn-ghost {

    background: transparent;

    color: var(--zyxan-text-secondary);

}

.zyxan-btn-ghost:hover {

    background: var(--zyxan-background);

    color: var(--zyxan-text);

}


.zyxan-btn-danger {

    background: var(--zyxan-danger);

    border-color: var(--zyxan-danger);

    color: #ffffff;

}

.zyxan-btn-danger:hover {

    background: #C5483F;

    border-color: #C5483F;

}


.zyxan-btn-success {

    background: var(--zyxan-success);

    border-color: var(--zyxan-success);

    color: #ffffff;

}

.zyxan-btn-success:hover {

    background: #228A60;

    border-color: #228A60;

}


/* ---- sizes ---- */

.zyxan-btn-sm {

    min-height: 30px;

    padding: 4px 10px;

    font-size: var(--zyxan-fs-sm);

}

.zyxan-btn-lg {

    min-height: 44px;

    padding: 10px 20px;

    font-size: var(--zyxan-fs-lg);

}


/* ---------------------------------------------------------
   ICON BUTTONS
   --------------------------------------------------------- */

.zyxan-icon-btn {

    width: 30px;

    height: 30px;

    flex-shrink: 0;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 1px solid var(--zyxan-line);

    border-radius: 8px;

    background: var(--zyxan-surface);

    color: var(--zyxan-text-secondary);

    cursor: pointer;

    transition:

        background 0.15s var(--zyxan-ease),
        color 0.15s var(--zyxan-ease),
        border-color 0.15s var(--zyxan-ease);

}

.zyxan-icon-btn:hover {

    background: var(--zyxan-background);

    border-color: var(--zyxan-primary);

    color: var(--zyxan-text);

}

.zyxan-icon-btn:focus-visible {

    outline: none;

    box-shadow: 0 0 0 3px rgba(255, 186, 3, 0.35);

}



/* =========================================================
   CARDS
   ========================================================= */

.zyxan-card {

    background: var(--zyxan-surface);

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-lg);

    box-shadow: var(--zyxan-shadow-sm);

}


.zyxan-card-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

    padding: 18px 20px;

    border-bottom: 1px solid var(--zyxan-line);

}


.zyxan-card-body {

    padding: 20px;

}


.zyxan-card-footer {

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 8px;

    padding: 14px 20px;

    border-top: 1px solid var(--zyxan-line);

}



/* =========================================================
   TABLES
   ========================================================= */

.zyxan-table-wrap {

    background: var(--zyxan-surface);

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-lg);

    box-shadow: var(--zyxan-shadow-sm);

    overflow-x: auto;

}


.zyxan-table {

    width: 100%;

    border-collapse: collapse;

}


.zyxan-table th {

    padding: 13px 16px;

    text-align: left;

    border-bottom: 1px solid var(--zyxan-line);

    color: var(--zyxan-text-muted);

    font-size: var(--zyxan-fs-xs);

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.04em;

    white-space: nowrap;

}


.zyxan-table td {

    padding: 14px 16px;

    border-bottom: 1px solid var(--zyxan-line);

    color: var(--zyxan-text);

    font-size: var(--zyxan-fs-md);

    vertical-align: middle;

}


.zyxan-table tbody tr:last-child td {

    border-bottom: none;

}


.zyxan-table-row {

    cursor: pointer;

    transition: background 0.12s var(--zyxan-ease);

}

.zyxan-table-row:hover {

    background: var(--zyxan-background);

}



/* =========================================================
   EMPLOYEE CELL + AVATARS
   ========================================================= */

.zyxan-employee-cell {

    display: flex;

    align-items: center;

    gap: 10px;

}


.zyxan-avatar {

    width: 34px;

    height: 34px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: var(--zyxan-primary);

    color: var(--zyxan-primary-text);

    font-size: 12px;

    font-weight: 700;

}


.zyxan-avatar-square {

    border-radius: var(--zyxan-radius-sm);

}


.zyxan-avatar-image {

    width: 34px;

    height: 34px;

    flex-shrink: 0;

    object-fit: cover;

    border-radius: 50%;

}


.zyxan-avatar-sm {

    width: 26px;

    height: 26px;

    font-size: 10px;

}

.zyxan-avatar-lg {

    width: 44px;

    height: 44px;

    font-size: 15px;

}


.zyxan-employee-cell-info {

    min-width: 0;

}


.zyxan-employee-name {

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    color: var(--zyxan-text);

}


.zyxan-employee-meta {

    margin-top: 2px;

    color: var(--zyxan-text-muted);

    font-size: var(--zyxan-fs-xs);

}



/* =========================================================
   BADGES
   ========================================================= */

.zyxan-badge {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 4px 10px;

    border-radius: var(--zyxan-radius-pill);

    font-size: var(--zyxan-fs-xs);

    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

}


.zyxan-badge-primary {

    background: var(--zyxan-primary-soft);

    color: var(--zyxan-gold-700);

}


.zyxan-badge-neutral {

    background: #EFEDE6;

    color: var(--zyxan-ink-600);

}


.zyxan-badge-success {

    background: var(--zyxan-success-soft);

    color: var(--zyxan-success-text);

}


.zyxan-badge-warning {

    background: #FBF1E2;

    color: #A36A1F;

}


.zyxan-badge-danger {

    background: #FAE9E8;

    color: #C2443B;

}


.zyxan-badge-info {

    background: #E9F0FA;

    color: #3D5F9E;

}



/* =========================================================
   FORM CONTROLS (standalone classes)
   ========================================================= */

.zyxan-field {

    margin-bottom: 17px;

}


.zyxan-label {

    display: block;

    margin-bottom: 6px;

    color: var(--zyxan-text-secondary);

    font-size: var(--zyxan-fs-sm);

    font-weight: 600;

}


.zyxan-input,
.zyxan-select,
.zyxan-textarea {

    width: 100%;

    min-height: 38px;

    padding: 8px 12px;

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-sm);

    background: var(--zyxan-surface);

    color: var(--zyxan-text);

    font-family: inherit;

    font-size: var(--zyxan-fs-md);

    transition:

        border-color 0.15s var(--zyxan-ease),
        box-shadow 0.15s var(--zyxan-ease);

}

.zyxan-input:focus,
.zyxan-select:focus,
.zyxan-textarea:focus {

    outline: none;

    border-color: var(--zyxan-primary);

    box-shadow: 0 0 0 2px var(--zyxan-primary-soft);

}

.zyxan-input::placeholder {

    color: var(--zyxan-text-muted);

}



/* =========================================================
   CHECK OPTIONS (checkbox cards: title + note, in a grid)
   ========================================================= */

.zyxan-check-grid {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));

    gap: var(--zyxan-space-3);

}


.zyxan-check-option {

    display: flex;

    align-items: flex-start;

    gap: var(--zyxan-space-3);

    margin: 0;

    padding: var(--zyxan-space-3) 14px;

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-sm);

    background: var(--zyxan-surface);

    cursor: pointer;

    transition:

        border-color 0.15s var(--zyxan-ease),
        background 0.15s var(--zyxan-ease);

}

.zyxan-check-option:hover {

    border-color: var(--zyxan-gold-400);

}

.zyxan-check-option:focus-within {

    box-shadow: 0 0 0 2px var(--zyxan-primary-soft);

}

.zyxan-check-option.is-checked {

    border-color: var(--zyxan-primary);

    background: var(--zyxan-primary-soft);

}

.zyxan-check-option.is-disabled {

    cursor: default;

    opacity: 0.7;

}

.zyxan-check-option input[type="checkbox"] {

    flex: none;

    width: 16px;

    height: 16px;

    margin: 2px 0 0;

    accent-color: var(--zyxan-gold-600);

}


/* ---- text ---- */

.zyxan-check-option-body {

    display: flex;

    flex-direction: column;

    gap: 3px;

    min-width: 0;

}

.zyxan-check-option-title {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    color: var(--zyxan-text);

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

}

.zyxan-check-option-note {

    color: var(--zyxan-text-secondary);

    font-size: var(--zyxan-fs-sm);

    line-height: 1.4;

}

.zyxan-check-option-meta {

    display: flex;

    flex-wrap: wrap;

    gap: 4px;

    margin-top: 2px;

}



/* =========================================================
   FORM LAYOUT (metadata-driven forms)
   ========================================================= */

.zyxan-form-container {

    background: var(--zyxan-surface);

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-lg);

    box-shadow: var(--zyxan-shadow-sm);

    overflow: hidden;

}


.zyxan-form-header {

    display: flex;

    justify-content: space-between;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    gap: 20px;

    margin-bottom: 20px;

}


.zyxan-form-title {

    text-align: center;

    min-width: 0;

}


.zyxan-form-actions {

    display: flex;

    justify-content: flex-end;

    gap: 8px;

}


/* ---- tabs ---- */

.zyxan-form-tabs {

    display: flex;

    align-items: center;

    gap: 2px;

    padding: 0 20px;

    border-bottom: 1px solid var(--zyxan-line);

    overflow-x: auto;
    
    overflow-y: hidden;

}


.zyxan-form-tab-button {

    position: relative;

    padding: 15px 16px;

    border: none;

    background: transparent;

    color: var(--zyxan-text-secondary);

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    white-space: nowrap;

    cursor: pointer;

    transition: color 0.15s var(--zyxan-ease);

}

.zyxan-form-tab-button:hover {

    color: var(--zyxan-text);

}

.zyxan-form-tab-button:focus-visible {

    outline: none;

    box-shadow: inset 0 0 0 2px var(--zyxan-primary-soft);

}

.zyxan-form-tab-button.active {

    color: var(--zyxan-primary);

}

.zyxan-form-tab-button.active::after {

    content: "";

    position: absolute;

    left: 12px;

    right: 12px;

    bottom: -1px;

    height: 2px;

    background: var(--zyxan-primary);

}


.zyxan-tab-pane {

    display: none;

    padding: 24px;

}

.zyxan-tab-pane.active {

    display: block;

}


/* ---- sections & columns ---- */

.zyxan-form-section {

    margin-bottom: 26px;

}

.zyxan-form-section:last-child {

    margin-bottom: 0;

}


.zyxan-form-section-title {

    margin-bottom: 16px;

    padding-bottom: 9px;

    border-bottom: 1px solid var(--zyxan-line);

    color: var(--zyxan-text);

    font-size: var(--zyxan-fs-md);

    font-weight: 700;

}


.zyxan-form-section-columns {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 0 24px;

}


.zyxan-form-column {

    min-width: 0;

}


/* ---- Frappe field wrappers ---- */

.zyxan-field-wrapper {

    margin-bottom: 17px;

}


.zyxan-field-wrapper .control-label {

    margin-bottom: 6px;

    color: var(--zyxan-text-secondary);

    font-size: var(--zyxan-fs-sm);

    font-weight: 600;

}


.zyxan-field-wrapper .form-control {

    min-height: 38px;

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-sm);

    background: var(--zyxan-surface);

    color: var(--zyxan-text);

    font-size: var(--zyxan-fs-md);

    transition:

        border-color 0.15s var(--zyxan-ease),
        box-shadow 0.15s var(--zyxan-ease);

}

.zyxan-field-wrapper .form-control:focus {

    border-color: var(--zyxan-primary);

    box-shadow: 0 0 0 2px var(--zyxan-primary-soft);

}

.zyxan-field-wrapper textarea.form-control {

    min-height: 90px;

}

.zyxan-field-wrapper .ql-container {

    border-color: var(--zyxan-line);

}


/* ---- Link / autocomplete dropdown (awesomplete) ----
   Frappe renders a Link field's option list as `.awesomplete > ul`. Give it a
   proper floating panel so options are readable and not clipped/faint inside
   the app's cards. */

.zyxan-field-wrapper .awesomplete {
    display: block;
    position: relative;
    width: 100%;
}

.zyxan-field-wrapper .awesomplete > ul {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1000;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    background: var(--zyxan-surface, #fff);
    border: 1px solid var(--zyxan-line, #e5e7eb);
    border-radius: var(--zyxan-radius-sm, 6px);
    box-shadow: var(--zyxan-shadow-lg, 0 10px 24px rgba(0, 0, 0, 0.12));
}

/* awesomplete hides the list with [hidden]; keep that working */
.zyxan-field-wrapper .awesomplete > ul[hidden],
.zyxan-field-wrapper .awesomplete > ul:empty {
    display: none;
}

.zyxan-field-wrapper .awesomplete > ul > li {
    padding: 7px 10px;
    border-radius: var(--zyxan-radius-sm, 6px);
    font-size: var(--zyxan-fs-md);
    color: var(--zyxan-text, #111827);
    cursor: pointer;
    white-space: normal;
}

.zyxan-field-wrapper .awesomplete > ul > li:hover,
.zyxan-field-wrapper .awesomplete > ul > li[aria-selected="true"] {
    background: var(--zyxan-primary-soft, #dbeafe);
    color: var(--zyxan-primary, #2563eb);
}

.zyxan-field-wrapper .awesomplete mark {
    background: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0;
}


/* ---- mandatory star ---- */

.zyxan-required-star {

    color: var(--zyxan-danger);

    font-weight: 700;

}


/* ---- table field (child-grid) ---- */

.zyxan-table-wrapper {

    grid-column: 1 / -1;

    margin-bottom: 24px;

}

.zyxan-table-wrapper .form-grid {

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-sm);

    overflow: hidden;

}



/* =========================================================
   STATES (empty / loading / error)
   ========================================================= */

.zyxan-empty-state,
.zyxan-error-state {

    padding: 50px 20px;

    text-align: center;

    color: var(--zyxan-text-muted);

    font-size: var(--zyxan-fs-md);

}

.zyxan-error-state {

    color: var(--zyxan-danger);

}


.zyxan-loading-state {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 50px 20px;

    text-align: center;

    color: var(--zyxan-text-muted);

    font-size: var(--zyxan-fs-md);

}

.zyxan-loading-state::before {

    content: "";

    width: 16px;

    height: 16px;

    border: 2px solid var(--zyxan-line);

    border-top-color: var(--zyxan-primary);

    border-radius: 50%;

    animation: zyxan-spin 0.8s linear infinite;

}

@keyframes zyxan-spin {

    to { transform: rotate(360deg); }

}

.zyxan-empty-state svg,
.zyxan-error-state svg {

    display: block;

    margin: 0 auto 12px;

    font-size: 30px;

}


/* =========================================================
   PAGER (Prev / Next under a paged table)
   ========================================================= */

.zyxan-pager {

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: var(--zyxan-space-3);

    padding: var(--zyxan-space-3) 0;

}

.zyxan-pager[hidden] {

    display: none;

}

.zyxan-pager-info {

    color: var(--zyxan-text-muted);

    font-size: var(--zyxan-fs-sm);

}


/* =========================================================
   SEGMENTED CONTROL (toolbar toggle / filter)
   ========================================================= */

.zyxan-segmented {

    display: inline-flex;

    align-items: center;

    gap: 4px;

    padding: 3px;

    background: var(--zyxan-background);

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-sm);

}

.zyxan-segmented-item {

    border: none;

    background: transparent;

    border-radius: 6px;

    padding: 6px 12px;

    font-family: inherit;

    font-size: var(--zyxan-fs-sm);

    font-weight: 600;

    color: var(--zyxan-text-secondary);

    cursor: pointer;

    transition:
        background 0.15s var(--zyxan-ease),
        color 0.15s var(--zyxan-ease);

}

.zyxan-segmented-item:hover {

    color: var(--zyxan-text);

}

.zyxan-segmented-item.active {

    background: var(--zyxan-surface);

    color: var(--zyxan-text);

    box-shadow: var(--zyxan-shadow-sm);

}


/* =========================================================
   TOOLTIP
   ========================================================= */

.zyxan-tooltip {

    position: absolute;

    top: 0;

    left: 0;

    z-index: 5;

    will-change: transform;

    min-width: 180px;

    max-width: 250px;

    padding: 12px 14px;

    background: var(--zyxan-surface);

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-md);

    box-shadow: var(--zyxan-shadow-lg);

    pointer-events: none;

}

.zyxan-tooltip[hidden] {

    display: none;

}

.zyxan-tooltip-head {

    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 8px;

}

.zyxan-tooltip-title {

    font-size: var(--zyxan-fs-md);

    font-weight: 700;

    color: var(--zyxan-text);

}

.zyxan-tooltip-sub {

    font-size: var(--zyxan-fs-xs);

    color: var(--zyxan-text-muted);

}

.zyxan-tooltip-rows {

    display: flex;

    flex-direction: column;

    gap: 4px;

}


/* =========================================================
   DETAIL PANEL (label/value rows + clickable item list)
   ========================================================= */

.zyxan-detail-rows {

    display: flex;

    flex-direction: column;

    gap: 10px;

}

.zyxan-detail-row {

    display: flex;

    align-items: baseline;

    justify-content: space-between;

    gap: 12px;

}

.zyxan-detail-label {

    font-size: var(--zyxan-fs-xs);

    color: var(--zyxan-text-muted);

    text-transform: uppercase;

    letter-spacing: 0.04em;

    white-space: nowrap;

}

.zyxan-detail-value {

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    color: var(--zyxan-text);

    text-align: right;

    word-break: break-word;

}

.zyxan-detail-list-title {

    padding: 14px 20px 8px;

    font-size: var(--zyxan-fs-xs);

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.04em;

    color: var(--zyxan-text-muted);

}

.zyxan-detail-list {

    display: flex;

    flex-direction: column;

    gap: 2px;

    padding: 0 12px 16px;

    max-height: 360px;

    overflow-y: auto;

}

.zyxan-detail-item {

    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    padding: 8px;

    border: none;

    background: transparent;

    border-radius: var(--zyxan-radius-sm);

    font-family: inherit;

    text-align: left;

    cursor: pointer;

    transition: background 0.12s var(--zyxan-ease);

}

.zyxan-detail-item:hover {

    background: var(--zyxan-background);

}

.zyxan-detail-item-info {

    min-width: 0;

    display: flex;

    flex-direction: column;

}

.zyxan-detail-item-name {

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    color: var(--zyxan-text);

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}

.zyxan-detail-item-meta {

    font-size: var(--zyxan-fs-xs);

    color: var(--zyxan-text-muted);

}

.zyxan-detail-none {

    padding: 10px 8px;

    color: var(--zyxan-text-muted);

    font-size: var(--zyxan-fs-sm);

}


/* =========================================================
   OVERLAY (centres a state over a positioned parent)
   ========================================================= */

.zyxan-overlay {

    position: absolute;

    inset: 0;

    z-index: 4;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background: rgba(250, 249, 246, 0.82);

}

.zyxan-overlay[hidden] {

    display: none;

}



/* =========================================================
   MODAL (pattern for custom dialogs)
   ========================================================= */

.zyxan-modal {

    position: fixed;

    inset: 0;

    z-index: 1050;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

}


.zyxan-modal-backdrop {

    position: absolute;

    inset: 0;

    background: rgba(20, 22, 31, 0.5);

}


.zyxan-modal-dialog {

    position: relative;

    width: 100%;

    max-width: 520px;

    /* A dialog must never grow past the viewport: the overlay is
       position:fixed with no scroll, so a taller dialog pushes the
       footer (Save/Cancel) off-screen with no way to reach it. Cap the
       dialog and let the body scroll instead - 40px is the overlay's
       own padding, so the header and footer always stay on screen. */
    max-height: calc(100vh - 40px);

    display: flex;

    flex-direction: column;

    background: var(--zyxan-surface);

    border: 1px solid var(--zyxan-line);

    border-radius: var(--zyxan-radius-lg);

    box-shadow: var(--zyxan-shadow-lg);

}


.zyxan-modal-header {

    flex: 0 0 auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

    padding: 18px 20px;

    border-bottom: 1px solid var(--zyxan-line);

}

.zyxan-modal-body {

    flex: 1 1 auto;

    /* min-height:0 is what lets a flex child shrink below its content
       and scroll, instead of stretching the dialog past the viewport. */
    min-height: 0;

    padding: 20px;

    overflow-y: auto;

    /* overflow-y:auto alone would make overflow-x compute to auto too,
       which can raise a stray horizontal scrollbar for children that
       bleed into the padding (e.g. .zyxan-leave-policy-tabs). */
    overflow-x: hidden;

    overscroll-behavior: contain;

}

.zyxan-modal-footer {

    flex: 0 0 auto;

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 8px;

    padding: 14px 20px;

    border-top: 1px solid var(--zyxan-line);

}



/* =========================================================
   COLLAPSIBLE + TREE (chevron toggle, expandable nested list)
   ========================================================= */

/* ---- collapse button: .zyxan-icon-btn + chevron, aria-expanded drives it ---- */

.zyxan-collapse-btn svg {

    transition: transform 0.15s var(--zyxan-ease);

}

.zyxan-collapse-btn[aria-expanded="false"] svg {

    transform: rotate(-90deg);

}

/* ---- tree: ul.zyxan-tree > li.zyxan-tree-node > .zyxan-tree-row + ul.zyxan-tree ----
   Branch lines like a file tree: each child list hangs under its parent's
   toggle. A child that has siblings below it carries the trunk down its
   whole height (li::before); every child's row draws the trunk from its
   top to its middle plus the horizontal branch (row ::before / ::after), so
   branches meet the row's centre whatever its height and the last child
   ends in a corner (└─). */

.zyxan-tree {

    margin: 0;

    padding: 0;

    list-style: none;

}

/* 15px = row left padding (4px) + half a toggle (11px): the line starts under the parent's chevron */
.zyxan-tree .zyxan-tree {

    margin-left: 15px;

}

.zyxan-tree .zyxan-tree > .zyxan-tree-node {

    position: relative;

    padding-left: 18px;

}

.zyxan-tree .zyxan-tree > .zyxan-tree-node:not(:last-child)::before {

    content: "";

    position: absolute;

    top: 0;

    bottom: 0;

    left: 0;

    border-left: 1px solid var(--zyxan-ink-400);

}

/* -18px reaches back over the node's left padding to the trunk */
.zyxan-tree .zyxan-tree > .zyxan-tree-node > .zyxan-tree-row::before {

    content: "";

    position: absolute;

    top: 0;

    left: -18px;

    height: 50%;

    border-left: 1px solid var(--zyxan-ink-400);

}

.zyxan-tree .zyxan-tree > .zyxan-tree-node > .zyxan-tree-row::after {

    content: "";

    position: absolute;

    top: 50%;

    left: -18px;

    width: 22px;

    border-top: 1px solid var(--zyxan-ink-400);

}

.zyxan-tree-node.is-collapsed > .zyxan-tree {

    display: none;

}

.zyxan-tree-row {

    position: relative;

    display: flex;

    align-items: center;

    gap: 8px;

    min-height: 34px;

    padding: 6px 8px 6px 4px;

    border-radius: var(--zyxan-radius-sm);

    transition: background 0.12s var(--zyxan-ease);

}

.zyxan-tree-row:hover {

    background: var(--zyxan-background);

}

.zyxan-tree-toggle,
.zyxan-tree-spacer {

    position: relative;

    width: 22px;

    height: 22px;

    flex-shrink: 0;

}

/* a leaf has no toggle: its branch runs on through the spacer to the label */
.zyxan-tree .zyxan-tree .zyxan-tree-spacer::before {

    content: "";

    position: absolute;

    top: 50%;

    left: 0;

    right: 2px;

    border-top: 1px solid var(--zyxan-ink-400);

}

.zyxan-tree-toggle {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 0;

    border: none;

    border-radius: 6px;

    background: transparent;

    color: var(--zyxan-text-muted);

    cursor: pointer;

}

.zyxan-tree-toggle:hover {

    color: var(--zyxan-text);

}

.zyxan-tree-toggle:focus-visible {

    outline: none;

    box-shadow: 0 0 0 3px rgba(255, 186, 3, 0.35);

}

.zyxan-tree-toggle svg {

    transition: transform 0.15s var(--zyxan-ease);

}

.zyxan-tree-node.is-collapsed > .zyxan-tree-row .zyxan-tree-toggle svg {

    transform: rotate(-90deg);

}

.zyxan-tree-label {

    flex: 1;

    min-width: 0;

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 4px 8px;

    padding: 0;

    border: none;

    background: transparent;

    font-family: inherit;

    font-size: var(--zyxan-fs-md);

    font-weight: 600;

    color: var(--zyxan-text);

    text-align: left;

    cursor: pointer;

}

.zyxan-tree-label:hover {

    color: var(--zyxan-gold-700);

}

.zyxan-tree-note {

    font-size: var(--zyxan-fs-xs);

    font-weight: 500;

    color: var(--zyxan-text-muted);

}

.zyxan-tree-meta {

    flex-shrink: 0;

    font-size: var(--zyxan-fs-xs);

    color: var(--zyxan-text-secondary);

    white-space: nowrap;

    font-variant-numeric: tabular-nums;

}



/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

    .zyxan-form-section-columns {

        grid-template-columns: 1fr;

    }

}


@media (max-width: 800px) {

    .zyxan-form-header {

        grid-template-columns: 1fr;

    }

    .zyxan-form-title {

        text-align: left;

        order: -1;

    }

    .zyxan-form-actions {

        justify-content: flex-start;

    }

    .zyxan-table {

        min-width: 820px;

    }

    .zyxan-search {

        width: 100%;

    }

}


@media (max-width: 760px) {

    .zyxan-app {

        grid-template-columns: 1fr;

        grid-template-areas:

            "topbar"
            "content";

    }

    .zyxan-sidebar {

        display: none;

    }

    .zyxan-content {

        padding: 20px;

    }

}

/* ---------------------------------------------------------
   SHELL OVERRIDES (frappe chrome hidden, brand logo, topbar profile logout)
   --------------------------------------------------------- */

/* Hide Frappe's own desk navbar / footer on custom pages */
body.zyxan-page .main-section > header,
body.zyxan-page .main-section > footer {
    display: none !important;
}

/* Sidebar logo (SVG brand mark) */
.zyxan-sidebar .zyxan-brand-mark {
    background: transparent;
}

.zyxan-sidebar .zyxan-brand-mark img {
    display: block;
    width: 30px;
    height: 30px;
}

/* Topbar profile - click the avatar/name to open the logout menu */
.zyxan-topbar-user-wrap {
    position: relative;
}

.zyxan-topbar-user {
    border: none;
    border-left: 1px solid var(--zyxan-border);
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
    border-radius: 0;
}

.zyxan-topbar-user:hover {
    opacity: 0.85;
}

.zyxan-topbar-profile-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    max-width: calc(100vw - 40px);
    z-index: 40;
    background: var(--zyxan-surface);
    color: var(--zyxan-text);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-md);
    box-shadow: var(--zyxan-shadow-lg);
    padding: 8px;
}

.zyxan-topbar-profile-menu[hidden] {
    display: none;
}

.zyxan-profile-menu-label {
    font-size: var(--zyxan-fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--zyxan-text-muted);
    padding: 2px 6px 6px;
}

.zyxan-profile-menu-email {
    font-size: var(--zyxan-fs-md);
    font-weight: 600;
    padding: 0 6px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zyxan-profile-divider {
    height: 1px;
    background: var(--zyxan-line);
    margin: 4px 0 6px;
}

.zyxan-profile-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    font-size: var(--zyxan-fs-md);
    font-weight: 600;
    color: var(--zyxan-danger);
    text-align: left;
    padding: 8px 6px;
    border-radius: var(--zyxan-radius-sm);
    cursor: pointer;
    transition: background 0.15s var(--zyxan-ease);
}

.zyxan-profile-menu-item:hover {
    background: rgba(214, 84, 74, 0.08);
}


/* =========================================================
   CUSTOMER PROJECT PORTAL (/my-projects)
   A lightweight, sidebar-less shell for external customers. Reuses the
   design-system tokens, cards, badges and buttons; adds only the portal
   layout (topbar + responsive project grid).
   ========================================================= */

body.zyxan-portal {
    margin: 0;
    min-height: 100vh;
    background: var(--zyxan-background, var(--zyxan-bg));
    color: var(--zyxan-text);
    font-family: var(--zyxan-font-body, inherit);
}

.zyxan-portal-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--zyxan-topbar-height, 64px);
    padding: 0 28px;
    background: var(--zyxan-surface);
    border-bottom: 1px solid var(--zyxan-border);
}

.zyxan-portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zyxan-portal-brand .zyxan-brand-name {
    font-weight: 700;
    color: var(--zyxan-text);
}

/* ---- tab navigation ---- */

.zyxan-portal-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 26px;
    margin-right: auto;
}

.zyxan-portal-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--zyxan-radius-pill);
    font-size: var(--zyxan-fs-sm);
    font-weight: 600;
    color: var(--zyxan-text-secondary);
    text-decoration: none;
    transition: background 0.15s var(--zyxan-ease), color 0.15s var(--zyxan-ease);
}

.zyxan-portal-nav-item:hover {
    background: var(--zyxan-background);
    color: var(--zyxan-text);
}

.zyxan-portal-nav-item.active {
    background: var(--zyxan-primary-soft);
    color: var(--zyxan-gold-700);
}

/* ---- account chip ---- */

.zyxan-portal-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zyxan-portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 5px;
    background: var(--zyxan-background);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-pill);
}

.zyxan-portal-chip-avatar {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--zyxan-navy-900);
    color: var(--zyxan-white, #fff);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.zyxan-portal-chip-name {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--zyxan-fs-sm);
    font-weight: 600;
    color: var(--zyxan-text);
}

/* ---- page frame ---- */

.zyxan-portal-main {
    display: flex;
    justify-content: center;
    padding: 30px 28px 60px;
}

.zyxan-portal-shell {
    width: 100%;
    max-width: 1120px;
}

.zyxan-portal-hero {
    margin-bottom: 22px;
}

.zyxan-portal-hero .zyxan-h1 {
    margin: 0 0 4px;
}

.zyxan-portal-back {
    display: inline-block;
    margin-bottom: 8px;
    font-size: var(--zyxan-fs-sm);
    font-weight: 600;
    color: var(--zyxan-text-secondary);
    text-decoration: none;
}

.zyxan-portal-back:hover {
    color: var(--zyxan-primary);
}

/* ---- stat tiles ---- */

.zyxan-portal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.zyxan-portal-stat {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon value"
        "icon label";
    align-items: center;
    column-gap: 13px;
    padding: 16px 18px;
    background: var(--zyxan-surface);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-lg);
    box-shadow: var(--zyxan-shadow-sm);
}

.zyxan-portal-stat-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--zyxan-radius-md, 10px);
    color: var(--zyxan-ink-600);
    background: var(--zyxan-background);
}

.zyxan-portal-stat-icon.is-total { background: var(--zyxan-primary-soft); color: var(--zyxan-gold-700); }
.zyxan-portal-stat-icon.is-open  { background: #FBF1E2; color: #A36A1F; }
.zyxan-portal-stat-icon.is-done  { background: var(--zyxan-success-soft); color: var(--zyxan-success-text); }
.zyxan-portal-stat-icon.is-team  { background: #E9F0FA; color: #3D5F9E; }

.zyxan-portal-stat-value {
    grid-area: value;
    font-family: var(--zyxan-font-heading, inherit);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--zyxan-text);
}

.zyxan-portal-stat-label {
    grid-area: label;
    font-size: var(--zyxan-fs-xs);
    font-weight: 600;
    color: var(--zyxan-text-muted);
}

/* ---- section heading ---- */

.zyxan-portal-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.zyxan-portal-section-head .zyxan-h3 {
    margin: 0;
}

/* ---- project cards ---- */

.zyxan-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

/* each card is an <a>: card chrome without link styling */
.zyxan-portal-card {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--zyxan-surface);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-lg);
    box-shadow: var(--zyxan-shadow-sm);
    text-decoration: none;
    color: inherit;
    transition:
        transform 0.18s var(--zyxan-ease, ease),
        box-shadow 0.18s var(--zyxan-ease, ease),
        border-color 0.18s var(--zyxan-ease, ease);
}

.zyxan-portal-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--zyxan-shadow-lg);
    border-color: var(--zyxan-primary);
}

.zyxan-portal-card:focus-visible {
    outline: 2px solid var(--zyxan-primary);
    outline-offset: 2px;
}

/* status accent along the top edge */
.zyxan-portal-card-accent {
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--zyxan-primary);
}

.zyxan-portal-card-accent.is-done { background: var(--zyxan-success); }
.zyxan-portal-card-accent.is-cancelled { background: var(--zyxan-danger); }

.zyxan-portal-card-body {
    padding: 20px;
}

.zyxan-portal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.zyxan-portal-card-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--zyxan-radius-md, 10px);
    background: var(--zyxan-navy-900);
    color: var(--zyxan-white, #fff);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.zyxan-portal-card-title {
    margin: 0 0 10px;
    font-family: var(--zyxan-font-heading, inherit);
    font-size: var(--zyxan-fs-lg, 16px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--zyxan-text);
}

.zyxan-portal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    font-size: var(--zyxan-fs-sm);
}

.zyxan-portal-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--zyxan-text-muted);
    font-size: var(--zyxan-fs-xs);
    font-weight: 600;
}

/* ---- progress ---- */

.zyxan-portal-progress-head {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 6px;
    font-size: var(--zyxan-fs-xs);
    color: var(--zyxan-text-muted);
}

.zyxan-portal-progress-pct {
    font-size: var(--zyxan-fs-md);
    font-weight: 700;
    color: var(--zyxan-text);
}

.zyxan-portal-progress {
    height: 7px;
    border-radius: var(--zyxan-radius-pill);
    background: var(--zyxan-line);
    overflow: hidden;
}

.zyxan-portal-progress-bar {
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--zyxan-gold-600, #E0A500), var(--zyxan-primary));
    transition: width 0.4s var(--zyxan-ease, ease);
}

/* ---- card footer ---- */

.zyxan-portal-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--zyxan-line);
}

.zyxan-portal-card-cta {
    font-size: var(--zyxan-fs-xs);
    font-weight: 700;
    color: var(--zyxan-text-muted);
    transition: color 0.15s var(--zyxan-ease, ease);
}

.zyxan-portal-card:hover .zyxan-portal-card-cta {
    color: var(--zyxan-gold-700);
}

.zyxan-portal-card.is-opening {
    pointer-events: none;
    opacity: 0.6;
}

/* ---- empty state ---- */

.zyxan-portal-empty {
    padding: 56px 24px;
    text-align: center;
    color: var(--zyxan-text-muted);
}

.zyxan-portal-empty svg {
    display: block;
    margin: 0 auto 14px;
    color: var(--zyxan-ink-400, #B8B2A4);
}

.zyxan-portal-empty .zyxan-h3 {
    margin: 0 0 6px;
    color: var(--zyxan-text);
}

.zyxan-portal-empty p {
    margin: 0;
    line-height: 1.6;
}

/* ---- responsive ---- */

@media (max-width: 860px) {
    .zyxan-portal-topbar {
        height: auto;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }
    .zyxan-portal-nav {
        order: 3;
        width: 100%;
        margin: 0;
    }
    .zyxan-portal-top-right { margin-left: auto; }
}

@media (max-width: 600px) {
    .zyxan-portal-main { padding: 20px 16px 40px; }
    .zyxan-portal-grid { grid-template-columns: 1fr; }
    .zyxan-portal-chip-name { max-width: 110px; }
    .zyxan-portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* =========================================================
   PROJECT WALL - GRAPH
   Shared by the desk Page (zyxan-projectwall) and the customer-facing
   /project-wall website page. Moved here from the page's own stylesheet so a
   single copy serves both desk and web. Shell/cards/toolbar/buttons/tooltip
   come from the sections above; this is the graph canvas + D3 node styling.
   ========================================================= */

.zyxan-wall-card {
    overflow: hidden;
}

.zyxan-wall-header {
    align-items: flex-start;
}

.zyxan-wall-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 160px;
}

.zyxan-wall-counts {
    color: var(--zyxan-text-muted);
    font-size: var(--zyxan-fs-sm);
}

.zyxan-wall-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.zyxan-wall-zoom {
    font-size: 16px;
    line-height: 1;
}

.zyxan-wall-canvas {
    position: relative;
    height: calc(100vh - 300px);
    min-height: 480px;
    background:
        radial-gradient(circle at 1px 1px, rgba(20, 22, 31, 0.06) 1px, transparent 0)
        0 0 / 22px 22px,
        var(--zyxan-background);
    border-top: 1px solid var(--zyxan-line);
    overflow: hidden;
}

.zyxan-wall-svg {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

.zyxan-wall-svg:active {
    cursor: grabbing;
}

.zyxan-wall-node {
    cursor: pointer;
}

.zyxan-wall-node .zyxan-wall-shape {
    transition:
        opacity 0.15s var(--zyxan-ease),
        stroke-width 0.15s var(--zyxan-ease);
}

.zyxan-wall-dim {
    opacity: 0.12;
}

.zyxan-wall-node,
.zyxan-wall-link {
    transition: opacity 0.15s var(--zyxan-ease);
}

.zyxan-wall-link {
    stroke: #C9C4B6;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.zyxan-wall-link.zyxan-wall-dim {
    stroke: #D8D4C8;
}

.zyxan-wall-node-project .zyxan-wall-shape {
    fill: var(--zyxan-primary);
    stroke: var(--zyxan-gold-600);
    stroke-width: 1.5;
}

.zyxan-wall-node-project .zyxan-wall-label {
    fill: var(--zyxan-primary-text);
    font-family: var(--zyxan-font-body);
    font-size: 12.5px;
    font-weight: 700;
    pointer-events: none;
}

.zyxan-wall-node-project:hover .zyxan-wall-shape,
.zyxan-wall-node-project.zyxan-wall-node-selected .zyxan-wall-shape {
    stroke: var(--zyxan-navy-900);
    stroke-width: 2.5;
}

.zyxan-wall-node-selected .zyxan-wall-shape {
    filter: drop-shadow(0 4px 10px rgba(20, 22, 31, 0.28));
}

.zyxan-wall-status-dot {
    fill: var(--zyxan-ink-400);
    stroke: var(--zyxan-surface);
    stroke-width: 1.5;
    pointer-events: none;
}

.zyxan-wall-status-success { fill: var(--zyxan-success); }
.zyxan-wall-status-warning { fill: var(--zyxan-warning); }
.zyxan-wall-status-danger { fill: var(--zyxan-danger); }
.zyxan-wall-status-neutral { fill: var(--zyxan-ink-400); }

.zyxan-wall-node-employee .zyxan-wall-shape {
    fill: var(--zyxan-navy-800);
    stroke: var(--zyxan-navy-600);
    stroke-width: 1.5;
}

.zyxan-wall-node-employee .zyxan-wall-avatar {
    pointer-events: none;
}

.zyxan-wall-node-employee .zyxan-wall-initials {
    fill: var(--zyxan-surface);
    font-family: var(--zyxan-font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.zyxan-wall-node-employee:hover .zyxan-wall-shape,
.zyxan-wall-node-employee.zyxan-wall-node-selected .zyxan-wall-shape {
    stroke: var(--zyxan-primary);
    stroke-width: 3;
}

.zyxan-wall-legend {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--zyxan-surface);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-sm);
    box-shadow: var(--zyxan-shadow-sm);
}

.zyxan-wall-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--zyxan-fs-xs);
    font-weight: 600;
    color: var(--zyxan-text-secondary);
}

.zyxan-wall-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--zyxan-primary);
}

.zyxan-wall-legend-swatch.is-employee {
    border-radius: 50%;
    background: var(--zyxan-navy-800);
}

.zyxan-wall-empty {
    max-width: 340px;
}

@media (max-width: 800px) {
    .zyxan-wall-canvas {
        height: 62vh;
        min-height: 420px;
    }
}


/* =========================================================
   CUSTOMER PORTAL - MONTHLY BILLS
   ========================================================= */

.zyxan-bills-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--zyxan-space-5);
    padding: var(--zyxan-space-4) var(--zyxan-space-5);
    margin-bottom: var(--zyxan-space-4);
}

.zyxan-bills-month-field {
    width: min(260px, 100%);
}

.zyxan-bills-period {
    padding-bottom: var(--zyxan-space-2);
    color: var(--zyxan-text-muted);
    font-size: var(--zyxan-fs-md);
    font-weight: 600;
}

.zyxan-bills-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--zyxan-space-4);
    margin-bottom: var(--zyxan-space-6);
}

.zyxan-bills-summary[hidden],
.zyxan-bills-table-wrap[hidden],
.zyxan-bills-state[hidden] {
    display: none;
}

.zyxan-bills-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--zyxan-space-4);
    padding: var(--zyxan-space-4) var(--zyxan-space-5);
    background: var(--zyxan-surface);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-lg);
    box-shadow: var(--zyxan-shadow-sm);
}

.zyxan-bills-summary-label {
    color: var(--zyxan-text-muted);
    font-size: var(--zyxan-fs-sm);
    font-weight: 600;
}

.zyxan-bills-summary-value {
    color: var(--zyxan-text);
    font-family: var(--zyxan-font-heading, inherit);
    font-size: var(--zyxan-fs-xl);
    font-variant-numeric: tabular-nums;
}

.zyxan-bills-table {
    min-width: 700px;
}

.zyxan-bills-table .zyxan-bills-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.zyxan-bills-amount {
    font-weight: 700;
}

/* project name spans all of that project's employee rows */
.zyxan-bills-table .zyxan-bills-project-cell {
    vertical-align: top;
    font-weight: 600;
    border-right: 1px solid var(--zyxan-line);
}

.zyxan-bills-table .zyxan-bills-project-cell.is-last-group {
    border-bottom: none;
}

.zyxan-bills-state {
    overflow: hidden;
    text-align: center;
}

.zyxan-bills-state .zyxan-btn {
    margin: 0 auto var(--zyxan-space-4);
}

@media (max-width: 640px) {
    .zyxan-bills-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .zyxan-bills-month-field {
        width: 100%;
    }

    .zyxan-bills-period {
        padding-bottom: 0;
    }

    .zyxan-bills-summary {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CHILD-TABLE "EDITING ROW" POPUP (custom pages)
   Only Save and a close (X) are offered; Frappe's Delete, Insert
   Above/Below, Duplicate, Move and collapse buttons are hidden.
   !important is needed because Frappe toggles these with inline styles.
   ========================================================= */

.zyxan-row-form .grid-form-heading .row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--zyxan-space-2);
}

.zyxan-row-form .grid-form-heading .row-actions > .btn,
.zyxan-row-form .grid-footer-toolbar .row-actions {
    display: none !important;
}


/* =========================================================
   PROGRESS CHARTS (public/js/zyxan-progress-charts.js)
   Used by the Projects page Progress tab and the Reports
   page project progress report.
   ========================================================= */

.zyxan-pc-svg {
    display: block;
    max-width: 100%;
    height: auto;
    font-family: var(--zyxan-font-body);
}

.zyxan-pc-line {
    width: 100%;
}

.zyxan-pc-legend {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: var(--zyxan-fs-sm);
}

.zyxan-pc-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zyxan-pc-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.zyxan-pc-legend-label {
    flex: 1;
    color: var(--zyxan-text-secondary);
}

.zyxan-pc-legend-value {
    font-weight: 700;
    color: var(--zyxan-text);
    font-variant-numeric: tabular-nums;
}

.zyxan-pc-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zyxan-pc-bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 200px) 1fr 52px;
    align-items: center;
    gap: 12px;
    font-size: var(--zyxan-fs-sm);
}

.zyxan-pc-bar-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--zyxan-text-secondary);
    font-weight: 600;
}

.zyxan-pc-bar-track {
    height: 10px;
    border-radius: var(--zyxan-radius-pill);
    background: var(--zyxan-line);
    overflow: hidden;
}

.zyxan-pc-bar-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.4s var(--zyxan-ease);
}

.zyxan-pc-bar-value {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.zyxan-pc-mini {
    display: inline-block;
    width: 90px;
    height: 7px;
    border-radius: var(--zyxan-radius-pill);
    background: var(--zyxan-line);
    overflow: hidden;
    vertical-align: middle;
}

.zyxan-pc-mini-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}


/* View-only banner (zyxan-topbar.js): a page held as Read on Roles & Access */
.zyxan-readonly-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--zyxan-space-2);
    margin: var(--zyxan-space-4) var(--zyxan-space-6) 0;
    padding: var(--zyxan-space-3) var(--zyxan-space-4);
    border: 1px solid #F0D9B5;
    border-radius: var(--zyxan-radius-md);
    background: #FBF1E2;
    color: #7A4F14;
    font-size: 13px;
    line-height: 1.45;
}

.zyxan-readonly-banner-icon {
    display: inline-flex;
    flex-shrink: 0;
    margin-top: 1px;
}

.zyxan-readonly-banner-icon svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 640px) {
    .zyxan-readonly-banner {
        margin: var(--zyxan-space-3) var(--zyxan-space-4) 0;
    }
}


/* =========================================================
   CONTENT COMPONENTS
   Small building blocks pages compose instead of writing their own CSS:
   text helpers, section labels, rows, tiles, item rows, callouts, star
   ratings, quotes, the side menu, the password field and form errors.
   A page's own stylesheet keeps only what is unique to that page.
   ========================================================= */

/* ---- text helpers ---- */

.zyxan-text-strong {
    font-weight: 600;
    color: var(--zyxan-text);
}

/* a muted line under a title (table cells, list items) */
.zyxan-text-sub {
    margin-top: 2px;
    font-size: var(--zyxan-fs-sm);
    color: var(--zyxan-text-muted);
}

/* muted small text inline; normal weight even inside bold text */
.zyxan-text-small {
    font-size: var(--zyxan-fs-sm);
    font-weight: 400;
    color: var(--zyxan-text-muted);
}

.zyxan-text-pre {
    white-space: pre-line;
}

/* a hint under a field or block */
.zyxan-hint {
    margin: 6px 0 0;
    font-size: var(--zyxan-fs-sm);
    color: var(--zyxan-text-muted);
}

/* free text a person wrote (descriptions, notes): line breaks kept */
.zyxan-description {
    margin: 8px 0 0;
    max-width: 720px;
    color: var(--zyxan-text-secondary);
    white-space: pre-line;
}

.zyxan-cell-end {
    text-align: right;
    white-space: nowrap;
}

.zyxan-grow {
    flex: 1;
    min-width: 0;
}

/* a badge next to a page title */
.zyxan-h1 .zyxan-badge {
    vertical-align: middle;
    margin-left: 6px;
}

/* ← Back above a page title (ghost button lined up with the title) */
.zyxan-page-back {
    margin: 0 0 6px -10px;
}

.zyxan-empty-state p {
    margin: 0 0 14px;
}

.zyxan-empty-state p:last-child {
    margin-bottom: 0;
}


/* ---- section label: small uppercase heading ---- */

.zyxan-section-label {
    display: block;
    margin: 0 0 12px;
    font-size: var(--zyxan-fs-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--zyxan-text-muted);
}

/* a label above a value inside a tile */
.zyxan-section-label.is-field {
    margin: 12px 0 6px;
}

.zyxan-section-label.is-flush {
    margin: 0;
}

.zyxan-section-label .zyxan-text-small {
    text-transform: none;
    letter-spacing: 0;
}

.zyxan-section-gap {
    margin-top: var(--zyxan-space-6);
}

/* count next to a heading */
.zyxan-count {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    margin-left: 6px;
    border-radius: var(--zyxan-radius-pill);
    background: var(--zyxan-warning);
    color: #fff;
    text-align: center;
}


/* ---- rows and stacks ---- */

/* title on the left, badge / button on the right */
.zyxan-row-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.zyxan-row-between.is-center {
    align-items: center;
}

/* buttons at the end of a block */
.zyxan-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.zyxan-actions.is-flush {
    margin-top: 0;
}

.zyxan-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* a badge and a short note on one line (status of something) */
.zyxan-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 10px;
}

/* items one under another */
.zyxan-stack {
    display: flex;
    flex-direction: column;
    gap: var(--zyxan-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.zyxan-stack.is-tight {
    gap: var(--zyxan-space-2);
}

/* groups of items (e.g. one per category) */
.zyxan-stack.is-loose {
    gap: var(--zyxan-space-5);
}

/* rows separated by a line (e.g. requests in a card) */
.zyxan-list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--zyxan-line);
}

.zyxan-list-row:first-of-type {
    border-top: none;
}


/* ---- card modifiers ---- */

.zyxan-card.is-padded {
    padding: 18px 20px;
}

.zyxan-card.is-spaced {
    margin-bottom: var(--zyxan-space-5);
}

/* content (e.g. a flipping card) never spills over the rounded corners */
.zyxan-card.is-clipped {
    overflow: hidden;
}

/* detail value that may run over several lines (addresses, notes) */
.zyxan-detail-value-wrap {
    white-space: normal;
    text-align: right;
}

/* a card that needs attention (e.g. requests waiting) */
.zyxan-card.is-attention {
    border-left: 3px solid var(--zyxan-warning);
}


/* ---- tile: a bordered block inside a card or dialog ---- */

.zyxan-tile {
    padding: 14px 16px;
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-md);
    background: var(--zyxan-surface);
}

.zyxan-tile.is-success {
    border-left: 3px solid var(--zyxan-success);
}

.zyxan-tile.is-danger {
    border-left: 3px solid var(--zyxan-danger);
}

.zyxan-tile.is-warning {
    border-color: var(--zyxan-warning);
}


/* ---- item row: icon, title + meta, actions (documents, files, links) ---- */

.zyxan-item {
    display: flex;
    align-items: flex-start;
    gap: var(--zyxan-space-3);
    padding: var(--zyxan-space-3) var(--zyxan-space-4);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-md);
    background: var(--zyxan-surface);
}

.zyxan-item-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--zyxan-radius-sm);
    background: var(--zyxan-primary-soft);
    color: var(--zyxan-gold-700);
}

.zyxan-item-icon svg {
    width: 18px;
    height: 18px;
}

.zyxan-item-main {
    flex: 1;
    min-width: 0;
}

.zyxan-item-title {
    font-weight: 700;
    color: var(--zyxan-text);
    overflow-wrap: anywhere;
}

.zyxan-item-meta {
    margin-top: 2px;
    font-size: var(--zyxan-fs-sm);
    color: var(--zyxan-text-muted);
}

.zyxan-item-desc {
    margin-top: 6px;
    font-size: var(--zyxan-fs-sm);
    color: var(--zyxan-text-secondary);
    white-space: pre-line;
}

.zyxan-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.zyxan-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.zyxan-item-actions .zyxan-btn svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 720px) {
    .zyxan-item {
        flex-wrap: wrap;
    }

    .zyxan-item-actions {
        width: 100%;
        justify-content: flex-start;
        padding-left: 48px;
    }
}


/* ---- callout: a note, status or prompt inside content ---- */

.zyxan-callout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 14px 0;
    padding: 10px 14px;
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-sm);
    background: var(--zyxan-surface);
}

/* text that flows (headings, quotes) instead of a row */
.zyxan-callout.is-block {
    display: block;
}

.zyxan-callout-note {
    border-color: transparent;
    background: var(--zyxan-background);
    color: var(--zyxan-text-secondary);
}

.zyxan-callout-primary {
    border-color: var(--zyxan-primary);
    background: var(--zyxan-primary-soft);
}

.zyxan-callout-warning {
    border-color: var(--zyxan-warning);
    background: var(--zyxan-primary-soft);
}

.zyxan-callout-success {
    border-color: var(--zyxan-success);
    background: var(--zyxan-success-soft);
}

.zyxan-callout-danger {
    border-color: var(--zyxan-danger);
    background: #FBEDEC;
}

/* settled: done, nothing to do */
.zyxan-callout-done {
    border-color: transparent;
    background: var(--zyxan-success-soft);
    color: var(--zyxan-success-text);
    font-weight: 600;
}


/* ---- quote / note box: text someone wrote ---- */

.zyxan-quote {
    margin: 6px 0 0;
    font-style: italic;
    white-space: pre-line;
}

.zyxan-note-box {
    padding: 10px 12px;
    border-radius: var(--zyxan-radius-sm);
    background: var(--zyxan-background);
    white-space: pre-line;
}


/* ---- star rating: display (.zyxan-stars) and input (.zyxan-star-input) ---- */

.zyxan-stars {
    color: var(--zyxan-primary);
    letter-spacing: 1px;
}

.zyxan-stars .is-off {
    color: var(--zyxan-line);
}

.zyxan-stars.is-md {
    font-size: 16px;
}

.zyxan-star-input {
    display: inline-flex;
}

.zyxan-star-input[hidden] {
    display: none;
}

.zyxan-star {
    border: none;
    background: transparent;
    padding: 0 2px;
    font-size: 22px;
    line-height: 1;
    color: var(--zyxan-line);
    cursor: pointer;
}

.zyxan-star.is-on {
    color: var(--zyxan-primary);
}

.zyxan-star:focus-visible {
    outline: 2px solid var(--zyxan-primary-soft);
    border-radius: 4px;
}


/* ---- inline checkbox / radio with its label ---- */

.zyxan-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--zyxan-text-secondary);
    font-size: var(--zyxan-fs-sm);
    font-weight: 500;
    cursor: pointer;
}

.zyxan-check-inline.is-strong {
    color: var(--zyxan-text);
    font-size: var(--zyxan-fs-md);
    font-weight: 600;
}

/* check options (above): a disabled one dims its text; a long list scrolls */
.zyxan-check-option input:disabled + .zyxan-check-option-body {
    opacity: 0.6;
}

.zyxan-check-grid.is-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding: 2px;
}


/* ---- side menu next to the content (e.g. Settings sections) ---- */

.zyxan-subnav-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--zyxan-space-5);
    align-items: start;
}

.zyxan-subnav {
    position: sticky;
    top: var(--zyxan-topbar-height);
    padding: var(--zyxan-space-3);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-lg);
    background: var(--zyxan-surface);
    box-shadow: var(--zyxan-shadow-sm);
}

.zyxan-subnav .zyxan-section-label {
    margin: 0;
    padding: var(--zyxan-space-2) var(--zyxan-space-3);
}

.zyxan-subnav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zyxan-subnav-item {
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: var(--zyxan-radius-sm);
    background: transparent;
    color: var(--zyxan-text-secondary);
    font-family: inherit;
    font-size: var(--zyxan-fs-md);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s var(--zyxan-ease), color 0.15s var(--zyxan-ease);
}

.zyxan-subnav-item:hover {
    background: var(--zyxan-background);
    color: var(--zyxan-text);
}

.zyxan-subnav-item.active {
    background: var(--zyxan-primary-soft);
    color: var(--zyxan-gold-700);
}

.zyxan-subnav-main {
    min-width: 0;
}

@media (max-width: 900px) {
    .zyxan-subnav-layout {
        grid-template-columns: 1fr;
    }

    .zyxan-subnav {
        position: static;
    }
}


/* ---- password field with a show / hide button ---- */

.zyxan-password {
    position: relative;
}

.zyxan-password .zyxan-input {
    padding-right: 42px;
}

.zyxan-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: var(--zyxan-radius-sm);
    background: transparent;
    color: var(--zyxan-text-muted);
    font-size: 17px;
    cursor: pointer;
}

.zyxan-password-toggle:hover {
    color: var(--zyxan-text);
}

.zyxan-password-toggle:focus-visible {
    outline: 2px solid var(--zyxan-primary);
    outline-offset: 1px;
}


/* ---- form error above the actions ---- */

.zyxan-form-error {
    margin-bottom: 14px;
    padding: 9px 12px;
    border-radius: var(--zyxan-radius-sm);
    background: rgba(220, 38, 38, 0.08);
    color: var(--zyxan-danger);
    font-size: var(--zyxan-fs-sm);
}

.zyxan-form-error[hidden] {
    display: none;
}


/* Communication message opened from the bell (ZyxanTopbar.show_announcement) */
.zyxan-announcement-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--zyxan-space-2);
    margin-bottom: var(--zyxan-space-4);
    font-size: 13px;
    color: var(--zyxan-text-muted);
}

.zyxan-announcement-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--zyxan-text);
    overflow-wrap: anywhere;
}

.zyxan-announcement-body img {
    max-width: 100%;
    height: auto;
}


/* ---------------------------------------------------------
   CHIPS - toggle filters and removable picks
   ---------------------------------------------------------
   <div class="zyxan-chips"><button class="zyxan-chip is-on">Sales <span class="zyxan-chip-count">4</span></button></div>
   .is-removable: a pick with an × button inside. */
.zyxan-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.zyxan-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-pill);
    background: var(--zyxan-surface);
    color: var(--zyxan-text-secondary);
    font-size: var(--zyxan-fs-sm);
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
}

.zyxan-chip:hover {
    background: var(--zyxan-background);
}

.zyxan-chip.is-on {
    background: var(--zyxan-primary);
    border-color: var(--zyxan-primary);
    color: var(--zyxan-primary-text);
}

.zyxan-chip:focus-visible {
    outline: 2px solid var(--zyxan-primary);
    outline-offset: 1px;
}

.zyxan-chip-count {
    font-weight: 500;
    opacity: 0.7;
}

.zyxan-chip.is-removable {
    padding: 3px 4px 3px 10px;
    border-color: transparent;
    background: var(--zyxan-primary-soft);
    color: var(--zyxan-gold-700);
    cursor: default;
}

.zyxan-chip.is-removable button {
    padding: 0 6px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}


/* ---------------------------------------------------------
   PICKER - a search box with a dropdown of matches
   --------------------------------------------------------- */
.zyxan-picker {
    position: relative;
    max-width: 480px;
}

.zyxan-picker-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    margin: 0;
    padding: 4px;
    overflow: auto;
    list-style: none;
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-md);
    background: var(--zyxan-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.zyxan-picker-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: var(--zyxan-radius-sm);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.zyxan-picker-option:hover {
    background: var(--zyxan-background);
}

.zyxan-picker-empty {
    padding: 8px 10px;
    font-size: var(--zyxan-fs-sm);
    color: var(--zyxan-text-muted);
}

.zyxan-picker + .zyxan-chips {
    margin-top: var(--zyxan-space-2);
}


/* ---------------------------------------------------------
   AUDIENCE PICKER (zyxan-audience.js) - everyone, or filters + names
   --------------------------------------------------------- */
.zyxan-audience-mode {
    display: flex;
    flex-wrap: wrap;
    gap: var(--zyxan-space-2) var(--zyxan-space-5);
    margin-bottom: var(--zyxan-space-3);
}

.zyxan-audience-filter {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: var(--zyxan-space-3);
    align-items: start;
    padding: var(--zyxan-space-2) 0;
    border-top: 1px solid var(--zyxan-line);
}

.zyxan-audience-filter:first-child {
    border-top: 0;
}

.zyxan-audience-filter-label {
    padding-top: 6px;
    font-size: var(--zyxan-fs-sm);
    font-weight: 600;
    color: var(--zyxan-text-secondary);
}

.zyxan-audience .zyxan-field {
    margin-top: var(--zyxan-space-3);
}

@media (max-width: 720px) {
    .zyxan-audience-filter {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}


/* ---------------------------------------------------------
   PROGRESS BAR
   ---------------------------------------------------------
   <div class="zyxan-progress"><span style="width:40%"></span></div>
   .is-success: the full / completed bar. */
.zyxan-progress {
    height: 8px;
    overflow: hidden;
    border-radius: var(--zyxan-radius-pill);
    background: var(--zyxan-line);
}

.zyxan-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--zyxan-primary);
    transition: width 0.25s ease;
}

.zyxan-progress.is-success > span {
    background: var(--zyxan-success);
}


/* ---------------------------------------------------------
   CARD GRID - cards side by side, wrapping (course cards, ...)
   --------------------------------------------------------- */
.zyxan-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--zyxan-space-4);
}

.zyxan-card-grid > .zyxan-card {
    display: flex;
    flex-direction: column;
    gap: var(--zyxan-space-2);
    margin: 0;
}

/* a whole card that opens something */
.zyxan-card.is-link {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.zyxan-card.is-link:hover,
.zyxan-card.is-link:focus-visible {
    border-color: var(--zyxan-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    outline: none;
}

/* pushes what follows to the bottom of a flex column card */
.zyxan-push-end {
    margin-top: auto;
}


/* ---------------------------------------------------------
   CHECK OPTION - radio choices and marked answers
   ---------------------------------------------------------
   A radio works like the checkbox in .zyxan-check-option (one choice of
   several, e.g. an exam answer). After marking:
   .is-correct  the right answer      .is-wrong  a wrong choice */
.zyxan-check-option input[type="radio"] {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--zyxan-gold-600);
}

.zyxan-check-option.is-correct {
    border-color: var(--zyxan-success);
    background: var(--zyxan-success-soft);
}

.zyxan-check-option.is-wrong {
    border-color: var(--zyxan-danger);
    background: rgba(220, 38, 38, 0.06);
}

.zyxan-check-option.is-correct,
.zyxan-check-option.is-wrong {
    cursor: default;
}

/* an option's letter (A, B, ...) before its text */
.zyxan-option-key {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--zyxan-background);
    color: var(--zyxan-text-secondary);
    font-size: var(--zyxan-fs-xs);
    font-weight: 700;
}

.zyxan-check-option.is-checked .zyxan-option-key {
    background: var(--zyxan-primary);
    color: var(--zyxan-primary-text);
}

.zyxan-check-option.is-correct .zyxan-option-key {
    background: var(--zyxan-success);
    color: #fff;
}

.zyxan-check-option.is-wrong .zyxan-option-key {
    background: var(--zyxan-danger);
    color: #fff;
}


/* ---------------------------------------------------------
   BIG NUMBER - a headline figure (a score, a total)
   ---------------------------------------------------------
   <span class="zyxan-big-number">82<small>%</small></span> */
.zyxan-big-number {
    font-family: var(--zyxan-font-heading);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.zyxan-big-number small {
    font-size: var(--zyxan-fs-md);
    font-weight: 600;
    color: var(--zyxan-text-muted);
}


/* the options under a question (exam questions, answers): a tight stack of
   .zyxan-check-option; inside a tile they read as one block */
.zyxan-option-list {
    margin-top: 10px;
}

div.zyxan-option-list > .zyxan-check-option:not(label) {
    cursor: default;
}


/* =========================================================
   IN-APP DOCUMENT VIEWER (learning/viewer.js)
   A course file opened inside the app: a bar (title, status, page
   navigation, close), a thin bar for the current page's time, and the
   file - a PDF page on a canvas, an image, a video or plain text.
   Built on .zyxan-modal / .zyxan-modal-backdrop.
   ========================================================= */

body.zyxan-viewer-open {
    overflow: hidden;
}

.zyxan-viewer-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    overflow: hidden;
    background: var(--zyxan-surface);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-lg);
    box-shadow: var(--zyxan-shadow-lg);
}

.zyxan-viewer-bar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--zyxan-line);
}

.zyxan-viewer-title {
    flex: 1 1 220px;
    min-width: 0;
}

.zyxan-viewer-title .zyxan-text-strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zyxan-viewer-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.zyxan-viewer-nav[hidden],
.zyxan-viewer-meter[hidden] {
    display: none;
}

.zyxan-viewer-page-label {
    min-width: 92px;
    text-align: center;
    font-size: var(--zyxan-fs-sm);
    font-variant-numeric: tabular-nums;
    color: var(--zyxan-text-secondary);
}

.zyxan-viewer-meter .zyxan-progress {
    height: 4px;
    border-radius: 0;
}

.zyxan-viewer-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--zyxan-bg);
    user-select: none;
}

.zyxan-viewer-body:focus {
    outline: none;
}

.zyxan-viewer-body:focus-visible {
    box-shadow: inset 0 0 0 2px var(--zyxan-primary);
}

.zyxan-viewer-page,
.zyxan-viewer-image {
    display: block;
    max-width: 100%;
    height: auto;
    background: var(--zyxan-white);
    box-shadow: var(--zyxan-shadow-md);
}

.zyxan-viewer-video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    background: #000;
}

.zyxan-viewer-text {
    width: 100%;
    max-width: 900px;
    margin: 0;
    padding: 20px 24px;
    background: var(--zyxan-white);
    border: 1px solid var(--zyxan-line);
    border-radius: var(--zyxan-radius-md);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--zyxan-fs-md);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: text;
}

.zyxan-viewer .zyxan-error-state,
.zyxan-viewer .zyxan-loading-state {
    align-self: center;
}

/* phones: the viewer fills the screen */
@media (max-width: 640px) {
    .zyxan-viewer.zyxan-modal {
        padding: 0;
    }

    .zyxan-viewer-dialog {
        height: 100vh;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .zyxan-viewer-body {
        padding: 8px;
    }
}

/* text only screen readers hear (live updates and the like) */
.zyxan-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;
}

