:root {
    --primary: #12223a;     
    --primary-light: #2c4a7c;
    --gold: #c5a86d;        
    --gold-light: #e6cd98;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --alert-color: #e53e3e;
    --alert-bg: #fed7d7;
    --success-color: #38a169;
    --success-bg: #c6f6d5;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding: 20px;
}

h1, h2, h3, h4, h5 {
    font-family: 'Montserrat', sans-serif;
}

/* Nav System */
.nav-container {
    max-width: 900px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    gap: 15px;
}

.nav-brand h1 {
    font-size: 20px;
    color: var(--primary);
    font-weight: 700;
}
.nav-brand p {
    font-size: 11px;
    color: var(--gold);
    letter-spacing: 2px;
    font-weight: 600;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.tab-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 13px;
}

.tab-btn:hover {
    background: #e2e8f0;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 13px;
}

.primary {
    background-color: var(--gold);
    color: #fff;
}
.primary:hover {
    background-color: #b5985d;
}

/* Main Wrapper */
.report-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.checklist-section {
    display: none;
}

.checklist-section.active {
    display: block;
}

/* Header */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.brand { flex: 1; }
.company-name { font-size: 28px; color: var(--primary); letter-spacing: 1px; font-weight: 700; margin-bottom: -5px; }
.company-sub { font-size: 14px; color: var(--gold); letter-spacing: 3px; font-weight: 600; }

.property-info { flex: 2; text-align: left; }
.property-info h2 { font-size: 20px; color: var(--text-main); margin-bottom: 10px; text-transform: uppercase; }
.inline-input { flex-direction: row; align-items: center; gap: 10px; }
.inline-input label { margin: 0; font-size: 14px;}
.global-address { font-size: 16px; font-weight: 600; padding: 5px; width: 100%; border: none; border-bottom: 1px dashed var(--border-color); border-radius: 0; background: transparent; }
.global-address:focus { box-shadow: none; border-bottom-color: var(--gold); }

/* Forms & Blocks */
.block { margin-bottom: 25px; }
.section-title {
    background-color: var(--primary);
    color: white;
    padding: 8px 15px;
    font-size: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.full-row { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--text-muted); text-transform: uppercase; }

input[type="text"], input[type="datetime-local"], input[type="number"], input[type="tel"], textarea {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}

.border-bottom-only {
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    background: transparent;
    padding: 4px 0 !important;
}

.border-none {
    border: none !important;
    padding: 4px !important;
    background: transparent;
}

input:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; min-height: 40px; }
.manual-box textarea { border: 1px solid var(--border-color); border-radius: 6px; padding: 10px; }

/* Inline Checkboxes */
.inline-checks { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 5px; }
.inline-checks label { text-transform: none; font-size: 14px; color: var(--text-main); font-weight: 400; display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* Inspection Items */
.inspection-items { border: 1px solid var(--border-color); border-radius: 6px; overflow: hidden; }
.item-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-bottom: 1px solid var(--border-color); background: #fff; flex-wrap: wrap; gap: 15px; }
.item-row:last-child { border-bottom: none; }
.item-desc { flex: 1; min-width: 250px; }
.item-desc h4 { font-size: 14px; color: var(--text-main); margin-bottom: 2px; }
.hint { font-size: 11px; color: var(--text-muted); font-style: italic; }

.item-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.item-controls label { cursor: pointer; user-select: none; }
.item-controls input[type="radio"] { display: none; }
.item-controls span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}
.item-controls input[type="radio"]:checked + span { background-color: var(--primary); color: white; border-color: var(--primary); }
.item-controls input[type="radio"]:checked + span.alert { background-color: var(--alert-color); border-color: var(--alert-color); color: white; }

.full-width { padding: 10px 15px; background-color: #fafbfc; border-bottom: 1px solid var(--border-color); }
.inspection-items .full-width:last-child { border-bottom: none; }

/* Takeover Specific Styles */
.box-layout .full-width { background: #fff; padding: 12px 15px; }
.large-check { text-transform: none !important; font-size: 14px !important; color: var(--text-main) !important; font-weight: 400 !important; display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.large-check input[type="checkbox"] { margin-top: 4px; }
.sub-checks { margin-left: 25px; margin-top: 10px; }
.sub-checks label { text-transform: none !important; font-size: 13px !important; font-weight: 400 !important; display: flex; align-items: center; gap: 5px; }

/* Matrix Table */
.matrix-table { width: 100%; border-collapse: collapse; }
.matrix-table th { background: #f8fafc; padding: 10px; text-align: left; font-size: 12px; color: var(--text-muted); border-bottom: 2px solid var(--border-color); }
.matrix-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.matrix-table .subheader td { background: var(--bg-color); font-weight: 600; font-size: 11px; color: var(--primary); text-transform: uppercase; }

/* Signature */
.signature-block { margin-top: 30px; padding-top: 15px; border-top: 2px dashed var(--border-color); page-break-inside: avoid; }
.sig-line { border-bottom: 1px solid var(--text-main); height: 30px; width: 100%; }

/* Responsive */
@media (max-width: 768px) {
    .report-wrapper { padding: 20px; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .item-controls span { padding: 8px; flex: 1; text-align: center; }
}

/* Print Settings */
@media print {
    @page {
        size: letter;
        margin: 0.5in;
    }
    body { background-color: white; padding: 0; font-size: 11px; }
    .report-wrapper { box-shadow: none; padding: 0; max-width: 100%; }
    .no-print { display: none !important; }
    .no-print-bg { background: transparent !important; }
    
    /* Ensure only active tab prints */
    .checklist-section { display: none !important; }
    .checklist-section.active { display: block !important; }

    .section-title { 
        background-color: #eaeaea !important; 
        color: black !important; 
        border: 1px solid black; 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact; 
        padding: 4px 8px; 
    }
    
    .item-controls span { padding: 4px 6px; font-size: 10px; border-color: #ccc; }
    .item-controls input[type="radio"]:checked + span { background-color: #ddd !important; border: 1px solid black; }
    
    .border-bottom-only { border-bottom: 1px solid black !important; }
    .matrix-table th { border-bottom: 2px solid black; }
    .matrix-table td { border-bottom: 1px solid #ddd; }
    
    .page-break-before { page-break-before: always; }
    .block { page-break-inside: avoid; margin-bottom: 15px; }
    .inspection-items { border: 1px solid #000; }
    
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
