/* ════════════════════════════════════════
   invoice.css — فواتير وسندات احترافية
   ════════════════════════════════════════ */

/* ── Controls Bar ── */
.inv-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--gray-50);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
}
.inv-controls label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--gray-700);
    white-space: nowrap;
}
.inv-controls input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.inv-ctrl-input {
    flex: 1;
    min-width: 180px;
    padding: 9px 13px;
    border: 1.5px solid var(--gray-200);
    border-radius: 9px;
    font-size: 0.85rem;
    font-family: 'Tajawal', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.inv-ctrl-input:focus { border-color: var(--primary); }

/* ── Invoice Wrapper ── */
.inv-wrap {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 36px 40px;
    max-width: 760px;
    margin: 0 auto;
    font-size: 0.88rem;
    line-height: 1.6;
    font-family: 'Tajawal', Arial, sans-serif;
}

/* ── Header ── */
.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 3px solid var(--primary);
}
.inv-logo-area { display: flex; align-items: center; gap: 16px; }
.inv-logo {
    width: 76px; height: 76px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem;
    background: var(--gray-50);
    flex-shrink: 0;
}
.inv-logo img { width:100%; height:100%; object-fit:cover; }
.inv-co-name   { color: var(--primary); font-size: 1rem; font-weight: 800; }
.inv-co-sub    { font-size: 0.78rem; color: var(--gray-400); margin-top: 2px; }
.inv-co-info   { font-size: 0.78rem; color: var(--gray-500); margin-top: 6px; line-height: 1.7; }

.inv-title-area { text-align: left; }
.inv-title-area h1 {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 4px;
    line-height: 1;
}
.inv-num  { font-size: 0.82rem; color: var(--gray-400); margin-top: 5px; }
.inv-date { font-size: 0.78rem; color: var(--gray-400); margin-top: 2px; }
.inv-status-paid  {
    display: inline-block;
    background: var(--success-bg); color: var(--success-text);
    padding: 4px 14px; border-radius: 20px;
    font-weight: 700; font-size: 0.82rem; margin-top: 8px;
}
.inv-status-draft {
    display: inline-block;
    background: var(--warning-bg); color: var(--warning-text);
    padding: 4px 14px; border-radius: 20px;
    font-weight: 700; font-size: 0.82rem; margin-top: 8px;
}

/* ── Parties ── */
.inv-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    background: var(--gray-50);
    border-radius: 10px;
    padding: 16px 20px;
}
.inv-party h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-400);
    margin-bottom: 8px;
    font-weight: 700;
}
.inv-party-name { font-weight: 700; font-size: 0.95rem; color: var(--gray-800); }
.inv-party p    { font-size: 0.82rem; color: var(--gray-500); line-height: 1.7; }

/* ── Proforma Note ── */
.inv-note {
    background: #fffbeb;
    border-right: 4px solid var(--warning);
    padding: 10px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    color: var(--warning-text);
    margin-bottom: 20px;
}

/* ── Table ── */
.inv-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.86rem;
}
.inv-table thead th {
    background: var(--primary);
    color: #fff;
    padding: 11px 14px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
}
.inv-table thead th:first-child { border-radius: 0 8px 8px 0; }
.inv-table thead th:last-child  { border-radius: 8px 0 0 8px; }
.inv-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
    color: var(--gray-700);
}
.inv-table tbody tr:last-child td { border-bottom: none; }
.inv-table tbody tr:hover td { background: var(--gray-50); }

/* ── Totals ── */
.inv-totals {
    margin-bottom: 24px;
    max-width: 300px;
    margin-right: 0;
    margin-left: auto;
}
.inv-tr {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 0.86rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
}
.inv-tr.subtotal { color: var(--gray-700); }
.inv-tr.tax      { color: var(--gray-500); font-style: italic; }
.inv-tr.paid     { color: var(--success);  font-weight: 600; }
.inv-tr.due      { color: var(--danger);   font-weight: 700; }
.inv-tr.grand {
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--primary);
    border-top: 2.5px solid var(--primary);
    border-bottom: none;
    padding-top: 10px;
    margin-top: 4px;
}

/* ── Bank Box ── */
.inv-bank {
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #c7d7f7;
}
.inv-bank h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 700;
}
.inv-bank-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.inv-bank-item .ibl { color: var(--gray-400); font-size: 0.72rem; display: block; margin-bottom: 2px; }
.inv-bank-item strong { font-size: 0.82rem; color: var(--gray-800); }

/* ── Notes ── */
.inv-notes-box {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.82rem;
}
.inv-notes-box strong { color: var(--primary); display: block; margin-bottom: 4px; }

/* ── Signatures ── */
.inv-sigs {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-200);
}
.inv-sig { text-align: center; width: 160px; }
.inv-sig-line {
    height: 60px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 7px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    padding-bottom: 4px;
}
.inv-sig-line img { max-height: 54px; max-width: 140px; object-fit: contain; }
.inv-sig p { font-size: 0.76rem; color: var(--gray-400); }
.inv-stamp-box { text-align: center; }
.stamp-circle {
    width: 84px; height: 84px;
    border-radius: 50%;
    border: 2px dashed var(--gray-300);
    margin: 0 auto 6px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.stamp-circle img { width:100%; height:100%; object-fit:cover; }
.stamp-label { font-size: 0.72rem; color: var(--gray-400); }

/* ── Footer ── */
.inv-footer {
    text-align: center;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.76rem;
    color: var(--gray-400);
}

/* ══════════════════════════════════════
   VOUCHER
══════════════════════════════════════ */
.vou-wrap {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: 28px 32px;
    max-width: 640px;
    margin: 0 auto;
}
.vou-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 18px 22px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.vou-header h2   { font-size: 1.2rem; font-weight: 800; }
.vou-header .vn  { font-size: 0.82rem; opacity: 0.75; margin-top: 3px; }
.vou-header .vd  { font-size: 0.82rem; opacity: 0.8; text-align: left; }

.vou-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.88rem;
}
.vou-l { color: var(--gray-500); font-weight: 600; }
.vou-v { font-weight: 700; color: var(--gray-800); }

.vou-amount {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    text-align: center;
    margin: 22px 0;
}
.vou-amount .va-l  { font-size: 0.82rem; opacity: 0.8; margin-bottom: 6px; }
.vou-amount .va-v  { font-size: 2.2rem; font-weight: 900; }
.vou-amount .va-w  { font-size: 0.75rem; opacity: 0.7; margin-top: 5px; }

/* ── Standalone Invoice Form ── */
.inv-form-section { margin-bottom: 20px; }
.inv-form-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid var(--gray-200);
}
