/* =========================================================
   NOVOTIX FRONTDESK
   Cleaned full stylesheet
========================================================= */

/* =========================================================
   THEME TOKENS
========================================================= */
:root,
html[data-theme="dark"] {
    --fd-bg: #0f1115;
    --fd-bg-elevated: #12151c;
    --fd-panel: #171a21;
    --fd-surface: #10141b;
    --fd-surface-2: #121722;
    --fd-surface-3: #1a2232;
    --fd-border: #272b35;
    --fd-border-strong: #2a3040;
    --fd-text: #f4f7fb;
    --fd-text-soft: #aab4c3;
    --fd-text-muted: #95a2b8;
    --fd-accent: #8f49ff;
    --fd-success: #1fbf75;
    --fd-warning: #ffb020;
    --fd-danger: #ef5350;
    --fd-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
    --fd-radius-sm: 10px;
    --fd-radius-md: 14px;
    --fd-radius-lg: 16px;
    --fd-radius-xl: 18px;
    --fd-font: 'Montserrat', Arial, sans-serif;
}

html[data-theme="light"] {
    --fd-bg: #f5f7fb;
    --fd-bg-elevated: #ffffff;
    --fd-panel: #ffffff;
    --fd-surface: #f8faff;
    --fd-surface-2: #eef3fb;
    --fd-surface-3: #e6edf8;
    --fd-border: #d8e0ec;
    --fd-border-strong: #c6d1e0;
    --fd-text: #18212f;
    --fd-text-soft: #5e6c80;
    --fd-text-muted: #6f7f95;
    --fd-accent: #7f3dff;
    --fd-success: #179d63;
    --fd-warning: #d69012;
    --fd-danger: #d74b48;
    --fd-shadow: 0 12px 30px rgba(20, 32, 58, 0.08);
}

/* =========================================================
   RESET / BASE
========================================================= */
html,
body {
    height: 100%;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    background: var(--fd-bg);
    color: var(--fd-text);
    font-family: var(--fd-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
}

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

.fd-hidden {
    display: none !important;
}

/* =========================================================
   APP SHELL
========================================================= */
#frontdesk-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    background: var(--fd-bg);
}

/* =========================================================
   TOPBAR
========================================================= */
.fd-topbar {
    flex: 0 0 auto;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
    background: var(--fd-bg-elevated);
    border-bottom: 1px solid var(--fd-border);
}

.fd-brand {
    display: flex;
    align-items: center;
}

.fd-status-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

/* =========================================================
   TOPBAR USER CARD
========================================================= */
.fd-topbar-user-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--fd-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(22, 27, 39, 0.92) 0%, rgba(12, 16, 27, 0.96) 100%);
    box-shadow: var(--fd-shadow);
}

html[data-theme="light"] .fd-topbar-user-card {
    background: linear-gradient(180deg, rgba(246, 249, 255, 0.96) 0%, rgba(236, 242, 251, 0.98) 100%);
    border-color: rgba(0, 0, 0, 0.06);
}

.fd-topbar-user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--fd-surface-3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fd-topbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fd-topbar-user-label {
    margin-bottom: 2px;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fd-text-muted);
}

.fd-topbar-user-name {
    font-size: 13px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--fd-text);
}

/* =========================================================
   MAIN GRID
========================================================= */
.fd-main {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    padding: 16px 20px;
    overflow: hidden;
    background: var(--fd-bg);
}

/* =========================================================
   PANELS
========================================================= */
.fd-panel {
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: var(--fd-panel);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-lg);
    overflow: hidden;
}

.fd-panel > * {
    position: relative;
    z-index: 1;
}

.fd-panel h1,
.fd-panel h2,
.fd-panel h3 {
    margin-top: 0;
    color: var(--fd-text);
    font-weight: 700;
}

.fd-panel label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--fd-text-soft);
}

.fd-panel input,
.fd-panel select,
.fd-panel textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface);
    color: var(--fd-text);
    outline: none;
}

.fd-panel input::placeholder,
.fd-panel textarea::placeholder {
    color: var(--fd-text-muted);
}

.fd-panel button {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--fd-radius-sm);
    background: var(--fd-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================================
   PANEL SHAPES
========================================================= */
.fd-panel-shape {
    position: absolute;
    right: 0;
    bottom: -12px;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: contain;
    z-index: 0;
}

.fd-panel-shape-left {
    width: 170px;
    height: 170px;
    opacity: 0.2;
    background-image: url('../img/frontdesk/shapes/abstract-8.svg');
    transform: rotate(180deg);
}

.fd-panel-shape-runtime {
    right: -16px;
    bottom: -60px;
    width: 840px;
    height: 840px;
    opacity: 0.1;
    background-image: url('../img/frontdesk/shapes/abstract-8.svg');
    transform: rotate(180deg);
}

/* =========================================================
   LEFT PANEL STATES
========================================================= */
.fd-panel-left {
    min-height: 0;
}

#fd-activation-block,
#fd-stats-block {
    min-height: 0;
}

#fd-stats-block {
    display: flex;
    flex-direction: column;
}

/* =========================================================
   RUNTIME STATES
========================================================= */
.fd-runtime-empty,
.fd-runtime-active {
    flex: 1 1 auto;
    min-height: 0;
}

.fd-runtime-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.fd-runtime-empty-visual {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.10;
}

.fd-runtime-empty-visual img {
    width: min(720px, 90%);
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

.fd-runtime-active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* =========================================================
   MESSAGES / DIVIDERS
========================================================= */
.fd-message {
    min-height: 22px;
    margin-top: 14px;
    color: var(--fd-text-soft);
}

.fd-divider {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid var(--fd-border);
}

/* =========================================================
   LOGIN / ACTIVATION
========================================================= */
.fd-scan-login-hint {
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px dashed var(--fd-border-strong);
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface);
    color: var(--fd-text-soft);
}

/* =========================================================
   STATS / DASHBOARD
========================================================= */
.fd-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.fd-stat-card {
    padding: 16px;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-md);
}

.fd-stat-label {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--fd-text-soft);
}

.fd-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--fd-text);
}

.fd-station-summary {
    display: grid;
    gap: 14px;
}

/* =========================================================
   CHARTS
========================================================= */
.fd-chart-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-md);
}

.fd-chart-card canvas {
    max-width: 100%;
    max-height: 170px;
}

.fd-chart-modal-body {
    min-height: 420px;
}

.fd-chart-modal-body canvas {
    width: 100% !important;
    height: 360px !important;
}

/* =========================================================
   SEARCH
========================================================= */
.fd-search-results-shell {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 10px;
    overflow: hidden;
}

.fd-search-results {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 6px;
}

.fd-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-md);
}

.fd-search-item-main {
    min-width: 0;
}

.fd-search-item-name {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--fd-text);
}

.fd-search-item-meta {
    word-break: break-word;
    font-size: 13px;
    color: var(--fd-text-soft);
}

.fd-search-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fd-search-checkin-btn {
    width: auto !important;
    padding: 10px 14px !important;
}

/* =========================================================
   SCROLLBAR
========================================================= */
.fd-search-results::-webkit-scrollbar {
    width: 8px;
}

.fd-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.fd-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

html[data-theme="light"] .fd-search-results::-webkit-scrollbar-thumb {
    background: rgba(24, 33, 47, 0.14);
}

/* =========================================================
   STATUS CHIPS / BADGES
========================================================= */
.fd-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.fd-badge-muted {
    background: #202633;
    color: var(--fd-text-soft);
}

.fd-badge-warning {
    background: rgba(255, 176, 32, 0.15);
    color: #ffcc66;
}

.fd-status-chip {
    padding: 6px 10px;
    border: 1px solid var(--fd-border-strong);
    border-radius: 999px;
    background: var(--fd-surface-2);
    font-size: 11px;
    color: var(--fd-text);
}

.fd-status-chip-success {
    border-color: rgba(31, 191, 117, 0.5);
    color: #9ff0c7;
}

.fd-status-chip-warning {
    border-color: rgba(255, 176, 32, 0.5);
    color: #ffd37a;
}

.fd-status-chip-muted {
    color: var(--fd-text-soft);
}

/* =========================================================
   INLINE ACTIONS / SECONDARY BUTTONS
========================================================= */
.fd-inline-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.fd-secondary-button {
    width: auto !important;
    padding: 10px 14px !important;
    border: 1px solid var(--fd-border-strong) !important;
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface) !important;
    color: var(--fd-text) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

/* =========================================================
   FOOTER
========================================================= */
.fd-footer {
    flex: 0 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 10px 20px;
    background: #0c1016;
    border-top: 1px solid #1f2633;
}

html[data-theme="light"] .fd-footer {
    background: #ffffff;
    border-top-color: var(--fd-border);
}

.fd-footer-left,
.fd-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.fd-footer-left {
    justify-content: flex-start;
}

.fd-footer-right {
    justify-content: flex-end;
    margin-left: auto;
}

.fd-footer button {
    width: auto;
    padding: 10px 14px;
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface-2);
    color: var(--fd-text);
    font-size: 13px;
    cursor: pointer;
}

.fd-footer-select {
    min-width: 220px;
    padding: 8px 12px;
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface-2);
    color: var(--fd-text);
}

/* =========================================================
   FOOTER STATUS PILLS
========================================================= */
.fd-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--fd-border-strong);
    border-radius: 999px;
    background: var(--fd-surface-2);
    font-size: 12px;
    color: var(--fd-text);
}

.fd-pill span {
    color: var(--fd-text);
}

.fd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.fd-dot-green {
    background: #2ecc71;
}

.fd-dot-red {
    background: #e74c3c;
}

.fd-dot-orange {
    background: #f39c12;
}

/* =========================================================
   SECONDARY STATUS BAR
========================================================= */
.fd-footer-secondary {
    flex: 0 0 auto;
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(10, 14, 20, 0.96);
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
}

html[data-theme="light"] .fd-footer-secondary {
    background: rgba(255,255,255,0.96);
    border-top: 1px solid rgba(0,0,0,0.04);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.fd-statusbar-message {
    width: 100%;
    font-size: 12px;
    font-weight: 600;
    color: var(--fd-text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.fd-statusbar-message.is-success {
    color: #9ff0c7;
}

.fd-statusbar-message.is-warning {
    color: #ffd37a;
}

.fd-statusbar-message.is-error {
    color: #ffb7b6;
}

.fd-statusbar-message.is-info {
    color: var(--fd-text-soft);
}

/* =========================================================
   SPINNER
========================================================= */
.fd-spinner {
    width: 10px;
    height: 10px;
    border: 2px solid #999999;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: fd-spin 1s linear infinite;
}

@keyframes fd-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================================================
   MODALS
========================================================= */
.fd-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
}

.fd-modal-card {
    width: min(560px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 20px;
    background: var(--fd-panel);
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-xl);
}

.fd-modal-card-wide {
    width: min(960px, calc(100vw - 40px));
}

.fd-modal-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 25px;
}

.fd-modal-header h3 {
    margin-top: 0 !important;
}

.fd-modal-close {
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--fd-text) !important;
    font-size: 24px !important;
    line-height: 1;
}

.fd-modal input,
.fd-modal select,
.fd-modal textarea {
    padding: 12px 14px;
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface);
    color: var(--fd-text);
    outline: none;
}

.fd-modal button {
    padding: 12px 16px;
    border: 0;
    border-radius: var(--fd-radius-sm);
    background: var(--fd-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.fd-modal-card form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.fd-modal-card form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--fd-text-soft);
}

.fd-modal-card form input,
.fd-modal-card form select,
.fd-modal-card form textarea {
    width: 100%;
}

.fd-modal-card form > button[type="submit"] {
    grid-column: 1 / -1;
    margin-top: 8px;
}

.fd-modal-card form > div,
.fd-modal-card form > .fd-form-row {
    min-width: 0;
}

/* =========================================================
   REGISTER MODAL LAYOUT
========================================================= */
#fd-register-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

#fd-register-dynamic-fields {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

#fd-register-form > button[type="submit"] {
    grid-column: 1 / -1;
    width: 100%;
}

/* =========================================================
   FLOATING FORM FIELDS
========================================================= */
.fd-form-row {
    position: relative;
    width: 100%;
    margin: 0;
}

.fd-form-row .fd-form-input,
.fd-form-row .fd-form-select,
.fd-form-row .fd-form-textarea {
    width: 100%;
    min-height: 54px;
    padding: 22px 14px 10px;
    border: 1px solid var(--fd-border-strong);
    border-radius: 14px;
    background: var(--fd-surface);
    color: var(--fd-text);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.fd-form-row .fd-form-textarea {
    min-height: 110px;
    resize: vertical;
    padding-top: 24px;
}

.fd-form-row .fd-form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--fd-text-muted) 50%),
        linear-gradient(135deg, var(--fd-text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.fd-form-row .fd-form-input:focus,
.fd-form-row .fd-form-select:focus,
.fd-form-row .fd-form-textarea:focus {
    outline: none;
    border-color: var(--fd-accent);
    box-shadow: 0 0 0 3px rgba(143, 73, 255, 0.12);
}

.fd-form-row .fd-form-label {
    position: absolute;
    top: 18px;
    left: 14px;
    z-index: 2;
    padding: 0 6px;
    margin-left: -6px;
    background: var(--fd-surface);
    color: var(--fd-text-muted);
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
    transition: all 0.18s ease;
}

.fd-form-row .fd-form-input:focus + .fd-form-label,
.fd-form-row .fd-form-input:not(:placeholder-shown) + .fd-form-label,
.fd-form-row .fd-form-textarea:focus + .fd-form-label,
.fd-form-row .fd-form-textarea:not(:placeholder-shown) + .fd-form-label,
.fd-form-row .fd-form-select:focus + .fd-form-label,
.fd-form-row .fd-form-select.has-value + .fd-form-label {
    top: -8px;
    left: 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--fd-accent);
}

.fd-form-row .fd-form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--fd-text-muted);
}

.fd-form-row .fd-form-error {
    margin-top: 6px;
    font-size: 12px;
    color: var(--fd-danger);
    font-weight: 600;
}

.fd-form-row.fd-form-row-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 14px 16px;
    border: 1px solid var(--fd-border-strong);
    border-radius: 14px;
    background: var(--fd-surface);
}

.fd-form-row.fd-form-row-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--fd-accent);
}

.fd-form-row.fd-form-row-checkbox label {
    margin: 0;
    color: var(--fd-text);
    font-size: 14px;
    font-weight: 500;
}

/* =========================================================
   TYPE STATS
========================================================= */
.fd-type-stats-card {
    margin-bottom: 18px;
    padding: 14px;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border-strong);
    border-radius: var(--fd-radius-md);
}

.fd-type-stats-title {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
}

.fd-type-stats-list {
    display: grid;
    gap: 8px;
}

.fd-type-stat-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: var(--fd-text-soft);
}

.fd-type-stat-name {
    color: var(--fd-text);
    font-weight: 600;
}

.fd-type-stat-pill {
    padding: 4px 10px;
    border: 1px solid var(--fd-border-strong);
    border-radius: 999px;
    background: var(--fd-surface-2);
    font-size: 11px;
    color: var(--fd-text);
}

/* =========================================================
   RUNTIME GRID
========================================================= */
.fd-runtime-grid {
    --fd-search-card-height: 146px;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(250px, 1fr) var(--fd-search-card-height);
    gap: 0;
    align-content: stretch;
}

.fd-runtime-grid.fd-runtime-grid-search-active {
    --fd-search-card-height: 292px;
}

/* =========================================================
   RUNTIME CARDS
========================================================= */
.fd-runtime-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.92) 0%, rgba(17, 23, 35, 0.98) 100%);
    border: 1px solid var(--fd-border);
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    overflow: hidden;
}

html[data-theme="light"] .fd-runtime-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(244,248,255,0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.fd-runtime-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 0;
}

.fd-runtime-card-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fd-text-muted);
}

.fd-runtime-card-title {
    margin: 0 0 2px;
    font-size: 18px;
    font-weight: 800;
    color: var(--fd-text);
}

.fd-runtime-card-subtitle {
    font-size: 13px;
    color: var(--fd-text-soft);
}

/* =========================================================
   SCAN CARD LAYOUT
========================================================= */
.fd-runtime-card-scan {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 32px 1fr 22px 0;
    gap: 10px;
    padding: 14px 16px 12px;
    align-content: start;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.fd-runtime-card-scan .fd-runtime-card-header {
    min-height: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fd-runtime-card-search {
    min-height: 0;
    height: 100%;
    align-self: stretch;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding-bottom: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top-width: 0;
}

.fd-runtime-card-search .fd-runtime-card-header {
    padding-bottom: 0;
}

.fd-runtime-card-search #fd-search-form {
    padding: 0 18px 14px;
}

.fd-runtime-card-search .fd-search-results-shell {
    min-height: 0;
    height: 100%;
    padding: 0 18px 18px;
    margin-top: 0;
    overflow: hidden;
}

.fd-runtime-card-search #fd-search-query {
    min-height: 44px;
    border-radius: 14px;
    font-size: 14px;
}

.fd-runtime-grid:not(.fd-runtime-grid-search-active) .fd-runtime-card-search {
    grid-template-rows: auto auto 0fr;
    overflow: hidden;
}

.fd-runtime-grid:not(.fd-runtime-grid-search-active) .fd-runtime-card-search .fd-search-results-shell {
    height: 0;
    min-height: 0;
    max-height: 0;
    padding: 0 18px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.fd-runtime-grid:not(.fd-runtime-grid-search-active) .fd-runtime-card-search .fd-search-results {
    display: none;
}

.fd-runtime-grid:not(.fd-runtime-grid-search-active) .fd-runtime-card-search #fd-search-form {
    padding-bottom: 16px;
}

.fd-runtime-grid.fd-runtime-grid-search-active .fd-runtime-card-search .fd-search-results-shell {
    opacity: 1;
    pointer-events: auto;
}

.fd-runtime-grid.fd-runtime-grid-search-active .fd-runtime-card-search .fd-search-results {
    height: 100%;
    overflow-y: auto;
}

/* =========================================================
   SCAN STATE PILL
========================================================= */
.fd-scan-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--fd-border-strong);
    background: var(--fd-surface-2);
    color: var(--fd-text);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fd-scan-state-valid {
    background: rgba(31, 191, 117, 0.14);
    border-color: rgba(31, 191, 117, 0.45);
    color: #b7ffd7;
}

.fd-scan-state-duplicate {
    background: rgba(255, 176, 32, 0.14);
    border-color: rgba(255, 176, 32, 0.45);
    color: #ffe09d;
}

.fd-scan-state-invalid {
    background: rgba(239, 83, 80, 0.14);
    border-color: rgba(239, 83, 80, 0.45);
    color: #ffb7b6;
}

.fd-scan-state-idle {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
    color: var(--fd-text-soft);
}

/* =========================================================
   SCAN RESULT CARD
========================================================= */
.fd-scan-result {
    position: relative;
    min-height: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    background: rgba(8, 12, 22, 0.72);
    border: 2px solid var(--fd-border-strong);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

html[data-theme="light"] .fd-scan-result {
    background: rgba(255,255,255,0.88);
}

.fd-scan-result-valid {
    border-color: rgba(114, 214, 31, 0.95);
    box-shadow:
        0 0 0 1px rgba(114, 214, 31, 0.10),
        0 0 24px rgba(114, 214, 31, 0.12) inset;
}

.fd-scan-result-duplicate {
    border-color: rgba(208, 167, 59, 0.95);
    box-shadow:
        0 0 0 1px rgba(208, 167, 59, 0.10),
        0 0 24px rgba(208, 167, 59, 0.10) inset;
}

.fd-scan-result-invalid {
    border-color: rgba(232, 75, 75, 0.95);
    box-shadow:
        0 0 0 1px rgba(232, 75, 75, 0.10),
        0 0 24px rgba(232, 75, 75, 0.10) inset;
}

.fd-scan-result-pending {
    border-color: rgba(255, 176, 32, 0.95);
    box-shadow:
        0 0 0 1px rgba(255, 176, 32, 0.10),
        0 0 24px rgba(255, 176, 32, 0.10) inset;
}

.fd-scan-result-idle {
    border-color: var(--fd-border-strong);
    box-shadow: none;
}

/* top bar inside card */
.fd-scan-result-topbar {
    display: flex;
    align-items: center;
    /*justify-content: flex-start;*/
	justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fd-scan-result-topbar.is-valid {
    background: linear-gradient(180deg, #93c61b 0%, #7eb817 100%);
    color: #ffffff;
}

.fd-scan-result-topbar.is-duplicate,
.fd-scan-result-topbar.is-pending {
    background: linear-gradient(180deg, #d8a532 0%, #b9851f 100%);
    color: #ffffff;
}

.fd-scan-result-topbar.is-invalid {
    background: linear-gradient(180deg, #e84b4b 0%, #c93a3a 100%);
    color: #ffffff;
}

.fd-scan-result-topbar.is-idle {
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.03) 100%);
    color: var(--fd-text-soft);
}

.fd-scan-result-topbar-status {
    display: inline-flex;
    align-items: center;
}

.fd-scan-result-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
    padding: 18px 22px 20px;
    align-items: start;
}

.fd-scan-result-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fd-scan-result-name {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 800;
    color: var(--fd-text);
    word-break: break-word;
}

.fd-scan-result-meta-list {
    display: grid;
    gap: 8px;
}

.fd-scan-result-meta-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.fd-scan-result-meta-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--fd-text-soft);
}

.fd-scan-result-meta-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--fd-text);
    word-break: break-word;
}

.fd-scan-result-state-line {
    font-size: 15px;
    font-weight: 700;
    color: var(--fd-text);
}

.fd-scan-result-right {
    width: 240px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.fd-scan-materials-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(195, 19, 255, 0.95) 0%, rgba(197, 45, 255, 0.85) 100%);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden;
}

.fd-scan-materials-title {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fd-scan-materials-content {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    word-break: break-word;
}

.fd-scan-materials-plain {
    white-space: pre-wrap;
    word-break: break-word;
}

.fd-scan-materials-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.fd-scan-materials-list li {
    margin: 0;
}

.fd-scan-color-card {
    width: 104px;
    height: 104px;
    align-self: flex-end;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}

.fd-scan-inline-blinker {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--fd-blinker-base-border, transparent);
    background: var(--fd-blinker-base-bg, #169bd5);
    color: var(--fd-blinker-base-color, #ffffff);
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fd-scan-inline-blinker.is-blinking {
    animation: fdInlineBlinkerPulse 0.35s linear 20;
}

@keyframes fdInlineBlinkerPulse {
    0% {
        background: var(--fd-blinker-base-bg, #169bd5);
        color: var(--fd-blinker-base-color, #ffffff);
        border-color: var(--fd-blinker-base-border, transparent);
    }
    50% {
        background: var(--fd-blinker-flash-bg, #ffffff);
        color: var(--fd-blinker-flash-color, #169bd5);
        border-color: var(--fd-blinker-flash-border, #ffffff);
    }
    100% {
        background: var(--fd-blinker-base-bg, #169bd5);
        color: var(--fd-blinker-base-color, #ffffff);
        border-color: var(--fd-blinker-base-border, transparent);
    }
}

.fd-scan-result-placeholder {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 28px;
}

.fd-scan-result-placeholder-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--fd-text);
}

.fd-scan-result-placeholder-subtitle {
    font-size: 14px;
    color: var(--fd-text-soft);
}

/* =========================================================
   LEGACY SCAN SUPPORT
========================================================= */
.fd-result-success {
    border-color: rgba(31, 191, 117, 0.5);
    background: rgba(31, 191, 117, 0.12);
}

.fd-result-warning {
    border-color: rgba(255, 176, 32, 0.5);
    background: rgba(255, 176, 32, 0.12);
}

.fd-result-error {
    border-color: rgba(239, 83, 80, 0.5);
    background: rgba(239, 83, 80, 0.12);
}

.fd-scan-message {
    margin: 0;
    min-height: 15px;
    height: 15px;
    display: flex;
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--fd-text-soft);
    overflow: hidden;
}

.fd-scan-blinker {
    display: none;
}

.fd-scan-color-block {
    display: none;
}

/* =========================================================
   UTILITIES
========================================================= */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none !important; }

.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-column-reverse { flex-direction: column-reverse; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }

.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.align-items-stretch { align-items: stretch; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 24px; }

.flex-grow-1 { flex-grow: 1; }
.flex-grow-0 { flex-grow: 0; }

.w-100 { width: 100%; }
.w-auto { width: auto; }

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

.fs-5px { font-size: 5px; }
.fs-6px { font-size: 6px; }
.fs-7px { font-size: 7px; }
.fs-8px { font-size: 8px; }
.fs-9px { font-size: 9px; }
.fs-10px { font-size: 10px; }
.fs-11px { font-size: 11px; }
.fs-12px { font-size: 12px; }
.fs-13px { font-size: 13px; }
.fs-14px { font-size: 14px; }
.fs-15px { font-size: 15px; }
.fs-16px { font-size: 16px; }
.fs-17px { font-size: 17px; }
.fs-18px { font-size: 18px; }
.fs-19px { font-size: 19px; }
.fs-20px { font-size: 20px; }
.fs-21px { font-size: 21px; }
.fs-22px { font-size: 22px; }
.fs-23px { font-size: 23px; }
.fs-24px { font-size: 24px; }
.fs-25px { font-size: 25px; }

.fw-100 { font-weight: 100; }
.fw-200 { font-weight: 200; }
.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fw-900 { font-weight: 900; }

.ms-1 { margin-left: 5px; }
.ms-2 { margin-left: 10px; }
.ms-3 { margin-left: 15px; }
.ms-4 { margin-left: 20px; }
.ms-5 { margin-left: 25px; }
.ms-6 { margin-left: 30px; }
.ms-7 { margin-left: 35px; }
.ms-8 { margin-left: 40px; }
.ms-9 { margin-left: 45px; }
.ms-10 { margin-left: 50px; }

.me-1 { margin-right: 5px; }
.me-2 { margin-right: 10px; }
.me-3 { margin-right: 15px; }
.me-4 { margin-right: 20px; }
.me-5 { margin-right: 25px; }
.me-6 { margin-right: 30px; }
.me-7 { margin-right: 35px; }
.me-8 { margin-right: 40px; }
.me-9 { margin-right: 45px; }
.me-10 { margin-right: 50px; }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1200px) {
    .fd-runtime-grid {
        --fd-search-card-height: 136px;
        grid-template-rows: minmax(220px, 1fr) var(--fd-search-card-height);
    }

    .fd-runtime-grid.fd-runtime-grid-search-active {
        --fd-search-card-height: 250px;
    }

    .fd-scan-result-body {
        grid-template-columns: 1fr;
    }

    .fd-scan-result-right {
        width: 100%;
        flex-direction: row;
        align-items: stretch;
    }

    .fd-scan-materials-card {
        flex: 1 1 auto;
    }

    .fd-scan-color-card {
        width: 96px;
        height: 96px;
        align-self: auto;
    }
}

@media (max-width: 1100px) {
    body {
        overflow: auto;
    }

    #frontdesk-app {
        height: auto;
        min-height: 100vh;
    }

    .fd-main {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .fd-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .fd-footer-left,
    .fd-footer-right {
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .fd-topbar {
        padding: 14px 16px;
    }

    .fd-main {
        gap: 16px;
        padding: 16px;
    }

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

    .fd-modal-card form > button[type="submit"] {
        grid-column: auto;
    }

    .fd-search-item {
        flex-direction: column;
        align-items: stretch;
    }

    .fd-search-item-actions {
        justify-content: space-between;
    }

    .fd-scan-result-meta-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .fd-scan-inline-blinker {
        font-size: 15px;
        min-height: 48px;
    }

    .fd-scan-result-right {
        flex-direction: column;
    }

    .fd-scan-color-card {
        align-self: flex-start;
    }
}

.fd-scan-result-valid {
    border-color: rgba(114, 214, 31, 0.95);
    box-shadow:
        0 0 0 1px rgba(114, 214, 31, 0.10),
        0 0 24px rgba(114, 214, 31, 0.10) inset;
    background: rgba(114, 214, 31, 0.04);
}

.fd-scan-result-duplicate {
    border-color: rgba(208, 167, 59, 0.95);
    box-shadow:
        0 0 0 1px rgba(208, 167, 59, 0.10),
        0 0 24px rgba(208, 167, 59, 0.08) inset;
    background: rgba(208, 167, 59, 0.04);
}

.fd-scan-result-invalid {
    border-color: rgba(232, 75, 75, 0.95);
    box-shadow:
        0 0 0 1px rgba(232, 75, 75, 0.10),
        0 0 24px rgba(232, 75, 75, 0.08) inset;
    background: rgba(232, 75, 75, 0.04);
}

.fd-scan-result-pending {
    border-color: rgba(255, 176, 32, 0.95);
    box-shadow:
        0 0 0 1px rgba(255, 176, 32, 0.10),
        0 0 24px rgba(255, 176, 32, 0.08) inset;
    background: rgba(255, 176, 32, 0.04);
}

.fd-scan-result-topbar {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.fd-scan-result-topbar.is-valid {
    background: linear-gradient(180deg, #93c61b 0%, #84b71a 100%);
    color: #ffffff;
}

.fd-scan-result-topbar.is-duplicate,
.fd-scan-result-topbar.is-pending {
    background: linear-gradient(180deg, #d8a532 0%, #bf8d22 100%);
    color: #ffffff;
}

.fd-scan-result-topbar.is-invalid {
    background: linear-gradient(180deg, #e84b4b 0%, #cf3f3f 100%);
    color: #ffffff;
}

.fd-scan-result-topbar.is-idle {
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.03) 100%);
    color: var(--fd-text-soft);
}

.fd-scan-result-blinker-row {
    padding: 14px 18px 0;
}

.fd-scan-inline-blinker {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--fd-blinker-base-border, transparent);
    background: var(--fd-blinker-base-bg, #169bd5);
    color: var(--fd-blinker-base-color, #ffffff);
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fd-scan-result-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
    padding: 16px 18px 18px;
    align-items: start;
}

.fd-scan-result-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fd-scan-result-right {
    width: 240px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.fd-scan-result-name {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    font-weight: 800;
    color: var(--fd-text);
    word-break: break-word;
}

.fd-scan-materials-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(195, 19, 255, 0.95) 0%, rgba(197, 45, 255, 0.85) 100%);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden;
}

.fd-scan-materials-content {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    word-break: break-word;
}

.fd-scan-color-card {
    width: 104px;
    height: 104px;
    align-self: flex-end;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}

@media (max-width: 1200px) {
    .fd-scan-result-body {
        grid-template-columns: 1fr;
    }

    .fd-scan-result-right {
        width: 100%;
        flex-direction: row;
        align-items: stretch;
    }

    .fd-scan-materials-card {
        flex: 1 1 auto;
    }

    .fd-scan-color-card {
        align-self: auto;
    }
}





.printer-admin-modal {
    display: none;
}

.printer-admin-modal.show {
    display: block;
}

.printer-admin-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9998;
}

.printer-admin-panel {
    position: fixed;
    top: 80px;
    right: 32px;
    width: 360px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
    z-index: 9999;
    overflow: hidden;
}

.printer-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.printer-admin-header button {
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.printer-admin-body {
    display: grid;
    gap: 12px;
    padding: 18px;
}

#printerAdminInstallFonts {
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #a855f7;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}