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

* {
    box-sizing: border-box;
}

html {
    font-family:
        "Inter",
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #172033;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    background: #f5f7fb;
}

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

a {
    text-decoration: none;
    color: inherit;
}

.muted {
    color: #748096;
}

.eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: 0.14em;
    font-weight: 800;
    color: #0f8f83;
    margin-bottom: 8px;
}

.btn {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: 0.18s;
}

.btn-primary {
    background: #0f8f83;
    color: #fff;
    box-shadow: 0 6px 16px rgba(15, 143, 131, 0.18);
}

.btn-primary:hover {
    background: #0c796f;
}

.btn-secondary {
    background: #172033;
    color: #fff;
}

.btn-ghost {
    background: #fff;
    border-color: #dce2ea;
    color: #465267;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 13px 15px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
}

.alert-danger {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #b42318;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #08745c;
}

.auth-body {
    min-height: 100vh;
    background: #eef4f4;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 46%) 1fr;
}

.auth-brand-panel {
    padding: 64px clamp(40px, 6vw, 90px);
    background: linear-gradient(145deg, #0a4f4b, #0f8f83 65%, #42b9aa);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel:after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    right: -190px;
    bottom: -130px;
    box-shadow:
        0 0 0 70px rgba(255, 255, 255, 0.035),
        0 0 0 140px rgba(255, 255, 255, 0.025);
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: #fff;
    color: #0f8f83;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 19px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 1;
}

.brand-mark.small {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 14px;
}

.auth-brand-panel .eyebrow {
    color: #a7f3e8;
    margin-top: 70px;
}

.auth-brand-panel h1 {
    font-size: clamp(36px, 4vw, 60px);
    line-height: 1.05;
    max-width: 620px;
    margin: 0 0 22px;
    letter-spacing: -0.045em;
}

.auth-brand-panel p {
    max-width: 520px;
    font-size: 17px;
    line-height: 1.7;
    color: #d9fffa;
}

.auth-feature-row {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.auth-feature-row span {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 12px;
}

.auth-form-panel {
    display: grid;
    place-items: center;
    padding: 40px;
    background: #fff;
}

.auth-form-wrap {
    width: min(440px, 100%);
}

.auth-form-wrap h2 {
    font-size: 32px;
    letter-spacing: -0.035em;
    margin: 0 0 8px;
}

.auth-form-wrap>.muted {
    margin: 0 0 28px;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    margin-bottom: 40px;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label {
    font-size: 13px;
    font-weight: 750;
    color: #344054;
}

.field label span {
    color: #d92d20;
}

.field input,
.field select,
.filters input,
.filters select {
    width: 100%;
    height: 44px;
    border: 1px solid #d6dce5;
    border-radius: 9px;
    background: #fff;
    padding: 0 12px;
    outline: none;
    color: #172033;
}

.field input:focus,
.field select:focus,
.filters input:focus,
.filters select:focus {
    border-color: #0f8f83;
    box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.09);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #0f8f83;
    font-weight: 750;
    font-size: 12px;
    cursor: pointer;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #596579;
}

.check-row input {
    accent-color: #0f8f83;
}

.admin-body {
    min-height: 100vh;
    background: #f5f7fb;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: #102a2d;
    color: #dbe8e8;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    height: 74px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand>div:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.sidebar-brand strong {
    color: #fff;
    font-size: 16px;
}

.sidebar-brand span {
    font-size: 11px;
    color: #8fb0b2;
    margin-top: 2px;
}

.sidebar-close {
    display: none;
    margin-left: auto;
}

.sidebar-nav {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.nav-label {
    font-size: 10px;
    letter-spacing: 0.13em;
    color: #739395;
    font-weight: 800;
    padding: 14px 11px 7px;
}

.nav-item {
    height: 44px;
    border-radius: 9px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #b8cdce;
    font-size: 14px;
    font-weight: 650;
}

.nav-item svg,
.menu-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.active {
    background: #0f8f83;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.nav-coming {
    margin: 3px 11px;
    padding: 9px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #69888a;
    font-size: 13px;
}

.nav-coming small {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 6px;
    border-radius: 10px;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar,
.avatar,
.table-avatar {
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #dff8f4;
    color: #087c72;
    font-weight: 850;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
}

.sidebar-user-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user-copy strong {
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-copy span {
    font-size: 10px;
    color: #7fa0a2;
}

.admin-shell {
    margin-left: 260px;
    min-height: 100vh;
}

.topbar {
    height: 74px;
    background: #fff;
    border-bottom: 1px solid #e4e8ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 30;
}

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

.topbar-left>div {
    display: flex;
    flex-direction: column;
}

.topbar-context {
    font-size: 10px;
    color: #8b96a8;
}

.topbar-left strong {
    font-size: 15px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #647084;
    cursor: pointer;
}

.menu-btn {
    display: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 9px;
}

.avatar {
    width: 38px;
    height: 38px;
}

.profile-copy {
    display: flex;
    flex-direction: column;
}

.profile-copy strong {
    font-size: 12px;
}

.profile-copy span {
    font-size: 10px;
    color: #7b879a;
}

.admin-content {
    padding: 28px;
    max-width: 1600px;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
}

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

.page-heading h1 {
    font-size: 28px;
    letter-spacing: -0.035em;
    margin: 0 0 6px;
    color: #172033;
}

.page-heading p {
    margin: 0;
    color: #748096;
    font-size: 14px;
}

.back-link {
    display: inline-block;
    color: #0f8f83;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 2px 5px rgba(16, 24, 40, 0.025);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #e8f8f6;
    color: #0b857b;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.stat-card>div:last-child {
    display: flex;
    flex-direction: column;
}

.stat-card span {
    font-size: 11px;
    color: #748096;
    font-weight: 700;
}

.stat-card strong {
    font-size: 27px;
    line-height: 1.2;
    margin: 2px 0;
}

.stat-card small {
    font-size: 10px;
    color: #98a2b3;
}

.panel {
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(16, 24, 40, 0.025);
    overflow: hidden;
}

.panel-header {
    padding: 19px 20px;
    border-bottom: 1px solid #edf0f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.panel-header h2 {
    font-size: 16px;
    margin: 0 0 4px;
}

.panel-header p {
    font-size: 12px;
    color: #8490a2;
    margin: 0;
}

.text-link {
    color: #0f8f83;
    font-size: 12px;
    font-weight: 750;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th {
    padding: 12px 18px;
    text-align: left;
    background: #fafbfc;
    border-bottom: 1px solid #e9edf2;
    color: #667085;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

td {
    padding: 13px 18px;
    border-bottom: 1px solid #eef1f5;
    color: #4b576a;
    font-size: 12px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fcfdfd;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.user-cell>div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-cell strong {
    font-size: 12px;
    color: #243047;
}

.user-cell span:not(.table-avatar) {
    font-size: 10px;
    color: #8490a2;
    margin-top: 2px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 800;
}

.badge-role {
    background: #eef2ff;
    color: #4f46a5;
}

.badge-active {
    background: #e9f9f1;
    color: #08745c;
}

.badge-inactive {
    background: #f2f4f7;
    color: #667085;
}

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

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.actions form {
    margin: 0;
}

.action-btn {
    border: 1px solid #dfe4eb;
    background: #fff;
    color: #4c596c;
    border-radius: 7px;
    padding: 6px 9px;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}

.action-btn.danger {
    color: #b42318;
}

.action-btn.success {
    color: #08745c;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 45px;
    color: #8c97a8;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 150px 150px auto auto;
    gap: 9px;
    padding: 15px;
    border-bottom: 1px solid #edf0f4;
}

.filters input,
.filters select {
    height: 39px;
    font-size: 12px;
}

.filters .btn {
    min-height: 39px;
    height: 39px;
    font-size: 12px;
}

.pagination-wrap {
    padding: 14px 18px;
    border-top: 1px solid #edf0f4;
}

.pagination-wrap nav>div:first-child {
    display: none;
}

.pagination-wrap nav>div:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pagination-wrap p {
    font-size: 11px;
    color: #748096;
}

.pagination-wrap span,
.pagination-wrap a {
    font-size: 11px;
}

.form-page {
    display: grid;
    gap: 16px;
}

.form-panel {
    overflow: visible;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 20px;
}

.field-full {
    grid-column: 1/-1;
}

.field-error {
    color: #b42318;
    font-size: 11px;
}

.status-options {
    display: flex;
    gap: 10px;
}

.status-options label {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #dce2ea;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
}

.status-options input {
    width: auto;
    height: auto;
    margin-top: 3px;
    accent-color: #0f8f83;
}

.status-options label>span {
    display: flex;
    flex-direction: column;
    color: inherit;
}

.status-options strong {
    font-size: 12px;
    color: #344054;
}

.status-options small {
    font-size: 10px;
    color: #8490a2;
    margin-top: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.form-actions.inside {
    padding: 0 20px 20px;
}

.password-panel {
    margin-top: 18px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 25, 0.48);
    z-index: 45;
}

.no-scroll {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        transform: translateX(-100%);
        transition: 0.22s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close,
    .menu-btn {
        display: grid;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .admin-shell {
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .auth-shell {
        display: block;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        padding: 28px 20px;
    }

    .mobile-brand {
        display: flex;
    }

    .admin-content {
        padding: 20px 14px;
    }

    .topbar {
        padding: 0 14px;
    }

    .profile-copy {
        display: none;
    }

    .topbar .btn-ghost {
        padding: 0 11px;
    }

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

    .page-heading>.btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
    }

    .search-box {
        grid-column: 1/-1;
    }

    .filters .btn {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .field-full {
        grid-column: auto;
    }

    .status-options {
        flex-direction: column;
    }

    .form-actions {
        position: sticky;
        bottom: 0;
        background: rgba(245, 247, 251, 0.94);
        padding: 12px 0;
        z-index: 10;
    }

    .panel-header {
        padding: 16px;
    }

    .topbar-context {
        display: none;
    }

    .pagination-wrap nav>div:last-child {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 440px) {
    .filters {
        grid-template-columns: 1fr;
    }

    .search-box {
        grid-column: auto;
    }

    .topbar-profile {
        display: none;
    }

    .page-heading h1 {
        font-size: 24px;
    }

    .auth-form-wrap h2 {
        font-size: 27px;
    }
}

/* Enhanced admin topbar */
.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 28px;
}

.admin-search {
    width: min(380px, 100%);
    height: 38px;
    border: 1px solid #e2e7ee;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    color: #8b96a8;
    font-size: 12px;
}

.admin-search svg {
    width: 17px;
    height: 17px;
    fill: #8b96a8;
    margin-right: 8px;
}

.admin-search kbd {
    margin-left: auto;
    border: 1px solid #dce2e9;
    background: #fff;
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 9px;
    color: #667085;
}

.dropdown-wrap {
    position: relative;
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e9ef;
    background: #fff;
    border-radius: 11px;
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
}

.topbar-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: #526075;
}

.notification-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5484d;
    border: 2px solid #fff;
    right: 8px;
    top: 7px;
}

.profile-trigger {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 7px;
    border-radius: 11px;
    cursor: pointer;
}

.profile-trigger:hover {
    background: #f5f7fa;
}

.chevron {
    width: 16px;
    height: 16px;
    fill: #8a95a6;
}

.topbar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 330px;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(23, 32, 51, 0.14);
    overflow: hidden;
    z-index: 100;
}

.topbar-dropdown.show {
    display: block;
    animation: dropdownIn 0.14s ease-out;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.dropdown-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf0f4;
}

.dropdown-header>div {
    display: flex;
    flex-direction: column;
}

.dropdown-header strong {
    font-size: 13px;
}

.dropdown-header span {
    font-size: 10px;
    color: #8b96a8;
    margin-top: 2px;
}

.mini-badge {
    background: #e8f8f6 !important;
    color: #087c72 !important;
    padding: 4px 7px;
    border-radius: 999px;
    font-weight: 800;
}

.notification-item {
    padding: 13px 16px;
    display: flex;
    gap: 11px;
    border-bottom: 1px solid #f0f2f5;
}

.notification-item:hover {
    background: #fafcfc;
}

.notification-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: #e8f8f6;
    color: #087c72;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.notification-item>div {
    display: flex;
    flex-direction: column;
}

.notification-item strong {
    font-size: 11px;
}

.notification-item span {
    font-size: 10px;
    color: #718096;
    margin-top: 3px;
    line-height: 1.45;
}

.notification-item small {
    font-size: 9px;
    color: #a0a9b7;
    margin-top: 4px;
}

.dropdown-footer {
    text-align: center;
    padding: 11px;
    font-size: 10px;
    color: #8390a2;
    background: #fafbfc;
}

.profile-menu {
    width: 280px;
}

.profile-menu-head {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid #edf0f4;
}

.avatar.large {
    width: 44px;
    height: 44px;
}

.profile-menu-head>div:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-menu-head strong {
    font-size: 12px;
}

.profile-menu-head span {
    font-size: 10px;
    color: #7b879a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu-links {
    padding: 7px;
}

.profile-menu-links a,
.logout-menu-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    text-align: left;
    cursor: pointer;
    color: #475467;
}

.profile-menu-links a:hover {
    background: #f7f9fb;
}

.profile-menu-links a>span,
.logout-menu-btn>span {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    background: #f0f4f6;
    display: grid;
    place-items: center;
}

.profile-menu-links a>div,
.logout-menu-btn>div {
    display: flex;
    flex-direction: column;
}

.profile-menu-links strong,
.logout-menu-btn strong {
    font-size: 11px;
}

.profile-menu-links small,
.logout-menu-btn small {
    font-size: 9px;
    color: #98a2b3;
    margin-top: 2px;
}

.profile-menu form {
    padding: 7px;
    border-top: 1px solid #edf0f4;
}

.logout-menu-btn {
    color: #b42318;
}

.logout-menu-btn>span {
    background: #fff1f2;
}

.logout-menu-btn:hover {
    background: #fff7f7;
}

/* Modal + DataTables */
.modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(12, 24, 29, 0.58);
    backdrop-filter: blur(2px);
    z-index: 200;
    padding: 20px;
    overflow: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.24s ease,
        visibility 0s linear 0.24s;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity 0.24s ease,
        visibility 0s linear 0s;
}

.app-modal {
    width: min(620px, 100%);
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 28px 80px rgba(16, 24, 40, 0.25);
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    transition:
        opacity 0.24s ease,
        transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-backdrop.show .app-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-sm {
    width: min(440px, 100%);
}

.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #e9edf2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.modal-header>div {
    display: flex;
    flex-direction: column;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: #172033;
}

.modal-header p {
    margin: 4px 0 0;
    font-size: 11px;
    color: #8490a2;
}

.modal-close {
    border: 0;
    background: #f4f6f8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    color: #667085;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e9edf2;
    background: #fbfcfd;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.modal-danger-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: #fff1f2;
    color: #c62935;
    display: grid;
    place-items: center;
    font-size: 22px;
    margin-bottom: 13px;
}

.modal-message {
    font-size: 13px;
    color: #667085;
    line-height: 1.6;
}

.form-errors {
    display: none;
    margin-bottom: 14px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #fff1f2;
    color: #b42318;
    font-size: 11px;
    line-height: 1.6;
}

.form-errors.show {
    display: block;
}

.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    padding: 15px 18px;
}

.dataTables_wrapper .dataTables_length {
    float: left;
}

.dataTables_wrapper .dataTables_filter {
    float: right;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dce2ea;
    border-radius: 8px;
    padding: 7px 9px;
    background: #fff;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #0f8f83;
    box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.08);
}

.dataTables_wrapper .dataTables_info {
    padding: 17px 18px !important;
    font-size: 11px;
    color: #748096;
}

.dataTables_wrapper table.dataTable {
    margin: 0 !important;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #edf0f4 !important;
}

/* ============================================================
   DATA TABLES | Pagination
   Shared by Users, Categories, Brands and Inventory tables.
   Keep base, hover, active and disabled states together.
   ============================================================ */
.dt-container .dt-paging {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

html body .dt-container .dt-paging button.dt-paging-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px !important;
    margin: 0 !important;
    border: 1px solid #dce4e9 !important;
    border-radius: 999px !important;
    background: #f3f6f8 !important;
    background-image: none !important;
    color: #526071 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

/* Hover applies only to available, non-active pages. */
html body .dt-container .dt-paging button.dt-paging-button:not(.current):not(.disabled):hover {
    border-color: #a9d9d3 !important;
    background: #e6f4f1 !important;
    background-image: none !important;
    color: #08776e !important;
    -webkit-text-fill-color: #08776e !important;
}

/* Active page stays green and its number stays white on hover. */
html body .dt-container .dt-paging button.dt-paging-button.current,
html body .dt-container .dt-paging button.dt-paging-button.current:hover {
    border-color: #0f8f83 !important;
    background: #0f8f83 !important;
    background-image: none !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 4px 11px rgba(15, 143, 131, 0.24);
}

html body .dt-container .dt-paging button.dt-paging-button.current * {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

/* Disabled arrows must not look interactive. */
html body .dt-container .dt-paging button.dt-paging-button.disabled,
html body .dt-container .dt-paging button.dt-paging-button.disabled:hover {
    border-color: #e7ebef !important;
    background: #f5f7f8 !important;
    background-image: none !important;
    color: #a8b1bd !important;
    -webkit-text-fill-color: #a8b1bd !important;
    opacity: 0.7 !important;
    cursor: default !important;
}

/* Compatibility with DataTables 1.x pagination markup. */
.dataTables_wrapper .dataTables_paginate {
    padding: 11px 18px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    margin: 0 3px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #0f8f83 !important;
    background-image: none !important;
    border-color: #0f8f83 !important;
    color: #fff !important;
}

@media (max-width: 760px) {
    .dt-container .dt-paging {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }
}

.table-action-menu {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
}

.table-action-menu button {
    border: 1px solid #dfe4eb;
    background: #fff;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}

.table-action-menu button:hover {
    background: #f7f9fb;
}

.table-action-menu .danger {
    color: #b42318;
}

.table-action-menu .success {
    color: #08745c;
}

.table-action-menu button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.table-subtitle {
    font-size: 10px;
    color: #98a2b3;
}

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 400;
    display: grid;
    gap: 8px;
}

.app-toast {
    min-width: 280px;
    max-width: 380px;
    background: #172033;
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    font-size: 12px;
    font-weight: 650;
    animation: toastIn 0.2s ease-out;
}

.app-toast.error {
    background: #b42318;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 900px) {
    .topbar-center {
        display: none;
    }
}

@media (max-width: 760px) {
    .topbar-actions {
        gap: 6px;
    }

    .profile-trigger .profile-copy,
    .profile-trigger .chevron {
        display: none;
    }

    .profile-trigger {
        padding: 3px;
    }

    .topbar-dropdown {
        position: fixed;
        top: 68px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .modal-backdrop {
        padding: 10px;
    }

    .app-modal {
        border-radius: 14px;
    }

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

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        padding: 10px 14px;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: calc(100% - 58px);
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: left !important;
    }

    .table-action-menu {
        justify-content: flex-start;
    }
}

/* Manage Users premium table refinement */
@media (min-width: 1400px) {
    .admin-content {
        max-width: none;
        width: 100%;
        padding: 34px clamp(34px, 3.2vw, 72px);
    }

    .page-heading {
        margin-bottom: 26px;
    }

    .users-panel {
        width: 100%;
    }
}

.users-panel {
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.055);
    border-color: #e4e9ef;
}

.users-panel .panel-header {
    padding: 20px 22px;
}

.directory-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e5e9ef;
    border-radius: 999px;
    color: #667085;
    font-size: 10px;
    font-weight: 750;
    background: #fbfcfd;
}

.summary-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #12a594;
    box-shadow: 0 0 0 4px rgba(18, 165, 148, 0.1);
}

.users-table-wrap {
    padding: 0 18px 12px;
}

.users-table-wrap .dt-container {
    padding-top: 0;
}

.users-table-wrap .dt-layout-row:first-child {
    margin: 0;
    padding: 14px 4px;
    align-items: center;
}

.users-table-wrap .dt-layout-row:last-child {
    margin: 0;
    padding: 15px 4px 4px;
    align-items: center;
    border-top: 1px solid #eef1f5;
}

.users-table-wrap .dt-length,
.users-table-wrap .dt-search {
    font-size: 11px;
    color: #667085;
    font-weight: 650;
}

.users-table-wrap .dt-length select {
    min-width: 68px;
    margin: 0 6px;
    border: 1px solid #dce3ea !important;
    border-radius: 9px !important;
    padding: 7px 28px 7px 10px !important;
    background: #fff !important;
}

.users-table-wrap .dt-search input {
    min-width: 280px;
    height: 36px;
    margin-left: 8px !important;
    border: 1px solid #dce3ea !important;
    border-radius: 10px !important;
    padding: 0 12px !important;
    background: #f9fafb !important;
}

.users-table-wrap .dt-search input:focus {
    background: #fff !important;
    border-color: #0f8f83 !important;
    box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.08) !important;
    outline: 0;
}

.users-table-wrap table.dataTable {
    border: 1px solid #e8edf2 !important;
    border-radius: 12px;
    overflow: hidden;
}

.users-table-wrap table.dataTable thead th {
    height: 46px;
    background: #f8fafb !important;
    color: #697586 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: 0.09em !important;
    padding: 0 16px !important;
    border-bottom: 1px solid #e5eaf0 !important;
}

.users-table-wrap table.dataTable tbody td {
    height: 64px;
    padding: 10px 16px !important;
    border-bottom: 1px solid #edf1f4 !important;
    vertical-align: middle;
}

.users-table-wrap table.dataTable tbody tr {
    transition: background 0.15s ease;
}

.users-table-wrap table.dataTable tbody tr:hover {
    background: #f8fcfb !important;
}

.users-table-wrap .table-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 11px;
    box-shadow: inset 0 0 0 1px rgba(8, 124, 114, 0.08);
}

.users-table-wrap .user-cell strong {
    font-size: 12px;
}

.users-table-wrap .badge {
    padding: 6px 9px;
    border: 1px solid transparent;
}

.users-table-wrap .badge-active {
    border-color: #cceede;
}

.users-table-wrap .badge-inactive {
    border-color: #e4e7ec;
}

.users-table-wrap .badge-role {
    border-color: #dfe3ff;
}

.actions-column {
    min-width: 260px !important;
}

.table-action-menu {
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: nowrap;
}

.table-icon-action {
    height: 34px !important;
    min-width: 34px;
    border: 1px solid #e1e6ec !important;
    background: #fff !important;
    border-radius: 9px !important;
    padding: 0 9px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #596579;
    font-size: 10px !important;
    font-weight: 750;
    transition: 0.15s ease;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.table-icon-action svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.table-icon-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 24, 40, 0.08);
}

.table-icon-action.edit:hover {
    color: #0b7f76;
    border-color: #bce5df !important;
    background: #f0fbf9 !important;
}

.table-icon-action.password:hover {
    color: #4f46a5;
    border-color: #d9dcff !important;
    background: #f6f6ff !important;
}

.table-icon-action.status-off {
    color: #b54708;
}

.table-icon-action.status-off:hover {
    border-color: #fedf89 !important;
    background: #fffaeb !important;
}

.table-icon-action.status-on {
    color: #08745c;
}

.table-icon-action.status-on:hover {
    border-color: #a6f4c5 !important;
    background: #ecfdf3 !important;
}

.table-icon-action.delete {
    color: #b42318;
}

.table-icon-action.delete:hover {
    border-color: #fecdca !important;
    background: #fff5f4 !important;
}

.table-icon-action:disabled {
    opacity: 0.3 !important;
    transform: none !important;
    box-shadow: none !important;
}

.users-table-wrap .dt-info {
    font-size: 11px;
    color: #7b8798;
    padding: 0 !important;
}

.confirm-dialog {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.confirm-close {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 2;
}

.confirm-body {
    padding: 30px 28px 18px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.confirm-icon-wrap {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: #eef8f6;
    color: #0f8f83;
    box-shadow: 0 0 0 7px #f7fbfa;
}

.confirm-icon-wrap.danger {
    background: #fff1f1;
    color: #d92d20;
    box-shadow: 0 0 0 7px #fff8f7;
}

.confirm-icon-wrap svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.confirm-copy {
    padding-right: 25px;
}

.confirm-kicker {
    display: block;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.13em;
    color: #98a2b3;
    margin: 1px 0 7px;
}

.confirm-copy h3 {
    font-size: 19px;
    letter-spacing: -0.02em;
    margin: 0 0 7px;
    color: #172033;
}

.confirm-copy p {
    font-size: 12px;
    line-height: 1.65;
    color: #667085;
    margin: 0;
}

.confirm-warning {
    margin: 0 28px 22px;
    padding: 11px 13px;
    border: 1px solid #dcefe9;
    background: #f5fbf9;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.confirm-warning.danger {
    border-color: #fee4e2;
    background: #fff8f7;
}

.confirm-warning strong {
    font-size: 10px;
    color: #344054;
}

.confirm-warning span {
    font-size: 10px;
    color: #7b8798;
}

.confirm-footer {
    padding: 15px 20px;
    background: #fafbfc;
}

.confirm-action-btn {
    min-width: 125px;
}

.confirm-danger-btn {
    background: #d92d20;
    color: #fff;
    box-shadow: 0 5px 14px rgba(217, 45, 32, 0.18);
}

.confirm-danger-btn:hover {
    background: #b42318;
}

@media (max-width: 900px) {
    .table-icon-action span {
        display: none;
    }

    .table-icon-action {
        padding: 0 !important;
        width: 34px;
    }

    .actions-column {
        min-width: 175px !important;
    }

    .users-table-wrap .dt-search input {
        min-width: 210px;
    }
}

@media (max-width: 760px) {
    .users-table-wrap {
        padding: 0 10px 10px;
    }

    .users-table-wrap .dt-layout-row:first-child,
    .users-table-wrap .dt-layout-row:last-child {
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .users-table-wrap .dt-search input {
        width: 100% !important;
        min-width: 0;
        margin: 6px 0 0 !important;
    }

    .users-table-wrap .dt-length select {
        margin-left: 6px;
    }

    .directory-summary {
        display: none;
    }

    .confirm-body {
        padding: 26px 20px 16px;
    }

    .confirm-warning {
        margin: 0 20px 18px;
    }

    .confirm-footer {
        flex-direction: column-reverse;
    }

    .confirm-footer .btn {
        width: 100%;
    }
}

/* Manage Users - eye comfort + rounded pagination */
.users-panel {
    background: #f9fbfc;
}

.users-panel .panel-header {
    background: #fbfcfd;
}

.users-table-wrap {
    background: #f9fbfc;
}

.users-table-wrap .dt-layout-row:first-child {
    background: #f9fbfc;
}

.users-table-wrap .dt-length select {
    background: #f4f7f9 !important;
}

.users-table-wrap .dt-search input {
    background: #f3f6f8 !important;
}

.users-table-wrap table.dataTable {
    background: #f6f8fa !important;
    border-color: #dfe6ec !important;
}

.users-table-wrap table.dataTable thead th {
    background: #e9eef2 !important;
    color: #526071 !important;
    border-bottom: 1px solid #d8e0e7 !important;
}

.users-table-wrap table.dataTable tbody tr,
.users-table-wrap table.dataTable tbody tr.odd {
    background: #f8fafb !important;
}

.users-table-wrap table.dataTable tbody tr.even {
    background: #f1f5f7 !important;
}

.users-table-wrap table.dataTable tbody td {
    background: transparent !important;
    border-bottom: 1px solid #dfe6eb !important;
}

.users-table-wrap table.dataTable tbody tr:hover,
.users-table-wrap table.dataTable tbody tr.odd:hover,
.users-table-wrap table.dataTable tbody tr.even:hover {
    background: #e6f4f1 !important;
}

.users-table-wrap .dt-layout-row:last-child {
    background: #f9fbfc;
    border-top-color: #dfe6eb;
}

/* Inter typography refinements */
body {
    font-family:
        "Inter",
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-weight: 400;
    line-height: 1.5;
}

.page-heading h1 {
    font-weight: 700;
    letter-spacing: -0.035em;
}

.panel-header h2,
.modal-header h3,
.confirm-copy h3 {
    font-weight: 700;
    letter-spacing: -0.018em;
}

.nav-item {
    font-weight: 600;
}

.btn,
.table-icon-action {
    font-weight: 600;
}

.users-table-wrap table.dataTable thead th {
    font-family: "Inter", sans-serif;
    font-weight: 700 !important;
}

.users-table-wrap table.dataTable tbody td {
    font-family: "Inter", sans-serif;
    font-weight: 400;
}

.users-table-wrap .user-cell strong {
    font-weight: 600;
}

.users-table-wrap .dt-length,
.users-table-wrap .dt-search,
.users-table-wrap .dt-info,
.users-table-wrap .dt-paging {
    font-family: "Inter", sans-serif;
}

/* Keep Actions heading perfectly aligned with its controls */
.users-table-wrap table.dataTable thead th.actions-column,
.users-table-wrap table.dataTable tbody td.actions-column {
    text-align: right !important;
}

.users-table-wrap table.dataTable thead th.actions-column .dt-column-header {
    justify-content: flex-end !important;
}

.users-table-wrap table.dataTable thead th.actions-column .dt-column-title {
    width: 100%;
    text-align: right !important;
}

.users-table-wrap table.dataTable tbody td.actions-column .table-action-menu {
    width: 100%;
    justify-content: flex-end !important;
}

/* Respect reduced-motion preferences while keeping modal behavior intact. */
@media (prefers-reduced-motion: reduce) {

    .modal-backdrop,
    .app-modal {
        transition-duration: 0.01ms !important;
    }
}

/* Catalog CRUD refinements: Categories & Brands */
.field textarea {
    width: 100%;
    min-height: 112px;
    border: 1px solid #d6dce5;
    border-radius: 9px;
    background: #fff;
    padding: 11px 12px;
    outline: none;
    color: #172033;
    line-height: 1.5;
    resize: vertical;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.field textarea::placeholder {
    color: #98a2b3;
}

.field textarea:hover {
    border-color: #c6ced9;
}

.field textarea:focus {
    border-color: #0f8f83;
    box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.09);
    background: #fff;
}

.catalog-action-menu {
    gap: 7px;
}

.catalog-action {
    width: 34px;
    min-width: 34px !important;
    padding: 0 !important;
}

.catalog-action svg {
    width: 15px;
    height: 15px;
}

.users-table-wrap table.dataTable thead th.actions-column,
.users-table-wrap table.dataTable tbody td.actions-column {
    min-width: 140px !important;
}

/* SaaS tenant additions */
.admin-create-field {
    border-top: 1px solid #edf0f4;
    padding-top: 14px;
}

.sidebar-brand strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Phase 3 purchasing */
.table-subcopy {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-muted, #7d8b99);
}

.money-paid {
    color: #17a66a;
}

.money-due {
    color: #dc4f5e;
}

.btn-sm {
    padding: 7px 11px;
    font-size: 12px;
}

.btn-outline {
    border: 1px solid rgba(31, 157, 139, 0.45);
    color: #168b7d;
    background: transparent;
    text-decoration: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.shipment-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.shipment-stat {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e3e8ee);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.shipment-stat span,
.shipment-stat small {
    display: block;
    color: var(--text-muted, #7d8b99);
}

.shipment-stat strong {
    display: block;
    font-size: 22px;
    margin: 7px 0 5px;
}

.shipment-two-col {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.shipment-section {
    margin-bottom: 18px;
}

.shipment-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 18px;
}

.shipment-info-grid>div {
    background: var(--surface-soft, #f8fafc);
    border: 1px solid var(--border, #e3e8ee);
    border-radius: 10px;
    padding: 14px;
}

.shipment-info-grid .wide {
    grid-column: 1/-1;
}

.shipment-info-grid span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted, #7d8b99);
    margin-bottom: 5px;
}

.inline-record-form {
    padding: 18px;
}

.shipment-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 120px;
    padding: 24px;
    color: var(--text-muted, #7d8b99);
    text-align: center;
}

.shipment-empty strong {
    color: var(--text, #172033);
}

.shipment-empty.compact {
    min-height: 70px;
}

.mini-ledger {
    padding: 0 18px 18px;
}

.mini-ledger-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border, #e3e8ee);
    padding: 12px 0;
}

.mini-ledger-row div strong,
.mini-ledger-row div small {
    display: block;
}

.mini-ledger-row small {
    color: var(--text-muted, #7d8b99);
    margin-top: 3px;
}

@media (max-width: 1000px) {
    .shipment-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 620px) {
    .shipment-stat-grid {
        grid-template-columns: 1fr;
    }

    .shipment-info-grid {
        grid-template-columns: 1fr;
    }

    .shipment-info-grid .wide {
        grid-column: auto;
    }
}

/* Desktop compact navigation rail; mobile remains an off-canvas drawer. */
.sidebar-brand-copy {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar-brand-copy strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-brand-mark {
    flex-shrink: 0;
}

.sidebar-collapse-toggle {
    display: none;
    color: #a8c7c6;
}

.sidebar-collapse-toggle svg,
.sidebar-close svg {
    width: 18px;
    height: 18px;
}

.sidebar-collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

@media (min-width: 1101px) {
    .sidebar {
        transition: width 0.2s ease;
        overflow: hidden;
    }

    .admin-shell {
        transition: margin-left 0.2s ease;
    }

    .sidebar .sidebar-close {
        display: none !important;
    }

    .sidebar-collapse-toggle {
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        flex-shrink: 0;
    }

    .sidebar-collapsed .sidebar {
        width: 72px;
    }

    .sidebar-collapsed .admin-shell {
        margin-left: 72px;
    }

    .sidebar-collapsed .sidebar-brand {
        height: 112px;
        min-height: 112px;
        padding: 16px 0 10px;
        flex-direction: column;
        justify-content: flex-start;
        gap: 10px;
    }

    .sidebar-collapsed .sidebar-brand .store-brand-mark {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        margin: 0;
        font-size: 13px;
        flex-shrink: 0;
    }

    .sidebar-collapsed .sidebar-brand-copy {
        display: none !important;
    }

    .sidebar-collapsed .sidebar-collapse-toggle {
        width: 30px;
        height: 30px;
        margin: 0;
        flex-shrink: 0;
    }

    .sidebar-collapsed .sidebar-collapse-toggle svg {
        transform: rotate(180deg);
    }

    .sidebar-collapsed .sidebar-nav {
        padding: 15px 10px;
        gap: 7px;
    }

    .sidebar-collapsed .sidebar-nav .nav-label {
        display: block;
        height: 1px;
        min-height: 1px;
        padding: 0;
        margin: 12px 8px 7px;
        font-size: 0;
        line-height: 0;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.14);
    }

    .sidebar-collapsed .sidebar-nav .nav-label:first-child {
        display: none;
    }

    .sidebar-collapsed .sidebar-nav .nav-item {
        width: 52px;
        height: 44px;
        min-height: 44px;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0;
        border-radius: 10px;
    }

    .sidebar-collapsed .sidebar-nav .nav-item>span {
        display: none !important;
    }

    .sidebar-collapsed .sidebar-nav .nav-item svg {
        display: block;
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
        margin: 0;
    }

    .sidebar-collapsed .sidebar-nav .nav-coming {
        display: none;
    }

    .sidebar-collapsed .sidebar-footer {
        height: 74px;
        min-height: 74px;
        padding: 12px 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .sidebar-collapsed .sidebar-footer .sidebar-user-avatar {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .sidebar-collapsed .sidebar-user-copy {
        display: none !important;
    }
}

@media (max-width: 1100px) {
    .sidebar-collapse-toggle {
        display: none !important;
    }

    .sidebar-brand-copy {
        min-width: 0;
    }
}

/* Global modal behavior */
html.app-modal-locked {
    overflow: hidden !important;
}

body.app-modal-locked {
    position: fixed !important;
    width: 100%;
    left: 0;
    right: 0;
    overflow: hidden !important;
}

.modal-backdrop.show,
.finance-modal.show {
    overscroll-behavior: contain;
}

.modal-action-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: modal-action-spin .65s linear infinite;
    flex-shrink: 0;
}

button[aria-busy="true"] {
    cursor: wait;
    opacity: .78;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

@media (prefers-reduced-motion: reduce) {
    .modal-action-spinner {
        animation-duration: 1.5s;
    }
}

/* ==========================================
   PREMIUM DATATABLE LOADING STATE
========================================== */

.dataTables_wrapper,
.dt-container {
    position: relative;
}

/* Processing overlay */
.dataTables_wrapper .dataTables_processing,
.dt-container .dt-processing {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;

    width: auto !important;
    height: auto !important;
    min-width: 210px;

    margin: 0 !important;
    padding: 16px 22px !important;

    transform: translate(-50%, -50%) !important;

    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.08),
        0 2px 8px rgba(15, 23, 42, 0.04) !important;

    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 600 !important;

    z-index: 100 !important;
}

/* Hide DataTables default animation */
.dataTables_processing > div,
.dt-processing > div {
    display: none !important;
}

/* Custom spinner */
.dataTables_processing::before,
.dt-processing::before {
    content: "";
    display: inline-block;

    width: 18px;
    height: 18px;

    margin-right: 12px;
    vertical-align: middle;

    border: 2px solid #d1eae6;
    border-top-color: #149688;

    border-radius: 50%;

    animation: premiumTableSpinner 0.7s linear infinite;
}

/* Animation */
@keyframes premiumTableSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* Subtle background fade during processing */
.dt-container:has(.dt-processing[style*="display: block"]) table tbody,
.dataTables_wrapper:has(.dataTables_processing[style*="display: block"]) table tbody {
    opacity: 0.55;
    pointer-events: none;
}

/* Dark mode */
.dark .dataTables_processing,
.dark .dt-processing,
[data-theme="dark"] .dataTables_processing,
[data-theme="dark"] .dt-processing {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.25) !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .dataTables_processing::before,
    .dt-processing::before {
        animation-duration: 1.5s;
    }
}

/* DataTables: preserve zebra striping uniformly across every column. */
.users-table-wrap table.dataTable tbody tr > th,
.users-table-wrap table.dataTable tbody tr > td {
    background-color: transparent !important;
    box-shadow: none !important;
}
.users-table-wrap table.dataTable tbody tr:nth-child(odd) {
    background-color: #f8fafb !important;
}
.users-table-wrap table.dataTable tbody tr:nth-child(even) {
    background-color: #f1f5f7 !important;
}
.users-table-wrap table.dataTable tbody tr:hover {
    background-color: #e6f4f1 !important;
}
