:root {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #f59e0b; /* Amber/Orange theme for Quotations */
    --primary-hover: #d97706;
    --border: #e2e8f0;
    --cell-bg: #f8fafc;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: white; border: 1px solid var(--border); color: var(--text-main); }
.btn-secondary:hover { background-color: var(--bg-color); }

.main-content {
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.quote-wrapper {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 900px; /* A4 proportions roughly */
    padding: 3rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1.5rem;
}

.company-details textarea {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-height: 80px;
    width: 300px;
}
.company-name {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: var(--text-main) !important;
    min-height: 40px !important;
    margin-bottom: 0.5rem;
}

.quote-title-section {
    text-align: right;
}

.quote-title-section h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.meta-row {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.hidden-input, .hidden-input-inline {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

textarea.hidden-input { resize: none; width: 100%; }
.hidden-input:hover, .hidden-input:focus, .hidden-input-inline:hover, .hidden-input-inline:focus {
    border-color: var(--border);
    background: var(--cell-bg);
}

.client-details {
    margin-bottom: 2rem;
}

.client-box {
    width: 50%;
}
.client-box h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}
.client-name { font-weight: 600; min-height: 30px;}
.client-address { min-height: 60px; font-size: 0.875rem; color: var(--text-muted);}


.table-responsive { overflow-x: auto; margin-bottom: 2rem;}

.quote-table {
    width: 100%;
    border-collapse: collapse;
}

.quote-table th, .quote-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0.5rem;
    text-align: right;
    vertical-align: top;
}

.quote-table th {
    background-color: var(--cell-bg);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.quote-table th.col-desc, .quote-table td.col-desc { text-align: left; }
.col-desc { width: 50%; }
.col-total { font-weight: 600; }
.col-action { width: 4%; border: none !important; }

.num-input { width: 80px; text-align: right; }

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    margin-top: 5px;
}
.btn-delete:hover { color: var(--danger); background: #fee2e2; }

.quote-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.terms-section {
    width: 55%;
}
.terms-section h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.terms-input {
    min-height: 120px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.totals-section {
    width: 35%;
    border-radius: 0.5rem;
    padding: 1rem;
    background: var(--cell-bg);
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.signature-section {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
}

.signature-box {
    width: 40%;
    text-align: center;
}
.signature-box p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}
.signature-line {
    border-top: 1px solid var(--text-main);
    margin-bottom: 0.5rem;
}

@media print {
    body { background: white; }
    .app-header, .hide-in-pdf { display: none !important; }
    .main-content { padding: 0; }
    .quote-wrapper { box-shadow: none; padding: 0; }
    .hidden-input, .hidden-input-inline { border: none !important; background: transparent !important; }
}
