:root {
    --bg-1: #f3f5fa;
    --bg-2: #eef2f8;
    --nav: #ffffff;
    --nav-2: #ffffff;
    --panel: #ffffff;
    --line: #e1e7f0;
    --text: #1b2437;
    --muted: #6f7b92;
    --brand: #2f61d8;
    --brand-2: #4b7af1;
    --danger: #cc4a4a;
    --shadow: 0 20px 38px rgba(15, 30, 59, 0.12);
}

* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    margin: 0;
    font-family: Sora, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 0% 0%, #edf4ff 0%, transparent 28%),
        radial-gradient(circle at 100% 20%, #f1f6ff 0%, transparent 35%),
        linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(58, 108, 217, 0.24), transparent 35%),
        radial-gradient(circle at 90% 20%, rgba(20, 166, 141, 0.2), transparent 36%),
        linear-gradient(145deg, #eef3ff, #f7fbff);
}

.login-shell {
    min-height: 100vh;
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 18px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 14px;
    align-items: stretch;
}

.login-showcase {
    background: linear-gradient(145deg, #203f83, #2f61d8 56%, #3f76e9);
    color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 54px rgba(16, 33, 67, 0.25);
}

.login-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.login-brand-row h1 {
    margin: 0;
    font-family: Archivo, sans-serif;
    font-size: 1.4rem;
}

.login-brand-row p {
    margin: 2px 0 0;
    opacity: 0.9;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.login-showcase h2 {
    margin: 0 0 10px;
    font-family: Archivo, sans-serif;
    font-size: 1.45rem;
    line-height: 1.22;
}

.login-showcase p {
    margin: 0 0 14px;
    line-height: 1.55;
    opacity: 0.95;
    font-size: 0.92rem;
}

.login-showcase ul {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 6px;
    font-size: 0.88rem;
}

.login-card {
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 24px 54px rgba(16, 33, 67, 0.16);
    display: grid;
    align-content: center;
}

.login-card h3 {
    margin: 0;
    font-family: Archivo, sans-serif;
    font-size: 1.2rem;
}

.login-card p {
    margin: 6px 0 14px;
    color: #5f6f8b;
    font-size: 0.86rem;
}

.login-alert {
    margin-bottom: 10px;
    border: 1px solid #f0cccc;
    background: #fff5f5;
    color: #8f2f2f;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.83rem;
}

.login-success {
    margin-bottom: 10px;
    border: 1px solid #bde4ce;
    background: #effcf4;
    color: #236847;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.83rem;
}

.login-demo {
    margin-top: 12px;
    border-top: 1px solid #e7eef9;
    padding-top: 10px;
    color: #637392;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.login-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    padding: 8px 9px;
}

.onboarding-card {
    align-content: flex-start;
}

.auth-shell {
    width: min(1220px, 100%);
    grid-template-columns: minmax(380px, 1fr) minmax(380px, 1fr);
    gap: 18px;
    padding: 24px;
}

.auth-card {
    border-radius: 20px;
    border: 1px solid #d8e4f6;
    box-shadow: 0 24px 56px rgba(14, 34, 70, 0.16);
    padding: 24px;
    align-content: start;
    gap: 0;
}

.auth-kicker {
    display: inline-flex;
    width: auto;
    margin-bottom: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #2a57ad;
    background: #eef4ff;
    border: 1px solid #d8e6ff;
}

.auth-card h3 {
    font-size: 2rem;
    line-height: 1.06;
    margin-bottom: 10px;
}

.auth-step {
    margin: 4px 0 10px;
    color: #5f6f8b;
    font-size: 0.86rem;
}

.auth-social {
    display: grid;
    gap: 8px;
}

.auth-social-btn {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid #d4deed;
    background: #ffffff;
    color: #1b2a44;
    font-weight: 700;
    padding: 9px 12px;
}

.auth-social-btn[disabled] {
    opacity: 0.66;
    cursor: not-allowed;
}

.auth-social-icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf2ff;
    color: #2e5fcc;
    font-size: 0.84rem;
    font-weight: 700;
}

.auth-divider {
    position: relative;
    margin: 12px 0 10px;
    text-align: center;
}

.auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: 1px solid #e0e8f5;
}

.auth-divider span {
    position: relative;
    z-index: 1;
    display: inline-block;
    background: #ffffff;
    color: #73829f;
    font-size: 0.78rem;
    padding: 0 8px;
}

.auth-form .field-label input,
.auth-form .field-label select {
    min-height: 44px;
    border-radius: 10px;
}

.auth-actions {
    margin-top: 6px;
    gap: 7px;
}

.auth-actions .btn-secondary {
    background: #f7faff;
}

.auth-showcase {
    border-radius: 20px;
    padding: 0;
    display: grid;
    align-content: stretch;
    gap: 0;
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.22), transparent 35%),
        radial-gradient(circle at 84% 22%, rgba(131, 249, 222, 0.17), transparent 28%),
        linear-gradient(145deg, #163979, #2f61d8 52%, #4e7ff2);
    overflow: hidden;
}

.auth-showcase-art {
    margin-top: 0;
    border-radius: 0;
    border: 0;
    background: rgba(17, 38, 79, 0.2);
    min-height: 100%;
    position: relative;
    overflow: hidden;
}

.auth-showcase-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: saturate(1.02) contrast(1.03);
}

.auth-window {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 0;
    border: 0;
    background:
        linear-gradient(180deg, rgba(14, 33, 70, 0.32), rgba(14, 33, 70, 0.08)),
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.08), transparent 35%);
    z-index: 1;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    transition: grid-template-columns 0.25s ease;
}

.layout.sidebar-collapsed {
    grid-template-columns: 74px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, var(--nav), var(--nav-2));
    color: var(--text);
    border-right: 1px solid var(--line);
    padding: 16px 10px;
    overflow: hidden;
    transition: padding 0.25s ease;
}

.layout.sidebar-collapsed .sidebar {
    padding: 16px 8px;
}

.brand p {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: #6f7b92;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.brand h1 {
    margin: 0;
    font-family: Archivo, sans-serif;
    font-size: 1.1rem;
    white-space: nowrap;
}

.brand-mark {
    width: 38px;
    height: 38px;
    line-height: 38px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(120deg, #2f61d8, #4b7af1);
    border: 1px solid rgba(47, 97, 216, 0.3);
    color: #ffffff;
}

.brand-mark-logo {
    background: #ffffff;
    border: 1px solid #d3def1;
    color: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
}

.brand-logo-icon {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    display: block;
    flex: 0 0 24px;
}

.brand-toggle {
    cursor: pointer;
}

.brand-toggle:hover {
    filter: brightness(1.05);
}

.brand-text p {
    margin-top: 2px;
    font-size: 0.67rem;
}

.menu {
    display: grid;
    gap: 8px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #3a4760;
    font-weight: 600;
    border-radius: 11px;
    padding: 10px;
    border: 1px solid transparent;
    background: transparent;
}

.menu-icon {
    width: 20px;
    min-width: 20px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-icon svg {
    width: 16px;
    height: 16px;
}

.menu-label {
    white-space: nowrap;
    font-size: 0.95rem;
}

.menu a.active,
.menu a:hover {
    background: #edf3ff;
    border-color: #d8e5ff;
    color: #234db3;
}

.layout.sidebar-collapsed .brand p,
.layout.sidebar-collapsed .brand h1 {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
}

.layout.sidebar-collapsed .brand-text {
    display: none;
}

.layout.sidebar-collapsed .brand-mark {
    margin: 0 auto;
}

.layout.sidebar-collapsed .menu a {
    justify-content: center;
    padding: 12px 8px;
}

.layout.sidebar-collapsed .menu-label {
    display: none;
}

.main {
    padding: 0;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    padding: 6px 14px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-left {
    min-height: 1px;
}

.mobile-menu-btn {
    display: none;
}

.crumb {
    color: #6b7992;
    font-size: 0.86rem;
}

.topbar-menu {
    position: relative;
}

.icon-btn {
    position: relative;
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid #d6dfed;
    background: #fff;
    color: #4a5771;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

.dot-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 999px;
    font-size: 0.62rem;
    background: #e94f4f;
    color: #fff;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #d6dfed;
    border-radius: 9px;
    padding: 2px 6px 2px 8px;
    cursor: pointer;
}

.user-box:hover {
    background: #f7f9ff;
}

.user-name {
    display: block;
    font-size: 0.8rem;
    color: #314a75;
}

.user-email {
    display: block;
    color: #7b88a2;
    font-size: 0.66rem;
    margin-top: 1px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 999px;
    background: linear-gradient(120deg, #5065d8, #6f7ce6);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #dce5f3;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(18, 37, 70, 0.16);
    z-index: 40;
}

.dropdown.hidden {
    display: none;
}

.dropdown-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #ebf1fa;
}

.dropdown-list {
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: 240px;
    overflow: auto;
}

.dropdown-list li {
    margin: 0;
}

.dropdown-item {
    display: grid;
    gap: 2px;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: #172c54;
    padding: 7px 9px;
    border-radius: 8px;
}

.dropdown-item:hover {
    background: #f5f8ff;
    border-color: #e4ecf9;
}

.dropdown-item small {
    color: #6a7fa6;
    font-size: 0.7rem;
}

.dropdown-item.unread strong::before {
    content: "• ";
    color: #e94f4f;
}

.link-btn {
    border: 0;
    background: transparent;
    color: #2f5faa;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}

.menu-action {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: #162949;
    border-radius: 8px;
    padding: 8px 9px;
}

.menu-action:hover {
    background: #f5f8ff;
    border-color: #e4ecf9;
}

.menu-action.danger {
    color: #b53737;
}

.dropdown-list.compact {
    max-height: none;
}

.header {
    margin: 0;
    padding: 10px 14px 6px;
}

.tag {
    margin: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.header h2 {
    margin: 4px 0 0;
    font-family: Archivo, sans-serif;
    font-size: 1.15rem;
}

.content {
    background: transparent;
    border: 0;
    border-radius: 20px;
    box-shadow: none;
    padding: 0 14px 14px;
}

.hero {
    margin-bottom: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0 2px 4px;
}

.hero h3 {
    margin: 0 0 4px;
    font-family: Archivo, sans-serif;
    font-size: 0.98rem;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.card {
    background: #fff;
    border: 1px solid #e4ebf5;
    border-radius: 11px;
    padding: 10px;
    box-shadow: 0 10px 22px rgba(18, 37, 70, 0.06);
}

.card h4 {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
}

.card p {
    margin: 6px 0 0;
    font-size: 1.04rem;
    font-weight: 700;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.settings-ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 12px;
    align-items: start;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.report-filters-grid {
    grid-template-columns: repeat(2, minmax(170px, 220px)) 1fr;
    align-items: end;
}

.report-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.report-filter-actions button {
    width: auto;
    min-width: 150px;
}

.report-list {
    display: grid;
    gap: 7px;
}

.report-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid #e5ecf8;
    border-radius: 9px;
    padding: 8px 9px;
    background: #f9fbff;
    font-size: 0.82rem;
}

.report-list-row strong {
    color: #20375f;
    font-size: 0.8rem;
}

.report-list-row span {
    color: #4f6081;
    text-align: right;
    font-size: 0.78rem;
}

.report-bars {
    display: grid;
    gap: 6px;
}

.report-bar-row {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.report-bar-track {
    height: 10px;
    border-radius: 999px;
    background: #eaf0fb;
    overflow: hidden;
}

.report-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(120deg, #3a67dd, #5d86f1);
}

.report-empty {
    margin: 0;
    color: #697895;
    font-size: 0.8rem;
}

.report-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.report-tab {
    width: auto;
    border: 1px solid #cfddf5;
    background: #f4f8ff;
    color: #2a4f95;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.report-tab.active {
    background: linear-gradient(120deg, #2f61d8, #4b7af1);
    color: #fff;
    border-color: transparent;
}

.report-tab-pane {
    display: none;
}

.report-tab-pane.active {
    display: block;
}

.report-chart-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}

.pos-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
    gap: 10px;
}

.panel {
    background: var(--panel);
    border: 1px solid #e4ebf5;
    border-radius: 11px;
    padding: 11px;
    box-shadow: 0 10px 22px rgba(18, 37, 70, 0.05);
}

.panel h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.panel-head-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.print-job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.print-job-grid p {
    margin: 4px 0 0;
    color: #24314f;
    font-size: 0.84rem;
}

.print-alert-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.76rem;
    font-weight: 700;
}

.status-pill.ok {
    background: #e7f7ef;
    color: #136746;
}

.status-pill.warn {
    background: #fff1e7;
    color: #8b4c1d;
}

.print-suggestion {
    border: 1px solid #dce6f4;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 0;
    background: #f9fbff;
    flex: 0 0 360px;
    max-width: 360px;
    min-height: 132px;
    scroll-snap-align: start;
}

.print-suggestion h5 {
    margin: 0 0 4px;
    font-size: 0.84rem;
    font-weight: 700;
}

.print-suggestion.recommended {
    border-color: #8dc0ff;
    background: #eef6ff;
}

.modal-card.modal-xl.print-plan-modal-card {
    width: min(980px, 92vw);
    border-radius: 16px;
    padding: 10px 11px;
}

.print-plan-subtitle {
    margin: 3px 0 0;
    font-size: 0.74rem;
    color: #6a7b98;
}

.print-plan-panel {
    margin-top: 7px;
    padding: 8px 9px;
}

.print-plan-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.print-plan-top-grid .print-plan-panel {
    margin-top: 0;
}

#print-job-summary {
    padding-right: 9px;
    min-height: 148px;
}

.btn-compact {
    width: auto;
    min-width: 118px;
    padding: 6px 9px;
    font-size: 0.76rem;
}

.print-suggestions-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 4px 6px 1px;
    scroll-snap-type: x proximity;
}

.print-execute-grid textarea {
    min-height: 42px;
    max-height: 42px;
    resize: none;
}

.print-execute-grid {
    grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.print-exec-action {
    display: flex;
    justify-content: flex-end;
    align-items: end;
}

.print-exec-action button {
    width: auto;
    min-width: 260px;
    white-space: nowrap;
    padding: 9px 14px;
}

.print-plan-actions {
    margin-top: 4px;
}

.print-plan-actions button {
    max-width: 260px;
    justify-self: end;
    padding: 8px 12px;
}

.print-job-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 7px;
}

.print-job-section {
    margin-top: 4px;
}

.print-job-section-title {
    display: block;
    margin-bottom: 5px;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #607392;
    font-weight: 700;
}

.print-job-section-live {
    border-top: 1px dashed #d9e3f3;
    padding-top: 6px;
    margin-top: 6px;
}

.print-job-grid-live {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.print-live-row {
    grid-template-columns: minmax(140px, 1fr) minmax(100px, 0.8fr) minmax(170px, 1fr) auto;
    align-items: end;
}

.print-live-row .field-label {
    min-width: 0;
}

.print-live-row .field-label span {
    font-size: 0.67rem;
}

.print-live-row input {
    padding: 6px 8px;
    font-size: 0.78rem;
}

.print-job-grid > div {
    min-width: 0;
}

.print-job-grid small {
    display: block;
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5d6d8a;
    font-weight: 700;
}

.print-job-grid p {
    margin: 2px 0 0;
    color: #24314f;
    font-size: 0.78rem;
    line-height: 1.22;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print-alert-row {
    margin-top: 7px;
}

.print-suggestion p {
    margin: 2px 0;
    color: #344464;
    font-size: 0.78rem;
    line-height: 1.25;
}

.print-suggestion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 3px;
    font-size: 0.72rem;
    color: #4c5f80;
}

.print-offcut-note {
    color: #19795b;
    font-weight: 700;
}

.print-empty {
    margin: 0;
    color: #6f7c95;
    font-size: 0.8rem;
    min-width: 100%;
}

.print-queue-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
}

.print-queue-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.print-toggle {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #596a88;
    font-size: 0.82rem;
    white-space: nowrap;
}

.print-toggle input {
    width: auto;
    margin: 0;
}

.print-queue-table {
    min-width: 980px;
    table-layout: fixed;
}

.print-queue-table th,
.print-queue-table td {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
}

.print-queue-table th:last-child,
.print-queue-table td:last-child {
    white-space: nowrap;
    word-break: normal;
}

.print-row-completed {
    opacity: 0.84;
}

.print-row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
}

.print-action-btn {
    width: auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #d5deeb;
    background: #fff;
    color: #34425e;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
}

.print-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.print-action-btn span {
    white-space: nowrap;
}

.print-action-btn.is-icon-only {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}

.print-action-btn.is-icon-only span {
    display: none;
}

.print-action-btn.is-plan {
    color: #234c94;
    border-color: #cadcfb;
    background: #f4f8ff;
}

.print-action-btn.is-ready {
    color: #1f7f58;
    border-color: #b8e4cf;
    background: #ecfbf3;
}

.print-action-btn.is-fail {
    color: #b64040;
    border-color: #f1c6c6;
    background: #fff2f2;
}

.print-action-btn.is-start {
    color: #3e4f70;
    border-color: #d7e0ef;
    background: #f7f9fd;
}

.customer-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.customer-form-actions button {
    width: auto;
    min-width: 160px;
    padding: 8px 12px;
}

.customer-actions-anchor {
    grid-column: 3;
    align-self: end;
}

.customer-actions-anchor .customer-form-actions {
    margin-top: 0;
}

.product-form-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.product-sku-field {
    grid-column: span 1;
}

.product-name-field {
    grid-column: span 2;
}

.draft-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.tabs-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tab-chip {
    border: 1px solid #cfdff3;
    background: #eef4ff;
    color: #0f1e3b;
    border-radius: 999px;
    padding: 3px 5px 3px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-chip small {
    color: #49628f;
    font-weight: 600;
    font-size: 0.74rem;
}

.tab-chip.active {
    background: linear-gradient(120deg, #0e8474, #14a68d);
    border-color: transparent;
    color: white;
}

.tab-chip.active small {
    color: rgba(255, 255, 255, 0.92);
}

.tab-open-btn {
    background: transparent;
    color: inherit;
    border: 0;
    padding: 5px 7px;
    border-radius: 999px;
    font-size: 0.78rem;
}

.tab-close-btn {
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
    border: 0;
    width: 21px;
    height: 21px;
    min-width: 21px;
    border-radius: 999px;
    line-height: 1;
    padding: 0;
}

.tab-chip.active .tab-close-btn {
    background: rgba(255, 255, 255, 0.22);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 24, 51, 0.5);
    display: grid;
    place-items: center;
    z-index: 50;
    padding: 14px;
    overflow: auto;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-card {
    width: min(720px, 100%);
    background: #fff;
    border: 1px solid #dce6f6;
    border-radius: 13px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.2);
    padding: 11px;
    max-height: calc(100vh - 28px);
    overflow: auto;
}

.modal-card.modal-xl {
    width: min(1360px, 100%);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.modal-head h4 {
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 7px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.field-label {
    display: grid;
    gap: 4px;
    align-content: start;
}

.field-label span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #5b6b87;
}

.field-span-all {
    grid-column: 1 / -1;
}

.input-name-lg input {
    min-height: 42px;
    font-size: 0.98rem;
}

.modal-actions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    align-content: end;
}

.modal-actions button {
    width: 100%;
}

.section-toolbar {
    justify-content: space-between;
    align-items: flex-end;
}

.section-search {
    margin: 0;
    min-width: min(380px, 100%);
}

input,
select,
textarea,
button {
    width: 100%;
    font: inherit;
    border-radius: 8px;
    border: 1px solid #d4deeb;
    padding: 8px 9px;
    font-size: 0.92rem;
}

textarea {
    grid-column: 1 / -1;
    min-height: 72px;
}

button {
    border: 0;
    color: #fff;
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary {
    border: 1px solid #cfe0fb;
    color: #244a92;
    background: #f4f8ff;
}

.icon-btn,
.user-box,
.tab-open-btn,
.tab-close-btn,
.link-btn {
    width: auto;
}

.btn-danger {
    background: var(--danger);
    padding: 5px 8px;
    font-size: 0.75rem;
}

.btn-success {
    background: #229062;
    padding: 5px 8px;
    font-size: 0.75rem;
}

.icon-action-btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #d6dfed;
    background: #fff;
    color: #415273;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 4px;
}

.icon-action-btn svg {
    width: 16px;
    height: 16px;
}

.icon-action-btn.success {
    color: #1f7f58;
    border-color: #b5e2ce;
    background: #ecfbf3;
}

.icon-action-btn.danger {
    color: #b53f3f;
    border-color: #f1c7c7;
    background: #fff1f1;
}

.pos-num-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 78px;
    padding: 8px 9px;
}

.ticket-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.ticket-preview {
    border: 1px dashed #c7d6ec;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    color: #1b2437;
}

.ticket-head {
    text-align: center;
    margin-bottom: 8px;
}

.ticket-head h3 {
    margin: 0;
    font-size: 1rem;
}

.ticket-head p {
    margin: 2px 0 4px;
    color: #5f7191;
    font-size: 0.78rem;
}

.ticket-logo-wrap {
    margin: 0 0 6px;
}

.ticket-head.ticket-logo-left {
    text-align: left;
}

.ticket-head.ticket-logo-left .ticket-logo-wrap {
    text-align: left;
}

.ticket-head.ticket-logo-center {
    text-align: center;
}

.ticket-head.ticket-logo-center .ticket-logo-wrap {
    text-align: center;
}

.ticket-head.ticket-logo-right {
    text-align: right;
}

.ticket-head.ticket-logo-right .ticket-logo-wrap {
    text-align: right;
}

.ticket-meta p {
    margin: 2px 0;
    font-size: 0.8rem;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.ticket-table th,
.ticket-table td {
    border-bottom: 1px solid #e9eff8;
    padding: 5px 4px;
    font-size: 0.78rem;
    vertical-align: top;
}

.ticket-table small {
    display: block;
    color: #607092;
}

.ticket-totals {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #d3deef;
}

.ticket-totals p {
    margin: 2px 0;
    font-size: 0.82rem;
}

.ticket-payments h4 {
    margin: 8px 0 4px;
    font-size: 0.84rem;
}

.ticket-payments ul {
    margin: 0;
    padding-left: 16px;
}

.ticket-payments li {
    margin: 2px 0;
    font-size: 0.78rem;
}

.catalog-pagination {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.catalog-pagination span {
    font-size: 0.78rem;
    color: #5f6f8b;
}

.btn-inline-action {
    width: auto;
    border: 1px solid #cfe0fb;
    color: #244a92;
    background: #f4f8ff;
    padding: 4px 9px;
    font-size: 0.76rem;
    border-radius: 8px;
}

.catalog-row-placeholder td {
    color: transparent;
    user-select: none;
}

.catalog-table-shell {
    position: relative;
    margin-top: 10px;
    min-height: 334px;
    max-height: 334px;
    overflow: auto;
    border: 1px solid #e6edf8;
    border-radius: 10px;
    background: #fff;
}

.catalog-table {
    margin: 0;
}

.catalog-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.74);
    color: #5f6f8b;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Scrollbar theme */
.modal-card,
.catalog-table-shell,
.dropdown-list {
    scrollbar-width: thin;
    scrollbar-color: #9db5e6 #edf3ff;
}

.modal-card::-webkit-scrollbar,
.catalog-table-shell::-webkit-scrollbar,
.dropdown-list::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.modal-card::-webkit-scrollbar-track,
.catalog-table-shell::-webkit-scrollbar-track,
.dropdown-list::-webkit-scrollbar-track {
    background: #edf3ff;
    border-radius: 999px;
}

.modal-card::-webkit-scrollbar-thumb,
.catalog-table-shell::-webkit-scrollbar-thumb,
.dropdown-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8ea8dd, #6f8fcb);
    border: 2px solid #edf3ff;
    border-radius: 999px;
}

.modal-card::-webkit-scrollbar-thumb:hover,
.catalog-table-shell::-webkit-scrollbar-thumb:hover,
.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7f9ad4, #5f81c2);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e6edf8;
    padding: 7px 4px;
    text-align: left;
    font-size: 0.8rem;
    vertical-align: top;
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 240px;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

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

    .modal-card.modal-xl.print-plan-modal-card {
        width: min(940px, 100%);
    }

    .print-plan-top-grid {
        grid-template-columns: 1fr;
    }

    .print-job-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .print-job-grid-live {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .print-queue-table {
        min-width: 920px;
    }

    #print-job-summary {
        min-height: 0;
    }

    .print-live-row {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .print-suggestion {
        flex-basis: min(300px, 88vw);
        max-width: min(300px, 88vw);
    }

    .btn-compact {
        width: 100%;
    }

    .print-execute-grid {
        grid-template-columns: 1fr;
    }

    .print-exec-action {
        justify-content: stretch;
    }

    .print-exec-action button {
        width: 100%;
        min-width: 0;
    }

    .customer-actions-anchor {
        grid-column: 1 / -1;
    }

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

    .product-sku-field,
    .product-name-field {
        grid-column: 1 / -1;
    }

    .layout.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .layout.sidebar-collapsed .brand p,
    .layout.sidebar-collapsed .brand h1 {
        opacity: 1;
        max-height: none;
        margin: initial;
    }

    .layout.sidebar-collapsed .brand-text {
        display: block;
    }

    .layout.sidebar-collapsed .menu a {
        justify-content: flex-start;
        padding: 12px;
    }

    .layout.sidebar-collapsed .menu-label {
        display: inline;
    }

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

    .settings-ticket-layout {
        grid-template-columns: 1fr;
    }

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

    .report-filter-actions {
        justify-content: stretch;
    }

    .report-filter-actions button {
        width: 100%;
    }

    .report-bar-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .report-chart-wrap {
        height: 240px;
    }

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

    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 7px 10px;
    }

    .topbar-left {
        display: flex;
        justify-content: flex-start;
        min-width: auto;
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

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

    .header {
        padding: 8px 10px 6px;
    }

    .content {
        padding: 0 10px 10px;
    }

    .dropdown {
        width: min(320px, calc(100vw - 30px));
        right: 0;
    }

    .modal-backdrop {
        place-items: start center;
        padding: 10px;
    }

    .modal-card,
    .modal-card.modal-xl {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .login-shell {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 10px;
    }

    .auth-card {
        padding: 16px;
        border-radius: 14px;
    }

    .auth-card h3 {
        font-size: 1.56rem;
    }

    .login-showcase {
        padding: 18px;
    }

    .login-showcase h2 {
        font-size: 1.2rem;
    }

    .auth-showcase {
        order: -1;
        padding: 0;
        gap: 0;
    }

    .auth-showcase-art {
        min-height: 280px;
    }

    .auth-window {
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
    }

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

    .section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .section-search {
        min-width: 100%;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    #ticket-modal-content,
    #ticket-modal-content * {
        visibility: visible;
    }

    #ticket-modal-content {
        position: absolute;
        inset: 0;
        padding: 0;
        margin: 0;
    }
}
