body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 5px;
}

.main-flow-wrapper {
    display: flex;
    gap: 40px;
}

.flow-form-area {
    flex: 2;
    min-width: 0;
}

.flow-sidebar {
    flex: 1;
    min-width: 300px;
}

.sticky-summary {
    position: sticky;
    top: 20px;
}

@media (max-width: 768px) {
    .main-flow-wrapper {
        flex-direction: column;
    }
    .flow-sidebar {
        min-width: 100%;
    }
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.progress-header h2 {
    margin: 0;
}

.progress-indicator {
    display: flex;
    gap: 8px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
}

.progress-dot.active {
    background: #3498db;
}

.card {
    background: #fff;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.collapsible-trigger {
    cursor: pointer;
    color: #3498db;
    font-size: 0.9rem;
    font-weight: bold;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.line-item-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.line-item-row .form-group {
    margin-bottom: 0;
}

.line-item-row-compact {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.line-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn-icon.remove-line {
    background: #fff;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon.remove-line:hover {
    background: #e74c3c;
    color: #fff;
}

.add-line-container {
    display: flex;
    justify-content: flex-end;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-outline {
    background: none;
    border: 1px solid #3498db;
    color: #3498db;
    font-size: 0.8rem;
    padding: 4px 10px;
}

.btn-outline:hover {
    background: #3498db;
    color: #fff;
}

.hint-note {
    background: #f8f9fa;
    padding: 12px;
    border-left: 4px solid #3498db;
    margin: 15px 0;
    font-size: 0.9rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    font-weight: bold;
}

.header-step-title {
    font-size: 1.5rem;
    font-weight: bold;
}

header {
    background: #2c3e50;
    color: #fff;
    padding: 0.8rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav a {
    color: #fff;
    text-decoration: none;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

main {
    padding: 2rem 0;
}

h1, h2, h3 {
    color: #2c3e50;
}

section {
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}

.btn-secondary {
    background-color: #95a5a6;
    color: #fff;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Flow specific styles */
.flow-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.progress-bar {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.flow-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.flow-header {
    text-align: center;
    margin-bottom: 2rem;
}

.flow-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.flow-secondary {
    margin-top: 2rem;
    text-align: center;
}

.flow-secondary a {
    margin: 0 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.bg-thumb.active, .logo-thumb.active {
    border-color: #3498db !important;
}

.bg-picker input[type="radio"], .logo-picker input[type="radio"] {
    display: none;
}

/* Deliver/Receipt Page Styles */
.deliver-page {
    text-align: center;
    padding: 20px 0;
    max-width: 600px;
    margin: 0 auto;
}

.success-header {
    margin-bottom: 30px;
}

.success-icon {
    font-size: 4rem;
    color: #2ecc71;
    margin-bottom: 10px;
}

.receipt-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 40px;
}

.receipt-header {
    background: #f8f9fa;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.receipt-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.receipt-date {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.receipt-body {
    padding: 24px;
    text-align: left;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.receipt-row .label {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.receipt-row .value {
    font-weight: 500;
    color: #2c3e50;
}

.receipt-divider {
    height: 1px;
    background: #eee;
    margin: 20px 0;
}

.receipt-row.total {
    margin-top: 10px;
}

.receipt-row.total .label {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

.receipt-row.total .value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.2rem;
}

.receipt-footer {
    padding: 24px;
    background: #fff;
    border-top: 1px dashed #ddd;
}

.receipt-footer .btn {
    width: 100%;
}

.form-layout {
    display: flex;
    gap: 30px;
}

.form-main {
    flex: 2;
}

.form-sidebar {
    flex: 1;
}

.sticky {
    position: sticky;
    top: 20px;
}

.totals-panel {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.totals-panel .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.totals-panel .total {
    border-top: 2px solid #eee;
    padding-top: 0.5rem;
    font-weight: bold;
    font-size: 1.2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.flash {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
}

.details-box {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
}

.file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-input + label {
    display: inline-block;
    cursor: pointer;
}

.file-input:focus + label {
    outline: 1px dotted #000;
    outline: -webkit-focus-ring-color auto 5px;
}
