html[data-bs-theme="light"] {
    --bs-primary: #0f6e56;
    --bs-primary-rgb: 15, 110, 86;
    --bs-link-color-rgb: 15, 110, 86;
    --bs-link-hover-color-rgb: 8, 80, 65;
    --bs-body-bg: #f5f4f0;
    --bs-body-color: #1a1a18;
    --app-navbar-bg: #ffffff;
    --app-navbar-border: #e5e4de;
    --app-primary: #0f6e56;
    --app-primary-hover: #085041;
}

html[data-bs-theme="dark"] {
    --bs-primary: #5dcaa5;
    --bs-primary-rgb: 93, 202, 165;
    --bs-link-color-rgb: 93, 202, 165;
    --bs-link-hover-color-rgb: 159, 225, 203;
    --app-navbar-bg: var(--bs-body-bg);
    --app-navbar-border: var(--bs-border-color);
    --app-primary: #5dcaa5;
    --app-primary-hover: #9fe1cb;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 14px;
    line-height: 1.5;
}

.navbar {
    background-color: var(--app-navbar-bg) !important;
    border-bottom: 1px solid var(--app-navbar-border);
}

.text-primary,
.text-success {
    color: var(--app-primary) !important;
}

.app-navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

.app-brand-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e1f5ee;
    color: #0f6e56;
    font-size: 1rem;
    line-height: 1;
    flex: 0 0 auto;
}

.bg-primary {
    background-color: var(--app-primary) !important;
}

.btn-primary,
.btn-success {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-hover);
    --bs-btn-hover-border-color: var(--app-primary-hover);
    --bs-btn-active-bg: var(--app-primary-hover);
    --bs-btn-active-border-color: var(--app-primary-hover);
}

.btn-outline-primary,
.btn-outline-success {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
    --bs-btn-active-bg: var(--app-primary);
    --bs-btn-active-border-color: var(--app-primary);
    --bs-btn-disabled-color: var(--app-primary);
    --bs-btn-disabled-border-color: var(--app-primary);
    --bs-btn-disabled-bg: transparent;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
.btn-close:focus,
.accordion-button:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.25rem rgba(15, 110, 86, 0.1);
}

.form-control,
.form-select,
textarea,
.input-group-text {
    font-size: 14px;
}

.form-control,
textarea,
.input-group-text {
    padding: 0.375rem 0.75rem;
}

.form-select {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    padding-left: 0.75rem;
    padding-right: 2.25rem;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-label,
.form-check-label,
.table,
.dropdown-item,
.dropdown-item-text,
.nav-link,
.navbar-brand,
.modal-title,
.card-header h5,
.card-header h6,
h2,
h5,
h6,
p,
small,
.form-text {
    font-size: 14px;
}

.table thead th {
    font-size: 12px;
}

.moisture-progress {
    min-width: 100px;
    flex-grow: 1;
    height: 20px;
}

.moisture-progress .progress-bar {
    float: right;
    color: #000000;
}

.signature-canvas,
#signatureCanvas {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: crosshair;
    background-color: white;
    width: 100%;
    height: 200px;
}

.signature-preview {
    font-family: 'Brush Script MT', cursive;
    font-size: 32px;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#page-scroll-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.18);
}

.quick-actions-wrap {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.quick-actions-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.quick-actions {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    gap: 0.5rem;
}

.quick-action-btn {
    white-space: nowrap;
}

.quick-actions-desktop-inline {
    display: none;
}

.btn-lot-blue {
    --bs-btn-color: #000;
    --bs-btn-bg: #0dcaf0;
    --bs-btn-border-color: #0dcaf0;
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: #31d2f2;
    --bs-btn-hover-border-color: #25cff2;
    --bs-btn-focus-shadow-rgb: 11, 172, 204;
    --bs-btn-active-color: #000;
    --bs-btn-active-bg: #3dd5f3;
    --bs-btn-active-border-color: #25cff2;
    --bs-btn-disabled-color: #000;
    --bs-btn-disabled-bg: #0dcaf0;
    --bs-btn-disabled-border-color: #0dcaf0;
}

@media (min-width: 992px) {
    .quick-actions-mobile-only {
        display: none;
    }

    .quick-actions-desktop-inline {
        display: block;
    }
}

@media (max-width: 991.98px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1030;
    }

    .navbar-utility-nav {
        border-top: 0;
        margin-top: 1.25rem;
        padding: 0.75rem 0.875rem 0.875rem;
        border-radius: 0.75rem;
        background: rgba(var(--bs-secondary-bg-rgb), 0.55);
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem 1rem;
    }

    .navbar-version-item,
    .navbar-theme-item {
        display: flex;
        align-items: center;
        min-height: 2.25rem;
    }

    .navbar-version-item {
        padding-left: 0 !important;
    }

    .navbar-utility-nav #toggle-theme {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.25rem;
        padding-top: 0;
        padding-bottom: 0;
    }

    .navbar-user-nav {
        border-top: 0;
        margin-top: 1rem;
        padding-top: 0;
    }

    .navbar-user-nav .nav-link {
        padding-left: 0;
    }

    .quick-actions-wrap {
        position: sticky;
        top: 57px;
        z-index: 1029;
        margin-top: 0;
        margin-bottom: 0.75rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        background-color: var(--bs-body-bg);
        border-bottom: 1px solid var(--app-navbar-border);
        box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.06);
    }

    .quick-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 0.4rem;
    }

    .quick-action-btn {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #page-scroll-toggle.is-visible {
        display: inline-flex;
    }
}
