html,
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #dfe4e7;
    color: #1d2a2f;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, #e7ecef 0%, #dfe4e7 100%);
}

.theme-host {
    min-height: 100vh;
}

a {
    color: inherit;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #2b8a57;
}

.invalid {
    outline: 1px solid #b93b3b;
}

.validation-message {
    color: #9f2a2a;
    font-size: 0.9rem;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    background: linear-gradient(90deg, #2f3336 0, #2f3336 250px, #dfe4e7 250px, #dfe4e7 100%);
}

.app-sidebar {
    background: linear-gradient(180deg, #373b3f 0%, #2f3336 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.app-main {
    padding: 18px;
}

.app-main-frame {
    min-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid rgba(29, 42, 47, 0.12);
    background: #f3f5f6;
    box-shadow: 0 14px 28px rgba(27, 38, 43, 0.08);
    overflow: hidden;
}

.app-content {
    flex: 1;
    padding: 20px;
}

.activation-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.activation-shell {
    width: min(100%, 760px);
}

.activation-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.activation-dashboard-shell {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
}

.activation-dashboard-center {
    width: min(100%, 720px);
}

.activation-dashboard-main-card {
    padding: 44px 40px;
    border-radius: 22px;
    box-shadow: 0 20px 44px rgba(27, 38, 43, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.activation-dashboard-main-card h2 {
    margin: 0;
    font-size: 2rem;
    color: #1f2d33;
}

.activation-dashboard-main-card p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #65737a;
}

.activation-dashboard-info {
    font-size: 0.95rem;
    font-weight: 600;
    color: #7a688d;
}

.activation-dashboard-button {
    min-width: 240px;
    min-height: 48px;
    padding: 0.95rem 1.4rem;
    background: linear-gradient(135deg, #6f42c1 0%, #5a33a3 100%);
    box-shadow: 0 16px 28px rgba(111, 66, 193, 0.2);
}

.activation-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activation-copy h1 {
    margin: 0;
}

.activation-copy p {
    margin-bottom: 0;
    color: #65737a;
}

.activation-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #65737a;
}

.activation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wizard-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wizard-progress {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.wizard-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6f42c1, #8b5cf6);
    transition: width 0.35s ease;
}

.wizard-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wizard-step {
    font-size: 0.8rem;
    color: #8a94a6;
}

.wizard-header h2 {
    margin: 5px 0;
}

.wizard-header p {
    color: #6c757d;
    margin: 0;
}

.wizard-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 12px;
}

.wizard-error {
    background: #fff1f2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.primary-button {
    min-width: 140px;
}

.secondary-button {
    min-width: 100px;
}

.activation-whatsapp,
.activation-submit {
    width: fit-content;
}

.activation-helper-text {
    margin-top: 6px;
    color: #7a858b;
    font-size: 0.84rem;
    line-height: 1.45;
}

.loader {
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

.success-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    text-align: center;
}

.checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #22c55e;
    position: relative;
    animation: pop 0.3s ease;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 18px;
    top: 30px;
    width: 18px;
    height: 8px;
    border-left: 3px solid white;
    border-bottom: 3px solid white;
    transform: rotate(-45deg);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pop {
    0% {
        transform: scale(0.5);
    }

    100% {
        transform: scale(1);
    }
}

.activation-sequence-card {
    padding: 14px;
    border: 1px solid #d9e0e4;
    border-radius: 14px;
    background: #f8fafb;
}

.activation-sequence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.activation-sequence-title {
    margin: 0;
}

.activation-sequence-info {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #91a4ff;
    background: #eef2ff;
    color: #4453b8;
    font-weight: 700;
    cursor: help;
}

.activation-sequence-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.activation-whatsapp-card {
    padding: 14px;
    border: 1px solid #a7d6b0;
    border-radius: 14px;
    background: #eef9f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.activation-whatsapp-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #1e4f2b;
}

.page-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 1480px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 6px 2px 2px;
}

.page-head h1 {
    margin-bottom: 4px;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2d33;
}

.page-head p {
    margin-bottom: 0;
    color: #65737a;
}

.page-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-card {
    border: 1px solid #cfd7db;
    border-radius: 10px;
    background: #fff;
    padding: 14px 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.form-section {
    padding-top: 12px;
}

.dense-section {
    min-height: 100%;
}

.form-section-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8eb;
}

.form-section-header p {
    margin: 0;
    color: #66757b;
}

.section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2d33;
}

.header-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #f7f7f2 0%, #eff1ec 100%);
    border-bottom: 1px solid #d7dddd;
}

.header-company,
.header-actions,
.header-user,
.header-datetime {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(29, 42, 47, 0.12);
    background: linear-gradient(135deg, #2f3336 0%, #4f5a60 100%);
    color: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-weight: 700;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7b868b;
}

.header-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: #1f2d33;
}

.header-subtitle {
    margin-top: 2px;
    color: #6a767c;
    font-size: 0.92rem;
}

.header-button,
.primary-button,
.secondary-button,
.danger-button,
.sidebar-link-button,
.table-link,
.modal-close {
    border: 0;
    cursor: pointer;
}

.header-button,
.primary-button,
.secondary-button,
.danger-button {
    min-height: 38px;
    padding: 0.72rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.header-button,
.primary-button {
    background: #2f3336;
    color: #fff;
}

.secondary-button {
    background: #e8ecef;
    color: #223038;
}

.danger-button {
    background: #b73a3a;
    color: #fff;
}

.header-button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(24, 35, 40, 0.12);
}

.header-button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.estoque-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-shell {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px 12px 14px;
    color: #edf1f2;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e6b555 0%, #f6e0aa 100%);
    color: #232b30;
    font-weight: 800;
}

.sidebar-brand-title {
    font-size: 1.08rem;
    font-weight: 700;
}

.sidebar-brand-subtitle {
    margin-top: 2px;
    color: rgba(237, 241, 242, 0.72);
    font-size: 0.92rem;
}

.sidebar-meta {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-meta-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(237, 241, 242, 0.62);
}

.sidebar-meta-value {
    margin-top: 4px;
    font-weight: 600;
}

.sidebar-nav-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-group-title {
    padding: 0 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(237, 241, 242, 0.58);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(237, 241, 242, 0.92);
    background: rgba(255, 255, 255, 0.035);
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(230, 181, 85, 0.16);
    transform: translateX(2px);
}

.sidebar-link-icon {
    width: 34px;
    height: 28px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
}

.sidebar-link-button {
    text-align: left;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0;
    color: rgba(237, 241, 242, 0.72);
}

.sidebar-footer-title,
.sidebar-footer-text {
    font-size: initial;
}

.sidebar-footer-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.sidebar-footer-text {
    color: rgba(237, 241, 242, 0.72);
    line-height: 1.45;
    font-size: 0.92rem;
}

.sidebar-activation-button {
    width: 100%;
    margin-top: 12px;
    min-height: 46px;
    padding: 0.9rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-align: center;
    background: linear-gradient(135deg, #6f42c1 0%, #5a33a3 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(111, 66, 193, 0.22);
}

.sidebar-activation-button:hover {
    box-shadow: 0 16px 28px rgba(111, 66, 193, 0.28);
}

.sidebar-activation-button span:first-child {
    font-size: 1.1rem;
    line-height: 1;
}

.login-card {
    max-width: 460px;
}

.autocomplete-shell {
    position: relative;
}

.autocomplete-input-wrap {
    position: relative;
}

.autocomplete-status {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #68777d;
    font-size: 0.88rem;
}

.autocomplete-panel {
    position: absolute;
    top: calc(100% + 0.3rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d8dfe3;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(18, 34, 29, 0.12);
    z-index: 20;
    max-height: 320px;
    overflow-y: auto;
}

.autocomplete-option {
    width: 100%;
    padding: 0.85rem 0.95rem;
    background: transparent;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #edf1f2;
    transition: background-color 0.15s ease;
}

.autocomplete-option:hover {
    background: #f4f7f8;
}

.autocomplete-option:last-child {
    border-bottom: 0;
}

.autocomplete-title {
    font-weight: 700;
    color: #223038;
}

.autocomplete-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.35rem;
    color: #66757b;
    font-size: 0.88rem;
}

.autocomplete-empty {
    padding: 1rem;
    color: #66757b;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #46555c;
    font-weight: 600;
}

.form-input {
    width: 100%;
    min-height: 38px;
    padding: 0.68rem 0.8rem;
    border: 1px solid #cfd7db;
    border-radius: 7px;
    background: #fff;
    color: #1d2a2f;
}

.form-input:focus {
    outline: none;
    border-color: #95a6ad;
    box-shadow: 0 0 0 3px rgba(149, 166, 173, 0.15);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #415058;
    font-weight: 500;
}

.remember-checkbox {
    width: 1rem;
    height: 1rem;
}

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

.full-span {
    grid-column: 1 / -1;
}

.form-actions,
.inline-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.feedback-banner,
.state-box {
    padding: 0.9rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.feedback-success {
    background: #eef8f1;
    border-color: #c8dfcf;
    color: #29573a;
}

.feedback-error {
    background: #fff1f1;
    border-color: #e2bcbc;
    color: #8d2f2f;
}

.feedback-info,
.state-box {
    background: #f3f6f7;
    border-color: #d6dee2;
    color: #4e5f66;
}

.config-page {
    gap: 18px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.config-card {
    display: grid;
    gap: 12px;
    padding: 1rem;
    border: 1px solid var(--theme-border, #d6dee2);
    border-radius: 12px;
    background: var(--theme-surface-soft, #f8fafb);
}

.config-card h3,
.config-card p {
    margin: 0;
}

.config-card__header {
    display: grid;
    gap: 0.3rem;
}

.config-card__header p {
    color: var(--theme-text-soft, #66757b);
}

.config-card--action {
    align-content: space-between;
}

.font-scale-box {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.font-scale-box strong {
    min-width: 68px;
    text-align: center;
    color: var(--theme-primary-ink, #223038);
}

.font-scale-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 1.1rem;
}

.password-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.config-card--choice {
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.config-card--choice span {
    color: var(--theme-text-soft, #66757b);
}

.config-card--choice:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(24, 35, 40, 0.08);
}

.estoque-search-card {
    display: grid;
    gap: 0.8rem;
}

.estoque-search-input {
    width: 100%;
}

.estoque-search-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--theme-text-soft, #888);
    font-size: 0.92rem;
}

.estoque-search-loading__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--theme-primary, #4f46e5);
    animation: estoque-pulse 0.9s ease-in-out infinite alternate;
}

.estoque-empty-state {
    padding: 1.4rem 1rem;
    text-align: center;
    color: var(--theme-text-soft, #777);
}

.estoque-table th {
    text-align: left;
}

@keyframes estoque-pulse {
    from {
        opacity: 0.35;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1.08);
    }
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.filters-row {
    align-items: stretch;
}

.search-input {
    max-width: 360px;
}

.filter-select {
    max-width: 220px;
}

.toolbar-meta {
    color: #66757b;
    font-size: 0.95rem;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e8edef;
}

.pagination-bar__summary,
.pagination-bar__meta {
    color: #66757b;
    font-size: 0.92rem;
}

.pagination-bar__size {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.pagination-bar__size-label {
    color: #66757b;
    font-size: 0.92rem;
    white-space: nowrap;
}

.pagination-bar__select {
    min-width: 88px;
}

.pagination-bar__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.pagination-bar__button {
    min-width: 90px;
}

.pagination-bar__button--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

.pagination-bar__numbers {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pagination-bar__number-button {
    min-width: 44px;
    padding-inline: 0.7rem;
}

.pagination-bar__number-button--active {
    background: linear-gradient(135deg, #6f42c1 0%, #5a33a3 100%);
    color: #fff;
    border-color: #5a33a3;
    box-shadow: 0 10px 20px rgba(111, 66, 193, 0.18);
}

.pagination-bar__button:not(.pagination-bar__button--disabled):hover,
.pagination-bar__number-button:not(.pagination-bar__button--disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(24, 35, 40, 0.12);
}

.selection-card {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    background: #f4f7f8;
    border: 1px solid #d8dfe3;
}

.selection-card p {
    margin: 0.35rem 0 0;
    color: #66757b;
}

.metric-label {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #77858b;
}

.metric-value {
    margin-top: 6px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2d33;
}

.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.metric-card {
    border: 1px solid #cfd7db;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8f9 100%);
    padding: 14px 16px;
}

.os-page {
    padding-bottom: 18px;
}

.os-page-head {
    padding-bottom: 8px;
}

.os-overview-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
}

.os-overview-form {
    align-content: start;
}

.os-status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
}

.os-status-item {
    padding: 4px 6px;
    border-left: 3px solid #d0d8dc;
}

.os-status-item strong {
    display: block;
    margin-top: 4px;
    color: #203038;
}

.os-blocks-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.os-block-section {
    overflow: visible;
}

.os-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8eb;
}

.os-block-kicker {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7b878d;
    margin-bottom: 4px;
}

.os-block-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 12px;
}

.os-panel-shell {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d8dfe3;
    background: linear-gradient(180deg, #fbfcfc 0%, #f5f7f8 100%);
}

.os-table-shell {
    overflow: visible;
}

.os-table-title {
    margin-bottom: 10px;
    font-weight: 700;
    color: #223038;
}

.os-table .compact-input {
    min-width: 84px;
}

.os-qty-cell,
.os-value-cell {
    width: 108px;
}

.piece-head-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 88px 120px 1fr;
    gap: 10px;
    padding: 0 0 8px;
    color: #76858b;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.piece-head-row span:nth-child(n + 2) {
    text-align: center;
}

.piece-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
}

.piece-fields {
    display: grid;
    grid-template-columns: 88px 120px 1fr;
    gap: 10px;
    align-items: center;
}

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

.piece-total {
    min-height: 38px;
    padding: 0.65rem 0.8rem;
    border-radius: 7px;
    background: #edf2f4;
    border: 1px solid #d2dade;
    font-weight: 700;
    color: #213038;
    text-align: center;
}

.add-line-button {
    margin-top: 0.35rem;
}

.totals-card {
    position: sticky;
    bottom: 10px;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.total-box {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f3f6f7;
    border: 1px solid #d7dfe3;
}

.total-box-highlight {
    background: linear-gradient(180deg, #2f3336 0%, #444b50 100%);
    border-color: #2f3336;
}

.total-box-highlight .metric-label,
.total-box-highlight .metric-value {
    color: #fff;
}

.os-created-note {
    margin-top: 12px;
    color: #4f5f66;
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 0.82rem 0.72rem;
    text-align: left;
    border-bottom: 1px solid #e8edef;
    vertical-align: top;
}

.data-table thead th {
    background: #f3f6f7;
    color: #68767c;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.actions-column {
    width: 180px;
}

.row-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.table-link {
    padding: 0;
    background: transparent;
    color: #23584b;
    font-weight: 600;
}

.danger-link {
    color: #af3434;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 22, 19, 0.48);
    display: grid;
    place-items: center;
    padding: 1rem;
    z-index: 50;
}

.modal-shell {
    width: min(100%, 520px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header,
.modal-footer,
.modal-body {
    padding: 1.1rem 1.2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    border-bottom: 1px solid #e8edef;
}

.modal-header h3 {
    margin: 0;
    color: #223038;
}

.modal-header p {
    margin: 0.35rem 0 0;
    color: #66757b;
}

.modal-body {
    padding-top: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid #e8edef;
}

.modal-close {
    background: transparent;
    font-size: 1.1rem;
    color: #66757b;
}

.save-button {
    min-width: 144px;
}

.form-error {
    padding: 0.9rem 1rem;
    border-radius: 8px;
    background: #fff0f0;
    border: 1px solid #e8b6b6;
    color: #8f2626;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

@media (max-width: 1180px) {
    .os-overview-grid,
    .os-block-grid,
    .totals-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
        background: #dfe4e7;
    }

    .app-main {
        padding: 12px;
    }

    .app-main-frame {
        min-height: auto;
    }

    .header-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-row,
    .row-actions,
    .form-actions,
    .inline-footer,
    .page-head,
    .page-head-actions,
    .selection-card,
    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-bar__size {
        justify-content: space-between;
    }

    .search-input,
    .filter-select {
        max-width: none;
    }

    .piece-head-row,
    .piece-editor-row,
    .piece-fields,
    .os-status-strip {
        grid-template-columns: 1fr;
    }

    .piece-head-row {
        display: none;
    }

    .pagination-bar__actions {
        width: 100%;
        justify-content: space-between;
    }

    .pagination-bar__numbers {
        justify-content: center;
    }
}

.os-page {
    --os-accent: #6c4ed9;
    --os-accent-soft: #efeaff;
    --os-accent-soft-border: #d8cbff;
    --os-accent-deep: #2e244f;
    --os-surface: #f7f5fc;
}

.os-page .page-head h1,
.os-page .section-title,
.os-page .os-table-title,
.os-page .os-status-item strong,
.os-page .piece-total,
.os-page .metric-value {
    color: var(--os-accent-deep);
}

.os-page .page-head p,
.os-page .form-section-header p,
.os-page .metric-label,
.os-page .os-block-kicker,
.os-page .piece-head-row,
.os-page .os-created-note {
    color: #6c6487;
}

.os-page .page-card {
    border-color: #ddd6f3;
    background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
}

.os-page .form-section-header,
.os-page .os-block-header {
    border-bottom-color: #e6def8;
}

.os-page .form-input:focus {
    border-color: #9d89e9;
    box-shadow: 0 0 0 3px rgba(108, 78, 217, 0.14);
}

.os-page .primary-button,
.os-page .header-button {
    background: linear-gradient(180deg, #5f43c9 0%, #4a34a8 100%);
    color: #fff;
}

.os-page .secondary-button {
    background: #efeaff;
    color: var(--os-accent-deep);
    border: 1px solid var(--os-accent-soft-border);
}

.os-page .feedback-success {
    background: #f2edff;
    border-color: #d6c8ff;
    color: #4a3895;
}

.os-page .feedback-error {
    background: #fff1f5;
    border-color: #f1c7d4;
    color: #8c2d57;
}

.os-page .feedback-info,
.os-page .state-box {
    background: #f5f2ff;
    border-color: #ddd3fb;
    color: #574e7a;
}

.os-page .os-status-strip {
    background: linear-gradient(180deg, #f8f5ff 0%, #f1ecff 100%);
    border-color: #ddd3fb;
}

.os-page .os-status-item {
    border-left-color: #9d89e9;
}

.os-page .os-panel-shell {
    border-color: #e0d8f5;
    background: linear-gradient(180deg, #fdfcff 0%, #f6f2ff 100%);
}

.os-page .data-table thead th {
    background: #f1ecff;
    color: #655c87;
}

.os-page .data-table td,
.os-page .data-table th {
    border-bottom-color: #ece5fa;
}

.os-page .piece-total {
    background: #f0ebff;
    border-color: #d6caff;
}

.os-page .totals-card {
    border-color: #ddd3fb;
    background: linear-gradient(180deg, #fbf9ff 0%, #f4f0ff 100%);
}

.os-page .total-box {
    border-color: #ddd3fb;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.os-page .total-box-highlight {
    border-color: #b9a8f3;
    background: linear-gradient(180deg, #f3eeff 0%, #e7deff 100%);
}

.os-page .total-box-highlight .metric-label,
.os-page .total-box-highlight .metric-value {
    color: var(--os-accent-deep);
}
