/* =====================================================================
   Altraconex Admin — design system
   Loaded after the legacy style.css. New components use the "ax-" prefix;
   legacy.css (loaded only on the old list pages) re-skins them without
   touching their markup.
   ===================================================================== */

:root {
    --ax-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --ax-bg: #f3f5f9;
    --ax-surface: #ffffff;
    --ax-surface-2: #f8fafc;
    --ax-border: #e4e9f1;
    --ax-border-strong: #cdd6e3;
    --ax-text: #0f1b2d;
    --ax-text-2: #44546a;
    --ax-muted: #6b7a90;

    --ax-primary: #0b57a4;
    --ax-primary-hover: #094987;
    --ax-primary-soft: #e8f1fb;
    --ax-primary-ring: rgba(11, 87, 164, .22);
    --ax-accent: #00d9ad;
    --ax-accent-soft: #e0faf3;

    --ax-success: #0f7a56;
    --ax-success-soft: #e4f6ee;
    --ax-warning: #a4560a;
    --ax-warning-soft: #fff3df;
    --ax-danger: #bf3326;
    --ax-danger-soft: #fdeceb;
    --ax-info: #1769c2;
    --ax-info-soft: #e8f1fb;

    --ax-sidebar: #0b1c33;
    --ax-sidebar-text: #c3cfe2;

    --ax-radius: 14px;
    --ax-radius-sm: 10px;
    --ax-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --ax-shadow: 0 8px 28px rgba(16, 24, 40, .10);
    --ax-shadow-lg: 0 24px 60px rgba(16, 24, 40, .22);

    --ax-sidebar-w: 268px;
    --ax-topbar-h: 64px;
}

/* ---------------------------------------------------------------------
   Base (shell pages only: <body class="ax">)
   --------------------------------------------------------------------- */
html { height: 100%; }

body.ax {
    margin: 0;
    padding: 0 !important;
    height: 100vh;
    overflow: hidden;
    background: var(--ax-bg) !important;
    color: var(--ax-text) !important;
    font-family: var(--ax-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.ax a { color: var(--ax-primary); }
body.ax h1, body.ax h2, body.ax h3, body.ax h4, body.ax h5 { color: var(--ax-text); font-family: var(--ax-font); }
body.ax :focus-visible { outline: 3px solid var(--ax-primary-ring); outline-offset: 2px; border-radius: 6px; }
body.ax ::selection { background: var(--ax-primary-soft); }

.ax-muted { color: var(--ax-muted) !important; }
.ax-small { font-size: 12.5px; }
.ax-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.ax-hide { display: none !important; }
/* The legacy stylesheet sets `form div { display: inline-block }`: keep our block-level helpers intact inside forms. */
.ax-card-body, .ax-card-foot, .ax-stack, .ax-empty, .ax-help, .ax-error, .ax-input-group, .ax-cell-title, .ax-cell-sub,
.ax-doc-name, .ax-doc-meta, .ax-caps { display: block; }
.ax-caps:not(.is-on) { display: none; }
.ax-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ax-row { display: flex; align-items: center; gap: 12px; }
.ax-row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ax-spacer { flex: 1; }
.ax-grid { display: grid; gap: 16px; }
.ax-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ax-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ax-stack > * + * { margin-top: 16px; }
.ax-mt { margin-top: 20px; }

/* ---------------------------------------------------------------------
   App shell
   --------------------------------------------------------------------- */
.ax-app { display: flex; height: 100vh; }

.ax-sidebar {
    width: var(--ax-sidebar-w);
    flex: 0 0 var(--ax-sidebar-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(185deg, #0e2442 0%, var(--ax-sidebar) 55%, #08152a 100%);
    color: var(--ax-sidebar-text);
    z-index: 1030;
    transition: transform .25s ease;
}

.ax-brand {
    height: var(--ax-topbar-h);
    flex: 0 0 var(--ax-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.ax-brand a { display: flex; align-items: center; }
.ax-brand img { height: 30px; width: auto; display: block; }

.ax-nav { flex: 1; overflow-y: auto; padding: 10px 14px 24px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.ax-nav-label {
    padding: 18px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: rgba(195, 207, 226, .5);
}
.ax-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--ax-sidebar-text) !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}
.ax-nav a i { width: 18px; text-align: center; font-size: 15px; opacity: .8; }
.ax-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff !important; }
.ax-nav a.is-active { background: rgba(0, 217, 173, .13); color: #fff !important; }
.ax-nav a.is-active i { color: var(--ax-accent); opacity: 1; }
.ax-nav a.is-active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ax-accent);
}
.ax-count {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--ax-accent);
    color: #04261f;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ax-sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: rgba(195, 207, 226, .6); }
.ax-sidebar-foot .ax-portal { display: flex; align-items: center; gap: 8px; }
.ax-dot { width: 8px; height: 8px; border-radius: 50%; background: #7b8aa3; display: inline-block; }
.ax-dot.ok { background: var(--ax-accent); box-shadow: 0 0 0 3px rgba(0, 217, 173, .18); }
.ax-dot.ko { background: #ff6b5e; box-shadow: 0 0 0 3px rgba(255, 107, 94, .18); }

.ax-stage { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; }

.ax-topbar {
    height: var(--ax-topbar-h);
    flex: 0 0 var(--ax-topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--ax-border);
    position: relative;
    z-index: 1020;
}
.ax-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--ax-muted); }
.ax-crumbs strong { color: var(--ax-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-crumbs i { margin: 0; font-size: 10px; opacity: .6; }

.ax-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ax-text-2);
    cursor: pointer;
    font-size: 16px;
}
.ax-icon-btn:hover { background: var(--ax-surface-2); border-color: var(--ax-border); }
.ax-burger { display: none; }

.ax-user { position: relative; }
.ax-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--ax-border);
    border-radius: 999px;
    background: #fff;
    color: var(--ax-text);
    cursor: pointer;
    font: 500 13px var(--ax-font);
}
.ax-user-btn:hover { border-color: var(--ax-border-strong); }
.ax-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ax-primary), #2a86e0);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.ax-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 260px;
    padding: 6px;
    display: none;
    background: #fff;
    border: 1px solid var(--ax-border);
    border-radius: 14px;
    box-shadow: var(--ax-shadow);
    z-index: 1100;
}
.ax-menu.is-open { display: block; }
.ax-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--ax-border); margin-bottom: 6px; }
.ax-menu-head strong { display: block; }
.ax-menu a, .ax-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ax-text) !important;
    font: 500 14px var(--ax-font);
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
}
.ax-menu a:hover, .ax-menu button:hover { background: var(--ax-surface-2); }
.ax-menu form { margin: 0; }
.ax-menu .danger { color: var(--ax-danger) !important; }

.ax-scrim { display: none; position: fixed; inset: 0; background: rgba(8, 21, 42, .5); z-index: 1025; opacity: 0; transition: opacity .2s; }

.ax-main { flex: 1; min-height: 0; position: relative; overflow: auto; }
.ax-main--modern { padding: 28px 32px 56px; }

/* ---------------------------------------------------------------------
   Page header
   --------------------------------------------------------------------- */
.ax-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; }
.ax-page-head h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ax-page-head p { margin: 6px 0 0; color: var(--ax-muted); max-width: 720px; }
.ax-wrap { max-width: 1280px; margin: 0 auto; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
body.ax .ax-btn, .ax-auth .ax-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--ax-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ax-text) !important;
    font: 600 14px/1 var(--ax-font);
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
body.ax .ax-btn:hover, .ax-auth .ax-btn:hover { background: var(--ax-surface-2); border-color: #b3c0d3; }
body.ax .ax-btn:active, .ax-auth .ax-btn:active { transform: translateY(1px); }
body.ax .ax-btn[disabled], body.ax .ax-btn.is-loading, .ax-auth .ax-btn[disabled] { opacity: .6; cursor: not-allowed; pointer-events: none; }
body.ax .ax-btn-primary, .ax-auth .ax-btn-primary { background: var(--ax-primary); border-color: var(--ax-primary); color: #fff !important; }
body.ax .ax-btn-primary:hover, .ax-auth .ax-btn-primary:hover { background: var(--ax-primary-hover); border-color: var(--ax-primary-hover); }
body.ax .ax-btn-success { background: var(--ax-success); border-color: var(--ax-success); color: #fff !important; }
body.ax .ax-btn-success:hover { background: #0b6546; border-color: #0b6546; }
body.ax .ax-btn-danger { border-color: #efb5af; color: var(--ax-danger) !important; }
body.ax .ax-btn-danger:hover { background: var(--ax-danger-soft); border-color: #e48f86; }
body.ax .ax-btn-danger-solid { background: var(--ax-danger); border-color: var(--ax-danger); color: #fff !important; }
body.ax .ax-btn-danger-solid:hover { background: #a02a1f; border-color: #a02a1f; }
body.ax .ax-btn-ghost { background: transparent; border-color: transparent; }
body.ax .ax-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
body.ax .ax-btn-lg, .ax-auth .ax-btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
body.ax .ax-btn-block, .ax-auth .ax-btn-block { width: 100%; }
.ax-btn .ax-spin { width: 14px; height: 14px; border-width: 2px; }

/* style.css restyles a few glyphs globally (size, colour, position): keep them neutral inside buttons and toasts */
body.ax .ax-btn i, body.ax .ax-icon-btn i, body.ax .ax-toast i {
    position: static;
    width: auto;
    margin: 0;
    border: 0;
    line-height: 1;
    color: inherit;
    font-size: inherit;
    cursor: inherit;
}
body.ax .ax-icon-btn i { font-size: 16px; }
body.ax .ax-toast button i { color: rgba(255, 255, 255, .65); font-size: 13px; }

.ax-spin {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(15, 27, 45, .15);
    border-top-color: var(--ax-primary);
    border-radius: 50%;
    animation: ax-rot .7s linear infinite;
}
.ax-btn-primary .ax-spin, .ax-auth .ax-btn-primary .ax-spin { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes ax-rot { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Cards, KPIs, badges
   --------------------------------------------------------------------- */
.ax-card { display: block; background: var(--ax-surface); border: 1px solid var(--ax-border); border-radius: var(--ax-radius); box-shadow: var(--ax-shadow-sm); }
.ax-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--ax-border); }
.ax-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ax-card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ax-muted); }
.ax-card-body { padding: 20px; }
.ax-card-body.flush { padding: 0; }
.ax-card-foot { padding: 14px 20px; border-top: 1px solid var(--ax-border); background: var(--ax-surface-2); border-radius: 0 0 var(--ax-radius) var(--ax-radius); }

.ax-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ax-kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--ax-surface);
    border: 1px solid var(--ax-border);
    border-radius: 16px;
    box-shadow: var(--ax-shadow-sm);
    color: var(--ax-text) !important;
    text-decoration: none !important;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.ax-kpi:hover { transform: translateY(-2px); box-shadow: var(--ax-shadow); border-color: #c4d1e3; }
.ax-kpi .ico {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--ax-primary-soft);
    color: var(--ax-primary);
    font-size: 19px;
}
.ax-kpi .val { font-size: 27px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.ax-kpi .lbl { margin-top: 2px; font-size: 13px; color: var(--ax-muted); }
.ax-kpi.tone-warning .ico { background: var(--ax-warning-soft); color: var(--ax-warning); }
.ax-kpi.tone-success .ico { background: var(--ax-success-soft); color: var(--ax-success); }
.ax-kpi.tone-danger .ico { background: var(--ax-danger-soft); color: var(--ax-danger); }
.ax-kpi.tone-accent .ico { background: var(--ax-accent-soft); color: #00826a; }
.ax-kpi .go { position: static; width: auto; margin-left: auto; border: 0; line-height: 1; color: var(--ax-muted); font-size: 12px; }

.ax-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475467;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.ax-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ax-badge.no-dot::before { display: none; }
.ax-badge-success { background: var(--ax-success-soft); color: var(--ax-success); }
.ax-badge-warning { background: var(--ax-warning-soft); color: var(--ax-warning); }
.ax-badge-danger { background: var(--ax-danger-soft); color: var(--ax-danger); }
.ax-badge-info { background: var(--ax-info-soft); color: var(--ax-info); }
.ax-badge-neutral { background: #eef2f7; color: #475467; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.ax-field { display: block; margin-bottom: 16px; }
.ax-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ax-text-2); }
.ax-label .req { color: var(--ax-danger); }
body.ax .ax-input, body.ax .ax-select, body.ax .ax-textarea, .ax-auth .ax-input {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--ax-border-strong);
    border-radius: 10px !important;
    background: #fff;
    color: var(--ax-text);
    font: 400 14px var(--ax-font);
    transition: border-color .15s, box-shadow .15s;
}
body.ax .ax-textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
body.ax .ax-input::placeholder, .ax-auth .ax-input::placeholder { color: #98a4b8; }
body.ax .ax-input:focus, body.ax .ax-select:focus, body.ax .ax-textarea:focus, .ax-auth .ax-input:focus {
    outline: none;
    border-color: var(--ax-primary);
    box-shadow: 0 0 0 3px var(--ax-primary-ring);
}
.ax-help { margin-top: 6px; font-size: 12px; color: var(--ax-muted); }
.ax-field.has-error .ax-input, .ax-field.has-error .ax-select { border-color: var(--ax-danger); }
.ax-error { margin-top: 6px; font-size: 12px; color: var(--ax-danger); }
.ax-input-group { position: relative; }
.ax-input-group .ax-input, body.ax .ax-input-group .ax-input { padding-right: 44px; }
.ax-input-group .ax-addon {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ax-muted);
    cursor: pointer;
}
.ax-input-group .ax-addon:hover { background: var(--ax-surface-2); color: var(--ax-text); }

.ax-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ax-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    user-select: none;
}
.ax-check:hover { border-color: var(--ax-border-strong); }
.ax-check input { width: 18px; height: 18px; accent-color: var(--ax-primary); margin: 0; }
.ax-check:has(input:checked) { border-color: var(--ax-primary); background: var(--ax-primary-soft); }
.ax-check.is-disabled { opacity: .5; cursor: not-allowed; }

.ax-fieldset { border: 0; margin: 0 0 8px; padding: 0; }
.ax-legend { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ax-muted); }

/* ---------------------------------------------------------------------
   Tables & lists
   --------------------------------------------------------------------- */
.ax-table-wrap { overflow: auto; background: var(--ax-surface); border: 1px solid var(--ax-border); border-radius: var(--ax-radius); }
.ax-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ax-table th {
    position: sticky;
    top: 0;
    padding: 11px 16px;
    background: var(--ax-surface-2);
    border-bottom: 1px solid var(--ax-border);
    color: var(--ax-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.ax-table td { padding: 13px 16px; border-bottom: 1px solid var(--ax-border); vertical-align: middle; }
.ax-table tbody tr:last-child td { border-bottom: 0; }
.ax-table tbody tr:hover { background: #fafcff; }
.ax-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ax-cell-title { font-weight: 600; }
.ax-cell-sub { font-size: 12.5px; color: var(--ax-muted); }

.ax-empty { padding: 48px 24px; text-align: center; color: var(--ax-muted); }
.ax-empty i { display: block; margin-bottom: 14px; font-size: 34px; color: #b6c2d3; }
.ax-empty strong { display: block; margin-bottom: 4px; color: var(--ax-text); font-size: 15px; }

.ax-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.ax-search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.ax-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ax-muted); font-size: 13px; }
body.ax .ax-search .ax-input { padding-left: 38px; }

.ax-tabs { display: inline-flex; gap: 4px; padding: 4px; background: #e9eef5; border-radius: 12px; }
.ax-tab {
    padding: 7px 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ax-text-2);
    font: 600 13px var(--ax-font);
    cursor: pointer;
}
.ax-tab.is-active { background: #fff; color: var(--ax-text); box-shadow: var(--ax-shadow-sm); }
.ax-tab .n { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #d8e1ee; font-size: 11px; }
.ax-tab.is-active .n { background: var(--ax-primary-soft); color: var(--ax-primary); }

/* ---------------------------------------------------------------------
   Master / detail
   --------------------------------------------------------------------- */
.ax-split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ax-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 260px); overflow: auto; padding: 2px; }
.ax-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--ax-border);
    border-radius: 12px;
    color: var(--ax-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.ax-list-item:hover { border-color: #b3c0d3; }
.ax-list-item.is-active { border-color: var(--ax-primary); box-shadow: 0 0 0 3px var(--ax-primary-ring); }
.ax-list-item .t { font-weight: 600; line-height: 1.3; }
.ax-list-item .s { font-size: 12.5px; color: var(--ax-muted); }
.ax-list-item .body { min-width: 0; flex: 1; }
.ax-list-item .body > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-initial {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--ax-primary-soft);
    color: var(--ax-primary);
    font-weight: 700;
}
.ax-back { display: none; margin-bottom: 14px; }

.ax-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ax-detail-head h3 { margin: 0; font-size: 20px; font-weight: 700; }
.ax-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 24px; margin: 0; }
.ax-kv dt { margin: 0 0 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ax-muted); }
.ax-kv dd { margin: 0; word-break: break-word; }

.ax-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ax-checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.ax-checks .ico { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 10px; }
.ax-checks .ok .ico { background: var(--ax-success-soft); color: var(--ax-success); }
.ax-checks .warn .ico { background: var(--ax-warning-soft); color: var(--ax-warning); }
.ax-checks .bad .ico { background: var(--ax-danger-soft); color: var(--ax-danger); }

.ax-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ax-doc { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--ax-border); border-radius: 12px; }
.ax-doc.is-missing { background: var(--ax-surface-2); border-style: dashed; }
.ax-doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ax-doc-name { font-weight: 600; line-height: 1.3; }
.ax-doc-meta { font-size: 12.5px; color: var(--ax-muted); }
.ax-doc .ax-field { margin: 0; }

.ax-viewer { width: 100%; height: 74vh; border: 1px solid var(--ax-border); border-radius: 12px; background: #eef2f7; display: block; }

.ax-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 13.5px; }
.ax-alert i { margin-top: 3px; }
.ax-alert-info { background: var(--ax-info-soft); border-color: #bcd6f3; color: #0f4c8a; }
.ax-alert-success { background: var(--ax-success-soft); border-color: #b4e2cd; color: #0b5c40; }
.ax-alert-warning { background: var(--ax-warning-soft); border-color: #f2d19a; color: #7a3f06; }
.ax-alert-danger { background: var(--ax-danger-soft); border-color: #f2bdb7; color: #8f2217; }

.ax-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: ax-step; }
.ax-steps li { position: relative; padding-left: 40px; counter-increment: ax-step; }
.ax-steps li::before {
    content: counter(ax-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ax-primary-soft);
    color: var(--ax-primary);
    font-size: 12px;
    font-weight: 700;
}

/* ---------------------------------------------------------------------
   Toasts & modals
   --------------------------------------------------------------------- */
.ax-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.ax-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #0f1b2d;
    color: #fff;
    border-radius: 12px;
    box-shadow: var(--ax-shadow);
    font-size: 14px;
    animation: ax-in .22s ease;
}
.ax-toast .ico { margin-top: 2px; }
.ax-toast.success .ico { color: #4ade80; }
.ax-toast.error .ico { color: #ff8a80; }
.ax-toast.warning .ico { color: #ffc36b; }
.ax-toast.info .ico { color: #7cc0ff; }
.ax-toast button { margin-left: auto; padding: 0 0 0 8px; border: 0; background: none; color: rgba(255, 255, 255, .6); cursor: pointer; }
@keyframes ax-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

body.ax .modal-content {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    filter: none;
    background: #fff;
    color: var(--ax-text);
    border: 1px solid var(--ax-border);
    border-radius: 18px;
    box-shadow: var(--ax-shadow-lg);
}
body.ax .modal-header { padding: 18px 22px; border-bottom: 1px solid var(--ax-border); }
body.ax .modal-title { color: var(--ax-text); font-size: 17px; font-weight: 700; }
body.ax .modal-body { overflow: visible; padding: 22px; }
body.ax .modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--ax-border); }
body.ax .modal-backdrop { z-index: 1050; }
body.ax .modal { z-index: 1060; }
body.ax .modal.ax-viewer-modal .modal-dialog { max-width: min(1100px, 94vw); }

/* ---------------------------------------------------------------------
   Skeleton
   --------------------------------------------------------------------- */
.ax-skel { display: block; border-radius: 8px; background: linear-gradient(90deg, #eef2f7 25%, #e3e9f1 37%, #eef2f7 63%); background-size: 400% 100%; animation: ax-shimmer 1.2s ease infinite; }
@keyframes ax-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------------
   Login (standalone page: <body class="ax-auth-body">)
   --------------------------------------------------------------------- */
body.ax-auth-body { margin: 0; min-height: 100vh; background: #0b1c33; color: var(--ax-text); font-family: var(--ax-font); -webkit-font-smoothing: antialiased; }
.ax-auth { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; }
.ax-auth * { box-sizing: border-box; }
.ax-auth-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px 60px;
    color: #fff;
    background:
        radial-gradient(900px 520px at 8% -8%, rgba(42, 134, 224, .55), transparent 62%),
        radial-gradient(700px 480px at 105% 105%, rgba(0, 217, 173, .28), transparent 58%),
        linear-gradient(160deg, #0b1c33 0%, #0a2447 100%);
}
.ax-auth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 72%);
    mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 72%);
    pointer-events: none;
}
.ax-auth-hero > * { position: relative; z-index: 1; }
.ax-auth-logo img { height: 38px; width: auto; display: block; }
.ax-auth-hero .ax-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
}
.ax-auth-hero h1 { max-width: 560px; margin: 0 0 16px; color: #fff; font-size: 42px; font-weight: 700; line-height: 1.08; letter-spacing: -.025em; }
.ax-auth-hero p { max-width: 480px; margin: 0; color: rgba(255, 255, 255, .74); font-size: 16px; line-height: 1.6; }
.ax-auth-points { display: grid; gap: 14px; margin: 34px 0 0; padding: 0; list-style: none; }
.ax-auth-points li { display: flex; align-items: flex-start; gap: 12px; color: rgba(255, 255, 255, .86); font-size: 14.5px; }
.ax-auth-points svg { flex: 0 0 22px; margin-top: 1px; color: var(--ax-accent); }
.ax-auth-hero small { color: rgba(255, 255, 255, .5); }

.ax-auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; background: #fff; }
.ax-auth-card { width: 100%; max-width: 400px; }
.ax-auth-card .ax-auth-logo-sm { display: none; margin-bottom: 28px; }
.ax-auth-card .ax-auth-logo-sm img { height: 34px; }
.ax-auth-card h2 { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.ax-auth-card > p { margin: 0 0 26px; color: var(--ax-muted); }
.ax-auth-card .ax-alert { margin-bottom: 20px; }
.ax-auth-card label { display: block; margin-bottom: 6px; color: var(--ax-text-2); font-size: 13px; font-weight: 600; }
.ax-auth-card .ax-field { margin-bottom: 18px; }
.ax-auth-card .ax-input { height: 46px; font-size: 15px; }
.ax-auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 22px; font-size: 13.5px; }
.ax-auth-row a { color: var(--ax-primary); font-weight: 600; text-decoration: none; }
.ax-auth-row a:hover { text-decoration: underline; }
.ax-caps { display: none; margin-top: 8px; color: var(--ax-warning); font-size: 12.5px; font-weight: 600; }
.ax-caps.is-on { display: block; }
.ax-auth-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--ax-border); color: var(--ax-muted); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }

/* Legacy list / detail screens are styled in legacy.css (loaded only on those pages). */

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .ax-split { grid-template-columns: 1fr; }
    .ax-split.has-selection .ax-list-col { display: none; }
    .ax-split:not(.has-selection) .ax-detail-col { display: none; }
    .ax-back { display: inline-flex; }
    .ax-list { max-height: none; }
}

@media (max-width: 991px) {
    .ax-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-102%); box-shadow: var(--ax-shadow-lg); }
    .ax-sidebar.is-open { transform: none; }
    .ax-scrim { display: block; pointer-events: none; }
    .ax-scrim.is-open { opacity: 1; pointer-events: auto; }
    .ax-burger { display: inline-flex; }
    .ax-topbar { padding: 0 16px; }
    .ax-main--modern { padding: 20px 16px 48px; }
    .ax-page-head h2 { font-size: 22px; }
    .ax-user-btn .name { display: none; }
    .ax-grid-2, .ax-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
    .ax-auth { grid-template-columns: 1fr; }
    .ax-auth-hero { display: none; }
    .ax-auth-main { min-height: 100vh; align-items: flex-start; padding: 40px 22px; }
    .ax-auth-card .ax-auth-logo-sm { display: block; }
}

@media (max-width: 575px) {
    .ax-kpis { grid-template-columns: 1fr; }
    .ax-topbar { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
    .ax-sidebar, .ax-topbar, .ax-toasts { display: none !important; }
    body.ax { height: auto; overflow: visible; }
    .ax-main { overflow: visible; }
}
