body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f6f7f2;
    color: #1f2a24;
}

.app-topbar,
.app-sidebar {
    background: #18332f;
    color: #ffffff;
}

.app-sidebar {
    min-height: calc(100vh - 56px);
    padding: 16px;
    width: 260px;
}

.app-sidebar .offcanvas-body {
    padding: 0;
}

.app-sidebar .nav-link {
    color: #d1d5db;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.94rem;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
    background: #d9f99d;
    color: #18332f;
}

.app-sidebar .btn-close {
    opacity: 1;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        min-height: 100vh;
    }
}

.main-content {
    background: #ffffff;
    min-height: calc(100vh - 56px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.page-header .meta {
    color: #475569;
    margin: 6px 0 0;
}

.app-footer {
    border-top: 1px solid #e5e7df;
    color: #667064;
    margin-top: 32px;
    padding-top: 16px;
    font-size: 0.9rem;
}

.auth-body {
    background: #f3f5f9;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 16px 50px rgba(15, 23, 42, 0.12);
    max-width: 440px;
    padding: 32px;
    width: 100%;
}

.card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 20px;
}

.panel {
    border: 1px solid #d9dfd1;
    border-radius: 8px;
    background: #ffffff;
    padding: 20px;
    margin-bottom: 24px;
}

.panel .table-wrap {
    margin-top: 4px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-header h2,
.section-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.panel-header p {
    margin: 0;
    color: #667064;
}

.section-title {
    margin-top: 24px;
}

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

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

.table-wrap th,
.table-wrap td {
    border-bottom: 1px solid #e5e7df;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.table-wrap th {
    background: #f0f4e8;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.muted {
    color: #667064;
    font-size: 0.88rem;
}

.status {
    display: inline-block;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status.ok {
    background: #d1fae5;
    color: #065f46;
}

.status.warning {
    background: #fef3c7;
    color: #92400e;
}

.actions {
    white-space: nowrap;
}

.actions a {
    color: #2f7d63;
    font-weight: 700;
    margin-right: 10px;
    text-decoration: none;
}

.product-images {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.product-image-item {
    border: 1px solid #d9dfd1;
    border-radius: 8px;
    padding: 8px;
}

.product-image-item img {
    aspect-ratio: 1;
    display: block;
    object-fit: cover;
    width: 100%;
}

.product-image-item a {
    color: #2f7d63;
    display: inline-block;
    font-weight: 700;
    margin-top: 8px;
    text-decoration: none;
}

.quote-detail {
    display: grid;
    gap: 12px;
}

.quote-detail table input,
.quote-detail table select {
    min-width: 110px;
    width: 100%;
}

.quote-detail table input[data-quote-description] {
    min-width: 220px;
}

.link-button {
    background: transparent;
    border: 0;
    color: #2f7d63;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-decoration: none;
}

.app-modal {
    border: 1px solid #d9dfd1;
    border-radius: 8px;
    max-height: 86vh;
    max-width: 980px;
    overflow: auto;
    padding: 20px;
    width: min(980px, calc(100vw - 32px));
}

.app-modal::backdrop {
    background: rgba(31, 42, 36, 0.46);
}

.modal-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: #b42318;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    padding: 8px 12px;
}

.alert {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    margin-bottom: 16px;
    padding: 12px;
}

.alert.success {
    background: #dcfce7;
    border-color: #16a34a;
    color: #166534;
}

.debug-output {
    background: #111827;
    border-radius: 8px;
    color: #e5e7eb;
    max-height: 360px;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
}

.form-grid {
    display: grid;
    gap: 16px;
    max-width: 760px;
}

.form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 1040px;
}

.form-grid label {
    color: #34423a;
    display: grid;
    font-weight: 700;
    gap: 8px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    border: 1px solid #cfd8c3;
    border-radius: 8px;
    font: inherit;
    padding: 11px 12px;
}

.form-grid textarea {
    resize: vertical;
}

.check-row {
    align-items: center;
    display: flex !important;
    gap: 8px;
}

.check-row input {
    width: auto;
}

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

.form-actions {
    display: flex;
    gap: 8px;
}

.form-help {
    background: #f0f4e8;
    border: 1px solid #d9dfd1;
    border-radius: 8px;
    color: #485447;
    padding: 12px;
}

.check-group {
    border: 1px solid #d9dfd1;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.check-group legend {
    color: #34423a;
    font-weight: 700;
    padding: 0 6px;
}

.inline-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-form input[type="text"] {
    border: 1px solid #cfd8c3;
    border-radius: 8px;
    font: inherit;
    padding: 9px 10px;
}

.location-selects {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-hint {
    color: #667064;
    font-size: 0.86rem;
    font-weight: 400;
}

.field-hint.valid {
    color: #047857;
}

.field-hint.invalid {
    color: #b42318;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button,
.header-actions button {
    display: inline-block;
    border: none;
    border-radius: 8px;
    background: #2f7d63;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 14px;
    text-decoration: none;
}

.button:hover {
    color: #ffffff;
    filter: brightness(0.95);
}

.button.secondary {
    background: #b42318;
}

.footer {
    margin-top: 32px;
    color: #64748b;
    font-size: 0.92rem;
}

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    padding: 32px;
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.75rem;
    color: #111827;
}

.login-card p {
    margin: 0 0 24px;
    color: #475569;
}

.login-card label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.login-card button {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    background: #2f7d63;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
}

.login-card .error-message {
    margin-bottom: 16px;
    color: #b91c1c;
    font-size: 0.95rem;
}
