:root,
[data-bs-theme="light"] {
    --app-bg: #f7f8fb;
    --app-surface: #ffffff;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-text);
    --bs-secondary-color: var(--app-muted);
    --bs-tertiary-bg: var(--app-bg);
    --bs-border-color: #cbd5e1;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--app-bg);
    color: var(--app-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.form-control,
.form-select,
input.form-control,
textarea.form-control,
select.form-select {
    background-color: var(--app-bg) !important;
    background: var(--app-bg) !important;
}

.cpid-danger-input {
    background-color: rgba(220, 53, 69, 0.18) !important;
    background: rgba(220, 53, 69, 0.18) !important;
    color: #111827 !important;
    border-color: rgba(220, 53, 69, 0.55) !important;
}

.cpid-danger-input::placeholder {
    color: rgba(17, 24, 39, 0.55) !important;
}

.cpid-danger-input:focus {
    background-color: rgba(220, 53, 69, 0.18) !important;
    background: rgba(220, 53, 69, 0.18) !important;
    color: #111827 !important;
    border-color: rgba(220, 53, 69, 0.75) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.12) !important;
}

.cpid-valid-input {
    background-color: rgba(25, 135, 84, 0.20) !important;
    background: rgba(25, 135, 84, 0.20) !important;
    color: #111827 !important;
    border-color: rgba(25, 135, 84, 0.55) !important;
}

.cpid-product-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 1);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    z-index: 1050;
}

.cpid-product-dropdown-inner {
    max-height: 216px;
    overflow-y: auto;
}

.cpid-product-option {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
}

.cpid-product-option:hover,
.cpid-product-option[aria-selected="true"] {
    background: rgba(13, 110, 253, 0.10);
}

.cpid-clipboard-btn {
    user-select: none;
    transition: transform 0.06s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.cpid-clipboard-btn i {
    color: #198754 !important;
}

.cpid-clipboard-btn:hover {
    background-color: rgba(13, 110, 253, 0.10);
}

.cpid-clipboard-btn:active {
    transform: translateY(1px) scale(0.98);
}

.cpid-clipboard-btn.cpid-clipboard-flash {
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.cpid-clipboard-btn.cpid-clipboard-flash i {
    color: #ffffff !important;
}

.cpid-clear-btn {
    user-select: none;
    transition: transform 0.06s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.cpid-clear-btn i {
    color: #dc3545 !important;
}

.cpid-clear-btn:hover {
    background-color: rgba(220, 53, 69, 0.08);
}

.cpid-clear-btn:active {
    transform: translateY(1px) scale(0.98);
}

.cpid-clear-btn.cpid-clear-flash {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.cpid-clear-btn.cpid-clear-flash i {
    color: #ffffff !important;
}

.form-control:disabled,
.form-select:disabled,
input.form-control:disabled,
textarea.form-control:disabled,
select.form-select:disabled {
    background-color: var(--app-bg) !important;
    background: var(--app-bg) !important;
}

.form-control:focus,
.form-select:focus,
input.form-control:focus,
textarea.form-control:focus,
select.form-select:focus {
    background-color: var(--app-bg) !important;
    background: var(--app-bg) !important;
}

.form-control.cpid-danger-input,
.form-control.cpid-danger-input:focus,
input.form-control.cpid-danger-input,
input.form-control.cpid-danger-input:focus,
textarea.form-control.cpid-danger-input,
textarea.form-control.cpid-danger-input:focus,
select.form-select.cpid-danger-input,
select.form-select.cpid-danger-input:focus {
    background-color: rgba(220, 53, 69, 0.18) !important;
    background: rgba(220, 53, 69, 0.18) !important;
    background-image: none !important;
    color: #111827 !important;
    border-color: rgba(220, 53, 69, 0.55) !important;
}

.form-control.cpid-danger-input.cpid-valid-input,
.form-control.cpid-danger-input.cpid-valid-input:focus,
input.form-control.cpid-danger-input.cpid-valid-input,
input.form-control.cpid-danger-input.cpid-valid-input:focus,
textarea.form-control.cpid-danger-input.cpid-valid-input,
textarea.form-control.cpid-danger-input.cpid-valid-input:focus,
select.form-select.cpid-danger-input.cpid-valid-input,
select.form-select.cpid-danger-input.cpid-valid-input:focus {
    background-color: rgba(25, 135, 84, 0.20) !important;
    background: rgba(25, 135, 84, 0.20) !important;
    background-image: none !important;
    color: #111827 !important;
    border-color: rgba(25, 135, 84, 0.55) !important;
}

input.form-control:-webkit-autofill,
input.form-control:-webkit-autofill:hover,
input.form-control:-webkit-autofill:focus,
select.form-select:-webkit-autofill,
select.form-select:-webkit-autofill:hover,
select.form-select:-webkit-autofill:focus,
textarea.form-control:-webkit-autofill,
textarea.form-control:-webkit-autofill:hover,
textarea.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px var(--app-bg) inset !important;
    box-shadow: 0 0 0px 1000px var(--app-bg) inset !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

input.form-control.cpid-danger-input:-webkit-autofill,
input.form-control.cpid-danger-input:-webkit-autofill:hover,
input.form-control.cpid-danger-input:-webkit-autofill:focus,
textarea.form-control.cpid-danger-input:-webkit-autofill,
textarea.form-control.cpid-danger-input:-webkit-autofill:hover,
textarea.form-control.cpid-danger-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px rgba(220, 53, 69, 0.18) inset !important;
    box-shadow: 0 0 0px 1000px rgba(220, 53, 69, 0.18) inset !important;
    -webkit-text-fill-color: #111827 !important;
}

input.form-control.cpid-danger-input.cpid-valid-input:-webkit-autofill,
input.form-control.cpid-danger-input.cpid-valid-input:-webkit-autofill:hover,
input.form-control.cpid-danger-input.cpid-valid-input:-webkit-autofill:focus,
textarea.form-control.cpid-danger-input.cpid-valid-input:-webkit-autofill,
textarea.form-control.cpid-danger-input.cpid-valid-input:-webkit-autofill:hover,
textarea.form-control.cpid-danger-input.cpid-valid-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px rgba(25, 135, 84, 0.20) inset !important;
    box-shadow: 0 0 0px 1000px rgba(25, 135, 84, 0.20) inset !important;
    -webkit-text-fill-color: #111827 !important;
}

main {
    flex: 1 0 auto;
}

.app-navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-navbar .nav-link {
    border-radius: 0;
}

.app-navbar .nav-link:hover {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.9) !important;
}

.app-navbar .nav-link.active {
    background-color: transparent;
    font-weight: 600;
    color: #ffffff !important;
}

.app-navbar .navbar-brand i {
    color: #ffffff;
}

.feature-card {
    border-radius: 4px;
    background-color: #ffffff;
    border: 0 !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

.feature-card:hover {
    transform: none;
}

.feature-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
}

.feature-icon-badge i {
    line-height: 1;
    font-size: 1em;
}

.feature-icon-settings {
    color: #2563eb !important;
}

.feature-icon-palette {
    color: #16a34a !important;
}

.feature-icon-rocket {
    color: #d97706 !important;
}

.feature-icon-badge.feature-icon-settings i {
    color: #2563eb !important;
}

.feature-icon-badge.feature-icon-palette i {
    color: #16a34a !important;
}

.feature-icon-badge.feature-icon-rocket i {
    color: #d97706 !important;
}

.ms-icon {
    display: inline-block;
    font-size: 2.4rem;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 48;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: none;
}

.ms-icon-settings {
    background-image: linear-gradient(135deg, #6b7280 0%, #60a5fa 50%, #1d4ed8 100%);
}

.ms-icon-palette {
    background-image: linear-gradient(135deg, #94a3b8 0%, #22c55e 45%, #0ea5e9 100%);
}

.ms-icon-rocket {
    background-image: linear-gradient(135deg, #9ca3af 0%, #f59e0b 45%, #ef4444 100%);
}

.app-user-link {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.38rem 0.7rem !important;
    font-weight: 500;
}

.app-user-link i {
    font-size: 0.95rem;
}

.app-user-link-login {
    color: #0f172a !important;
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.app-user-link-register {
    color: #ffffff !important;
    border-color: #1d4ed8;
    background-color: #2563eb;
}

.app-footer {
    background-color: #0f172a;
    border-top: 1px solid #111827;
    box-shadow: none;
    color: #ffffff;
}

.app-footer-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.app-footer-brand {
    justify-self: start;
}

.app-footer-copy {
    justify-self: center;
    text-align: center;
}

.app-footer-links {
    justify-self: end;
    flex-wrap: wrap;
}

@media (max-width: 575.98px) {
    .app-footer-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .app-footer-links {
        justify-self: center;
        justify-content: center;
        text-align: center;
        order: 1;
    }

    .app-footer-copy {
        justify-self: center;
        order: 2;
    }

    .app-footer-brand {
        justify-self: center;
        order: 3;
    }
}

.app-footer .text-secondary {
    color: #ffffff !important;
}

.app-footer-support-link:hover {
    color: #ffffff !important;
}

.footer-icon {
    color: #ffffff;
    font-size: 1rem;
}

.footer-icon:hover {
    color: #ffffff;
}

.auth-card {
    border-radius: 12px;
    background-color: var(--app-surface);
}

.auth-card-header {
    background-color: var(--app-surface);
    border-bottom: 1px solid rgba(203, 213, 225, 0.85);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.auth-card-header h1 {
    letter-spacing: -0.02em;
}

.auth-hero .auth-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.auth-hero .auth-hero-icon i {
    font-size: 1.6rem;
    color: #2563eb;
}

.app-form-page {
    flex: 1 0 auto;
}

.app-form-card {
    box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.12) !important;
    background-color: #ffffff !important;
    overflow: hidden;
}

.app-form-card .card-body {
    background-color: #ffffff;
}

.app-form-card .card-footer {
    background-color: var(--app-bg);
    border-top: 1px solid rgba(203, 213, 225, 0.85);
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

.app-form-card .form-control,
.app-form-card .form-select,
.app-form-card textarea.form-control {
    background-color: var(--app-bg) !important;
    background: var(--app-bg) !important;
}

.app-form-card-header {
    color: #ffffff !important;
}

.app-form-card-header h4 {
    font-weight: 600;
}



.auth-card .form-control,
.auth-card .form-select {
    background-color: var(--app-bg) !important;
    border-color: #cbd5e1;
}

.auth-card textarea.form-control {
    background-color: var(--app-bg) !important;
}

.auth-card input.form-control:-webkit-autofill,
.auth-card input.form-control:-webkit-autofill:hover,
.auth-card input.form-control:-webkit-autofill:focus,
.auth-card select.form-select:-webkit-autofill,
.auth-card select.form-select:-webkit-autofill:hover,
.auth-card select.form-select:-webkit-autofill:focus,
.auth-card textarea.form-control:-webkit-autofill,
.auth-card textarea.form-control:-webkit-autofill:hover,
.auth-card textarea.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px var(--app-bg) inset !important;
    box-shadow: 0 0 0px 1000px var(--app-bg) inset !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    background-color: var(--app-bg) !important;
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
}

.pm-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.pm-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 92px 120px 70px;
    align-items: center;
    column-gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #f8fafc;
}

.pm-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.pm-row + .pm-row {
    margin-top: 0.75rem;
}

.pm-row-left {
    display: contents;
}

.pm-row-right {
    display: contents;
}

.pm-row .badge,
.pm-row .pm-price,
.pm-row .pm-perfile {
    justify-self: end;
}

.pm-perfile {
    font-size: 0.85rem;
    line-height: 1;
    color: rgba(15, 23, 42, 0.60);
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .pm-row {
        grid-template-columns: 40px minmax(0, 1fr);
        row-gap: 0.6rem;
    }
    .pm-row .badge {
        grid-column: 1 / -1;
        justify-self: start;
    }
    .pm-row .pm-price {
        grid-column: 1 / -1;
        justify-self: start;
    }
    .pm-row .pm-perfile {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

.pm-price {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
    border: 1px solid rgba(15, 23, 42, 0.10);
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.icon-circle.icon-green {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.icon-circle.icon-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.icon-circle.icon-indigo {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.icon-circle.icon-gray {
    background: linear-gradient(135deg, #334155, #0f172a);
}

.pm-copy {
    font-weight: 700;
}

.pm-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: 0.2px;
    word-break: break-all;
}
