:root {
    --mh-control-h: 48px;
    --mh-radius-control: 10px;
    --mh-radius-card: 16px;
    --mh-radius-pill: 999px;
    --mh-gap: 12px;

    --mh-ease: cubic-bezier(0.22, 0.8, 0.28, 1);
    --mh-ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --mh-dur-fast: 0.15s;
    --mh-dur: 0.22s;
    --mh-dur-slow: 0.32s;

    --mh-shadow-pop: 0 16px 40px -8px rgba(15, 23, 42, 0.28);
    --mh-focus-ring: 0 0 0 3px rgba(var(--primary-rgb, 76, 161, 175), 0.22);

    --mh-success-solid: #16a34a; --mh-success-fg: #047857; --mh-success-bg: #ecfdf5; --mh-success-border: #a7f3d0;
    --mh-warning-solid: #d97706; --mh-warning-fg: #b45309; --mh-warning-bg: #fffbeb; --mh-warning-border: #fde68a;
    --mh-danger-solid:  #dc2626; --mh-danger-fg:  #b91c1c; --mh-danger-bg:  #fef2f2; --mh-danger-border:  #fecaca;
    --mh-info-solid:    #0ea5e9; --mh-info-fg:    #0369a1; --mh-info-bg:    #eff6ff; --mh-info-border:    #bae6fd;
    --mh-neutral-solid: #64748b; --mh-neutral-fg: #475569; --mh-neutral-bg: #f1f5f9; --mh-neutral-border: #cbd5e1;

    --mh-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
html[data-theme="dark"] {
    --mh-shadow-pop: 0 18px 44px -8px rgba(0, 0, 0, 0.6);
    --mh-success-solid: #34d399; --mh-success-fg: #6ee7b7; --mh-success-bg: rgba(16, 185, 129, 0.14); --mh-success-border: rgba(52, 211, 153, 0.35);
    --mh-warning-solid: #fbbf24; --mh-warning-fg: #fcd34d; --mh-warning-bg: rgba(245, 158, 11, 0.14); --mh-warning-border: rgba(251, 191, 36, 0.35);
    --mh-danger-solid:  #f87171; --mh-danger-fg:  #fca5a5; --mh-danger-bg:  rgba(239, 68, 68, 0.14);  --mh-danger-border:  rgba(248, 113, 113, 0.38);
    --mh-info-solid:    #38bdf8; --mh-info-fg:    #7dd3fc; --mh-info-bg:    rgba(14, 165, 233, 0.14); --mh-info-border:    rgba(56, 189, 248, 0.35);
    --mh-neutral-solid: #94a3b8; --mh-neutral-fg: #cbd5e1; --mh-neutral-bg: rgba(148, 163, 184, 0.14); --mh-neutral-border: rgba(148, 163, 184, 0.3);
    --mh-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

@keyframes mh-fade-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes mh-pop-in     { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes mh-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes mh-dropdown-in{ from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes mh-page-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes mh-spin       { to { transform: rotate(360deg); } }
@keyframes mh-shake      { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }
@keyframes mh-toast-bar  { from { transform: scaleX(1); } to { transform: scaleX(0); } }

body:not(.bg-auth):not(.bg-landing) .main-content { animation: mh-page-in var(--mh-dur-slow) var(--mh-ease) both; }

body:has(.modal-overlay.active), body:has(.universal-modal.active) { overflow: hidden; }

body:not(.bg-auth):not(.bg-landing) :is(.btn-add, .btn-submit, .btn-primary, .btn-save, .btn-secondary, .btn-danger, .btn-ghost) {
    min-height: var(--mh-control-h);
    padding: 0 28px;
    border-radius: var(--mh-radius-pill);
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.2;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: transform var(--mh-dur-fast) var(--mh-ease), box-shadow var(--mh-dur) var(--mh-ease),
                background-color var(--mh-dur-fast) ease, filter var(--mh-dur-fast) ease, border-color var(--mh-dur-fast) ease;
}
body:not(.bg-auth):not(.bg-landing) :is(.btn-add, .btn-submit, .btn-primary, .btn-save, .btn-secondary, .btn-danger, .btn-ghost):active { transform: translateY(0) scale(0.97); }
body:not(.bg-auth):not(.bg-landing) :is(.btn-add, .btn-submit, .btn-primary, .btn-save, .btn-secondary, .btn-danger, .btn-ghost, .btn-view-record, .btn-icon, .btn-outline-blue, .btn-outline-green, .btn-outline-red):focus-visible {
    outline: none; box-shadow: var(--mh-focus-ring);
}
body:not(.bg-auth):not(.bg-landing) :is(.btn-save) { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff; border: none; box-shadow: var(--glow-primary, 0 8px 20px -6px rgba(76,161,175,.45)); }
body:not(.bg-auth):not(.bg-landing) :is(.btn-save):hover { filter: brightness(1.06); transform: translateY(-2px); }
body:not(.bg-auth):not(.bg-landing) :is(.btn-add, .btn-submit, .btn-primary, .btn-save, .btn-secondary, .btn-danger, .btn-ghost, .btn-view-record, .btn-icon, .btn-outline-blue, .btn-outline-green, .btn-outline-red):disabled,
body:not(.bg-auth):not(.bg-landing) :is(.btn-add, .btn-submit, .btn-primary, .btn-save, .btn-secondary, .btn-danger, .btn-ghost)[aria-disabled="true"] {
    opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: grayscale(0.25);
}

body:not(.bg-auth):not(.bg-landing) :is(.btn-add, .btn-submit, .btn-secondary, .btn-danger, .btn-ghost, .btn-primary, .btn-save).btn-sm { min-height: 40px; padding: 0 20px; font-size: 0.88rem; }

.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading > * { opacity: 0; }
.is-loading::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
    border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff;
    animation: mh-spin 0.7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after, .btn-view-record.is-loading::after, .btn-outline-blue.is-loading::after,
.btn-outline-green.is-loading::after, .btn-outline-red.is-loading::after {
    border-color: rgba(100, 116, 139, 0.35); border-top-color: var(--primary);
}

body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .form-group select,
body:not(.bg-auth):not(.bg-landing) .form-group textarea,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .mh-field select,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .modal-content select,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .du-modal-box select,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea,
body:not(.bg-auth):not(.bg-landing) .search-box,
body:not(.bg-auth):not(.bg-landing) .mh-input,
body:not(.bg-auth):not(.bg-landing) .mh-select,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .panel-controls select,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]) {
    min-height: var(--mh-control-h);
    padding-top: 0; padding-bottom: 0;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: var(--mh-radius-control);
    background-color: var(--bg-input, #f8fafc);
    color: var(--text-main, #334155);
    font-family: inherit; font-size: 0.95rem; line-height: 1.3;
    box-sizing: border-box;
    transition: border-color var(--mh-dur-fast) ease, box-shadow var(--mh-dur) var(--mh-ease), background-color var(--mh-dur-fast) ease;
}
body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .form-group select:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .form-group textarea:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .mh-field select:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .mh-field textarea:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .modal-content select:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .modal-content textarea:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .du-modal-box select:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .search-box:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .mh-input:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .mh-select:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .panel-controls select:hover:not(:disabled):not(:focus),
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):hover:not(:disabled):not(:focus) { border-color: var(--text-muted, #64748b); }
body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus,
body:not(.bg-auth):not(.bg-landing) .form-group select:focus,
body:not(.bg-auth):not(.bg-landing) .form-group textarea:focus,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus,
body:not(.bg-auth):not(.bg-landing) .mh-field select:focus,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea:focus,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus,
body:not(.bg-auth):not(.bg-landing) .modal-content select:focus,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea:focus,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus,
body:not(.bg-auth):not(.bg-landing) .du-modal-box select:focus,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea:focus,
body:not(.bg-auth):not(.bg-landing) .search-box:focus,
body:not(.bg-auth):not(.bg-landing) .mh-input:focus,
body:not(.bg-auth):not(.bg-landing) .mh-select:focus,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select:focus,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus,
body:not(.bg-auth):not(.bg-landing) .panel-controls select:focus,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus,
body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus-visible,
body:not(.bg-auth):not(.bg-landing) .form-group select:focus-visible,
body:not(.bg-auth):not(.bg-landing) .form-group textarea:focus-visible,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus-visible,
body:not(.bg-auth):not(.bg-landing) .mh-field select:focus-visible,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea:focus-visible,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus-visible,
body:not(.bg-auth):not(.bg-landing) .modal-content select:focus-visible,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea:focus-visible,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus-visible,
body:not(.bg-auth):not(.bg-landing) .du-modal-box select:focus-visible,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea:focus-visible,
body:not(.bg-auth):not(.bg-landing) .search-box:focus-visible,
body:not(.bg-auth):not(.bg-landing) .mh-input:focus-visible,
body:not(.bg-auth):not(.bg-landing) .mh-select:focus-visible,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select:focus-visible,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus-visible,
body:not(.bg-auth):not(.bg-landing) .panel-controls select:focus-visible,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus-visible {
    outline: none; border-color: var(--primary); background-color: var(--bg-card, #fff); box-shadow: var(--mh-focus-ring);
}
body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):disabled,
body:not(.bg-auth):not(.bg-landing) .form-group select:disabled,
body:not(.bg-auth):not(.bg-landing) .form-group textarea:disabled,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):disabled,
body:not(.bg-auth):not(.bg-landing) .mh-field select:disabled,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea:disabled,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):disabled,
body:not(.bg-auth):not(.bg-landing) .modal-content select:disabled,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea:disabled,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):disabled,
body:not(.bg-auth):not(.bg-landing) .du-modal-box select:disabled,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea:disabled,
body:not(.bg-auth):not(.bg-landing) .search-box:disabled,
body:not(.bg-auth):not(.bg-landing) .mh-input:disabled,
body:not(.bg-auth):not(.bg-landing) .mh-select:disabled,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select:disabled,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):disabled,
body:not(.bg-auth):not(.bg-landing) .panel-controls select:disabled,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):disabled { background-color: var(--bg-hover, #f1f5f9); color: var(--text-muted, #64748b); cursor: not-allowed; opacity: 0.85; }
body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"])::placeholder,
body:not(.bg-auth):not(.bg-landing) .form-group select::placeholder,
body:not(.bg-auth):not(.bg-landing) .form-group textarea::placeholder,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"])::placeholder,
body:not(.bg-auth):not(.bg-landing) .mh-field select::placeholder,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea::placeholder,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"])::placeholder,
body:not(.bg-auth):not(.bg-landing) .modal-content select::placeholder,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea::placeholder,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"])::placeholder,
body:not(.bg-auth):not(.bg-landing) .du-modal-box select::placeholder,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea::placeholder,
body:not(.bg-auth):not(.bg-landing) .search-box::placeholder,
body:not(.bg-auth):not(.bg-landing) .mh-input::placeholder,
body:not(.bg-auth):not(.bg-landing) .mh-select::placeholder,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select::placeholder,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"])::placeholder,
body:not(.bg-auth):not(.bg-landing) .panel-controls select::placeholder,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"])::placeholder { color: var(--text-muted, #64748b); opacity: 0.7; }

body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .form-group select,
body:not(.bg-auth):not(.bg-landing) .form-group textarea,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .mh-field select,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .modal-content select,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .du-modal-box select,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea,
body:not(.bg-auth):not(.bg-landing) .mh-input,
body:not(.bg-auth):not(.bg-landing) .mh-select { padding-left: 12px; padding-right: 12px; }
body:not(.bg-auth):not(.bg-landing) .mh-input,
body:not(.bg-auth):not(.bg-landing) .mh-select,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body:not(.bg-auth):not(.bg-landing) .panel-controls select,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]) { padding-left: 12px; padding-right: 12px; }
body:not(.bg-auth):not(.bg-landing) .form-group textarea,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea { padding-top: 10px; padding-bottom: 10px; min-height: 90px; resize: vertical; line-height: 1.5; }

body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid,
body:not(.bg-auth):not(.bg-landing) .form-group select.invalid,
body:not(.bg-auth):not(.bg-landing) .form-group textarea.invalid,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid,
body:not(.bg-auth):not(.bg-landing) .mh-field select.invalid,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea.invalid,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid,
body:not(.bg-auth):not(.bg-landing) .modal-content select.invalid,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea.invalid,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid,
body:not(.bg-auth):not(.bg-landing) .du-modal-box select.invalid,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea.invalid,
body:not(.bg-auth):not(.bg-landing) .search-box.invalid,
body:not(.bg-auth):not(.bg-landing) .mh-input.invalid,
body:not(.bg-auth):not(.bg-landing) .mh-select.invalid,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select.invalid,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid,
body:not(.bg-auth):not(.bg-landing) .panel-controls select.invalid,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid { border-color: var(--mh-danger-solid); }
body:not(.bg-auth):not(.bg-landing) .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid:focus,
body:not(.bg-auth):not(.bg-landing) .form-group select.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .form-group textarea.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .mh-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid:focus,
body:not(.bg-auth):not(.bg-landing) .mh-field select.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .mh-field textarea.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid:focus,
body:not(.bg-auth):not(.bg-landing) .modal-content select.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .modal-content textarea.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .du-modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid:focus,
body:not(.bg-auth):not(.bg-landing) .du-modal-box select.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .du-modal-box textarea.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .search-box.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .mh-input.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .mh-select.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .filter-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid:focus,
body:not(.bg-auth):not(.bg-landing) .panel-controls select.invalid:focus,
body:not(.bg-auth):not(.bg-landing) .panel-controls input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]).invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2); }
.mh-shake { animation: mh-shake 0.35s ease; }
body:not(.bg-auth):not(.bg-landing) .field-error { display: block; margin-top: 5px; font-size: 0.8rem; font-weight: 600; color: var(--mh-danger-fg); animation: mh-slide-down 0.2s var(--mh-ease) both; }
body:not(.bg-auth):not(.bg-landing) .field-hint  { display: block; margin-top: 5px; font-size: 0.8rem; color: var(--text-muted, #64748b); }
body:not(.bg-auth):not(.bg-landing) .form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-main, #334155); margin-bottom: 6px; }

body:not(.bg-auth):not(.bg-landing) .form-group select:not([multiple]):not([size]),
body:not(.bg-auth):not(.bg-landing) .mh-field select:not([multiple]):not([size]),
body:not(.bg-auth):not(.bg-landing) .modal-content select:not([multiple]):not([size]),
body:not(.bg-auth):not(.bg-landing) .du-modal-box select:not([multiple]):not([size]),
body:not(.bg-auth):not(.bg-landing) .mh-select:not([multiple]):not([size]),
body:not(.bg-auth):not(.bg-landing) .filter-toolbar select:not([multiple]):not([size]),
body:not(.bg-auth):not(.bg-landing) .panel-controls select:not([multiple]):not([size]) {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: var(--mh-select-arrow); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
    padding-right: 38px; cursor: pointer; text-overflow: ellipsis;
}
body:not(.bg-auth):not(.bg-landing) select[multiple], body:not(.bg-auth):not(.bg-landing) select[size]:not([size="1"]) { min-height: 120px; padding: 6px; }

body:not(.bg-auth):not(.bg-landing) input[type="date"]::-webkit-calendar-picker-indicator,
body:not(.bg-auth):not(.bg-landing) input[type="time"]::-webkit-calendar-picker-indicator,
body:not(.bg-auth):not(.bg-landing) input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body:not(.bg-auth):not(.bg-landing) input[type="month"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; border-radius: 4px; padding: 2px; transition: opacity var(--mh-dur-fast) ease, background-color var(--mh-dur-fast) ease; }
body:not(.bg-auth):not(.bg-landing) input[type="date"]::-webkit-calendar-picker-indicator:hover,
body:not(.bg-auth):not(.bg-landing) input[type="time"]::-webkit-calendar-picker-indicator:hover,
body:not(.bg-auth):not(.bg-landing) input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
body:not(.bg-auth):not(.bg-landing) input[type="month"]::-webkit-calendar-picker-indicator:hover { opacity: 1; background-color: rgba(var(--primary-rgb, 76, 161, 175), 0.14); }

body:not(.bg-auth):not(.bg-landing) input[type="checkbox"], body:not(.bg-auth):not(.bg-landing) input[type="radio"] { accent-color: var(--primary); width: 17px; height: 17px; cursor: pointer; vertical-align: -3px; }
body:not(.bg-auth):not(.bg-landing) input[type="file"]::file-selector-button {
    margin-right: 12px; padding: 7px 16px; border: 1px solid var(--border-color, #cbd5e1); border-radius: var(--mh-radius-pill);
    background: var(--bg-hover, #f1f5f9); color: var(--text-main, #334155); font-family: inherit; font-weight: 600; font-size: 0.85rem; cursor: pointer;
    transition: background-color var(--mh-dur-fast) ease, border-color var(--mh-dur-fast) ease;
}
body:not(.bg-auth):not(.bg-landing) input[type="file"]::file-selector-button:hover { border-color: var(--primary); color: var(--primary); }

body:not(.bg-auth):not(.bg-landing) .select2-container { max-width: 100%; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: var(--mh-control-h) !important; height: auto !important;
    border: 1px solid var(--border-color, #cbd5e1) !important; border-radius: var(--mh-radius-control) !important;
    background-color: var(--bg-input, #f8fafc) !important; box-sizing: border-box;
    transition: border-color var(--mh-dur-fast) ease, box-shadow var(--mh-dur) var(--mh-ease), background-color var(--mh-dur-fast) ease;
}
.select2-container--default .select2-selection--single { height: var(--mh-control-h) !important; display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main, #334155) !important; font-size: 0.95rem; line-height: normal; padding-left: 12px; padding-right: 54px; width: 100%;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--text-muted, #64748b) !important; opacity: 0.75; }
.select2-container--default .select2-selection--single .select2-selection__clear { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); margin: 0; color: var(--text-muted, #64748b); font-size: 1.15rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 100% !important; top: 0; right: 8px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--text-muted, #64748b) transparent transparent transparent; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent var(--text-muted, #64748b) transparent; }
.select2-container--default:hover .select2-selection--single,
.select2-container--default:hover .select2-selection--multiple { border-color: var(--text-muted, #64748b) !important; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--primary) !important; box-shadow: var(--mh-focus-ring); background-color: var(--bg-card, #fff) !important;
}
.select2-container--default.select2-container--disabled .select2-selection--single { background-color: var(--bg-hover, #f1f5f9) !important; opacity: 0.8; cursor: not-allowed; }
.select2-container--default .select2-selection--multiple { padding: 3px 6px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(var(--primary-rgb, 76, 161, 175), 0.14); border: 1px solid rgba(var(--primary-rgb, 76, 161, 175), 0.3); color: var(--text-main, #334155); border-radius: var(--mh-radius-pill); padding: 2px 10px;
}

.select2-dropdown {
    background: var(--bg-card, #fff) !important; color: var(--text-main, #334155);
    border: 1px solid var(--border-color, #cbd5e1) !important; border-radius: 12px !important;
    box-shadow: var(--mh-shadow-pop); overflow: hidden; z-index: 100002;
    animation: mh-dropdown-in var(--mh-dur-fast) var(--mh-ease) both; transform-origin: top center;
}
.select2-container--open .select2-dropdown--below { margin-top: 4px; }
.select2-container--open .select2-dropdown--above { margin-bottom: 4px; }
.select2-container--default .select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
    min-height: 38px; padding: 0 12px; border: 1px solid var(--border-color, #cbd5e1) !important; border-radius: var(--mh-radius-control);
    background: var(--bg-input, #f8fafc) !important; color: var(--text-main, #334155) !important; font-family: inherit; font-size: 0.93rem; outline: none; box-sizing: border-box;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--primary) !important; box-shadow: var(--mh-focus-ring); }
.select2-container--default .select2-results__option { padding: 9px 14px; font-size: 0.93rem; color: var(--text-main, #334155); transition: background-color 0.1s ease; }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: rgba(var(--primary-rgb, 76, 161, 175), 0.16) !important; color: var(--heading-color, #0f172a) !important; }
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--selected { background: rgba(var(--primary-rgb, 76, 161, 175), 0.08); font-weight: 600; }
.select2-container--default .select2-results__option--disabled { opacity: 0.5; }
.select2-results__message { color: var(--text-muted, #64748b) !important; }

body:not(.bg-auth):not(.bg-landing) .badge { padding: 6px 14px; border-radius: var(--mh-radius-pill); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; }
.mh-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--mh-radius-pill);
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; white-space: nowrap;
    border: 1px solid var(--mh-neutral-border); background: var(--mh-neutral-bg); color: var(--mh-neutral-fg);
}
.mh-badge-success { background: var(--mh-success-bg); color: var(--mh-success-fg); border-color: var(--mh-success-border); }
.mh-badge-warning { background: var(--mh-warning-bg); color: var(--mh-warning-fg); border-color: var(--mh-warning-border); }
.mh-badge-danger  { background: var(--mh-danger-bg);  color: var(--mh-danger-fg);  border-color: var(--mh-danger-border); }
.mh-badge-info    { background: var(--mh-info-bg);    color: var(--mh-info-fg);    border-color: var(--mh-info-border); }
.mh-text-success { color: var(--mh-success-fg); } .mh-text-warning { color: var(--mh-warning-fg); }
.mh-text-danger  { color: var(--mh-danger-fg); }  .mh-text-info    { color: var(--mh-info-fg); }

body:not(.bg-auth):not(.bg-landing) :is(.unified-table, .data-table, .mh-table) { width: 100%; border-collapse: collapse; }
body:not(.bg-auth):not(.bg-landing) :is(.unified-table, .data-table, .mh-table) th {
    padding: 14px 16px; text-align: left; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
    color: var(--text-muted, #64748b); background: var(--bg-hover, #f8fafc); border-bottom: 2px solid var(--border-color, #e2e8f0);
}
body:not(.bg-auth):not(.bg-landing) :is(.unified-table, .data-table, .mh-table) td { padding: 14px 16px; font-size: 0.93rem; vertical-align: middle; color: var(--text-main, #334155); border-bottom: 1px solid var(--border-color, #e2e8f0); }
body:not(.bg-auth):not(.bg-landing) :is(.unified-table, .data-table, .mh-table) tbody tr { transition: background-color var(--mh-dur-fast) ease; }
body:not(.bg-auth):not(.bg-landing) :is(.unified-table, .data-table, .mh-table) tbody tr:hover { background-color: var(--bg-hover, #f8fafc); }
body:not(.bg-auth):not(.bg-landing) :is(.unified-table, .data-table, .mh-table) tbody tr:last-child td { border-bottom: none; }
body:not(.bg-auth):not(.bg-landing) .mh-table-sticky thead th { position: sticky; top: 0; z-index: 2; }
body:not(.bg-auth):not(.bg-landing) .table-scroll { border-radius: var(--mh-radius-control); }

body:not(.bg-auth):not(.bg-landing) .modal-overlay {
    background: rgba(15, 23, 42, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    padding: 16px; box-sizing: border-box; overscroll-behavior: contain;
    animation: mh-fade-in var(--mh-dur) ease both;
}
body:not(.bg-auth):not(.bg-landing) .modal-content { border-radius: var(--mh-radius-card); overscroll-behavior: contain; animation: mh-pop-in var(--mh-dur-slow) var(--mh-ease-spring) both; }
body:not(.bg-auth):not(.bg-landing) .du-modal { animation: mh-fade-in var(--mh-dur) ease both; }
body:not(.bg-auth):not(.bg-landing) .du-modal-box { animation: mh-pop-in var(--mh-dur-slow) var(--mh-ease-spring) both; }
body:not(.bg-auth):not(.bg-landing) .universal-modal { animation: mh-fade-in var(--mh-dur) ease both; }
body:not(.bg-auth):not(.bg-landing) .universal-modal-content { animation: mh-pop-in var(--mh-dur-slow) var(--mh-ease-spring) both; }
body:not(.bg-auth):not(.bg-landing) .close-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; line-height: 1; border-radius: 50%;
    right: 16px; top: 14px; transition: background-color var(--mh-dur-fast) ease, color var(--mh-dur-fast) ease, transform var(--mh-dur-fast) ease;
}
body:not(.bg-auth):not(.bg-landing) .close-btn:hover { background: var(--mh-danger-bg); color: var(--mh-danger-solid); transform: rotate(90deg); }

.mh-modal-card { background: var(--bg-card, var(--panel-bg, #fff)); border: 1px solid var(--border-color, transparent); }
.mh-modal-input { background: var(--bg-input, #fff); color: var(--text-main, #334155); border-color: var(--border-color, #e2e8f0); border-radius: var(--mh-radius-control); }
.mh-modal-icon.mh-type-success { background: var(--mh-success-bg); color: var(--mh-success-solid); }
.mh-modal-icon.mh-type-warning { background: var(--mh-warning-bg); color: var(--mh-warning-solid); }
.mh-modal-icon.mh-type-danger  { background: var(--mh-danger-bg);  color: var(--mh-danger-solid); }
.mh-modal-icon.mh-type-info    { background: var(--mh-info-bg);    color: var(--mh-info-solid); }
.mh-modal-message strong { color: var(--heading-color, #1e293b); }

.mh-toast {
    position: relative; overflow: hidden; background: var(--bg-card, var(--panel-bg, #fff)); color: var(--text-main, #334155);
    border: 1px solid var(--border-color, #e2e8f0); border-left-width: 4px; border-radius: 12px; box-shadow: var(--mh-shadow-pop);
    padding: 13px 14px 15px;
}
.mh-toast::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: currentColor; opacity: 0.35; transform-origin: left center;
    animation: mh-toast-bar var(--mh-toast-dur, 3.5s) linear forwards;
}
.mh-toast:hover::after { animation-play-state: paused; }
.mh-toast.mh-type-success { border-left-color: var(--mh-success-solid); } .mh-toast.mh-type-success::after { color: var(--mh-success-solid); }
.mh-toast.mh-type-warning { border-left-color: var(--mh-warning-solid); } .mh-toast.mh-type-warning::after { color: var(--mh-warning-solid); }
.mh-toast.mh-type-danger  { border-left-color: var(--mh-danger-solid); }  .mh-toast.mh-type-danger::after  { color: var(--mh-danger-solid); }
.mh-toast.mh-type-info    { border-left-color: var(--mh-info-solid); }    .mh-toast.mh-type-info::after    { color: var(--mh-info-solid); }
.mh-toast-icon.mh-type-success { color: var(--mh-success-solid); } .mh-toast-icon.mh-type-warning { color: var(--mh-warning-solid); }
.mh-toast-icon.mh-type-danger  { color: var(--mh-danger-solid); }  .mh-toast-icon.mh-type-info    { color: var(--mh-info-solid); }
.mh-toast-text { font-weight: 500; word-break: break-word; }

.alert, .pr-alert, .flash {
    border-radius: 12px; border: 1px solid var(--mh-neutral-border); border-left-width: 4px;
    background: var(--mh-neutral-bg); color: var(--mh-neutral-fg);
    animation: mh-slide-down 0.28s var(--mh-ease) both;
}
.alert-success, .pr-alert.ok   { background: var(--mh-success-bg); color: var(--mh-success-fg); border-color: var(--mh-success-border); border-left-color: var(--mh-success-solid); }
.alert-error,   .pr-alert.err  { background: var(--mh-danger-bg);  color: var(--mh-danger-fg);  border-color: var(--mh-danger-border);  border-left-color: var(--mh-danger-solid); }
.alert-warn, .alert-warning    { background: var(--mh-warning-bg); color: var(--mh-warning-fg); border-color: var(--mh-warning-border); border-left-color: var(--mh-warning-solid); }
.alert-info                    { background: var(--mh-info-bg);    color: var(--mh-info-fg);    border-color: var(--mh-info-border);    border-left-color: var(--mh-info-solid); }
.flash { background: var(--mh-info-bg); color: var(--mh-info-fg); border-color: var(--mh-info-border); border-left-color: var(--mh-info-solid); }
.pp-notice { animation: mh-slide-down 0.28s var(--mh-ease) both; }

.dropdown-content.show, .dropdown:hover .dropdown-content { animation: mh-dropdown-in var(--mh-dur-fast) var(--mh-ease) both; transform-origin: top right; }

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

@media (max-width: 768px) {
    body:not(.bg-auth):not(.bg-landing) .modal-overlay { padding: 10px; align-items: flex-start; overflow-y: auto; }
    body:not(.bg-auth):not(.bg-landing) .modal-content { margin: 8px auto; }
    body:not(.bg-auth):not(.bg-landing) :is(.btn-add, .btn-submit, .btn-primary, .btn-save, .btn-secondary, .btn-danger, .btn-ghost) { min-height: 44px; }
    .mh-toast-stack { top: 10px; left: 10px; right: 10px; max-width: none; }
}

.mh-pw { position: relative; display: block; width: 100%; }
.mh-pw > input { width: 100%; box-sizing: border-box; padding-right: 46px !important; }
.mh-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: #64748b; cursor: pointer; line-height: 0;
    transition: color var(--mh-dur-fast, .15s) ease, background-color var(--mh-dur-fast, .15s) ease;
}
.mh-eye:hover, .mh-eye:focus-visible { color: var(--primary, #4ca1af); background: rgba(100, 116, 139, 0.14); outline: none; }
.mh-eye .off { display: none; }
.mh-eye.is-on .on { display: none; }
.mh-eye.is-on .off { display: block; }

input.mh-invalid, select.mh-invalid, textarea.mh-invalid {
    border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16) !important;
}
.mh-invalid-group { outline: 2px solid #dc2626; outline-offset: 3px; border-radius: 8px; }
.mh-field-msg { display: block; margin-top: 5px; font-size: 0.8rem; font-weight: 600; color: var(--mh-danger-fg, #b91c1c); animation: mh-slide-down 0.2s var(--mh-ease, ease) both; }
.mh-field-msg.ok { color: var(--mh-success-fg, #047857); }
.mh-error-list { margin: 8px 0 0; padding-left: 20px; text-align: left; }
.mh-error-list li { margin: 4px 0; line-height: 1.4; }
.mh-modal-message .mh-error-list strong { color: var(--mh-danger-fg, #b91c1c); }

.mh-ps { position: relative; margin: 4px 0 12px; }
.mh-ps-input {
    width: 100%; box-sizing: border-box; min-height: 42px; padding: 0 14px 0 38px; border-radius: 10px;
    border: 1px dashed var(--primary, #4ca1af); background-color: var(--bg-input, #f8fafc); color: var(--text-main, #334155); font-family: inherit; font-size: 0.95rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 12px center;
}
.mh-ps-input:focus { outline: none; border-style: solid; box-shadow: var(--mh-focus-ring, 0 0 0 3px rgba(76,161,175,.22)); }
.mh-ps-list {
    position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto;
    background: var(--bg-card, #fff); border: 1px solid var(--border-color, #cbd5e1); border-radius: 12px; box-shadow: var(--mh-shadow-pop, 0 12px 30px rgba(15,23,42,.25));
    animation: mh-dropdown-in 0.15s var(--mh-ease, ease) both;
}
.mh-ps-list[hidden] { display: none; }
.mh-ps-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text-main, #334155); font-size: 0.93rem; }
.mh-ps-list li span { color: var(--text-muted, #64748b); font-size: 0.8rem; white-space: nowrap; }
.mh-ps-list li.is-active, .mh-ps-list li[data-i]:hover { background: rgba(var(--primary-rgb, 76, 161, 175), 0.16); }
.mh-ps-list li.mh-ps-empty { cursor: default; color: var(--text-muted, #64748b); font-size: 0.85rem; display: block; }
.mh-ps-badge {
    margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 0.85rem;
    background: var(--mh-success-bg, #ecfdf5); color: var(--mh-success-fg, #047857); border: 1px solid var(--mh-success-border, #a7f3d0);
}
.mh-ps-badge[hidden] { display: none; }
.mh-ps-clear { border: 0; background: none; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 6px; }
.mh-ps-clear:hover { background: rgba(0, 0, 0, 0.08); }

.dv-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dv-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .dv-grid-3, .dv-grid-2 { grid-template-columns: 1fr; } }
.dv-alerts { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--mh-danger-border, #fecaca); background: var(--mh-danger-bg, #fef2f2); color: var(--mh-danger-fg, #b91c1c); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.dv-alerts[hidden], #dvGate[hidden], #dvBody[hidden] { display: none; }
.dv-seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.dv-seg .du-btn.is-on { background: var(--primary, #4ca1af); color: #fff; border-color: var(--primary, #4ca1af); }
.dv-teeth { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border-color, #cbd5e1); border-radius: 12px; background: var(--bg-hover, #f8fafc); overflow-x: auto; }
.dv-arch { display: grid; gap: 4px; min-width: 520px; }
.dv-tooth { padding: 7px 0; font-size: .78rem; font-weight: 700; border-radius: 8px; border: 1px solid var(--border-color, #cbd5e1); background: var(--bg-card, #fff); color: var(--text-main, #334155); cursor: pointer; transition: background-color .12s ease, transform .12s ease; }
.dv-tooth:hover { border-color: var(--primary, #4ca1af); }
.dv-tooth.is-on { background: var(--primary, #4ca1af); border-color: var(--primary, #4ca1af); color: #fff; transform: translateY(-1px); }
.dv-chips { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; min-height: 4px; }
.dv-checks { display: grid; gap: 6px; }
.dv-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-color, #cbd5e1); border-radius: 10px; background: var(--bg-input, #f8fafc); cursor: pointer; font-weight: 500; }
.dv-check:hover { border-color: var(--primary, #4ca1af); }
.dv-check input { margin: 0; }
.dv-dl { margin: 0; padding: 8px 4px; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.dv-dl dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted, #64748b); letter-spacing: .04em; }
.dv-dl dd { margin: 2px 0 0; color: var(--text-main, #334155); word-break: break-word; }
.dv-detail td { background: var(--bg-hover, #f8fafc); }
.dv-detail[hidden] { display: none; }

.dv-toothrows { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border-color, #cbd5e1); border-radius: 12px; background: var(--bg-hover, #f8fafc); }
.dv-toothrows[hidden] { display: none; }
.dv-tr-head { margin-bottom: 8px; font-size: .88rem; }
.dv-tr { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.dv-tr b { text-align: center; padding: 6px 0; border-radius: 8px; background: var(--primary, #4ca1af); color: #fff; font-size: .82rem; }
.dv-cmp { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; }
.dv-cmp label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-muted, #64748b); font-size: .85rem; }
.dv-cmp select { max-width: 100%; }
.dv-snaplist { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: .88rem; }
@media (max-width: 640px) { .dv-tr { grid-template-columns: 38px 1fr; } .dv-tr select + select { grid-column: 2; } }

.dv-scanbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.dv-scan { margin: 0 0 14px; padding: 12px; border: 1px solid var(--mh-info-border, #bae6fd); background: var(--mh-info-bg, #eff6ff); border-radius: 12px; }
.dv-scan[hidden] { display: none; }
.dv-scan-head { margin-bottom: 8px; font-size: .9rem; }
.dv-scan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dv-scan input[type="date"] { min-height: 34px; }

.mh-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-hover, #f1f5f9); border: 1px solid var(--border-color, #e2e8f0); }
.mh-tabs a { padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--text-muted, #64748b); transition: background-color .15s ease, color .15s ease; }
.mh-tabs a:hover { color: var(--text-main, #334155); }
.mh-tabs a.active { background: var(--primary, #4ca1af); color: #fff; }

@keyframes mh-live-flash { from { background-color: rgba(var(--primary-rgb, 76, 161, 175), 0.18); } to { background-color: transparent; } }
.mh-live-flash { animation: mh-live-flash 1.4s ease-out 1; }
.mh-live-pill {
    position: fixed; right: 18px; bottom: 18px; z-index: 100001; padding: 13px 22px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--primary, #4ca1af); color: #fff; font-family: inherit; font-size: .88rem; box-shadow: var(--mh-shadow-pop, 0 12px 30px rgba(15,23,42,.3));
    animation: mh-slide-down .25s var(--mh-ease, ease) both;
}
.mh-live-pill:hover { filter: brightness(1.08); }
.mh-req { color: #dc2626; font-weight: 700; margin-left: 2px; }
