/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Color Palette (HSL for high quality visual harmonies) */
    --primary-hue: 0;
    --primary: hsl(var(--primary-hue), 87%, 36%); /* #ac0c0c */
    --primary-hover: hsl(var(--primary-hue), 87%, 28%);
    --primary-light: hsl(var(--primary-hue), 87%, 96%);
    --primary-glow: hsla(var(--primary-hue), 87%, 36%, 0.15);
    
    --secondary-hue: 250;
    --secondary: hsl(var(--secondary-hue), 70%, 55%);
    --secondary-hover: hsl(var(--secondary-hue), 70%, 48%);
    
    --success: hsl(142, 72%, 40%);
    --success-hover: hsl(142, 72%, 35%);
    --success-light: hsl(142, 70%, 95%);
    
    --warning: hsl(38, 92%, 50%);
    --danger: hsl(354, 76%, 50%);
    --danger-light: hsl(354, 80%, 96%);
    
    --text-main: hsl(220, 40%, 15%);
    --text-muted: hsl(220, 20%, 45%);
    --text-light: hsl(220, 15%, 65%);
    
    --bg-app: hsl(220, 25%, 97%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-input: hsl(220, 20%, 98%);
    
    --border-color: hsl(220, 15%, 88%);
    --border-hover: hsl(220, 20%, 75%);
    
    /* Layout Constants */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 16px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 0 4px var(--primary-glow);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding: 24px;
}

.database-error-screen {
    min-height: calc(100vh - 48px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.database-error-card {
    width: min(100%, 560px);
    padding: 40px 32px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.database-error-icon {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    place-items: center;
    color: var(--danger);
    background: var(--danger-light);
    border-radius: 50%;
}

.database-error-icon svg {
    width: 32px;
    height: 32px;
}

.database-error-card h1 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.database-error-card p {
    color: var(--text-muted);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: hsl(220, 10%, 80%);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: hsl(220, 10%, 70%);
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, hsl(0, 75%, 20%) 0%, hsl(0, 75%, 12%) 100%);
    padding: 20px 32px;
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-md);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    background: rgba(255, 255, 255, 0.1);
    color: hsl(0, 85%, 65%);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-icon i {
    width: 24px;
    height: 24px;
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.brand-text p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.header-stats {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    color: hsl(142, 70%, 55%);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   FORM CONTAINER & STEPPER LAYOUT
   ========================================================================== */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.form-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 520px;
}

/* Stepper Sidebar */
.stepper-sidebar {
    background: hsl(220, 20%, 97.5%);
    border-right: 1px solid var(--border-color);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: default;
    transition: var(--transition);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: hsl(220, 10%, 88%);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.step-details {
    display: flex;
    flex-direction: column;
}

.step-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1.2;
}

.step-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Stepper States */
.step-item.active {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.step-item.active .step-number {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.step-item.active .step-title {
    color: var(--primary);
    font-weight: 700;
}

.step-item.completed .step-number {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.step-item.completed .step-title {
    color: var(--text-main);
}

/* Form Container Inner */
.form-container {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.form-step-panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.form-step-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel Header */
.panel-header {
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.panel-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header h2 i {
    width: 26px;
    height: 26px;
    color: var(--primary);
}

.panel-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   FORM INPUTS & GRID SYSTEM
   ========================================================================== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 16px -10px;
}

.form-group {
    padding: 0 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Column Utilities */
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.required {
    color: var(--danger);
}

/* Input Fields & Icons wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    padding: 12px 16px 12px 42px; /* Pad left to accommodate the absolute icon */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    outline: none;
}

/* Textarea input padding adjustment */
.input-wrapper textarea {
    padding-top: 14px;
    resize: vertical;
}

/* RT / RW fields without left icon */
.col-2 .input-wrapper input {
    padding-left: 12px;
}

/* Icon positioning */
.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-light);
    pointer-events: none;
    transition: var(--transition);
}

.input-icon.align-start {
    top: 14px;
}

/* Focus States */
.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-glow);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper select:focus + .input-icon,
.input-wrapper textarea:focus + .input-icon {
    color: var(--primary);
}

/* Readonly styles for auto-calculated/disabled elements */
.input-wrapper input[readonly],
.input-wrapper input:disabled,
.input-wrapper select:disabled {
    background-color: hsl(220, 10%, 93%);
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: not-allowed;
}

/* Validation states styles */
.form-group.has-error .input-wrapper input,
.form-group.has-error .input-wrapper select,
.form-group.has-error .input-wrapper textarea {
    border-color: var(--danger);
    background-color: var(--danger-light);
}

.form-group.has-error .input-icon {
    color: var(--danger);
}

.error-msg {
    display: none;
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 500;
}

.form-group.has-error .error-msg {
    display: block;
}

/* Form Headings */
.section-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 12px 10px 16px 10px;
    border-left: 3px solid var(--primary);
    padding-left: 10px;
    flex: 0 0 100%;
}

.section-title-with-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex: 0 0 100%;
    margin-bottom: 4px;
}

/* Custom Checkbox Container */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
    margin-right: 10px;
    max-width: 100%;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-secondary {
    background-color: hsl(220, 15%, 90%);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background-color: hsl(220, 15%, 85%);
    color: var(--text-main);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.btn-outline:hover {
    background-color: hsl(220, 15%, 93%);
    border-color: var(--border-hover);
    color: var(--text-main);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: var(--success-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: hsl(354, 76%, 45%);
}

.btn-group-right {
    display: flex;
    gap: 12px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    margin-top: 24px;
}

/* ==========================================================================
   DATABASE SECTION / TABLE
   ========================================================================== */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 28px 32px;
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.table-header-left h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-header-left h2 i {
    color: var(--primary);
}

.table-header-left p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.table-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Search Box */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper input {
    padding: 10px 16px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    width: 260px;
    outline: none;
    transition: var(--transition);
}

.search-wrapper input:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-glow);
    width: 320px;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-light);
    pointer-events: none;
}

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

th {
    background-color: hsl(220, 20%, 96%);
    color: var(--text-main);
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: hsl(220, 20%, 98.5%);
}

.empty-row {
    text-align: center;
    color: var(--text-light);
    font-weight: 500;
    background-color: hsl(220, 10%, 98%);
}

.empty-row td {
    padding: 32px;
}

/* Action button icons in table */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.btn-icon-only:hover {
    background-color: hsl(220, 15%, 92%);
    color: var(--text-main);
}

.btn-icon-only.btn-view-details:hover {
    color: var(--primary);
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.btn-icon-only.btn-delete-row:hover {
    color: var(--danger);
    border-color: var(--danger);
    background-color: var(--danger-light);
}

.btn-icon-only i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   MODAL DIALOG
   ========================================================================== */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.25s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from { transform: translateY(32px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    background-color: hsl(220, 20%, 98%);
}

/* Modal details content layout styles */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-section {
    background-color: hsl(220, 15%, 97.5%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.detail-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed hsl(220, 10%, 90%);
    font-size: 0.8rem;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
}

.detail-val {
    font-weight: 500;
    color: var(--text-main);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: var(--transition);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-success {
    border-left-color: var(--success);
}

.toast.toast-success .toast-icon {
    color: var(--success);
}

.toast.toast-danger {
    border-left-color: var(--danger);
}

.toast.toast-danger .toast-icon {
    color: var(--danger);
}

.toast-icon {
    width: 20px;
    height: 20px;
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVENESS)
   ========================================================================== */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stepper-sidebar {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px 24px;
        overflow-x: auto;
    }
    
    .step-item {
        flex: 1 0 auto;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 20px;
    }
    
    .header-stats {
        width: 100%;
    }
    
    .stat-card {
        flex: 1;
    }
    
    .form-container {
        padding: 20px;
    }
    
    /* Collapse grid columns to full width on mobile */
    .col-8, .col-6, .col-4, .col-3, .col-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Keep RT/RW side-by-side even on small screens */
    .col-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .table-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrapper input {
        width: 100%;
    }
    
    .search-wrapper input:focus {
        width: 100%;
    }
    
    .form-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .btn-group-right {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* ==========================================================================
   SUCCESS SCREEN & FOOTER STYLES
   ========================================================================== */
.success-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 680px;
    margin: 0 auto;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px;
    gap: 24px;
}

.success-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--success-light);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
    animation: scaleBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes scaleBounce {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-badge i {
    width: 40px;
    height: 40px;
}

.success-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.success-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 480px;
    line-height: 1.6;
}

.receipt-box {
    width: 100%;
    background-color: hsl(220, 15%, 97.5%);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: left;
}

.receipt-box h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.receipt-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.receipt-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.receipt-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.receipt-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.receipt-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.receipt-label {
    color: var(--text-muted);
    font-weight: 500;
}

.receipt-value {
    color: var(--text-main);
    font-weight: 700;
    text-align: right;
}

.success-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
    justify-content: center;
}

.success-actions .btn {
    flex: 1;
    max-width: 200px;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: currentColor;
    animation: btn-spin 0.8s linear infinite;
    flex: 0 0 auto;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading .btn-spinner {
    margin-right: 0;
}

.btn-loading .btn-label {
    white-space: nowrap;
}
/* Media query adjustments for success actions */
@media (max-width: 600px) {
    .success-content {
        padding: 24px 16px;
        gap: 16px;
    }

    .success-content h2 {
        font-size: 1.35rem;
    }

    .success-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .success-badge {
        width: 64px;
        height: 64px;
    }

    .success-badge i {
        width: 32px;
        height: 32px;
    }

    .receipt-box {
        padding: 16px 14px;
    }

    .receipt-box h3 {
        margin-bottom: 12px;
        padding-bottom: 6px;
    }

    .receipt-details {
        gap: 14px;
    }

    .receipt-section {
        padding: 12px;
    }

    .receipt-section h4 {
        margin-bottom: 10px;
    }

    .receipt-section-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .receipt-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .receipt-value {
        text-align: left;
        line-height: 1.4;
    }

    .success-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .success-actions .btn {
        max-width: 100%;
    }
}
