/* ============================================================
   YourToolbox.in — Shared Stylesheet
   Tool: YTB-0073 Invoice Generator
   Version: 1.0
   ============================================================ */

/* ---------- Page Layout ---------- */
.ytb-page-wrap {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 60px;
    background: #fff;
}
.ytb-main { min-width: 0; }
.ytb-sidebar { width: 220px; }

@media (max-width: 860px) {
    .ytb-page-wrap { grid-template-columns: 1fr; }
    .ytb-sidebar { width: 100%; order: 2; }
}

/* ---------- Breadcrumb ---------- */
.ytb-breadcrumb { font-size: 13px; color: #666; margin-bottom: 14px; }
.ytb-breadcrumb a { color: #1976D2; text-decoration: none; }
.ytb-breadcrumb a:hover { text-decoration: underline; }

/* ---------- Tool Card ---------- */
.ytb-tool-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    background: #fff;
}
.ytb-tool-header {
    background: #1976D2;
    color: #fff;
    padding: 16px 20px;
    font-size: 20px;
    font-weight: 700;
}
.ytb-tool-header span {
    display: block;
    font-size: 13px;
    font-weight: 400;
    opacity: .9;
    margin-top: 4px;
}

/* ---------- Invoice Builder Form ---------- */
.ytb-inv-section {
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.ytb-inv-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1976D2;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.ytb-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ytb-field-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) {
    .ytb-field-grid, .ytb-field-grid-3 { grid-template-columns: 1fr; }
}

.ytb-field { display: flex; flex-direction: column; }
.ytb-field.full { grid-column: 1 / -1; }
.ytb-field label { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 5px; }
.ytb-field input,
.ytb-field select,
.ytb-field textarea {
    border: 1px solid #ccd6e4;
    border-radius: 6px;
    padding: 9px 11px;
    font-size: 14px;
    color: #222;
    background: #fff;
    font-family: inherit;
}
.ytb-field textarea { resize: vertical; min-height: 60px; }
.ytb-field input:focus,
.ytb-field select:focus,
.ytb-field textarea:focus {
    outline: none;
    border-color: #1976D2;
    box-shadow: 0 0 0 3px rgba(25,118,210,.12);
}

/* ---------- Line Items Table ---------- */
.ytb-items-wrap { padding: 18px 20px; border-bottom: 1px solid #f0f0f0; }
.ytb-items-wrap h3 { font-size: 14px; font-weight: 700; color: #1976D2; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .5px; }

.ytb-items-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.ytb-items-table th {
    background: #1976D2;
    color: #fff;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
}
.ytb-items-table td { padding: 6px 6px; border-bottom: 1px solid #eee; }
.ytb-items-table td input {
    width: 100%;
    border: 1px solid #dde4ed;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    box-sizing: border-box;
}
.ytb-items-table td input:focus { outline: none; border-color: #1976D2; }
.ytb-items-table .del-btn {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
}
.ytb-items-table .del-btn:hover { background: #ffcdd2; }

.ytb-add-row-btn {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.ytb-add-row-btn:hover { background: #bbdefb; }

/* ---------- Tax / Summary Section ---------- */
.ytb-tax-section {
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}
.ytb-tax-col { flex: 1; min-width: 200px; }
.ytb-summary-col { flex: 0 0 260px; }

.ytb-summary-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ytb-summary-table td { padding: 6px 8px; }
.ytb-summary-table td:last-child { text-align: right; font-weight: 600; color: #1b5e20; }
.ytb-summary-table tr.total-row td {
    border-top: 2px solid #1976D2;
    font-size: 16px;
    font-weight: 700;
    color: #1976D2;
    padding-top: 10px;
}

/* ---------- Action Buttons ---------- */
.ytb-btn-row { padding: 18px 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.ytb-btn-primary {
    background: #2e7d32; color: #fff; border: none;
    border-radius: 6px; padding: 12px 28px;
    font-size: 15px; font-weight: 700; cursor: pointer;
}
.ytb-btn-primary:hover { background: #1b5e20; }
.ytb-btn-secondary {
    background: #1976D2; color: #fff; border: none;
    border-radius: 6px; padding: 12px 28px;
    font-size: 15px; font-weight: 700; cursor: pointer;
}
.ytb-btn-secondary:hover { background: #1565c0; }
.ytb-btn-outline {
    background: #fff; color: #555; border: 1px solid #ccc;
    border-radius: 6px; padding: 12px 24px;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.ytb-btn-outline:hover { background: #f5f5f5; }

/* ---------- Invoice Preview ---------- */
#ytb73-preview-wrap {
    display: none;
    margin-top: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}
#ytb73-preview-wrap.active { display: block; }

.inv-preview {
    background: #fff;
    padding: 40px;
    max-width: 720px;
    margin: 0 auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: #222;
}

/* Invoice header band */
.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 3px solid #1976D2;
}
.inv-brand { font-size: 24px; font-weight: 800; color: #1976D2; }
.inv-brand small { display: block; font-size: 12px; font-weight: 400; color: #777; }
.inv-meta { text-align: right; font-size: 13px; }
.inv-meta strong { font-size: 20px; color: #1976D2; display: block; margin-bottom: 4px; }

/* Party details */
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.inv-party h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #888; margin: 0 0 6px; }
.inv-party p { margin: 0; line-height: 1.65; }
.inv-party strong { font-size: 15px; color: #111; }

/* Line items */
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.inv-table th { background: #1976D2; color: #fff; padding: 9px 10px; text-align: left; font-size: 13px; }
.inv-table td { padding: 9px 10px; border-bottom: 1px solid #eef2f7; font-size: 13px; }
.inv-table td:nth-child(2),
.inv-table td:nth-child(3),
.inv-table td:nth-child(4) { text-align: right; }
.inv-table th:nth-child(2),
.inv-table th:nth-child(3),
.inv-table th:nth-child(4) { text-align: right; }
.inv-table tr:nth-child(even) td { background: #f7fafd; }

/* Totals */
.inv-totals { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.inv-totals-table { width: 260px; border-collapse: collapse; font-size: 14px; }
.inv-totals-table td { padding: 6px 8px; }
.inv-totals-table td:last-child { text-align: right; font-weight: 600; }
.inv-totals-table tr.grand td {
    border-top: 2px solid #1976D2;
    font-size: 16px; font-weight: 800;
    color: #1976D2; padding-top: 10px;
}

/* Amount in words */
.inv-words { background: #e8f5e9; border-left: 4px solid #2e7d32; padding: 10px 14px; font-size: 13px; margin-bottom: 20px; border-radius: 0 6px 6px 0; }

/* Notes / bank details */
.inv-footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.inv-footer-box { font-size: 13px; }
.inv-footer-box h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #888; margin: 0 0 6px; }

/* Signature */
.inv-sign { margin-top: 30px; text-align: right; }
.inv-sign-line { border-top: 1px solid #bbb; width: 160px; margin-left: auto; padding-top: 6px; font-size: 12px; color: #666; }

/* Stamp */
.inv-stamp {
    display: inline-block;
    border: 3px solid #2e7d32;
    color: #2e7d32;
    border-radius: 50%;
    width: 80px; height: 80px;
    line-height: 80px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    opacity: .3;
    position: relative;
    margin-top: -50px;
}

/* Print preview bar */
.ytb-preview-bar {
    background: #f5f8fd;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.ytb-preview-bar span { font-size: 13px; font-weight: 600; color: #444; flex: 1; }

/* ---------- Content / Article ---------- */
.ytb-content { margin-top: 10px; line-height: 1.8; color: #333; font-size: 15.5px; }
.ytb-content h2 { font-size: 22px; color: #1976D2; margin: 32px 0 12px; border-bottom: 2px solid #e3f0fc; padding-bottom: 6px; }
.ytb-content h3 { font-size: 18px; color: #1a1a1a; margin: 22px 0 10px; }
.ytb-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.ytb-content table th, .ytb-content table td { border: 1px solid #e0e0e0; padding: 8px 10px; text-align: left; }
.ytb-content table th { background: #1976D2; color: #fff; }
.ytb-content table tr:nth-child(even) { background: #f7fafd; }
.ytb-faq-item { border: 1px solid #e0e0e0; border-radius: 6px; margin-bottom: 10px; padding: 14px 16px; background: #fafcff; }
.ytb-faq-item h4 { margin: 0 0 6px; font-size: 15.5px; color: #1976D2; }
.ytb-faq-item p { margin: 0; }

/* ---------- Sidebar ---------- */
.ytb-sidebar h3 { font-size: 15px; color: #1976D2; border-bottom: 2px solid #e3f0fc; padding-bottom: 8px; margin-bottom: 10px; }
.ytb-sidebar ul { list-style: none; padding: 0; margin: 0; }
.ytb-sidebar li { margin-bottom: 8px; }
.ytb-sidebar a { font-size: 13.5px; color: #333; text-decoration: none; display: block; padding: 7px 10px; border-radius: 5px; background: #f5f8fd; border: 1px solid #eef3fa; }
.ytb-sidebar a:hover { background: #e3f0fc; color: #1976D2; }

/* ---------- Disclaimer ---------- */
.ytb-disclaimer { margin-top: 24px; font-size: 12px; color: #888; border-top: 1px solid #eee; padding-top: 12px; }

/* ---------- Print Styles ---------- */
@media print {
    .ytb-page-wrap, .ytb-tool-card, .ytb-content, .ytb-sidebar,
    .ytb-preview-bar, .ytb-btn-row, .ytb-breadcrumb, h1,
    .ytb-disclaimer { display: none !important; }
    #ytb73-preview-wrap { display: block !important; border: none !important; }
    .inv-preview { padding: 20px; max-width: 100%; }
    body { margin: 0; padding: 0; }
}
