:root {
    --primary-color: #2E7D32;
    /* Green */
    --primary-hover: #1B5E20;
    --secondary-color: #333333;
    /* Charcoal */
    --background-color: #f4f7f6;
    --card-bg: #ffffff;
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

.hidden {
    display: none !important;
}

/* Buttons */
button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    margin-bottom: 12px;
}

.btn-secondary:hover {
    background-color: #000;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background-color: #f0f0f0;
}

/* Challan Card */
.challan-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 24px;
    border-top: 6px solid var(--primary-color);
}

.challan-header {
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.psid-logo {
    background: #008542;
    /* HBL Greenish */
    color: white;
    padding: 6px 10px;
    text-align: center;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.psid-text {
    font-weight: 800;
    font-size: 1.1rem;
}

.psid-sub {
    font-size: 0.6rem;
    text-transform: uppercase;
}

.header-text {
    text-align: right;
}

.header-text h2 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 2px;
}

.header-text h3 {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.challan-body {
    padding: 20px;
}

.row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.label {
    color: var(--text-light);
    font-weight: 500;
}

.value {
    color: var(--secondary-color);
    font-weight: 600;
    text-align: right;
}

.divider {
    height: 1px;
    background: #eee;
    margin: 12px 0;
}

.highlight {
    color: #d32f2f;
    font-size: 0.9rem;
    font-weight: 700;
    /* Bold as requested */
}

.total-row {
    margin-top: 16px;
    align-items: center;
}

.amount {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 800;
}

.challan-footer {
    background: #f1f1f1;
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Loading Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    text-align: center;
    padding: 20px;
    max-width: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.safety-msg {
    margin-top: 10px;
    color: var(--text-light);
    font-style: italic;
    min-height: 1.6em;
    /* Prevent jumping */
    animation: fadeText 0.5s ease;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeText {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .container {
        padding: 0;
    }

    .card {
        border-radius: 0;
        box-shadow: none;
    }
}