/*
 * WMS UI system
 * The final, component-oriented interface layer. New work belongs here or in
 * a feature stylesheet; legacy rules in style.css are kept only while each
 * screen is migrated, so future changes do not create another override pile.
 */

html { min-width: 320px; background: var(--bg-main); }
body { min-width: 320px; color: var(--text-main); font-family: var(--font-body); }
button, input, select, textarea { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* Respect the operating-system accessibility setting without changing the
   visual hierarchy of the application. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Application shell ------------------------------------------------------- */
.app-container { min-width: 0; min-height: 100dvh; }
.main-content { min-width: 0; }
.main-content > * { min-width: 0; }
.panel-container,
.page-panel { width: min(100%, var(--content-max-width)); min-width: 0; margin-inline: auto; }
.panel-header { display: grid; gap: var(--space-1); }
.panel-header h2 { margin: 0; font-family: var(--font-heading); font-weight: 800; letter-spacing: -0.01em; }
.panel-header p { margin-bottom: 0; }
.workspace-panel-slot { min-width: 0; margin-top: 20px; }
.panel-loading {
    display: grid;
    min-height: 220px;
    place-content: center;
    justify-items: center;
    gap: 10px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    background: color-mix(in srgb, var(--surface-soft) 50%, transparent);
    font-size: 13px;
    font-weight: 700;
}
.panel-loading > i { color: var(--color-blue); font-size: 22px; }

/* Shared surfaces and action rhythm -------------------------------------- */
.card-glass,
.dashboard-card,
.workflow-scan-panel,
.workflow-form-panel,
.operations-progress-card,
.operations-purchase-card,
.operations-report-card,
.operations-user-card,
.operations-tip-card,
.operations-alert-card,
.operations-backup-card,
.operations-checklist,
.stocktake-card,
.requisition-queue-card,
.req-card-item {
    min-width: 0;
    border-color: var(--border-color);
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-accent {
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: normal;
    text-align: center;
    touch-action: manipulation;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-success:focus-visible,
.btn-danger:focus-visible,
.btn-accent:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}
[role='button']:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

input:not([type='checkbox']):not([type='radio']),
select,
textarea,
.input-text,
.input-select {
    min-width: 0;
    min-height: var(--control-height);
}

.table-responsive { max-width: 100%; overscroll-behavior-inline: contain; }
.table th,
.table td { overflow-wrap: anywhere; }

/* Global header ----------------------------------------------------------- */
.top-header { position: relative; z-index: var(--z-header); }
.top-header__layout {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
}
.top-header__brand,
.header-search,
.top-header__status,
.top-header__account-actions {
    display: flex;
    min-width: 0;
    align-items: center;
}
.top-header__brand { gap: var(--space-3); }
.header-search { min-width: 0; gap: 10px; }
.header-search img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}
.header-search h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-header__status { justify-content: center; gap: var(--space-2); }
.live-clock-widget { min-height: 32px; }
.live-clock-widget > i { color: var(--color-accent); }
.live-clock-widget small { color: var(--text-muted); font-size: 10px; }
.header-scanner-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid color-mix(in srgb, var(--color-blue) 35%, var(--border-color));
    border-radius: var(--radius-sm);
    color: var(--color-blue);
    background: color-mix(in srgb, var(--color-blue) 11%, transparent);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.top-header__account-actions { justify-content: flex-end; gap: var(--space-2); }
.header-account-action { position: relative; min-height: 38px; padding: 7px 10px; font-size: 12px; }
.header-notification-button { min-width: 38px; padding-inline: 9px; }
.header-notification-button.has-unread {
    border-color: color-mix(in srgb, var(--color-red) 50%, var(--border-color));
    color: var(--color-red);
    background: color-mix(in srgb, var(--color-red) 11%, transparent);
}
.header-notification-count {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--color-red);
    box-shadow: 0 2px 5px color-mix(in srgb, var(--color-red) 42%, transparent);
    font-size: 10px;
    font-weight: 800;
}

/* Sidebar ----------------------------------------------------------------- */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}
.sidebar-brand { display: flex; min-width: 0; align-items: center; gap: 10px; }
.brand-logo-img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    object-fit: contain;
}
.logo-text { min-width: 0; }
.logo-text h2 { margin: 0; color: var(--text-main); font-size: 15px; font-weight: 800; letter-spacing: 0.5px; line-height: 1.2; }
.logo-text span { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.sidebar .divider { margin: 10px 0; }
.nav-btn--disabled { opacity: 0.52; }
.badge-count-green {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--color-green);
    font-size: 11px;
    font-weight: 800;
}
.sidebar-system-controls { display: grid; gap: var(--space-2); margin-bottom: 15px; }
.sidebar-role-badge,
.sidebar-connection-badge {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.sidebar-role-badge { min-height: 34px; padding: 8px; font-size: 11px; white-space: nowrap; }
.sidebar-connection-badge { min-height: 30px; margin-top: 4px; padding: 6px; }
.sidebar-theme-action { display: grid; grid-template-columns: minmax(0, 1fr); }
.sidebar-account-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sidebar-control-button { min-width: 0; min-height: 36px; padding: 7px 3px; border-radius: 7px; font-size: 10px; }
.active-user-badge__icon { flex: 0 0 auto; font-size: 16px; }
.active-user-badge__copy { min-width: 0; text-align: left; }
.active-user-badge__name { overflow: hidden; color: var(--text-main); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.active-user-badge__meta { overflow-wrap: anywhere; color: var(--text-muted); font-size: 9px; }

/* Workflow state: content should explain what happens next.  The same empty,
   notice and action spacing is used on dashboards, queues and forms. */
.operations-empty,
.empty-state,
.no-data-message {
    min-height: 96px;
    display: grid;
    place-items: center;
    padding: var(--space-5);
    text-align: center;
}
.operations-form,
.workflow-form,
.modal-form-stack { gap: var(--space-3); }
.operations-form label,
.modal-form-stack label { min-width: 0; }
.operations-layout,
.dashboard-grid,
.stats-grid { min-width: 0; }
.panel-inline-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 700;
}
.panel-inline-notice > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}
.panel-inline-notice > button { flex: 0 0 auto; min-height: 36px; padding: 6px 10px; font-size: 12px; }
.panel-inline-notice--error {
    border-color: color-mix(in srgb, var(--color-red) 48%, var(--border-color));
    color: var(--color-red);
    background: color-mix(in srgb, var(--color-red) 10%, var(--bg-card));
}

/* Dialogs and fixed mobile controls -------------------------------------- */
.modal-overlay { z-index: var(--z-modal); }
body.has-modal-open .mobile-bottom-nav,
body.has-modal-open .mobile-fab-container { visibility: hidden; pointer-events: none; }

@media (max-width: 1180px) {
    .sidebar-placeholder { display: none !important; }
    .top-header__layout { grid-template-columns: minmax(0, 1fr) auto; }
    .top-header__status { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
    .top-header__account-actions { grid-column: 2; grid-row: 1; }
    .header-scanner-status span { display: none; }
    .header-scanner-status { padding-inline: 9px; }
}

@media (max-width: 1024px) {
    .app-container { grid-template-columns: 232px minmax(0, 1fr); }
    .sidebar { width: 232px; padding-inline: 12px; }
    .main-content { padding: 18px 18px calc(96px + env(safe-area-inset-bottom)); }
    .panel-header h2 { font-size: clamp(20px, 3vw, 24px); }
}

@media (max-width: 640px) {
    .main-content { padding: 12px 10px calc(96px + env(safe-area-inset-bottom)); }
    .workspace-panel-slot { margin-top: 14px; }
    .top-header { margin-bottom: var(--space-4); }
    .top-header__layout {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            'brand account'
            'status account';
        gap: 8px;
    }
    .top-header__brand { grid-area: brand; gap: 8px; }
    .top-header__status { grid-area: status; grid-column: auto; grid-row: auto; min-width: 0; }
    .top-header__account-actions { grid-area: account; grid-column: auto; grid-row: auto; align-self: center; }
    .header-search { gap: 7px; }
    .header-search img { width: 31px; height: 31px; flex-basis: 31px; padding: 2px; border-radius: 7px; }
    .header-search h1 { font-size: 14px; }
    .top-header__status .header-scanner-status { display: none; }
    .live-clock-widget { min-height: 28px; padding: 5px 8px; font-size: 10px; }
    .live-clock-widget .clock-divider,
    .live-clock-widget small { display: none; }
    .header-account-summary,
    .header-account-action-label { display: none; }
    .header-account-action { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 9px; }
    .header-account-action--logout { width: 58px; min-width: 58px; font-size: 0; }
    .header-account-action--logout::after { content: 'ออก'; font-size: 11px; font-weight: 800; }
    .header-notification-count { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; }
    .sidebar-account-actions { gap: 5px; }
    .sidebar-control-button { min-height: 38px; font-size: 9px; }
    .table { min-width: 600px; }
    .table th,
    .table td { padding: 10px 11px; }
    .panel-inline-notice { align-items: stretch; flex-direction: column; }
    .panel-inline-notice > button { width: 100%; }
    .modal-card:not(.modal-card--image):not(.modal-card--document) { width: min(100%, 560px); }
}

@media (max-width: 390px) {
    .top-header__account-actions { gap: 5px; }
    .header-account-action--logout { width: 52px; min-width: 52px; }
    .sidebar-account-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablet workspace --------------------------------------------------------
   iPad has enough room for dense information, but not for a persistent
   desktop sidebar plus two narrow content columns.  Treat it as its own
   workspace: navigation becomes an on-demand panel and the task area keeps
   the full screen width.  This applies to every panel through shared shell,
   card, form and table classes rather than fixing one screen at a time. */
@media (min-width: 641px) and (max-width: 1180px) {
    .app-container { grid-template-columns: minmax(0, 1fr) !important; }
    .sidebar-placeholder { display: none !important; }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -100vw !important;
        width: min(360px, 88vw) !important;
        max-width: 88vw !important;
        padding: 20px 18px !important;
        z-index: 999999 !important;
        box-shadow: 12px 0 36px rgba(2, 6, 23, 0.5) !important;
        transition: left 200ms ease !important;
    }

    .sidebar.sidebar-open,
    .sidebar.active { left: 0 !important; }

    .btn-close-sidebar,
    .btn-mobile-menu { display: flex !important; }

    /* The tablet uses the header menu, avoiding duplicate persistent menus
       while preserving the room needed for tables and approval actions. */
    .mobile-bottom-nav,
    .mobile-fab-container { display: none !important; }

    .main-content {
        padding: 20px clamp(18px, 3vw, 32px) calc(32px + env(safe-area-inset-bottom)) !important;
    }

    .panel-container,
    .page-panel { width: 100%; max-width: none; }
    .workspace-panel-slot { margin-top: 18px; }

    .top-header { margin-bottom: 20px; }
    .top-header__layout {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }
    .top-header__status {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }
    .top-header__account-actions { grid-column: 2; grid-row: 1; }
    .header-account-action { min-height: 42px; padding: 9px 11px; font-size: 13px; }
    .header-account-summary { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .live-clock-widget,
    .header-scanner-status { min-height: 36px; font-size: 12px; }

    .card-glass,
    .dashboard-card,
    .workflow-scan-panel,
    .workflow-form-panel,
    .operations-progress-card,
    .operations-purchase-card,
    .operations-report-card,
    .operations-user-card,
    .operations-tip-card,
    .operations-alert-card,
    .operations-backup-card,
    .stocktake-card,
    .requisition-queue-card,
    .req-card-item { padding: 20px; }

    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-accent { min-height: 42px; font-size: 13px; }

    .operations-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .operations-tabs { gap: 10px; margin-block: 20px; }
    .operations-tabs button { min-height: 44px; padding: 10px 14px; font-size: 13px; }
    .operations-user-list > div,
    .operations-order,
    .operations-alert,
    .operations-lot-list > div,
    .operations-location-report > div,
    .operations-outbox-list > div,
    .operations-backup-list > div { padding: 14px 16px; gap: 14px; }
    .operations-user-list strong,
    .operations-order strong,
    .operations-alert strong { font-size: 14px; }
    .operations-user-list span,
    .operations-order span,
    .operations-alert p { font-size: 12px; }
    .operations-order__actions .btn-secondary,
    .operations-order__actions .btn-success { min-height: 40px; padding: 8px 11px; font-size: 12px; }
    .operations-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .operations-metrics > div { padding: 14px 10px; }
    .operations-metrics span { font-size: 11px; }
    .operations-metrics strong { font-size: 24px; }
    .operations-receipt-line { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; }
    .operations-receipt-line > strong { grid-column: 1 / -1; }
    .operations-integration-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
    .operations-integration-row__summary,
    .operations-endpoint { grid-column: 1 / -1; }

    .wms-form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid,
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .form-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .table { min-width: 640px; }
    .table th,
    .table td { padding: 12px 13px; font-size: 13px; }
}

@media (min-width: 641px) and (max-width: 860px) {
    .header-account-summary { display: none; }
    .header-account-action-label { display: none; }
    .header-account-action--logout { min-width: 52px; padding-inline: 10px; font-size: 0; }
    .header-account-action--logout::after { content: 'à¸­à¸­à¸'; font-size: 12px; font-weight: 800; }
    .operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-user-list__item { align-items: flex-start; flex-direction: column; }
    .operations-user-list__item > div:last-child {
        display: grid !important;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px !important;
    }
    .operations-user-list__item > div:last-child .btn-secondary,
    .operations-user-list__item > div:last-child .btn-success { width: 100%; }
    .operations-reset-request { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .operations-reset-request > .btn-primary { width: 100%; }
}

/* Keep logout labels ASCII-safe in CSS.  Thai characters encoded directly in
   an older stylesheet were interpreted twice by some iPad browsers. */
@media (max-width: 640px) {
    .top-header__account-actions .btn-secondary.header-account-action--logout::after {
        content: "\0e2d\0e2d\0e01";
    }
}

@media (min-width: 641px) and (max-width: 860px) {
    .header-account-action--logout { min-width: 108px; }
    .top-header__account-actions .btn-secondary.header-account-action--logout::after {
        content: "\0e2d\0e2d\0e01\0e08\0e32\0e01\0e23\0e23\0e30\0e1a";
        font-size: 12px;
        font-weight: 800;
    }
}

/* Account management ------------------------------------------------------
   Each person is a compact management record: identity and status on the
   left, deliberate actions on the right.  This prevents the large action
   buttons from visually overwhelming the employee details on tablets. */
.operations-user-list__item {
    align-items: center;
    border-left-width: 4px !important;
    text-align: left !important;
}
.operations-user-list__identity {
    position: relative;
    display: grid;
    min-width: 0;
    gap: 3px;
    padding-left: 42px;
    text-align: left;
}
.operations-user-list__identity::before {
    content: '\f2bd';
    position: absolute;
    top: 3px;
    left: 0;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    color: var(--color-blue);
    background: color-mix(in srgb, var(--color-blue) 13%, transparent);
    font-family: 'Font Awesome 7 Free';
    font-size: 14px;
    font-weight: 900;
}
.operations-user-list__identity strong {
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font-size: 14px;
}
.operations-user-list__identity > span {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}
.operations-user-list__identity em {
    width: max-content;
    max-width: 100%;
    margin-top: 4px;
    overflow-wrap: anywhere;
}
.operations-user-list__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.operations-user-list__actions .btn-secondary,
.operations-user-list__actions .btn-success {
    min-height: 40px;
    padding: 8px 12px !important;
    font-size: 12px !important;
}
.operations-user-list__item--active { border-left-color: var(--color-green) !important; }
.operations-user-list__item--suspended { border-left-color: var(--color-red) !important; }
.operations-user-list__item--pending { border-left-color: var(--color-accent) !important; }

@media (min-width: 861px) {
    .operations-user-list__item { min-height: 84px; }
    .operations-user-list__identity { flex: 1 1 360px; }
}

@media (max-width: 860px) {
    .operations-user-list__item { align-items: stretch; }
    .operations-user-list__identity { padding-left: 40px; }
    .operations-user-list__actions {
        display: grid !important;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px !important;
    }
    .operations-user-list__actions .btn-secondary,
    .operations-user-list__actions .btn-success { width: 100%; }
}

@media (max-width: 460px) {
    .operations-user-list__actions { grid-template-columns: minmax(0, 1fr); }
}

/* Dialog foundation -------------------------------------------------------
   Legacy screens historically supplied their own full-screen overlays.  New
   portals add modal-overlay--open so every dialog shares one backdrop and
   one scroll container instead of producing overlapping frames. */
.modal-overlay.modal-overlay--open {
    position: fixed !important;
    inset: 0 !important;
    z-index: var(--z-modal) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(10px, 2.5vw, 24px) !important;
    background: rgba(2, 6, 23, 0.68) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}
.modal-overlay.modal-overlay--open > .modal-card:not(.modal-card--image):not(.modal-card--document) {
    width: min(720px, calc(100vw - 32px)) !important;
    height: auto !important;
    max-height: min(760px, calc(100dvh - 32px)) !important;
    margin: 0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    background: var(--bg-card) !important;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.48) !important;
}
.modal-overlay.modal-overlay--open > .modal-card > .modal-header,
.modal-overlay.modal-overlay--open > .modal-card > .modal-footer {
    flex: 0 0 auto;
}
.modal-overlay.modal-overlay--open > .modal-card > .modal-body {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

/* Notification center: one dialog, with readable state and no nested shade. */
.notification-center-modal__card {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}
.notification-center-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--surface-soft) 72%, var(--bg-card));
}
.notification-center-modal__heading,
.notification-center-modal__header-actions,
.notification-center-modal__item-main,
.notification-center-modal__item-title {
    display: flex;
    min-width: 0;
    align-items: center;
}
.notification-center-modal__heading { gap: 12px; align-items: flex-start; }
.notification-center-modal__icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--color-blue) 36%, var(--border-color));
    border-radius: 12px;
    color: var(--color-blue);
    background: color-mix(in srgb, var(--color-blue) 13%, transparent);
    font-size: 18px;
}
.notification-center-modal__heading h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-main);
    font-size: 17px;
    line-height: 1.3;
}
.notification-center-modal__heading p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.notification-center-modal__unread-count,
.notification-center-modal__tab-count {
    display: inline-grid;
    min-width: 18px;
    place-items: center;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}
.notification-center-modal__unread-count { min-height: 20px; padding: 2px 8px; color: #fff; background: var(--color-red); }
.notification-center-modal__header-actions { flex: 0 0 auto; gap: 8px; }
.notification-center-modal__clear { min-height: 36px; padding: 6px 10px; font-size: 11px; }
.notification-center-modal__close { flex: 0 0 36px; margin: 0; color: var(--text-muted); }
.notification-center-modal__tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    padding: 10px 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-main) 45%, var(--bg-card));
    scrollbar-width: thin;
}
.notification-center-modal__tab {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-muted);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.notification-center-modal__tab.is-active {
    border-color: color-mix(in srgb, var(--color-blue) 45%, var(--border-color));
    color: var(--color-blue);
    background: color-mix(in srgb, var(--color-blue) 12%, transparent);
}
.notification-center-modal__tab-count { min-height: 17px; padding: 1px 5px; color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 15%, transparent); }
.notification-center-modal__list {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    gap: 10px;
    padding: 16px 20px;
    overflow: auto;
    overscroll-behavior: contain;
}
.notification-center-modal__empty { display: grid; min-height: 200px; place-content: center; justify-items: center; padding: 24px; color: var(--text-muted); text-align: center; }
.notification-center-modal__empty > i { margin-bottom: 10px; opacity: 0.38; font-size: 42px; }
.notification-center-modal__empty h4 { margin: 0 0 4px; color: var(--text-main); font-size: 15px; }
.notification-center-modal__empty p { margin: 0; font-size: 12px; }
.notification-center-modal__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid color-mix(in srgb, var(--notice-color) 34%, var(--border-color));
    border-left: 4px solid var(--notice-color);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--notice-background) 55%, var(--bg-card));
}
.notification-center-modal__item.is-read { opacity: 0.74; }
.notification-center-modal__item-main { flex: 1 1 auto; align-items: flex-start; gap: 11px; }
.notification-center-modal__item-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    color: var(--notice-color);
    background: var(--notice-background);
    font-size: 15px;
}
.notification-center-modal__item-copy { min-width: 0; flex: 1 1 auto; }
.notification-center-modal__item-title { flex-wrap: wrap; gap: 6px; align-items: baseline; }
.notification-center-modal__item-label { padding: 2px 6px; border-radius: 5px; color: var(--notice-color); background: var(--notice-background); font-size: 10px; font-weight: 800; }
.notification-center-modal__item-title strong { min-width: 0; color: var(--text-main); font-size: 13px; overflow-wrap: anywhere; }
.notification-center-modal__item-time { margin-left: auto; color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.notification-center-modal__item-copy > p { margin: 5px 0 9px; color: var(--text-muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.notification-center-modal__item-action { min-height: 30px; padding: 4px 9px; border-color: color-mix(in srgb, var(--notice-color) 45%, var(--border-color)); color: var(--notice-color); font-size: 10px; }
.notification-center-modal__item-close { width: 28px; min-width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; color: var(--text-muted); background: transparent; font-size: 18px; line-height: 1; }
.notification-center-modal__item-close:hover,
.notification-center-modal__item-close:focus-visible { color: var(--notice-color); background: var(--notice-background); }

/* Fast barcode registration uses the shared dialog frame and remains compact. */
.modal-overlay.modal-overlay--open > .quick-product-modal__card { width: min(540px, calc(100vw - 32px)) !important; }
.quick-product-modal__card .modal-body { padding: 20px; }

@media (max-width: 640px) {
    .modal-overlay.modal-overlay--open { align-items: center !important; padding: 10px !important; }
    .modal-overlay.modal-overlay--open > .modal-card:not(.modal-card--image):not(.modal-card--document) { width: 100% !important; max-height: calc(100dvh - 20px) !important; }
    .notification-center-modal__header { padding: 14px; }
    .notification-center-modal__heading h3 { font-size: 15px; }
    .notification-center-modal__heading p { font-size: 11px; }
    .notification-center-modal__clear { width: 36px; min-width: 36px; padding: 0; font-size: 0; }
    .notification-center-modal__clear > i { font-size: 13px; }
    .notification-center-modal__tabs { padding: 9px 14px; }
    .notification-center-modal__list { gap: 8px; padding: 12px 14px; }
    .notification-center-modal__item { padding: 11px; }
    .notification-center-modal__item-time { width: 100%; margin-left: 0; }
}
