:root {
    --primary: #701B55;
    --primary-hover: #591344;
    --bg: #f4f6fb;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}
* { box-sizing: border-box; }
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-dark);
    margin: 0;
    padding: 30px 15px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.box {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    padding: 38px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05);
}
.logo-img {
    display: block;
    max-width: 160px;
    margin: 0 auto 20px;
    border-radius: 8px;
    object-fit: contain;
}
h1 {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.subtitle {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 22px;
}
.warning {
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 25px;
}
.db-error {
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 20px;
}
label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #334155;
    margin: 18px 0 6px;
}
select, input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    background: #f8fafc;
    transition: all 0.2s ease;
}
select:focus, input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(112, 27, 85, 0.15);
}
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 28px;
    padding: 14px 20px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(112, 27, 85, 0.25);
}
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(112, 27, 85, 0.35);
}
.btn:active {
    transform: translateY(0);
}
.btn:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}
.hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}
.product-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    margin: 18px 0;
}
.product-name {
    font-weight: 800;
    font-size: 16px;
    color: var(--text-dark);
}
.product-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.amount-display {
    margin-top: 8px;
    font-size: 15px;
    color: var(--text-dark);
}
.amount-display strong {
    font-size: 18px;
    color: var(--primary);
}
.field-block {
    margin-top: 18px;
}
.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 500;
}
.checkbox-line input[type="checkbox"] {
    width: auto;
    margin: 0;
}
.checkbox-line a {
    color: var(--primary);
    font-weight: 700;
}
.cib-badge {
    height: 26px;
    width: auto;
    border-radius: 4px;
    background: #ffffff;
    padding: 2px;
}
.cards-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12px;
}
.cards-table th, .cards-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.cards-table th {
    color: var(--text-muted);
    font-weight: 700;
}
.cards-table td {
    font-family: monospace;
    color: #334155;
}
.cards-table tr:last-child td {
    border-bottom: none;
}
details {
    margin-top: 24px;
}
summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--primary);
}
.cards-wrap {
    overflow-x: auto;
    margin-top: 8px;
}
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-box {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}
.modal-box h2 {
    color: var(--primary);
    font-size: 19px;
    margin: 0 0 12px;
}
.modal-box h3 {
    font-size: 14.5px;
    color: var(--primary);
    margin: 20px 0 6px;
}
.modal-box p {
    font-size: 13.5px;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
}
.modal-close:hover {
    color: var(--primary);
}
.modal-box .btn {
    margin-top: 24px;
}
