/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #f5f3ef;
    --surface:  #ffffff;
    --border:   #e2ddd8;
    --text:     #1c1c1a;
    --muted:    #6b6560;
    --accent:   #000;
    --accent2:  #8b7355;
    --danger:   #b94a48;
    --success:  #3a6b42;
    --radius:   6px;
    --shadow:   0 2px 16px rgba(0,0,0,.07);
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    background: var(--surface);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo img {
    height: 36px;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: var(--muted);
}

.header-right strong {
    color: var(--text);
    font-weight: 500;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-family: inherit;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s;
}
.btn-logout:hover { border-color: var(--accent); color: var(--accent); }

/* Main layout */
main {
    max-width: 1060px;
    margin: 48px auto;
    padding: 0 24px 80px;
    width: 100%;
}

.page-title {
    font-family: 'Inter', sans-serif;
    font-size: 36px;
    font-weight: 500;
    letter-spacing: -.5px;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 40px;
}

/* Login card */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    padding: 40px 24px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 48px 44px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img { height: 32px; }

.login-heading {
    font-family: 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 28px;
    color: var(--text);
}

/* Form elements */
.field { margin-bottom: 18px; }

label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 300;
    color: var(--text);
    background: var(--bg);
    transition: border-color .15s;
    outline: none;
}

input:focus, textarea:focus {
    border-color: var(--accent);
    background: #fff;
}

input[type="number"] { width: 80px; text-align: center; }

textarea { resize: vertical; min-height: 90px; }

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover { background: #333; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-error   { background: #fdf0ef; border: 1px solid #f5c5c4; color: var(--danger); }
.alert-success { background: #eff6f0; border: 1px solid #b8d9bc; color: var(--success); }

/* Products grid */
.products-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 36px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 220px 1fr;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.product-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.11); }

.product-image {
    background: #fff;
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: 200px;
}
.product-image img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    display: block;
}

.product-body {
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
}

.product-code {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 6px;
}

.product-name {
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 14px;
}

.product-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}

.product-meta-block { margin-bottom: 10px; }
.product-meta-block strong {
    display: block;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text);
    margin-bottom: 3px;
}
.product-meta-block span { line-height: 2; }

.product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 18px;
    gap: 16px;
    flex-wrap: wrap;
}

.product-price {
    display: flex;
    flex-direction: column;
}
.price-main {
    font-family: 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}
.price-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.price-inc {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}

.qty-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.qty-wrap label {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 2px;
}

.subtotal-display {
    font-size: 13px;
    color: var(--muted);
    text-align: right;
    min-height: 18px;
}

/* Order footer */
.order-footer {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px 36px;
    box-shadow: var(--shadow);
}

.order-footer h2 {
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 22px;
}

.order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Total rows */
.total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.total-row--minor {
    border-top: none;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 16px;
    font-weight: 500;
    color: var(--muted);
}

.total-row--inc {
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.total-label {
    font-size: 13px;
    color: var(--text);
    font-weight: 400;
}

.total-amount {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
}

.total-amount-before {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.total-note {
    font-size: 12px;
    color: var(--muted);
    margin-left: 6px;
}

.submit-row {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-submit {
    padding: 13px 36px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .15s;
}
.btn-submit:hover { background: #444; }

.submit-note { font-size: 13px; color: var(--muted); }

/* Success screen */
.success-card {
    background: var(--surface);
    border: 1px solid #b8d9bc;
    border-radius: 10px;
    padding: 48px 44px;
    text-align: center;
    box-shadow: var(--shadow);
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.success-card h2 {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--success);
}

.success-card p { color: var(--muted); font-size: 14px; margin-bottom: 6px; }

.success-summary {
    margin: 28px auto;
    max-width: 520px;
    text-align: left;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}

.success-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 4px 0;
}

.success-total {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.btn-new-order {
    display: inline-block;
    margin-top: 10px;
    padding: 11px 28px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--accent);
    cursor: pointer;
    background: none;
    transition: all .15s;
}
.btn-new-order:hover { background: var(--accent); color: #fff; }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 20px 40px;
}

.footer-inner {
    max-width: 1060px;
    margin: 0 auto;
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

.footer-inner a {
    color: var(--muted);
    text-decoration: none;
}

.footer-inner a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 680px) {
    header { padding: 0 20px; }
    main { margin: 24px auto; }
    .product-card { grid-template-columns: 1fr; }
    .product-image { min-height: 160px; }
    .order-grid { grid-template-columns: 1fr; }
    .product-meta { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; }
    .order-footer { padding: 24px 20px; }
    footer { padding: 20px 24px; }
    
    .logo img { height: 24px; }
    
    .header-right { 
        gap: 10px; 
        font-size: 12px; 
    }
    
    .btn-logout { 
        padding: 4px 10px; 
        font-size: 12px; 
    }
    
    .footer-inner { 
        gap: 8px; 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
    }
}