.card,
.dashboard-card,
.metric-card,
.success-card,
.receipt-sheet,
.empty-state,
.info-tile {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow);
}
.dashboard-card { overflow: hidden; }
.metric-card {
    height: 100%;
    padding: 22px;
    min-width: 0;
    overflow-wrap: anywhere;
}
.metric-card span { display: block; color: var(--muted); font-size: 0.86rem; }
.metric-card strong { display: block; margin-top: 5px; color: var(--navy); font-size: 1.8rem; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(2rem, 4vw, 3.2rem); }

.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: 1rem; border-color: var(--border); }
.table thead th {
    color: var(--muted);
    background: var(--surface-alt);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.status-badge {
    display: inline-block;
    padding: 0.38rem 0.68rem;
    border-radius: 999px;
    color: var(--text-light);
    background: var(--surface-alt);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}
.status-placed { color: var(--muted-color); background: rgba(var(--secondary-rgb), 0.08); }
.status-assigned { color: var(--secondary-dark-color); background: rgba(var(--secondary-rgb), 0.12); }
.status-accepted,
.status-printing { color: var(--primary-dark-color); background: rgba(var(--primary-rgb), 0.14); }
.status-ready,
.status-delivered { color: var(--primary-color); background: rgba(var(--primary-rgb), 0.16); }
.status-cancelled { color: var(--danger-color); background: rgba(var(--danger-color), 0.12); }
.detail-row,
.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.summary-row small { display: block; color: var(--muted); }
.timeline { margin-left: 8px; border-left: 2px solid var(--border-color); }
.timeline-item { position: relative; padding: 0 0 24px 24px; }
.timeline-dot {
    position: absolute;
    top: 4px;
    left: -7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--surface);
}
.timeline-item small { display: block; color: var(--muted); }

.contact-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(130px, 0.8fr) minmax(140px, 0.8fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) auto auto;
    gap: 12px;
    align-items: end;
}
.contact-filter-grid .btn {
    min-height: 42px;
    white-space: nowrap;
}
.message-cell {
    min-width: 220px;
    max-width: 420px;
    overflow-wrap: anywhere;
}
.admin-table-wrap {
    width: 100%;
}
.admin-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.admin-action-row .btn {
    white-space: nowrap;
}
.admin-print-panel {
    border-radius: 16px;
}
.admin-option-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.admin-option-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-alt-color);
}
.admin-inline-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}
.admin-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.admin-option-list span,
.admin-option-list small {
    display: inline-flex;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--muted-color);
    font-size: 0.78rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.admin-price-tools {
    display: grid;
    gap: 14px;
}
.admin-price-form,
.admin-import-form,
.admin-global-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(110px, 0.7fr) auto;
    gap: 10px;
    align-items: end;
}
.admin-import-form {
    grid-template-columns: minmax(220px, 1fr) auto;
}
.admin-global-form {
    grid-template-columns: minmax(120px, 0.7fr) minmax(130px, 0.7fr) auto auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.admin-global-form label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}
.admin-page-range-check {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
}
.admin-price-table {
    min-width: 980px;
}
.admin-price-table .form-select,
.admin-price-table .form-control {
    min-width: 130px;
}
.admin-price-table .price-input {
    min-width: 96px;
}

.auth-section {
    position: relative;
    display: grid;
    min-height: calc(100vh - 72px);
    padding: 48px 16px;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(140deg, rgba(var(--primary-rgb), 0.08), rgba(var(--secondary-rgb), 0.06) 45%, var(--background));
}
.auth-section .page-heading { margin-bottom: 24px; }
.auth-orb { position: absolute; width: 320px; height: 320px; border-radius: 50%; filter: blur(70px); }
.auth-orb-one { top: -100px; left: -90px; background: rgba(var(--primary-rgb), 0.24); }
.auth-orb-two { right: -100px; bottom: -120px; background: rgba(var(--light-blue-rgb), 0.2); }
.auth-card {
    position: relative;
    display: grid;
    width: min(100%, 950px);
    grid-template-columns: 0.9fr 1.1fr;
    min-width: 0;
    overflow: hidden;
    border-radius: 26px;
    background: white;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.15);
}
.customer-login-section {
    align-items: center;
    justify-items: center;
}
.customer-login-card {
    width: min(100% - 24px, 1040px);
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
    align-items: stretch;
    border-radius: 24px;
}
.consumer-auth-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 56px 100px;
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.06)),
        white;
}
.consumer-auth-panel h1 {
    max-width: 560px;
    margin: 14px 0;
    color: var(--navy);
    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 1.02;
}
.consumer-auth-panel p {
    max-width: 560px;
    color: var(--muted);
}
.staff-auth-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 42px;
    border-left: 1px solid var(--border);
    background: var(--surface-alt);
}
.staff-auth-panel h2 {
    margin: 8px 0;
    color: var(--navy);
}
.staff-auth-panel p {
    color: var(--muted);
}
.otp-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0 22px;
    max-width: 520px;
}
.otp-progress span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: white;
    font-size: 0.82rem;
    font-weight: 800;
}
.otp-progress span.active {
    color: var(--primary-dark-color);
    border-color: rgba(var(--primary-rgb), 0.28);
    background: rgba(var(--primary-rgb), 0.12);
}
.otp-auth-form {
    width: 100%;
    max-width: 520px;
}
.verify-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.otp-sent-note,
.customer-auth-note {
    color: var(--muted);
    font-size: 0.9rem;
}
.otp-sent-note {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--primary-rgb), 0.24);
    border-radius: 14px;
    background: rgba(var(--primary-rgb), 0.12);
    overflow-wrap: anywhere;
}
.otp-sent-note #resendTimerText {
    display: block;
    margin-top: 8px;
    color: var(--primary-dark-color);
    font-weight: 800;
}
.otp-resend-form {
    width: 100%;
    max-width: 520px;
    margin-top: 10px;
}
.otp-resend-form .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
}
.w-100 {
    width: 100% !important;
}
.customer-auth-note {
    width: 100%;
    max-width: 520px;
    margin: 18px 0 0;
}
.agent-register-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 18px;
    font-weight: 800;
}
.change-email-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 14px;
    border: 0;
    background: transparent;
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 800;
}
.otp-cancel-form {
    width: 100%;
    max-width: 520px;
}
.customer-login-card .auth-form {
    width: 100%;
}
.customer-login-card .form-group {
    margin-bottom: 1rem;
}
.customer-login-card .form-label {
    margin-bottom: 0.45rem;
}
.customer-login-card .input-shell {
    width: 100%;
}
.customer-login-card .form-control {
    min-height: 50px;
}
.customer-login-card .btn-lg {
    min-height: 50px;
}
.login-mode-shell {
    width: min(100% - 24px, 760px);
}
.login-mode-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto 18px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}
.login-mode-tabs a {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--muted);
    padding: 8px 12px;
    font-weight: 800;
    text-align: center;
    white-space: normal;
}
.login-mode-tabs a.active {
    color: white;
    background: var(--primary);
}
.login-mode-card {
    width: 100%;
    grid-template-columns: 1fr;
}
.consumer-auth-panel-full,
.staff-auth-panel-full {
    align-items: center;
    border-left: 0;
    text-align: center;
}
.consumer-auth-panel-full {
    padding: 42px;
}
.consumer-auth-panel-full .otp-auth-form,
.consumer-auth-panel-full .otp-resend-form,
.consumer-auth-panel-full .otp-cancel-form,
.consumer-auth-panel-full .customer-auth-note,
.consumer-auth-panel-full .otp-progress {
    max-width: none;
}
.staff-auth-panel-full {
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--light-blue-rgb), 0.04)),
        white;
}
.staff-auth-panel-full .auth-form {
    width: 100%;
    max-width: 520px;
    text-align: left;
}
.auth-link-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 22px;
    margin-top: 18px;
}
.auth-link-row .agent-register-link {
    margin-top: 0;
}
.auth-back-button {
    min-width: 96px;
    min-height: 42px;
}
.auth-card-register { width: min(100%, 1020px); }
.auth-side { padding: 52px; color: var(--surface-color); background: linear-gradient(145deg, var(--secondary-color), var(--primary-dark-color)); }
.auth-side h1 {
    margin: 18px 0;
    font-size: 2.5rem;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
.auth-side p { color: var(--surface-alt-color); }
.auth-feature,
.password-rules span {
    display: block;
    margin-top: 13px;
    color: var(--surface-alt-color);
}
.auth-feature span { margin-right: 8px; color: var(--accent-color); font-weight: 800; }
.password-rules { margin-top: 30px; }
.auth-form-panel { padding: 48px; }
.auth-form { display: grid; gap: 2px; }
.input-shell { position: relative; }
.input-shell .form-control { padding-left: 42px; }
.input-icon { position: absolute; z-index: 2; top: 50%; left: 15px; color: var(--muted-color); transform: translateY(-50%); }
.field-error,
.form-alert-danger {
    margin-top: 6px;
    color: var(--danger-color);
    font-size: 0.86rem;
}
.form-alert-danger {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(var(--danger-rgb), 0.28);
    border-radius: 10px;
    background: rgba(var(--danger-rgb), 0.12);
}
.auth-register-links,
.login-role-note {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}
.login-role-note { color: var(--muted); font-size: 0.78rem; }
.auth-switch { margin: 18px 0 0; text-align: center; }

.registration-page { padding: 55px 0; }
.registration-heading { max-width: 800px; margin-bottom: 28px; }
.registration-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: white;
    box-shadow: var(--shadow);
}
.registration-section { padding: 30px; border-bottom: 1px solid var(--border); }
.registration-section-title { display: flex; gap: 15px; margin-bottom: 22px; }
.registration-section-title > span {
    display: grid;
    flex: 0 0 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--primary);
    font-weight: 800;
}
.registration-section-title h2 { margin: 0; font-size: 1.25rem; }
.registration-section-title p { margin: 3px 0 0; color: var(--muted); }
.registration-grid,
.registration-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.registration-full { grid-column: 1 / -1; }
.registration-submit {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 25px 30px;
    background: var(--surface-alt-color);
}
.registration-submit small { display: block; color: var(--muted); }
.choice-row ul,
.service-choice-grid ul { margin: 0; padding: 0; list-style: none; }
.choice-row ul,
.service-choice-grid ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}
.choice-row li,
.service-choice-grid li { margin: 0; }
.choice-row label,
.service-choice-grid label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 767px) {
    .user-orders-table,
    .user-orders-table tbody,
    .user-orders-table tr,
    .user-orders-table td {
        display: block;
        width: 100%;
    }
    .user-orders-table thead { display: none; }
    .user-orders-table tbody { padding: 12px; }
    .user-orders-table tr {
        margin-bottom: 14px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: white;
    }
    .user-orders-table tr:last-child { margin-bottom: 0; }
    .user-orders-table td {
        display: grid;
        grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1.2fr);
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
        overflow-wrap: anywhere;
    }
    .user-orders-table td:last-child { border-bottom: 0; }
    .user-orders-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .success-files-table,
    .success-files-table tbody,
    .success-files-table tr,
    .success-files-table td {
        display: block;
        width: 100%;
    }
    .success-files-table thead { display: none; }
    .success-files-table tbody { padding: 0; }
    .success-files-table tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface-alt-color, #f8f9fa);
    }
    .success-files-table tr:last-child { margin-bottom: 0; }
    .success-files-table td {
        display: grid;
        grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.3fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
        overflow-wrap: anywhere;
        font-size: 0.9rem;
    }
    .success-files-table td:last-child { border-bottom: 0; }
    .success-files-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
}

.success-card { max-width: 760px; padding: 42px; }
.success-check,
.pending-icon {
    display: grid;
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--primary);
    font-weight: 900;
}
.pending-icon { color: var(--warning-color); background: rgba(var(--warning-rgb), 0.14); }
.info-tile { padding: 18px; box-shadow: none; }
.info-tile small { display: block; color: var(--muted); }
.receipt-sheet { max-width: 850px; padding: 42px; }
.empty-state { padding: 50px; text-align: center; }
.upi-qr { width: 210px; min-height: 210px; padding: 5px; }
.payment-form { max-width: 440px; }

@media (max-width: 767px) {
    .contact-filter-grid {
        grid-template-columns: 1fr;
    }
    .contact-filter-grid .btn,
    .contact-filter-grid a.btn {
        width: 100%;
    }
    .admin-option-grid,
    .admin-price-form,
    .admin-import-form,
    .admin-global-form {
        grid-template-columns: 1fr;
    }
    .admin-inline-control {
        grid-template-columns: 1fr;
    }
    .admin-inline-control .btn,
    .admin-price-form .btn,
    .admin-import-form .btn,
    .admin-global-form .btn {
        width: 100%;
    }
    .admin-action-row {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-action-row .btn {
        width: 100%;
    }
    .auth-card,
    .customer-login-card { grid-template-columns: 1fr; }
    .auth-side,
    .auth-form-panel,
    .consumer-auth-panel,
    .staff-auth-panel { padding: 32px 24px; }
    .customer-login-card {
        width: min(100% - 20px, 1040px);
    }
    .login-mode-shell {
        width: min(100% - 20px, 720px);
    }
    .consumer-auth-panel {
        justify-content: flex-start;
    }
    .staff-auth-panel {
        border-top: 1px solid var(--border);
        border-left: 0;
    }
    .auth-side h1 { font-size: 2rem; }
    .auth-section {
        min-height: calc(100vh - 64px);
        padding: 28px 0;
    }
    .auth-card { border-radius: 20px; }
    .otp-auth-form,
    .otp-resend-form,
    .otp-cancel-form,
    .customer-auth-note {
        max-width: none;
    }
    .consumer-auth-panel h1 {
        font-size: clamp(2rem, 10vw, 2.6rem);
    }
    .otp-progress {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }
    .otp-progress span {
        padding-inline: 8px;
        text-align: center;
    }
    .auth-register-links { align-items: center; flex-direction: column; }
    .login-mode-tabs {
        grid-template-columns: 1fr;
    }
    .registration-grid,
    .registration-upload-grid { grid-template-columns: 1fr; }
    .registration-submit { align-items: stretch; flex-direction: column; }
    .registration-submit .btn { width: 100%; }
    .choice-row ul,
    .service-choice-grid ul {
        flex-direction: column;
        gap: 10px;
    }
    .receipt-sheet,
    .success-card { padding: 25px; }
    .receipt-sheet .d-flex.justify-content-between {
        align-items: stretch !important;
        flex-direction: column;
        gap: 14px;
    }
    .receipt-sheet .text-end {
        text-align: left !important;
    }
}

@media (max-width: 420px) {
    .auth-side,
    .auth-form-panel,
    .consumer-auth-panel,
    .staff-auth-panel,
    .registration-section,
    .registration-submit {
        padding-left: 18px;
        padding-right: 18px;
    }
    .customer-login-card {
        width: min(100% - 16px, 1040px);
        border-radius: 16px;
    }
    .login-mode-shell {
        width: min(100% - 16px, 720px);
    }
    .login-mode-tabs {
        gap: 6px;
        border-radius: 16px;
    }
    .login-mode-tabs a {
        border-radius: 12px;
        padding-inline: 6px;
        font-size: 0.78rem;
    }
    .consumer-auth-panel,
    .staff-auth-panel {
        padding-top: 26px;
        padding-bottom: 26px;
    }
    .auth-register-links,
    .login-role-note {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }
    .empty-state {
        padding: 28px 18px;
    }
}
