:root {
    --primary-color: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #e0f2fe;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --accent: #22c55e;
    --accent-hover: #16a34a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 30px 20px;
}

.app-container {
    display: flex;
    gap: 40px;
    max-width: 1100px;
    width: 100%;
}

/* Form Section */
.form-section {
    flex: 6;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.05);
}

.form-header {
    margin-bottom: 35px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-titles h1 {
    font-size: 26px;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.header-titles p {
    color: var(--text-muted);
    font-size: 15px;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.lang-toggle span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

.lang-toggle span.lang-active {
    color: var(--primary-color);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: var(--primary-color);
}
input:checked + .slider:before {
    transform: translateX(22px);
}
.slider.round { border-radius: 22px; }
.slider.round:before { border-radius: 50%; }


.weigh-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row.align-end {
    align-items: flex-end;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    flex: 100%;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: var(--text-main);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-with-action {
    display: flex;
    position: relative;
}

.input-with-action input {
    padding-right: 50px;
}

.btn-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

.net-weight-display {
    background: var(--primary-light);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px dashed var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.net-weight-display label {
    color: var(--primary-dark);
    margin-bottom: 2px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.net-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}
.net-value small {
    font-size: 14px;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover { 
    background: var(--primary-dark); 
    transform: translateY(-2px); 
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.2);
}

.btn-secondary {
    background: var(--accent);
    color: white;
}
.btn-secondary:hover { 
    background: var(--accent-hover); 
    transform: translateY(-2px); 
    box-shadow: 0 8px 16px rgba(34, 197, 94, 0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    flex: 0.5;
}
.btn-outline:hover { 
    background: var(--bg-color); 
    color: var(--text-main);
}

/* Preview Section */
.preview-section {
    flex: 4;
    display: flex;
    flex-direction: column;
}

.preview-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.slip-container {
    background: #e2e8f0;
    padding: 30px;
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    position: relative;
    overflow: hidden;
}
.slip-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(0,0,0,0.05) 1px, transparent 0);
    background-size: 20px 20px;
}

.slip {
    position: relative;
    z-index: 10;
    width: 380px;
    background: white;
    padding: 2px;
    border: 2px solid #1e7b38;
    border-radius: 4px; /* classic paper look */
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #1e7b38;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

.slip * {
    border-color: #1e7b38;
}

.slip-super-header {
    text-align: center;
    font-size: 11px;
    padding: 3px 0;
    font-weight: bold;
}

.slip-main-title {
    background: #1e7b38;
    color: white;
    text-align: center;
    padding: 6px 0;
    margin: 0px 2px;
    border-radius: 2px;
}

.slip-main-title h2 {
    font-size: 24px;
    margin: 0;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.slip-address {
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    padding: 6px 0;
    border-bottom: 2px solid #1e7b38;
    font-weight: bold;
}

.slip-sub-header {
    display: flex;
    border-bottom: 2px solid #1e7b38;
}

.ton-box {
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #1e7b38;
    background: #1e7b38;
    color: white;
    font-weight: bold;
    padding: 4px 0;
}

.ton-number {
    font-size: 28px;
    line-height: 1;
}

.ton-text {
    font-size: 16px;
}

.gov-approved {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.slip-fields {
    display: flex;
    flex-direction: column;
}

.field-row {
    display: flex;
    border-bottom: 1.5px solid #1e7b38;
}

.nett-row {
    border-bottom: 2px solid #1e7b38;
}

.field-label {
    width: 120px;
    padding: 6px;
    border-right: 1.5px solid #1e7b38;
    font-weight: bold;
    font-size: 13px;
    line-height: 1.3;
}

.field-label small {
    font-size: 11px;
}

.field-value {
    flex: 1;
    padding: 6px;
    display: flex;
    align-items: center;
    color: #000;
    font-family: inherit;
    font-size: 14px;
}

.value-right {
    justify-content: space-between;
}

.unit {
    color: #1e7b38;
    font-weight: bold;
}

.slip-footer {
    display: flex;
    justify-content: space-between;
    height: 60px;
}

.hours-24 {
    width: 120px;
    padding: 4px;
    border-right: 1.5px solid #1e7b38;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.3;
}

.footer-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding-top: 15px;
}

.copy-type {
    font-weight: bold;
    font-size: 16px;
}

.footer-right {
    display: flex;
    align-items: flex-end;
    padding: 6px;
}

.signature {
    font-size: 13px;
    font-weight: bold;
}

.developer-credit {
    text-align: center;
    font-size: 11px;
    margin-top: 15px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
    color: #64748b;
}

.developer-credit a {
    color: var(--primary-color);
    text-decoration: none;
}

.developer-credit a:hover {
    text-decoration: underline;
}

#print-area {
    display: none;
}

/* Responsiveness */
@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }
    .preview-section {
        order: -1;
    }
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    .form-actions {
        flex-direction: column;
    }
}
