:root {
    --af-accent: #ce7e00;
    --af-accent-dark: #a85f00;
    --af-accent-soft: #fff3df;
    --af-ink: #172033;
    --af-ink-soft: #475467;
    --af-muted: #667085;
    --af-line: #e4e7ec;
    --af-surface: #ffffff;
    --af-canvas: #f4f6f8;
    --af-sidebar: #111827;
    --af-sidebar-soft: #1f2937;
    --af-success: #157347;
    --af-danger: #b42318;
    --af-warning: #b54708;
    --af-info: #175cd3;
    --af-radius-sm: 8px;
    --af-radius: 14px;
    --af-radius-lg: 22px;
    --af-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --af-shadow: 0 10px 30px rgba(16, 24, 40, .08);
}

html {
    min-height: 100%;
    background: var(--af-canvas);
}

body,
button,
input,
select,
textarea {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--af-ink);
    background: var(--af-canvas);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--af-accent-dark);
    text-decoration: none;
}

a:hover,
a:focus {
    color: #7c4700;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 3px solid rgba(206, 126, 0, .38);
    outline-offset: 2px;
}

.wrapper {
    min-height: 100vh;
    background: var(--af-canvas);
}

/* Header */
.main-header.af-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1035;
    min-height: 64px;
    background: var(--af-surface);
    border-bottom: 1px solid var(--af-line);
    box-shadow: var(--af-shadow-sm);
}

.main-header.af-header .logo {
    height: 64px;
    line-height: 64px;
    padding: 0 20px;
    overflow: hidden;
    color: #fff;
    background: var(--af-sidebar);
    border-right: 1px solid rgba(255, 255, 255, .08);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.main-header.af-header .logo:hover {
    color: #fff;
    background: var(--af-sidebar-soft);
}

.af-brand-mark {
    display: inline-flex;
    width: 32px;
    height: 32px;
    margin-right: 9px;
    align-items: center;
    justify-content: center;
    color: #111827;
    background: var(--af-accent);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    vertical-align: middle;
}

.logo-mini .af-brand-mark {
    margin-right: 0;
}

.main-header.af-header .navbar {
    min-height: 64px;
    margin-left: 230px;
    padding: 0 18px 0 4px;
    background: var(--af-surface);
    border: 0;
}

.main-header.af-header .sidebar-toggle {
    display: inline-flex;
    width: 48px;
    height: 64px;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: var(--af-ink);
    background: transparent;
    font-size: 18px;
}

.main-header.af-header .sidebar-toggle::before {
    content: "\f0c9";
    font-family: FontAwesome;
}

.main-header.af-header .sidebar-toggle:hover,
.main-header.af-header .sidebar-toggle:focus {
    color: var(--af-ink);
    background: var(--af-accent-soft);
}

.af-header-title {
    display: inline-flex;
    min-height: 64px;
    margin-left: 8px;
    align-items: center;
    color: var(--af-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
}

.af-user-menu {
    display: flex;
    min-height: 64px;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.af-user-name {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    color: var(--af-ink-soft);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.af-user-avatar {
    display: inline-flex;
    width: 34px;
    height: 34px;
    margin-right: 7px;
    align-items: center;
    justify-content: center;
    color: var(--af-ink);
    background: var(--af-accent-soft);
    border: 1px solid #f5d5a1;
    border-radius: 50%;
}

.af-header-link {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 11px;
    align-items: center;
    gap: 7px;
    color: var(--af-ink-soft);
    border-radius: var(--af-radius-sm);
    font-weight: 600;
}

.af-header-link:hover,
.af-header-link:focus {
    color: var(--af-ink);
    background: var(--af-accent-soft);
}

/* Sidebar */
.main-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    padding-top: 64px;
    color: #d0d5dd;
    background: var(--af-sidebar);
    box-shadow: 8px 0 24px rgba(16, 24, 40, .08);
}

.sidebar {
    height: calc(100vh - 64px);
    padding: 14px 12px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #344054 transparent;
    scrollbar-width: thin;
}

.sidebar .user-panel {
    min-height: 0;
    margin: 0 2px 14px;
    padding: 14px;
    color: #f2f4f7;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
}

.af-sidebar-user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.af-sidebar-avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    color: #111827;
    background: var(--af-accent);
    border-radius: 10px;
}

.af-sidebar-user-copy {
    min-width: 0;
}

.af-sidebar-eyebrow {
    display: block;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.af-sidebar-email {
    display: block;
    overflow: hidden;
    color: #f2f4f7;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-menu {
    margin: 0;
    padding: 0;
}

.sidebar-menu > li.header {
    margin: 18px 10px 7px;
    padding: 0;
    color: #667085;
    background: transparent;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
}

.sidebar-menu > li > a,
.sidebar-menu .treeview-menu > li > a {
    margin: 2px 0;
    color: #cbd5e1;
    border-radius: 9px;
    transition: color .15s ease, background-color .15s ease, transform .15s ease;
}

.sidebar-menu > li > a {
    padding: 11px 12px;
    border-left: 0;
    font-size: 13px;
    font-weight: 650;
}

.sidebar-menu > li > a > .fa {
    width: 20px;
    color: #98a2b3;
}

.sidebar-menu > li:hover > a,
.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
    color: #fff;
    background: rgba(206, 126, 0, .18);
    border-left: 0;
}

.sidebar-menu > li.active > a > .fa,
.sidebar-menu > li.menu-open > a > .fa {
    color: var(--af-accent);
}

.sidebar-menu .treeview-menu {
    margin: 3px 0 7px;
    padding: 4px 0 4px 12px;
    background: transparent;
}

.sidebar-menu .treeview-menu > li > a {
    padding: 8px 10px 8px 31px;
    color: #98a2b3;
    font-size: 12px;
    line-height: 1.35;
}

.sidebar-menu .treeview-menu > li > a::before {
    position: absolute;
    left: 14px;
    width: 5px;
    height: 5px;
    margin-top: 6px;
    background: #475467;
    border-radius: 50%;
    content: "";
}

.sidebar-menu .treeview-menu > li.active > a,
.sidebar-menu .treeview-menu > li > a:hover,
.sidebar-menu .treeview-menu > li > a:focus {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.sidebar-menu .treeview-menu > li.active > a::before {
    background: var(--af-accent);
}

/* Main content */
.content-wrapper {
    min-height: 100vh !important;
    margin-left: 230px;
    padding-top: 64px;
    background: var(--af-canvas);
}

.content-header {
    padding: 28px 30px 12px;
}

.content-header > h1 {
    margin: 0;
    color: var(--af-ink);
    font-size: clamp(23px, 2.4vw, 32px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.2;
}

.content-header > h1 > small {
    display: block;
    margin-top: 6px;
    color: var(--af-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
}

.content-header > .breadcrumb {
    position: static;
    float: none;
    margin: 10px 0 0;
    padding: 0;
    color: var(--af-muted);
    background: transparent;
    font-size: 12px;
}

.content {
    min-height: calc(100vh - 184px);
    padding: 12px 30px 30px;
    overflow-x: hidden;
}

.antifire-page-surface {
    min-width: 0;
    padding: 24px;
    background: var(--af-surface);
    border: 1px solid rgba(228, 231, 236, .9);
    border-radius: var(--af-radius-lg);
    box-shadow: var(--af-shadow);
}

.antifire-page-surface::after {
    display: block;
    clear: both;
    content: "";
}

.antifire-page-surface > h1:first-child,
.antifire-page-surface > h2:first-child,
.antifire-page-surface > h3:first-child,
.antifire-page-surface > h4:first-child {
    margin-top: 0;
}

/* Bootstrap's legacy jumbotron class is still used by a few business views.
   Keep the unqualified component neutral so ordinary record text can never be
   placed on a dark hero background. The dashboard hero opts in explicitly. */
.jumbotron {
    display: block;
    min-height: 0;
    margin: 0 0 20px;
    padding: 24px;
    overflow: visible;
    color: var(--af-ink);
    background: #f8fafc;
    border: 1px solid var(--af-line);
    border-radius: 16px;
}

.jumbotron.af-home-hero {
    display: grid;
    min-height: 320px;
    margin: 0;
    padding: clamp(28px, 6vw, 72px);
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr);
    align-items: center;
    gap: 32px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 20%, rgba(206, 126, 0, .20), transparent 20rem),
        linear-gradient(135deg, #111827, #1f2937);
    border: 0;
    border-radius: 18px;
}

.jumbotron.af-home-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(32px, 5vw, 58px);
    font-weight: 780;
    letter-spacing: -.05em;
    line-height: 1.04;
}

.jumbotron.af-home-hero img {
    display: block;
    width: 100%;
    max-width: 360px;
    max-height: 190px;
    margin: auto;
    object-fit: contain;
    background: #fff;
    border: 10px solid #fff;
    border-radius: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--af-ink);
    font-weight: 700;
    letter-spacing: -.02em;
}

hr {
    border-color: var(--af-line);
    opacity: 1;
}

.text-muted {
    color: var(--af-muted) !important;
}

.text-primary {
    color: var(--af-accent-dark) !important;
}

.main-footer {
    margin-left: 230px;
    padding: 18px 30px;
    color: var(--af-muted);
    background: var(--af-surface);
    border-top: 1px solid var(--af-line);
    font-size: 12px;
}

@media (min-width: 768px) {
    .sidebar-mini.sidebar-collapse .main-header.af-header .logo {
        width: 50px;
        padding: 0;
    }

    .sidebar-mini.sidebar-collapse .main-header.af-header .logo > .logo-mini {
        display: block;
    }

    .sidebar-mini.sidebar-collapse .main-header.af-header .logo > .logo-lg {
        display: none;
    }

    .sidebar-mini.sidebar-collapse .main-header.af-header .navbar {
        margin-left: 50px;
    }

    .sidebar-mini.sidebar-collapse .content-wrapper,
    .sidebar-mini.sidebar-collapse .main-footer {
        margin-left: 50px !important;
    }
}

/* Cards, legacy boxes and panels */
.card,
.box,
.panel,
.well {
    margin-bottom: 20px;
    overflow: hidden;
    color: var(--af-ink);
    background: var(--af-surface);
    border: 1px solid var(--af-line);
    border-radius: var(--af-radius);
    box-shadow: var(--af-shadow-sm);
}

.card-header,
.box-header,
.panel-heading {
    min-height: 52px;
    padding: 15px 18px;
    color: var(--af-ink);
    background: #fafbfc;
    border: 0;
    border-bottom: 1px solid var(--af-line);
    font-size: 15px;
    font-weight: 700;
}

.card-body,
.box-body,
.panel-body {
    padding: 20px;
}

.card-footer,
.box-footer,
.panel-footer {
    padding: 14px 18px;
    background: #fafbfc;
    border-top: 1px solid var(--af-line);
}

.box.box-primary,
.box.box-info,
.box.box-success,
.box.box-warning,
.box.box-danger {
    border-top: 1px solid var(--af-line);
}

/* Heading elements otherwise keep the global dark heading colour even when a
   component supplies an intentional dark background and light foreground. */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.box-header h1,
.box-header h2,
.box-header h3,
.box-header h4,
.box-header h5,
.box-header h6,
.panel-heading h1,
.panel-heading h2,
.panel-heading h3,
.panel-heading h4,
.panel-heading h5,
.panel-heading h6,
.info-box h1,
.info-box h2,
.info-box h3,
.info-box h4,
.info-box h5,
.info-box h6,
[class*="bg-"] > h1,
[class*="bg-"] > h2,
[class*="bg-"] > h3,
[class*="bg-"] > h4,
[class*="bg-"] > h5,
[class*="bg-"] > h6 {
    color: inherit;
}

.modal-content,
.dropdown-menu {
    color: var(--af-ink);
    background: #fff;
}

.modal-header,
.modal-body,
.modal-footer {
    color: var(--af-ink);
}

.modal-title {
    color: inherit;
}

.dropdown-menu > li > a,
.dropdown-item {
    color: var(--af-ink-soft);
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--af-ink);
    background: var(--af-accent-soft);
}

/* Forms */
input,
select,
textarea,
.form-control {
    max-width: none;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    color: var(--af-ink);
    background-color: #fff;
    border: 1px solid #d0d5dd;
    border-radius: var(--af-radius-sm);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea,
textarea.form-control {
    min-height: 104px;
    resize: vertical;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #98a2b3;
    opacity: 1;
}

.form-control:disabled,
.form-control[readonly],
input:disabled,
input[readonly],
select:disabled,
textarea:disabled,
textarea[readonly] {
    color: #475467;
    background-color: #f2f4f7;
    opacity: 1;
    cursor: not-allowed;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--af-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(206, 126, 0, .16);
}

label,
.control-label {
    margin-bottom: 6px;
    color: #344054;
    font-size: 13px;
    font-weight: 650;
}

.form-group {
    margin-bottom: 18px;
}

.form-horizontal .control-label {
    padding-top: 10px;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 42px;
    color: var(--af-ink);
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: var(--af-radius-sm);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 34px;
    padding-left: 12px;
    color: var(--af-ink);
    line-height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #98a2b3;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple {
    color: #475467;
    background: #f2f4f7;
    opacity: 1;
}

.select2-dropdown,
.select2-results__option {
    color: var(--af-ink);
    background: #fff;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
    color: #111827;
    background: var(--af-accent-soft);
}

.input-validation-error {
    border-color: var(--af-danger) !important;
}

.field-validation-error,
.validation-summary-errors,
.text-danger {
    color: var(--af-danger) !important;
}

.validation-summary-errors {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: var(--af-radius-sm);
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0 7px 0 0;
    padding: 0;
    accent-color: var(--af-accent);
    vertical-align: middle;
}

/* Record details --------------------------------------------------------- */
.af-detail-surface {
    color: var(--af-ink);
}

.af-detail-heading {
    display: flex;
    margin-bottom: 18px;
    padding-bottom: 15px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--af-line);
}

.af-detail-heading h1,
.af-detail-heading h2,
.af-detail-heading h3,
.af-detail-heading h4 {
    margin: 0;
    color: var(--af-ink);
}

.af-detail-heading p {
    margin: 5px 0 0;
    color: var(--af-muted);
}

.af-detail-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: stretch;
    gap: 12px;
}

.af-detail-item {
    display: flex;
    min-width: 0;
    min-height: 78px;
    padding: 13px 15px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    color: var(--af-ink);
    background: #f8fafc;
    border: 1px solid var(--af-line);
    border-radius: 11px;
}

.af-detail-label {
    display: block;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.25;
    text-transform: uppercase;
}

.af-detail-value {
    display: block;
    min-width: 0;
    color: var(--af-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.af-detail-value:empty::after {
    color: #98a2b3;
    content: "Not provided";
    font-weight: 500;
}

.af-detail-value-multiline {
    white-space: pre-wrap;
}

.af-detail-item-wide {
    grid-column: span 2;
}

.af-detail-item-full {
    grid-column: 1 / -1;
}

.af-page-actions {
    display: flex;
    margin-top: 18px;
    padding-top: 16px;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--af-line);
}

.af-page-actions .btn {
    margin: 0;
}

/* Standard scaffolded Details views use definition lists. Give all of them
   the same readable label/value cards without touching their model bindings. */
.af-details-page .dl-horizontal {
    display: grid;
    width: 100%;
    margin: 18px 0 22px;
    overflow: hidden;
    grid-template-columns:
        minmax(135px, .38fr) minmax(180px, 1fr)
        minmax(135px, .38fr) minmax(180px, 1fr);
    color: var(--af-ink);
    background: #fff;
    border: 1px solid var(--af-line);
    border-radius: 12px;
}

.af-details-page .dl-horizontal > dt,
.af-details-page .dl-horizontal > dd {
    float: none;
    width: auto;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 13px 15px;
    overflow-wrap: anywhere;
    border-bottom: 1px solid #eef0f3;
}

.af-details-page .dl-horizontal > dt {
    color: #475467;
    background: #f8fafc;
    font-weight: 700;
    text-align: left;
    white-space: normal;
}

.af-details-page .dl-horizontal > dd {
    color: var(--af-ink);
    background: #fff;
    border-right: 1px solid #eef0f3;
    font-weight: 600;
}

.af-details-page .antifire-page-surface > p:last-child {
    display: flex;
    margin: 18px 0 0;
    padding-top: 16px;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--af-line);
}

.af-details-page .antifire-page-surface > p:last-child .btn {
    margin: 0;
}

/* Map and contextual information panels must always use explicit, matching
   foreground/background pairs. */
.af-map-surface {
    width: 100%;
    margin: 20px 0;
    padding: 10px;
    overflow: hidden;
    color: var(--af-ink);
    background: #fff;
    border: 1px solid var(--af-line);
    border-radius: 14px;
    box-shadow: var(--af-shadow-sm);
}

.af-map-surface #dvMap {
    width: 100% !important;
    height: clamp(320px, 52vh, 500px) !important;
    border-radius: 10px;
}

.af-info-panel {
    padding: 15px;
    color: #1849a9;
    background: #eff8ff;
    border: 1px solid #b2ddff;
    border-radius: 10px;
}

.af-info-panel h1,
.af-info-panel h2,
.af-info-panel h3,
.af-info-panel h4,
.af-info-panel h5,
.af-info-panel h6 {
    color: #1849a9;
}

.af-info-panel .table {
    margin: 0;
    color: #344054;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.af-info-panel .table > tbody > tr > th,
.af-info-panel .table > tbody > tr > td {
    padding: 8px 10px;
    color: #344054;
    background: transparent;
    border-bottom: 1px solid #d1e9ff;
}

.af-info-panel .table > tbody > tr:last-child > th,
.af-info-panel .table > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* Responsive Create / Edit / Delete views */
.af-crud-surface,
.af-crud-surface > form,
.af-crud-surface .form-horizontal {
    width: 100%;
    max-width: none;
}

.af-crud-page .af-crud-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    align-items: start;
    gap: 18px 20px;
}

.af-crud-page .af-crud-grid > h1,
.af-crud-page .af-crud-grid > h2,
.af-crud-page .af-crud-grid > h3,
.af-crud-page .af-crud-grid > h4,
.af-crud-page .af-crud-grid > h5,
.af-crud-page .af-crud-grid > h6,
.af-crud-page .af-crud-grid > hr,
.af-crud-page .af-crud-grid > .row,
.af-crud-page .af-crud-grid > fieldset,
.af-crud-page .af-crud-grid > .validation-summary-errors,
.af-crud-page .af-crud-grid > .validation-summary-valid,
.af-crud-page .af-crud-grid > .af-form-actions {
    grid-column: 1 / -1;
}

.af-crud-page .af-crud-grid > h1,
.af-crud-page .af-crud-grid > h2,
.af-crud-page .af-crud-grid > h3,
.af-crud-page .af-crud-grid > h4,
.af-crud-page .af-crud-grid > h5,
.af-crud-page .af-crud-grid > h6 {
    margin: 0;
}

.af-crud-page .af-crud-grid > hr {
    width: 100%;
    margin: -5px 0 2px;
}

.af-crud-page .af-crud-grid > .form-group {
    min-width: 0;
    min-height: 100%;
    margin: 0;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
}

.af-crud-page .af-crud-grid > .form-group > .control-label,
.af-crud-page .af-crud-grid > .form-group > [class*="col-"] {
    float: none;
    width: 100%;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
}

.af-crud-page .af-crud-grid > .form-group > .control-label {
    padding-top: 0;
    padding-bottom: 7px;
    text-align: left;
}

.af-crud-page .af-crud-grid > .form-group .checkbox {
    min-height: 32px;
    padding-top: 7px;
}

.af-crud-page .af-crud-grid > .af-form-wide {
    grid-column: span 2;
}

.af-crud-page .af-crud-grid > .af-form-actions,
.af-crud-page .af-crud-grid > .form-group:last-child {
    min-height: 0;
    padding: 16px 0 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--af-line);
    border-radius: 0;
}

.af-crud-page .af-crud-grid > .row {
    display: flex;
    margin-right: -8px;
    margin-left: -8px;
    flex-wrap: wrap;
}

.af-crud-page .af-crud-grid > .row > [class*="col-"] {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
}

.af-crud-page .select2-container {
    width: 100% !important;
}

.af-crud-delete .antifire-page-surface > h3 {
    margin: 0 0 20px;
    padding: 15px 18px;
    color: #912018;
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: 12px;
    font-size: 18px;
}

.af-crud-delete .dl-horizontal {
    display: grid;
    width: 100%;
    margin: 18px 0 22px;
    overflow: hidden;
    grid-template-columns: minmax(140px, .42fr) minmax(180px, 1fr) minmax(140px, .42fr) minmax(180px, 1fr);
    background: #fff;
    border: 1px solid var(--af-line);
    border-radius: 12px;
}

.af-crud-delete .dl-horizontal > dt,
.af-crud-delete .dl-horizontal > dd {
    float: none;
    width: auto;
    min-height: 48px;
    margin: 0;
    padding: 13px 15px;
    overflow-wrap: anywhere;
    border-bottom: 1px solid #eef0f3;
}

.af-crud-delete .dl-horizontal > dt {
    color: #475467;
    background: #f8fafc;
    text-align: left;
    white-space: normal;
}

.af-crud-delete .dl-horizontal > dd {
    color: var(--af-ink);
    border-right: 1px solid #eef0f3;
}

.af-crud-delete .form-actions {
    display: flex;
    padding-top: 16px;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--af-line);
}

/* Buttons */
.btn {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--af-radius-sm);
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 24, 40, .12);
}

.btn-primary {
    color: #151515;
    background: var(--af-accent);
    border-color: var(--af-accent);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    color: #111;
    background: #e09217;
    border-color: #e09217;
}

.btn-default,
.btn-secondary {
    color: #344054;
    background: #fff;
    border-color: #d0d5dd;
}

.btn-default:hover,
.btn-secondary:hover {
    color: var(--af-ink);
    background: #f9fafb;
    border-color: #98a2b3;
}

.btn-info {
    color: #1849a9;
    background: #eff8ff;
    border-color: #b2ddff;
}

.btn-success {
    color: #fff;
    background: var(--af-success);
    border-color: var(--af-success);
}

.btn-warning {
    color: #7a2e0e;
    background: #fef0c7;
    border-color: #fedf89;
}

.btn-danger {
    color: #fff;
    background: var(--af-danger);
    border-color: var(--af-danger);
}

.btn + .btn,
.btn + a.btn,
a.btn + .btn {
    margin-left: 5px;
}

/* Traditional HTML tables */
.antifire-page-surface .table,
.antifire-page-surface table.dataTable {
    width: 100% !important;
    margin: 16px 0;
    color: #344054;
    background: #fff;
    border: 1px solid var(--af-line);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
}

.antifire-page-surface .table > thead > tr > th {
    padding: 12px 14px;
    color: #475467;
    background: #f9fafb;
    border: 0;
    border-bottom: 1px solid var(--af-line);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
    vertical-align: middle;
}

.antifire-page-surface .table > tbody > tr > td {
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid #eef0f3;
    vertical-align: middle;
}

.antifire-page-surface .table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.antifire-page-surface .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #fcfcfd;
    background: #fcfcfd;
}

.antifire-page-surface .table-hover > tbody > tr:hover > * ,
.antifire-page-surface .table > tbody > tr:hover > td {
    background: #fffaf2;
}

.antifire-page-surface .table .form-control {
    min-width: 120px;
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
}

.table-responsive,
.af-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table.table-responsive {
    display: table;
    overflow: visible;
}

/* Alerts and status labels */
.alert {
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
}

.alert-success {
    color: #05603a;
    background: #ecfdf3;
    border-color: #abefc6;
}

.alert-danger {
    color: #912018;
    background: #fef3f2;
    border-color: #fecdca;
}

.alert-warning {
    color: #7a2e0e;
    background: #fffaeb;
    border-color: #fedf89;
}

.alert-info {
    color: #1849a9;
    background: #eff8ff;
    border-color: #b2ddff;
}

.label,
.badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
}

/* Shared standalone/auth layouts */
.af-standalone-body {
    padding: 0;
    background: var(--af-canvas);
}

.af-standalone-header {
    min-height: 64px;
    padding: 0 28px;
    color: #fff;
    background: var(--af-sidebar);
}

.af-standalone-header .container-fluid {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
}

.af-standalone-brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 17px;
    font-weight: 750;
}

.af-standalone-brand:hover,
.af-standalone-brand:focus {
    color: #fff;
}

.af-standalone-main {
    width: min(1180px, calc(100% - 32px));
    min-height: calc(100vh - 130px);
    margin: 24px auto;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--af-line);
    border-radius: var(--af-radius-lg);
    box-shadow: var(--af-shadow);
}

.af-standalone-footer {
    padding: 10px 24px 22px;
    color: var(--af-muted);
    text-align: center;
    font-size: 12px;
}

.af-auth-body {
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(206, 126, 0, .20), transparent 34rem),
        linear-gradient(145deg, #0b1220 0%, #111827 48%, #1f2937 100%);
}

.af-auth-shell {
    display: grid;
    min-height: calc(100vh - 48px);
    grid-template-columns: minmax(300px, .9fr) minmax(440px, 1.1fr);
    align-items: stretch;
}

.af-auth-story {
    display: flex;
    padding: clamp(36px, 7vw, 92px);
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.af-auth-story .af-brand-mark {
    width: 46px;
    height: 46px;
    margin: 0 0 24px;
    border-radius: 14px;
    font-size: 15px;
}

.af-auth-story h1 {
    max-width: 600px;
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(34px, 5vw, 62px);
    font-weight: 780;
    letter-spacing: -.055em;
    line-height: 1.02;
}

.af-auth-story p {
    max-width: 540px;
    margin: 0;
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.7;
}

.af-auth-points {
    display: flex;
    margin-top: 34px;
    flex-wrap: wrap;
    gap: 10px;
}

.af-auth-point {
    display: inline-flex;
    padding: 8px 11px;
    align-items: center;
    gap: 7px;
    color: #e5e7eb;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.af-auth-point .fa {
    color: var(--af-accent);
}

.af-auth-form-side {
    display: flex;
    padding: clamp(24px, 5vw, 72px);
    align-items: center;
    justify-content: center;
}

.af-login-card {
    width: min(100%, 480px);
    padding: clamp(28px, 5vw, 48px);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .30);
}

.af-login-logo {
    display: block;
    width: auto;
    max-width: 190px;
    max-height: 90px;
    margin: 0 0 26px;
    object-fit: contain;
}

.af-login-card h2 {
    margin: 0 0 8px;
    color: var(--af-ink);
    font-size: 28px;
    letter-spacing: -.035em;
}

.af-login-intro {
    margin: 0 0 28px;
    color: var(--af-muted);
}

.af-login-card .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.af-login-card .form-control {
    min-height: 48px;
    padding: 11px 13px;
    background: #fcfcfd;
}

.af-login-options {
    display: flex;
    margin: 3px 0 22px;
    align-items: center;
    justify-content: space-between;
}

.af-login-options label {
    margin: 0;
    font-weight: 600;
}

.af-login-submit {
    width: 100%;
    min-height: 48px;
    color: #111827;
    background: var(--af-accent);
    border-color: var(--af-accent);
    font-size: 14px;
}

.af-login-submit:hover,
.af-login-submit:focus {
    color: #111827;
    background: #e09217;
    border-color: #e09217;
}

.af-auth-footer {
    min-height: 48px;
    padding: 14px 24px;
    color: #98a2b3;
    text-align: center;
    font-size: 11px;
}

.af-auth-footer a {
    color: #f0b85e;
}

@media (max-width: 991px) {
    .main-header.af-header .logo {
        width: 64px;
        padding: 0;
    }

    .main-header.af-header .logo .logo-lg {
        display: none;
    }

    .main-header.af-header .logo .logo-mini {
        display: block;
    }

    .main-header.af-header .navbar {
        margin-left: 64px;
    }

    .content-header,
    .content {
        padding-right: 20px;
        padding-left: 20px;
    }

    .af-auth-shell {
        grid-template-columns: 1fr;
    }

    .af-auth-story {
        min-height: auto;
        padding: 42px 28px 16px;
    }

    .af-auth-story h1 {
        max-width: 720px;
        font-size: clamp(30px, 8vw, 48px);
    }

    .af-auth-form-side {
        padding: 24px 24px 46px;
    }
}

@media (max-width: 767px) {
    .main-header.af-header {
        min-height: 58px;
    }

    .main-header.af-header .logo {
        position: relative;
        float: left;
        width: 58px;
        height: 58px;
        line-height: 58px;
    }

    .main-header.af-header .navbar {
        min-height: 58px;
        margin-left: 58px;
        padding-right: 8px;
    }

    .main-header.af-header .sidebar-toggle {
        width: 44px;
        height: 58px;
    }

    .af-header-title,
    .af-user-name,
    .af-header-link span {
        display: none;
    }

    .af-user-menu {
        min-height: 58px;
    }

    .main-sidebar {
        padding-top: 58px;
    }

    .sidebar {
        height: calc(100vh - 58px);
    }

    .content-wrapper {
        margin-left: 0;
        padding-top: 58px;
    }

    .content-header {
        padding: 22px 14px 8px;
    }

    .content {
        padding: 10px 12px 24px;
    }

    .antifire-page-surface {
        padding: 16px;
        border-radius: 15px;
    }

    .jumbotron {
        padding: 18px;
    }

    .jumbotron.af-home-hero {
        min-height: 0;
        padding: 28px 20px;
        grid-template-columns: 1fr;
    }

    .jumbotron.af-home-hero img {
        max-width: 260px;
    }

    .af-detail-item-wide,
    .af-detail-item-full {
        grid-column: auto;
    }

    .af-details-page .dl-horizontal {
        grid-template-columns: minmax(0, 1fr);
    }

    .af-details-page .dl-horizontal > dt {
        min-height: 0;
        padding-bottom: 5px;
        border-bottom: 0;
    }

    .af-details-page .dl-horizontal > dd {
        min-height: 0;
        padding-top: 5px;
        border-right: 0;
    }

    .af-page-actions .btn {
        flex: 1 1 150px;
    }

    .af-map-surface {
        padding: 7px;
    }

    .af-map-surface #dvMap {
        height: 360px !important;
    }

    .main-footer {
        margin-left: 0;
        padding: 16px;
        text-align: center;
    }

    .main-footer .pull-right {
        display: none;
    }

    .form-horizontal .control-label {
        padding-top: 0;
        text-align: left;
    }

    .btn {
        margin-top: 4px;
        margin-bottom: 4px;
    }

    .btn + .btn,
    .btn + a.btn,
    a.btn + .btn {
        margin-left: 2px;
    }

    .af-standalone-header {
        padding: 0 14px;
    }

    .af-standalone-main {
        width: calc(100% - 20px);
        margin: 10px auto;
        padding: 16px;
        border-radius: 15px;
    }

    .af-auth-story {
        padding: 32px 20px 10px;
    }

    .af-auth-story p {
        font-size: 14px;
    }

    .af-auth-points {
        margin-top: 22px;
    }

    .af-auth-form-side {
        padding: 18px 14px 32px;
    }

    .af-login-card {
        padding: 26px 20px;
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Shared Tabulator surface -------------------------------------------------
   All management grids use the same compact, responsive interaction model.
   Export-only libraries are loaded on demand by AntifireTabulator.js. */
.af-table-shell {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 16px 0;
    overflow: visible;
    border: 1px solid var(--af-border, #d7dde5);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .07);
}

.antifire-page-surface img,
.antifire-page-surface svg,
.antifire-page-surface video,
.antifire-page-surface canvas {
    max-width: 100%;
    height: auto;
}

.antifire-page-surface iframe,
.antifire-page-surface object,
.antifire-page-surface embed {
    max-width: 100%;
}

.antifire-page-surface .select2-container,
.antifire-page-surface .input-group,
.antifire-page-surface fieldset {
    max-width: 100%;
}

.antifire-page-surface .btn-toolbar,
.antifire-page-surface .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.af-table-toolbar {
    position: relative;
    z-index: 12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 12px;
    padding: 12px;
    overflow: visible;
    border-bottom: 1px solid var(--af-border, #d7dde5);
    background: #f8fafc;
    border-radius: 13px 13px 0 0;
}

.af-column-search-row {
    display: flex;
    flex: 1 0 100%;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding: 7px 1px 2px;
    border-top: 1px solid #d7dde5;
    scrollbar-width: thin;
}

.af-column-search-field {
    display: flex;
    flex: 0 0 165px;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    margin: 0;
    color: #344054;
    font-size: 11px;
    font-weight: 600;
}

.af-column-search-field > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.af-column-search-field .form-control {
    width: 100%;
    height: 29px;
    min-height: 29px;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
}

.af-table-search {
    flex: 1 1 280px;
    max-width: 420px;
}

.af-table-search .form-control {
    width: 100%;
    min-height: 38px;
    margin: 0;
    border-radius: 9px;
}

.af-table-actions {
    position: relative;
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    gap: 6px;
    overflow: visible;
}

.af-table-actions .af-table-button {
    min-height: 36px;
    margin: 0;
    padding: 7px 12px;
    border-color: #cbd5e1;
    border-radius: 8px;
    color: #1f2937;
    background: #fff;
    font-weight: 600;
}

.af-table-actions .af-table-button:hover,
.af-table-actions .af-table-button:focus {
    border-color: var(--af-accent, #f59e0b);
    color: #111827;
    background: #fff8e7;
}

.af-column-picker {
    position: relative;
    display: inline-flex;
    overflow: visible;
}

.af-index-column-slot {
    position: relative;
    z-index: 1060;
    display: inline-flex;
    margin-left: 10px;
    vertical-align: middle;
    font-size: 12px;
    line-height: 1;
}

.af-index-column-slot[hidden] {
    display: none !important;
}

.af-index-column-slot .af-table-button {
    min-height: 32px;
    margin: -3px 0 0;
    padding: 6px 11px;
    border: 1px solid #a85f00;
    border-radius: 7px;
    color: #111827;
    background: #f59e0b;
    box-shadow: 0 3px 8px rgba(145, 82, 0, .2);
    font-size: 12px;
    font-weight: 700;
}

.af-index-column-slot .af-table-button:hover,
.af-index-column-slot .af-table-button:focus,
.af-index-column-slot .af-column-picker.is-open > .af-columns {
    border-color: #7c4500;
    color: #111827;
    background: #fbbf24;
}

.af-index-column-slot .af-columns-loading {
    cursor: wait;
    opacity: .75;
}

.af-columns .fa {
    margin-right: 6px;
}

.af-column-picker.is-open > .af-columns {
    border-color: var(--af-accent, #f59e0b);
    color: #111827;
    background: #fff8e7;
}

.af-column-menu {
    position: absolute;
    z-index: 1050;
    top: calc(100% + 6px);
    right: 0;
    width: min(320px, calc(100vw - 32px));
    max-height: min(62vh, 460px);
    padding: 10px;
    overflow: auto;
    overscroll-behavior: contain;
    color: #111827;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 18px 42px rgba(17, 24, 39, .22);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
}

.af-column-menu[hidden] {
    display: none !important;
}

.af-column-menu-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 3px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.af-column-count {
    color: #667085;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.af-column-list {
    display: grid;
    padding: 7px 0;
    gap: 2px;
}

.af-column-option {
    display: grid;
    margin: 0;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    color: #1f2937;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

.af-column-option:hover,
.af-column-option:focus-within {
    color: #111827;
    background: #f3f4f6;
}

.af-column-option input {
    width: 15px;
    height: 15px;
    margin: 1px 0 0;
    accent-color: #ce7e00;
}

.af-column-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.af-column-menu-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.af-column-menu-actions .af-table-button {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px;
}

.af-table-report-heading {
    padding: 18px 18px 4px;
    overflow-x: auto;
}

.af-table-report-heading table {
    width: 100%;
    margin: 0;
    border: 0;
}

.af-table-report-heading img {
    max-width: min(260px, 100%);
    height: auto;
}

.af-tabulator.tabulator {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0 0 13px 13px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
}

.af-tabulator .tabulator-tableholder {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-color: #667085 #eef1f5;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: auto;
    -webkit-overflow-scrolling: touch;
}

.af-tabulator .tabulator-tableholder::-webkit-scrollbar {
    width: 12px;
    height: 13px;
}

.af-tabulator .tabulator-tableholder::-webkit-scrollbar-track {
    background: #eef1f5;
}

.af-tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
    background: #667085;
    border: 3px solid #eef1f5;
    border-radius: 999px;
}

.af-tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
    background: #475467;
}

.af-tabulator .tabulator-header {
    border: 0;
    border-bottom: 2px solid var(--af-accent, #f59e0b);
    color: #fff;
    background: #1f2937;
}

.af-tabulator .tabulator-header .tabulator-col,
.af-tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    border-right-color: rgba(255, 255, 255, .12);
    background: #1f2937;
}

.af-tabulator .tabulator-header .tabulator-col-content {
    padding: 10px 9px;
}

.af-tabulator .tabulator-header-filter input {
    min-height: 32px;
    margin-top: 7px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #111827;
    background: #fff;
}

.af-tabulator .tabulator-row {
    min-height: 44px;
    border-bottom: 1px solid #e7ebf0;
    background: #fff;
}

.af-tabulator .tabulator-row:nth-child(even) {
    background: #f8fafc;
}

.af-tabulator .tabulator-row:hover,
.af-tabulator .tabulator-row.tabulator-selectable:hover {
    background: #fff8e7;
}

.af-tabulator .tabulator-cell {
    display: inline-flex;
    align-items: center;
    padding: 9px;
    border-right-color: #edf0f3;
    white-space: normal;
    line-height: 1.35;
}

.af-tabulator .tabulator-cell.af-tabulator-actions {
    flex-wrap: nowrap;
    gap: 5px;
    white-space: nowrap;
}

.af-tabulator .tabulator-cell.af-tabulator-actions .btn {
    flex: 0 0 auto;
    margin: 0;
}

.af-tabulator .tabulator-cell .btn,
.af-tabulator .tabulator-cell a {
    max-width: 100%;
}

.af-tabulator .tabulator-footer {
    border-top: 1px solid #d7dde5;
    background: #f8fafc;
}

.af-tabulator .tabulator-footer .tabulator-page,
.af-tabulator .tabulator-footer .tabulator-page-size {
    min-height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #1f2937;
    background: #fff;
}

.af-tabulator .tabulator-footer .tabulator-page.active {
    border-color: var(--af-accent, #f59e0b);
    color: #111827;
    background: #fde7ad;
}

.af-native-grid-scroll {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: #667085 #eef1f5;
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
}

.af-native-grid-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
}

.af-native-grid-table th,
.af-native-grid-table td {
    min-width: 90px;
    max-width: 320px;
    padding: 7px 9px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Compact Index/list pages -------------------------------------------------
   Keep the page itself inside the browser viewport. Large result sets scroll
   inside their grid and paginate, while all columns remain available through
   the horizontal table scrollbar. */
.af-index-page .content-wrapper {
    min-height: calc(100vh - 38px) !important;
}

.af-index-page .content-header {
    padding-top: 14px;
    padding-bottom: 5px;
}

.af-index-page .content-header > h1 {
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.1;
}

.af-index-page .content-header > h1 > small {
    display: inline;
    margin: 0 0 0 7px;
    font-size: 12px;
}

.af-index-page .content-header > .breadcrumb {
    margin-top: 5px;
    font-size: 11px;
}

.af-index-page .content {
    padding-top: 5px;
    padding-bottom: 10px;
}

.af-index-page .antifire-page-surface {
    padding: 11px 13px;
}

.af-index-page .antifire-page-surface > p:first-child,
.af-index-page .antifire-page-surface > p:first-of-type {
    margin: 0 0 7px;
}

.af-index-page .antifire-page-surface > p .btn {
    min-height: 31px;
    padding: 5px 10px;
    font-size: 12px;
}

.af-index-page .af-table-shell {
    margin: 6px 0 0;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .06);
}

.af-index-page .af-table-toolbar {
    gap: 7px;
    padding: 6px 8px;
}

.af-index-page .af-table-search {
    flex-basis: 220px;
    max-width: 330px;
}

.af-index-page .af-table-search .form-control {
    min-height: 30px;
    height: 30px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.af-index-page .af-table-actions {
    gap: 4px;
}

.af-index-page .af-table-actions .af-table-button {
    min-height: 29px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.af-index-page .af-table-report-heading {
    padding: 7px 9px 2px;
}

.af-index-page .af-table-report-heading img {
    max-height: 42px;
    width: auto;
}

.af-index-page .af-tabulator.tabulator {
    font-size: 12px;
}

.af-index-page .af-tabulator .tabulator-header .tabulator-col-content {
    padding: 6px 7px;
}

.af-index-page .af-tabulator .tabulator-header .tabulator-col-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.af-index-page .af-tabulator .tabulator-header-filter input {
    min-height: 25px;
    height: 25px;
    margin-top: 4px;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 11px;
}

.af-index-page .af-tabulator .tabulator-row {
    min-height: 33px;
}

.af-index-page .af-tabulator .tabulator-cell {
    min-height: 33px;
    padding: 5px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.af-index-page .af-tabulator .tabulator-cell.af-tabulator-actions {
    overflow: visible;
}

.af-index-page .af-tabulator .tabulator-cell .btn {
    min-height: 25px;
    padding: 3px 7px;
    font-size: 11px;
    line-height: 1.25;
}

.af-index-page .af-tabulator .tabulator-footer {
    padding: 3px 6px;
    font-size: 11px;
}

.af-index-page .af-tabulator .tabulator-footer .tabulator-page,
.af-index-page .af-tabulator .tabulator-footer .tabulator-page-size {
    min-height: 27px;
    padding: 3px 7px;
    border-radius: 5px;
}

.af-index-page .main-footer {
    height: 38px;
    min-height: 38px;
    padding-top: 9px;
    padding-bottom: 9px;
    overflow: hidden;
    font-size: 11px;
    line-height: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .af-crud-page .af-crud-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .af-crud-page .af-crud-grid > .af-form-wide {
        grid-column: auto;
    }

    .af-crud-page .af-crud-grid > .form-group {
        padding: 13px;
    }

    .af-crud-page .af-crud-grid > .row {
        display: block;
    }

    .af-crud-page .af-crud-grid > .row > [class*="col-"] {
        width: 100%;
        margin-bottom: 14px;
    }

    .af-crud-delete .dl-horizontal {
        grid-template-columns: minmax(0, 1fr);
    }

    .af-crud-delete .dl-horizontal > dt {
        min-height: 0;
        padding-bottom: 5px;
        border-bottom: 0;
    }

    .af-crud-delete .dl-horizontal > dd {
        min-height: 0;
        padding-top: 5px;
        border-right: 0;
    }

    .af-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .af-table-search {
        flex-basis: auto;
        max-width: none;
    }

    .af-table-actions {
        justify-content: flex-start;
    }

    .af-table-actions .af-table-button {
        flex: 1 1 76px;
    }

    .af-column-picker {
        flex: 1 1 112px;
    }

    .af-column-picker > .af-columns {
        width: 100%;
    }

    .af-column-menu {
        right: auto;
        left: 0;
        width: min(320px, calc(100vw - 38px));
    }

    .af-tabulator.tabulator {
        font-size: 12px;
    }

    .af-index-page .content-header {
        padding-top: 12px;
        padding-bottom: 4px;
    }

    .af-index-page .content {
        padding-top: 4px;
        padding-bottom: 8px;
    }

    .af-index-page .antifire-page-surface {
        padding: 9px;
    }

    .af-index-page .af-table-toolbar {
        gap: 5px;
        padding: 5px;
    }

    .af-index-page .af-table-search {
        max-width: none;
    }

    .af-index-page .af-table-actions .af-table-button {
        flex: 1 1 62px;
    }

    .af-index-column-slot {
        display: flex;
        width: fit-content;
        margin: 8px 0 0;
    }

    .af-index-column-slot .af-table-button {
        margin: 0;
    }
}

@media print {
    .af-table-toolbar,
    .af-index-column-slot,
    .tabulator-footer {
        display: none !important;
    }

    .af-table-shell {
        overflow: visible;
        border: 0;
        box-shadow: none;
    }
}
