* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', sans-serif;
    background: #eef1f4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex: 1;
    height: 100vh;
}

#form-container {
    width: 100%;
    max-width: 480px;
    background: #fff;
    padding: 24px;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.06);
}

#preview-container {
    flex: 1;
    background: #f8f9fb;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

h2 { font-size: 24px; margin-bottom: 20px; color: #2c3e50; }
h3 { font-size: 18px; margin: 24px 0 12px; color: #2c3e50; }

label {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin: 16px 0 6px;
    font-size: 14px;
}

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 14px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #4a90e2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74,144,226,0.15);
}

button {
    padding: 11px 20px;
    margin: 10px 8px 10px 0;
    border: none;
    border-radius: 8px;
    background: #4a90e2;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

button:hover { background: #357abd; transform: translateY(-1px); }
.btn-delete { background: #e74c3c !important; }
.btn-delete:hover { background: #c0392b !important; }

.item-box {
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#invoice-preview {
    width: 100%;
    max-width: 900px;
    background: white;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.title {
    font-size: 56px;
    font-weight: 900;
    color: #dde4eb;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.date {
    font-size: 15px;
    color: #7f8c8d;
    margin-bottom: 40px;
}

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

.info-box {
    background: #f8fafc;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.7;
}

.section-title {
    font-weight: 700;
    font-size: 16px;
    color: #2c3e50;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 15px;
}

th, td {
    border: 1px solid #d9e1e8;
    padding: 14px 16px;
    text-align: left;
}

th {
    background: #eef2f8;
    font-weight: 700;
    color: #2c3e50;
}

tr:nth-child(even) td { background: #fcfdfe; }

.total-row td {
    font-weight: 700;
    font-size: 18px;
    background: #e3f2fd !important;
    color: #1e88e5;
}

.note {
    margin-top: 20px;
    font-size: 14px;
    color: #7f8c8d;
    font-style: italic;
}

.amount {
    text-align: right;
    font-family: 'Inter', monospace;
    white-space: nowrap;
}

@media (max-width: 992px) {
    .app-container { flex-direction: column; height: auto; }
    #form-container { max-width: 100%; }
    #invoice-preview { padding: 30px; }
    .title { font-size: 46px; }
}

@media (max-width: 600px) {
    .info-grid { grid-template-columns: 1fr; }
    #invoice-preview { padding: 20px; }
    .title { font-size: 38px; }
    table { font-size: 14px; }
    th, td { padding: 10px; }
    button { width: 100%; margin: 8px 0; }
}
.sidebar-footer {
margin-top: auto;
padding-top: 20px;
font-size: 11px;
color: #95a5a6;
text-align: center;
line-height: 1.5;
}

.sidebar-footer a {
color: #7f8c8d;
text-decoration: none;
transition: color 0.2s;
}

.sidebar-footer a:hover {
color: #2c3e50;
text-decoration: underline;
}
@media print {
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    #form-container {
        display: none !important;
    }
    #preview-container {
        display: block !important;
        padding: 0px;
    }
    #invoice-preview {
        display: block !important;
        position: running !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 auto !important;
        padding: 40px 50px !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        page-break-after: avoid;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    .title { font-size: 62px !important; }
}