:root {
    --ui-primary: #0f766e;
    --ui-primary-strong: #115e59;
    --ui-accent: #d97706;
    --ui-bg: #f3f7fb;
    --ui-surface: #ffffff;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
    --ui-border: #dbe4ee;
    --ui-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    --ui-shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.06);
    --ui-radius-lg: 24px;
    --ui-radius-md: 18px;
    --ui-radius-sm: 14px;
}

html,
body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 30%),
        radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.1), transparent 25%),
        var(--ui-bg);
    color: var(--ui-text);
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.logo-lg,
.ui-page-title,
.ui-login-title {
    font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
}

a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

.page-content {
    min-height: calc(100vh - 70px);
}

.page-content-wrapper {
    padding: 34px 0 42px;
}

.page-title-box + .page-content-wrapper {
    padding-top: 1rem;
}

.page-content-wrapper .container-fluid {
    max-width: 1440px;
}

.page-content-wrapper .row {
    row-gap: 1.25rem;
}

.container-fluid {
    padding-left: 20px;
    padding-right: 20px;
}

.page-title-box {
    display: block;
    min-height: 96px;
    padding: 1.25rem 0 1.4rem !important;
    margin: 0 0 1.75rem !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    clear: both;
    position: relative;
}

.page-title-box .container-fluid {
    max-width: 1440px;
    padding-left: 20px;
    padding-right: 20px;
}

.page-title-box .page-title,
.page-title-box .breadcrumb-item,
.page-title-box .breadcrumb-item a,
.page-title-box .breadcrumb-item.active {
    color: var(--ui-text) !important;
}

.page-title-box .row {
    row-gap: 0.85rem;
    align-items: center;
}

.page-title-box + .page-content-wrapper > .container-fluid > .row:first-of-type {
    margin-top: 0.25rem;
}

.ui-page-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.ui-page-actions .dropdown,
.ui-page-actions .btn {
    max-width: 100%;
}

.ui-page-actions .btn,
.page-title-box .btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    padding: 0.65rem 1.05rem;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-strong)) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
}

.ui-page-actions .btn:hover,
.page-title-box .btn-light:hover {
    background: linear-gradient(135deg, var(--ui-primary-strong), #134e4a) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.ui-page-actions .btn::after,
.page-title-box .btn-light::after {
    display: none;
}

.ui-page-actions .btn i,
.page-title-box .btn-light i {
    margin-right: 0 !important;
    font-size: 1rem;
}

.card-body > .btn.btn-primary.btn-rounded,
.card-body .btn.btn-primary.btn-rounded[data-toggle="modal"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-strong));
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.card-body > .btn.btn-primary.btn-rounded i,
.card-body .btn.btn-primary.btn-rounded[data-toggle="modal"] i {
    margin-right: 0 !important;
}

.ui-tab-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1.8rem;
}

.page-title-box:empty {
    display: none;
}

.page-title-box:not(:has(.page-title)):not(:has(.breadcrumb)):not(:has(.ui-page-actions)) {
    display: none;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.navbar-header {
    min-height: 72px;
    padding: 0 10px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.96), rgba(21, 94, 117, 0.96));
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(14px);
}

.ui-header-main {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.75rem;
}

.ui-header-actions {
    flex: 0 0 auto;
    gap: 0.4rem;
    margin-left: 0.75rem;
}

.navbar-brand-box {
    width: auto;
    min-width: clamp(230px, 20vw, 280px);
    max-width: 320px;
    padding: 0 1.1rem 0 1.25rem;
    text-align: left;
    background: transparent;
}

.logo {
    display: inline-flex;
    align-items: center;
    min-height: 72px;
    gap: 1rem;
    line-height: 1;
    text-decoration: none;
}

.logo-lg {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.logo .logo-sm img {
    display: block;
}

.ui-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    padding: 3px;
    background: rgba(255, 255, 255, 0.12);
    flex: 0 0 auto;
}

.ui-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}

.ui-brand-name {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ui-brand-tag {
    color: rgba(255, 255, 255, 0.72);
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logo-dark .logo-lg {
    color: #ffffff;
}

.logo-light .logo-lg {
    color: #ffffff;
}

.ui-app-search {
    flex: 1 1 320px;
    max-width: min(420px, 40vw);
    margin: 0;
    padding: 0;
}

.ui-app-search .position-relative {
    width: 100%;
}

.app-search .form-control {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: none;
}

.app-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.78);
}

.app-search span {
    color: rgba(255, 255, 255, 0.9);
}

.header-profile-user {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.header-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ui-user-trigger {
    gap: 0.55rem;
    max-width: min(260px, 24vw);
    padding-right: 0.4rem;
}

.ui-user-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body[data-topbar="colored"] .navbar-brand-box {
    background: transparent;
}

.vertical-menu {
    background: rgba(248, 250, 252, 0.94);
    border-right: 1px solid rgba(219, 228, 238, 0.9);
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(10px);
}

#sidebar-menu {
    padding: 18px 0 28px;
}

#sidebar-menu ul li.menu-title {
    padding: 0 20px 10px;
    color: var(--ui-muted);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#sidebar-menu ul li a {
    margin: 4px 12px;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    color: #334155;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#sidebar-menu ul li a:hover,
#sidebar-menu ul li.mm-active > a,
#sidebar-menu ul li a.active {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(217, 119, 6, 0.12));
    color: var(--ui-primary);
    transform: translateX(2px);
}

#sidebar-menu ul li ul.sub-menu li a {
    margin-left: 28px;
    font-size: 0.92rem;
}

.card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(219, 228, 238, 0.9);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow);
    overflow: hidden;
}

.ui-dashboard-hero + .row,
.page-content-wrapper > .container-fluid > .row + .row {
    margin-top: 1.5rem;
}

.page-content-wrapper > .container-fluid > .row > [class*="col-"] {
    margin-bottom: 1.25rem;
}

.page-content-wrapper > .container-fluid > .row:last-child > [class*="col-"]:last-child {
    margin-bottom: 0;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(219, 228, 238, 0.8);
    padding: 1.2rem 1.4rem;
}

.card-body {
    padding: 1.4rem;
}

.card-body > *:last-child,
.modal-body > *:last-child {
    margin-bottom: 0;
}

.footer {
    padding: 18px 0 28px;
    color: var(--ui-muted);
    background: transparent;
}

.footer a {
    color: var(--ui-primary);
}

.alert {
    border: 0;
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-soft);
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-block,
button.btn-block {
    min-height: 48px;
}

.btn-primary,
.btn-success {
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.form-control,
.custom-select,
.selectize-input,
.dataTables_filter input,
.dataTables_length select {
    min-height: 48px;
    border-radius: var(--ui-radius-sm);
    border: 1px solid var(--ui-border);
    box-shadow: none;
}

.form-control:focus,
.custom-select:focus,
.dataTables_filter input:focus,
.dataTables_length select:focus,
.selectize-input.focus {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12);
}

.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 3.5rem);
}

.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-dialog.modal-lg,
.modal-dialog.modal-xl {
    width: calc(100% - 2rem);
}

.modal-content {
    width: 100%;
    border: 1px solid rgba(219, 228, 238, 0.95);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.modal-header,
.modal-footer {
    border-color: rgba(219, 228, 238, 0.8);
}

.modal-header {
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1.35rem;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(217, 119, 6, 0.08));
}

.modal-title {
    margin: 0;
    color: var(--ui-text);
    font-weight: 700;
    line-height: 1.35;
}

.modal-header .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0 0 0 auto;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ui-text);
    opacity: 1;
    text-shadow: none;
}

.modal-body {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 1.35rem;
}

.modal-footer {
    padding: 1rem 1.35rem;
    background: #f8fafc;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-footer form {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
}

.modal .form-group {
    margin-bottom: 1rem;
}

.modal .row {
    row-gap: 0.35rem;
}

.modal table {
    min-width: 720px;
}

.modal .table-shell {
    margin-top: 0;
}

.nav-tabs {
    gap: 0.65rem;
    border-bottom: 0;
    flex-wrap: wrap;
}

.nav-tabs .nav-item {
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1rem;
    background: #eef4f9;
    color: #475569;
    font-weight: 600;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-strong));
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}

.table-shell {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(219, 228, 238, 0.92);
    border-radius: 18px;
    background: #ffffff;
    margin-top: 0.35rem;
}

.table-shell::-webkit-scrollbar {
    height: 10px;
}

.table-shell::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
}

.table-shell table,
.table-shell .dataTables_wrapper {
    min-width: 640px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    white-space: nowrap;
    background: #f8fafc;
    border-top: 0;
    border-bottom-width: 1px;
    color: #475569;
    font-weight: 700;
}

.table td,
.table th {
    vertical-align: middle;
}

.table td .btn {
    margin: 0.12rem;
}

.table td:last-child {
    min-width: max-content;
}

.table td {
    color: var(--ui-text);
}

.dataTables_wrapper {
    padding: 0.2rem 0;
}

.dataTables_wrapper > .row:first-child {
    align-items: center;
    margin-bottom: 0.8rem;
}

.dataTables_wrapper > .row:last-child {
    align-items: center;
    margin-top: 0.8rem;
}

.dataTables_wrapper .row {
    row-gap: 0.75rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    width: 100%;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    margin-left: 0.4rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
}

.ui-page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.35rem 1.5rem;
    border-radius: 26px;
    border: 1px solid rgba(219, 228, 238, 0.9);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.55), transparent 35%),
        linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(217, 119, 6, 0.14));
    box-shadow: var(--ui-shadow-soft);
}

.ui-eyebrow {
    margin: 0;
    color: var(--ui-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ui-page-title {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.1;
}

.ui-page-subtitle {
    margin: 0;
    max-width: 720px;
    color: var(--ui-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.ui-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ui-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.ui-section-subtitle {
    margin: 0.2rem 0 0;
    color: var(--ui-muted);
    line-height: 1.6;
}

.ui-stream-shell {
    position: relative;
    padding: 0.9rem;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(217, 119, 6, 0.08)),
        #f8fafc;
    border: 1px solid rgba(219, 228, 238, 0.9);
}

.ui-stream-media {
    display: block;
    width: 100%;
    height: clamp(320px, 58vh, 720px);
    min-height: 260px;
    object-fit: contain;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #020617;
}

.ui-expression-scan .ui-stream-media {
    object-fit: cover;
}

.ui-stream-shell:fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    border: 0;
    border-radius: 0;
    background: #020617;
}

.ui-stream-shell:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    border: 0;
    border-radius: 0;
    background: #020617;
}

.ui-stream-shell:fullscreen .ui-stream-media {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

.ui-stream-shell:-webkit-full-screen .ui-stream-media {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

.ui-stream-shell:fullscreen .ui-camera-status,
.ui-stream-shell:fullscreen .ui-scan-session-summary {
    color: #e2e8f0;
}

.ui-stream-shell:-webkit-full-screen .ui-camera-status,
.ui-stream-shell:-webkit-full-screen .ui-scan-session-summary {
    color: #e2e8f0;
}

.ui-stream-shell:fullscreen .ui-camera-status {
    background: rgba(15, 118, 110, 0.32);
}

.ui-stream-shell:-webkit-full-screen .ui-camera-status {
    background: rgba(15, 118, 110, 0.32);
}

.ui-stream-shell:fullscreen .ui-scan-complete {
    flex: 0 0 auto;
}

.ui-stream-shell:-webkit-full-screen .ui-scan-complete {
    flex: 0 0 auto;
}

.ui-gesture-scan .ui-stream-media {
    object-fit: contain;
}

.ui-scan-overlay {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    bottom: calc(0.9rem + 58px);
    left: 0.9rem;
    z-index: 2;
    pointer-events: none;
}

.ui-face-guide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-face-guide::before {
    content: "";
    width: min(34vw, 280px);
    height: min(44vw, 360px);
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.04);
}

.ui-face-guide span,
.ui-hand-zone span,
.ui-hand-guide-caption {
    position: absolute;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-weight: 700;
}

.ui-face-guide span {
    bottom: 1rem;
}

.ui-hand-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: clamp(1rem, 3vw, 2rem);
}

.ui-hand-zone {
    position: relative;
    min-height: 58%;
    border: 2px dashed rgba(217, 119, 6, 0.2);
    border-radius: 28px;
    background: rgba(217, 119, 6, 0.03);
    box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.015);
}

.ui-hand-zone span {
    display: none;
}

.ui-hand-guide-caption {
    right: 1.25rem;
    bottom: 1rem;
    left: 1.25rem;
    text-align: center;
    white-space: normal;
}

.ui-camera-status {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-weight: 700;
}

.ui-scan-session {
    margin-top: 0.8rem;
}

.ui-scan-session-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.ui-scan-session-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #d97706);
    transition: width 0.25s ease;
}

.ui-scan-session-summary {
    margin-top: 0.55rem;
    color: var(--ui-muted);
    font-weight: 600;
}

.ui-scan-complete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    background: #ecfdf5;
    color: #0f766e;
}

.ui-scan-complete span {
    display: block;
    margin-top: 0.15rem;
    color: #334155;
}

.ui-analysis-result {
    min-height: 72px;
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px dashed rgba(148, 163, 184, 0.7);
    color: var(--ui-muted);
    line-height: 1.7;
}

.ui-dashboard-hero {
    align-items: center;
}

.ui-scanner-hero {
    align-items: center;
}

.ui-scanner-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.85rem;
}

.ui-scanner-count {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 140px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: var(--ui-shadow-soft);
}

.ui-scanner-count strong {
    font-size: 1.35rem;
    line-height: 1;
}

.ui-scanner-count span {
    margin-top: 0.35rem;
    color: var(--ui-muted);
    font-size: 0.82rem;
}

.ui-scanner-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.ui-scan-mode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
    min-height: 120px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(219, 228, 238, 0.95);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.92));
    color: var(--ui-text);
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ui-scan-mode:hover {
    transform: translateY(-2px);
    box-shadow: var(--ui-shadow-soft);
}

.ui-scan-mode.is-active {
    border-color: rgba(15, 118, 110, 0.32);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 35%),
        linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(217, 119, 6, 0.12));
    box-shadow: var(--ui-shadow-soft);
}

.ui-scan-mode-title {
    font-size: 1rem;
    font-weight: 700;
}

.ui-scan-mode-text {
    color: var(--ui-muted);
    line-height: 1.6;
}

.ui-scanner-active {
    margin-top: 1.25rem;
}

.ui-knowledge-summary {
    color: var(--ui-text);
    line-height: 1.75;
}

.ui-knowledge-block + .ui-knowledge-block {
    margin-top: 1rem;
}

.ui-knowledge-block h6 {
    margin-bottom: 0.65rem;
    font-weight: 700;
    color: var(--ui-primary-strong);
}

.ui-knowledge-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--ui-muted);
}

.ui-knowledge-list li + li {
    margin-top: 0.45rem;
}

.ui-knowledge-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.ui-knowledge-source {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--ui-primary-strong);
    font-weight: 600;
    text-decoration: none;
}

.ui-knowledge-source:hover {
    background: rgba(15, 118, 110, 0.14);
    color: var(--ui-primary-strong);
    text-decoration: none;
}

.ui-stat-card .card-header {
    padding-bottom: 0;
    border-bottom: 0;
}

.ui-stat-card .list-group-item {
    border: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.ui-stat-card .icons-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(217, 119, 6, 0.12));
    color: var(--ui-primary);
}

.ui-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    margin: 0 !important;
    padding: 2.5rem 0 !important;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.32), transparent 30%),
        radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.24), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #155e75 100%);
}

.ui-login-card {
    background: rgba(255, 255, 255, 0.97);
    border: 0;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.ui-login-title {
    font-size: 1.9rem;
    font-weight: 700;
}

.ui-login-subtitle {
    color: var(--ui-muted);
    line-height: 1.7;
}

.ui-login-role {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 0.35rem;
}

.ui-login-role .custom-control-inline {
    width: 100%;
    margin-right: 0;
}

.ui-login-role .custom-control {
    min-height: auto;
    padding-left: 0;
}

.ui-login-role .custom-control-input {
    position: absolute;
    opacity: 0;
}

.ui-login-role .custom-control-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(219, 228, 238, 0.95);
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
}

.ui-login-role .custom-control-label::before,
.ui-login-role .custom-control-label::after {
    display: none;
}

.ui-login-role .custom-control-input:checked ~ .custom-control-label {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(217, 119, 6, 0.12));
    border-color: rgba(15, 118, 110, 0.35);
    color: var(--ui-primary);
}

.ui-register-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.ui-register-links .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
}

.ui-login-brand {
    color: rgba(255, 255, 255, 0.95);
}

.ui-login-brand h1 {
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 700;
    line-height: 1.05;
}

.ui-login-brand p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.8;
}

.ui-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 1399.98px) {
    .navbar-brand-box {
        min-width: 220px;
        max-width: 270px;
    }

    .ui-app-search {
        max-width: 340px;
    }

    .ui-user-trigger {
        max-width: 210px;
    }
}

@media (max-width: 1199.98px) {
    .navbar-header {
        padding-right: 12px;
    }

    .navbar-brand-box {
        min-width: 205px;
        max-width: 245px;
        padding-left: 0.9rem;
    }

    .ui-app-search {
        max-width: 280px;
    }

    .ui-brand-tag {
        display: none;
    }

    .ui-user-name {
        max-width: 120px;
    }
}

@media (max-width: 991.98px) {
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar-header {
        padding: 0 10px;
        gap: 0.4rem;
    }

    .ui-header-main {
        gap: 0.4rem;
    }

    .ui-header-actions {
        margin-left: auto;
        gap: 0.25rem;
    }

    .navbar-brand-box {
        min-width: auto;
        max-width: none;
        padding: 0 0.5rem 0 0.65rem;
    }

    .logo {
        min-height: 64px;
        gap: 0.85rem;
    }

    .logo-lg {
        gap: 0.85rem;
    }

    .ui-brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        padding: 3px;
    }

    .app-search {
        display: none !important;
    }

    .page-content-wrapper {
        padding-top: 24px;
    }

    .page-title-box + .page-content-wrapper {
        padding-top: 0.75rem;
    }

    .ui-page-intro,
    .ui-section-head,
    .ui-dashboard-hero,
    .ui-scanner-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .ui-scanner-meta,
    .ui-scanner-count {
        align-items: flex-start;
    }

    .ui-scanner-switcher {
        grid-template-columns: 1fr;
    }

    .ui-stream-media {
        height: clamp(280px, 54vh, 560px);
    }

    .ui-scan-overlay {
        bottom: calc(0.9rem + 74px);
    }

    .ui-hand-guide {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .ui-hand-zone {
        min-height: 110px;
        border-radius: 18px;
    }

    .ui-hand-guide-caption {
        font-size: 0.82rem;
    }

    .ui-scan-complete {
        align-items: stretch;
        flex-direction: column;
    }

    .footer .text-sm-right {
        display: block !important;
        text-align: left !important;
        margin-top: 0.35rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-header {
        padding: 0 8px;
    }

    .header-item {
        height: 64px;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .ui-user-trigger {
        max-width: none;
        padding-right: 0;
    }

    .card,
    .modal-content,
    .ui-page-intro {
        border-radius: 20px;
    }

    .card-body,
    .card-header {
        padding: 1rem;
    }

    .page-title-box .row {
        align-items: stretch !important;
    }

    .page-title-box {
        min-height: auto;
        padding: 0.9rem 0 1.05rem !important;
        margin-bottom: 1rem !important;
    }

    .page-title-box .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ui-page-actions {
        justify-content: flex-start;
    }

    .ui-page-actions .dropdown,
    .ui-page-actions .btn {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_length label {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100% !important;
        margin-left: 0;
    }

    .table td .btn {
        width: 38px;
        height: 38px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .modal-body {
        max-height: calc(100vh - 170px);
        padding: 1rem;
    }

    .modal-header,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer,
    .modal-footer form {
        justify-content: stretch;
    }

    .modal-footer .btn,
    .modal-footer form .btn {
        flex: 1 1 140px;
    }

    .ui-page-subtitle,
    .ui-section-subtitle {
        font-size: 0.93rem;
    }

    .table-shell table,
    .table-shell .dataTables_wrapper {
        min-width: 560px;
    }

    .ui-login-shell {
        padding: 1.5rem 0 !important;
    }

    .ui-login-brand {
        text-align: center;
    }

    .ui-stream-shell {
        padding: 0.65rem;
        border-radius: 16px;
    }

    .ui-stream-media {
        height: clamp(240px, 50vh, 460px);
        min-height: 220px;
        border-radius: 14px;
    }

    .ui-scan-overlay {
        top: 0.65rem;
        right: 0.65rem;
        left: 0.65rem;
        bottom: calc(0.65rem + 86px);
    }

    .ui-scan-session-summary {
        font-size: 0.88rem;
        line-height: 1.45;
    }
}

@media (max-width: 575.98px) {
    .page-content-wrapper {
        padding: 14px 0 24px;
    }

    .navbar-header {
        padding: 0 6px;
    }

    .logo-lg {
        font-size: 0.92rem;
        gap: 0.75rem;
    }

    .navbar-brand-box {
        padding-left: 0.5rem;
    }

    .ui-brand-mark {
        width: 36px;
        height: 36px;
    }

    .ui-page-intro {
        padding: 1rem;
    }

    .ui-page-title {
        font-size: 1.45rem;
    }

    .btn,
    .form-control,
    .custom-select {
        font-size: 0.95rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .ui-login-role {
        grid-template-columns: 1fr;
    }

    .ui-register-links {
        grid-template-columns: 1fr;
    }

    .ui-stream-media {
        height: clamp(220px, 46vh, 380px);
        min-height: 210px;
    }

    .ui-stream-shell:fullscreen,
    .ui-stream-shell:-webkit-full-screen {
        padding: 0.5rem;
    }
}
