/* ============================================================
   HairGlass Invoice Generator v2 – Styles
   ============================================================ */

/* ---- FORM CARD ---- */
.hg-form-card {
    background: #fff;
    padding: 24px 28px;
    max-width: 860px;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.10);
}

.hg-form-section-title {
    color: #8B6914;
    border-bottom: 2px solid #8B6914;
    padding-bottom: 8px;
    margin-top: 0;
    font-size: 17px;
}

.hg-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.hg-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}

.hg-field input,
.hg-field textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.hg-full { grid-column: 1 / -1; }

/* Product table */
#hg-prod-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

#hg-prod-table thead tr {
    background: #f5f5f5;
}

#hg-prod-table th {
    border: 1px solid #ddd;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

#hg-prod-table td {
    border: 1px solid #ddd;
    padding: 4px;
}

#hg-prod-table input {
    width: 100%;
    border: none;
    padding: 5px 6px;
    font-size: 13px;
    background: transparent;
    box-sizing: border-box;
}

#hg-prod-table input[readonly] { background: #f9f9f9; }

.hg-del-row {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    width: 100%;
}

/* Summary box */
.hg-summary {
    margin-top: 20px;
    background: #f9f9f9;
    padding: 14px 18px;
    border-radius: 6px;
    display: flex;
    justify-content: flex-end;
}

.hg-summary table { min-width: 300px; border-collapse: collapse; }
.hg-summary td { padding: 5px 12px; font-size: 14px; }
.hg-gst-line td { color: #c0392b; font-weight: 600; }
.hg-net-line { background: #1a1a2e; color: #fff; }
.hg-net-line td { color: #fff; padding: 8px 12px; font-size: 15px; }

/* Buttons */
.hg-btn-gold {
    background: #8B6914;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.hg-btn-gold:hover { background: #a07a20; }
.hg-btn-lg { padding: 12px 32px; font-size: 16px; }

/* ============================================================
   INVOICE LAYOUT — exact match to PDF
   ============================================================ */
.hg-invoice {
    max-width: 800px;
    margin: 30px auto;
    background: #fff;
    padding: 32px 40px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #222;
    border: 1px solid #ddd;
    box-shadow: 0 2px 16px rgba(0,0,0,.10);
}

/* TOP BAR */
.hg-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #222;
    padding-bottom: 8px;
    margin-bottom: 18px;
    font-size: 12px;
    font-weight: 700;
}

.hg-tb-center {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 4px;
    font-style: italic;
}

/* COMPANY HEADER — logo left, text center */
.hg-company-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 22px;
    position: relative;
}

.hg-logo-cell {
    position: absolute;
    left: 0;
}

.hg-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
}

.hg-company-text {
    text-align: center;
}

.hg-co-name {
    font-size: 34px;
    font-weight: 900;
    color: #111;
    letter-spacing: 2px;
    line-height: 1.1;
}

.hg-co-tag {
    font-size: 11px;
    color: #c0392b;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 1.5px;
    margin: 3px 0 6px;
    text-transform: uppercase;
}

.hg-co-addr,
.hg-co-contact {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.6;
}

/* META BOX */
.hg-meta-box {
    display: flex;
    border: 1px solid #ccc;
    margin-bottom: 0;
}

.hg-bill-to {
    flex: 1;
    padding: 12px 16px;
    border-right: 1px solid #ccc;
}

.hg-label-red {
    font-size: 10px;
    font-weight: 700;
    color: #c0392b;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.hg-cust-name {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    margin-bottom: 4px;
}

.hg-cust-addr {
    font-size: 12px;
    color: #555;
    font-style: italic;
    margin-bottom: 8px;
    line-height: 1.5;
}

.hg-cust-gstin {
    display: inline-block;
    border: 1.5px solid #8B6914;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #222;
    border-radius: 3px;
    margin-bottom: 4px;
}

.hg-cust-state {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 600;
}

.hg-inv-meta {
    width: 240px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.hg-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.hg-meta-key { color: #777; font-size: 11px; letter-spacing: .4px; }
.hg-meta-val { font-weight: 700; color: #111; }
.hg-inv-no-val { font-size: 17px; color: #8B6914 !important; font-weight: 900; }

/* ITEMS TABLE */
.hg-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ccc;
    border-top: none;
}

.hg-table thead tr { background: #fff; }

.hg-table th {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #222;
    border-bottom: 1px solid #ccc;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.hg-th-x    { width: 28px; }
.hg-th-desc { text-align: left; }
.hg-th-num  { text-align: center; width: 100px; }

.hg-table tbody tr { border-bottom: 1px solid #eee; }

.hg-table td { padding: 10px 12px; }

.hg-td-x    { text-align: center; width: 28px; }
.hg-td-desc { font-weight: 600; color: #444; text-transform: uppercase; font-size: 12px; }
.hg-td-num  { text-align: center; }
.hg-qty     { font-weight: 700; color: #8B6914; }
.hg-x       { color: #c0392b; font-weight: 700; font-size: 13px; }

/* FOOTER BOX */
.hg-footer-box {
    display: flex;
    border: 1px solid #ccc;
    border-top: none;
}

.hg-bank-col {
    flex: 1;
    padding: 12px 16px;
    border-right: 1px solid #ccc;
}

.hg-bank-info {
    font-size: 12px;
    font-weight: 700;
    color: #222;
    margin-bottom: 2px;
}

.hg-words {
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    color: #111;
    margin-top: 4px;
    line-height: 1.5;
}

.hg-totals-col {
    width: 260px;
    padding: 12px 16px;
}

.hg-tot-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.hg-gst-row { color: #c0392b; font-weight: 700; }

.hg-net-row {
    background: #1a1a2e;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 9px 6px;
    margin-top: 6px;
    border-radius: 2px;
    border-bottom: none;
}

/* SIGNATURE */
.hg-sign-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 28px;
}

.hg-disclaimer {
    font-size: 11px;
    color: #777;
    font-style: italic;
    line-height: 1.8;
}

.hg-sign-col { text-align: center; }

.hg-sign-img {
    width: 160px;
    height: 55px;
    object-fit: contain;
    display: block;
    margin: 0 auto 4px;
}

.hg-for-hg {
    font-size: 12px;
    font-weight: 700;
    border-top: 1.5px solid #333;
    padding-top: 4px;
    color: #111;
}

.hg-auth {
    font-size: 11px;
    color: #555;
    letter-spacing: .8px;
    margin-top: 2px;
}

.hg-footer-note {
    text-align: center;
    font-size: 10px;
    font-style: italic;
    color: #aaa;
    margin-top: 18px;
    letter-spacing: 1px;
}

/* ============================================================
   PRINT — show ONLY invoice, hide everything else
   ============================================================ */
@media print {
    /* Hide ALL WordPress UI */
    #wpadminbar,
    #adminmenuwrap,
    #adminmenuback,
    #wpfooter,
    #wpbody-content > .notice,
    #wpbody-content > .updated,
    #wpbody-content > .error,
    .update-nag,
    .wrap > h1,
    .wrap > p,
    .hg-no-print,
    .hg-form-card,
    #hg-preview-btns,
    #hg-sc-form,
    .hg-form-section-title,
    .page-title-action {
        display: none !important;
    }

    /* Remove page margins / padding from body */
    body, html {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    /* Show only invoice */
    #hg-preview-wrap,
    #hg-invoice-print {
        display: block !important;
    }

    .hg-invoice {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 20px !important;
        max-width: 100% !important;
    }

    /* Full-width columns */
    #wpcontent,
    #wpbody,
    #wpbody-content {
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }
}
