/* Jawad Zafar Estimates — admin styles */

.estprop-wrap { --estprop-border: #dcdcde; --estprop-muted: #646970; --estprop-bg: #fff; --estprop-accent: #2271b1; --estprop-ok: #00a32a; --estprop-warn: #dba617; --estprop-bad: #d63638; }
.estprop-wrap .description, .estprop-wrap small { color: var(--estprop-muted); }
.estprop-lead { color: var(--estprop-muted); max-width: 720px; }

.estprop-panel { background: var(--estprop-bg); border: 1px solid var(--estprop-border); border-radius: 6px; padding: 16px 20px; margin: 16px 0; }
.estprop-panel h2 { font-size: 15px; margin: 0 0 12px; }
.estprop-panel h3 { font-size: 13px; margin: 12px 0 6px; }
.estprop-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.estprop-panel__head h2 { margin: 0; }
.estprop-panel .form-table th { width: 200px; }

.estprop-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.estprop-filters--right { justify-content: flex-end; }
.estprop-table td, .estprop-table th { vertical-align: middle; }
.estprop-table .num, .estprop-mini-table .num { text-align: right; white-space: nowrap; }
.estprop-row-actions { white-space: nowrap; text-align: right; }
.estprop-empty { text-align: center; padding: 40px 20px; background: #fff; border: 1px dashed var(--estprop-border); border-radius: 6px; margin: 16px 0; }
.estprop-empty-row { padding: 20px !important; }
.estprop-inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 6px 12px 0 0; }
.estprop-prefix, .estprop-suffix { color: var(--estprop-muted); padding: 0 4px; }
.estprop-w-70 { width: 70px !important; } .estprop-w-90 { width: 90px !important; } .estprop-w-120 { width: 120px !important; }
.estprop-check { display: inline-block; margin: 2px 0; }
.estprop-warn { color: var(--estprop-bad) !important; font-weight: 600; }
.estprop-danger-link, .estprop-wrap .button-link.estprop-danger-link { color: var(--estprop-bad); }
.estprop-small-link { display: inline-block; margin-top: 4px; font-size: 12px; }
.estprop-logo-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.estprop-logo-preview { max-height: 48px; max-width: 160px; border: 1px solid var(--estprop-border); padding: 4px; background: #fff; }

/* Badges */
.estprop-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: middle; background: #f0f0f1; color: #3c434a; }
.estprop-badge--sent { background: #e5f0fa; color: #135e96; }
.estprop-badge--viewed { background: #ede7fb; color: #5b3cc4; }
.estprop-badge--changes_requested { background: #fcf3dc; color: #8a6100; }
.estprop-badge--accepted { background: #e6f6ea; color: #0a6b25; }
.estprop-badge--declined { background: #fbe9ea; color: #a1191d; }
.estprop-version { display: inline-block; font-size: 11px; color: var(--estprop-muted); border: 1px solid var(--estprop-border); border-radius: 3px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }

/* Dashboard */
.estprop-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.estprop-card { background: #fff; border: 1px solid var(--estprop-border); border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.estprop-card__label { color: var(--estprop-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.estprop-card__value { font-size: 24px; line-height: 1.2; }
.estprop-card__meta { color: var(--estprop-muted); font-size: 12px; }
.estprop-dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.estprop-dash-grid .estprop-panel { margin: 0; }
.estprop-pipeline { margin: 0 0 16px; }
.estprop-pipeline li { margin: 0; }
.estprop-pipeline a { display: grid; grid-template-columns: 1fr 40px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0f0f1; text-decoration: none; color: inherit; }
.estprop-start ol { margin: 0 0 0 20px; }
.estprop-start li { margin: 6px 0; }
.estprop-start li.is-done { color: var(--estprop-muted); text-decoration: line-through; }

/* Activity */
.estprop-activity { margin: 0; }
.estprop-activity li { display: flex; gap: 8px; margin: 0 0 10px; }
.estprop-activity__dot { flex: 0 0 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: #c3c4c7; }
.estprop-ev--sent { background: #2271b1; } .estprop-ev--viewed { background: #7f54e0; } .estprop-ev--accepted { background: var(--estprop-ok); }
.estprop-ev--declined { background: var(--estprop-bad); } .estprop-ev--changes_requested { background: var(--estprop-warn); } .estprop-ev--payment { background: #00a0a0; }

/* Editor layout */
.estprop-editor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.estprop-editor-head h1 { display: flex; align-items: center; gap: 8px; padding: 4px 0 0; }
.estprop-editor-head__actions { display: flex; gap: 6px; }
.estprop-back { text-decoration: none; font-size: 13px; }
.estprop-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.estprop-editor fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.estprop-editor__side .estprop-panel:first-child { margin-top: 16px; }
.estprop-editor .notice.inline { margin: 12px 0 0; }
.estprop-savebar { display: flex; gap: 8px; }

.estprop-field { margin: 0 0 12px; }
.estprop-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.estprop-field input[type=text], .estprop-field input[type=email], .estprop-field input[type=date], .estprop-field input[type=number], .estprop-field select, .estprop-field textarea { width: 100%; max-width: 100%; }
.estprop-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.estprop-span-2 { grid-column: span 2; }

/* Line items */
.estprop-line-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.estprop-line-tools select { max-width: 320px; }
.estprop-lines-scroll { overflow-x: auto; }
.estprop-lines { width: 100%; border-collapse: collapse; min-width: 700px; }
.estprop-lines th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--estprop-muted); padding: 6px 4px; border-bottom: 1px solid var(--estprop-border); }
.estprop-lines td { padding: 8px 4px; border-bottom: 1px solid #f0f0f1; vertical-align: top; position: relative; }
.estprop-lines input, .estprop-lines select, .estprop-lines textarea { width: 100%; min-width: 0; font-size: 13px; }
.estprop-lines textarea { min-height: 34px; resize: vertical; }
.estprop-col-move { width: 20px; }
.estprop-col-desc { min-width: 200px; }
.estprop-desc-top { display: flex; gap: 4px; margin-bottom: 4px; }
.estprop-desc-top .estprop-section-input { flex: 1 1 auto; }
.estprop-desc-top .estprop-type-select { flex: 0 0 112px; width: 112px; font-size: 12px; min-height: 28px; }
.estprop-col-qty { width: 92px; }
.estprop-unit-input { margin-top: 4px; font-size: 12px !important; }
.estprop-col-cost { width: 84px; }
.estprop-col-pct { width: 70px; }
.estprop-mini-label { display: block; font-size: 10px; color: var(--estprop-muted); text-transform: uppercase; letter-spacing: .03em; }
.estprop-mini-label + .estprop-mini-label { margin-top: 2px; }
.estprop-col-flags { width: 104px; font-size: 12px; }
.estprop-col-flags label { display: block; white-space: nowrap; line-height: 20px; }
.estprop-col-flags input[type=checkbox] { width: 16px !important; min-width: 16px; height: 16px; margin: 0 4px 0 0; vertical-align: -3px; }
.estprop-col-flags label[hidden] { display: none; }
.estprop-col-total { width: 96px; text-align: right; white-space: nowrap; font-weight: 600; padding-top: 14px !important; }
.estprop-col-total small { display: block; font-weight: 400; font-size: 11px; }
.estprop-col-remove { width: 22px; }
.estprop-section-input { font-size: 12px !important; color: var(--estprop-muted); }
.estprop-qty { display: flex; gap: 2px; }
.estprop-icon-btn { background: none; border: 0; padding: 2px 4px; cursor: pointer; color: var(--estprop-muted); line-height: 1; font-size: 11px; display: block; }
.estprop-icon-btn:hover { color: var(--estprop-accent); }
.estprop-remove { font-size: 20px; }
.estprop-remove:hover { color: var(--estprop-bad); }
.estprop-line--excluded td { background: #fbfbfb; }
.estprop-line--excluded [data-price] { color: var(--estprop-muted); text-decoration: line-through; }
.estprop-no-lines td { text-align: center; color: var(--estprop-muted); padding: 24px !important; }

.estprop-calc-pop { position: absolute; z-index: 20; top: 40px; right: 0; width: 260px; background: #fff; border: 1px solid var(--estprop-border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 10px; }
.estprop-calc-pop select { margin-bottom: 8px; }
.estprop-calc-pop__inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.estprop-calc-pop__inputs label { font-size: 11px; color: var(--estprop-muted); }
.estprop-calc-pop__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.estprop-calc-pop__foot strong { font-size: 16px; }

/* Pricing & totals */
.estprop-pricing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.estprop-field--inline { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; }
.estprop-field--inline label { margin: 0; font-weight: 500; }
.estprop-field--inline small { grid-column: 2; margin-top: -4px; font-size: 11px; }
.estprop-input-wrap { display: flex; align-items: center; gap: 4px; }
.estprop-input-wrap input[type=number] { width: 110px; }
.estprop-totals { background: #f6f7f7; border-radius: 6px; padding: 12px 16px; }
.estprop-totals__table { width: 100%; border-collapse: collapse; }
.estprop-totals__table th { text-align: left; font-weight: 400; padding: 4px 0; color: #3c434a; }
.estprop-totals__table td { text-align: right; padding: 4px 0; white-space: nowrap; }
.estprop-totals__table .estprop-strong th, .estprop-totals__table .estprop-strong td { font-weight: 600; border-top: 1px solid var(--estprop-border); }
.estprop-totals__table .estprop-grand th, .estprop-totals__table .estprop-grand td { font-size: 18px; font-weight: 700; border-top: 2px solid #1d2327; padding-top: 8px; }
.estprop-schedule-preview ul { margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--estprop-border); }
.estprop-schedule-preview li { display: flex; justify-content: space-between; margin: 2px 0; font-size: 12px; }
.estprop-internal { margin-top: 12px; padding-top: 4px; border-top: 1px dashed var(--estprop-border); }
.estprop-internal h3 { color: var(--estprop-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }

.estprop-schedule__row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.estprop-schedule__row input[type=text] { flex: 1; min-width: 120px; }
.estprop-schedule__remove { font-size: 18px; color: var(--estprop-muted); text-decoration: none; }
.estprop-schedule__sum { margin-left: 8px; }

/* Sidebar */
.estprop-side h2 { font-size: 14px; }
.estprop-link-box { display: flex; gap: 4px; }
.estprop-link-box input { flex: 1; min-width: 0; font-size: 12px; }
.estprop-side-links { margin: 8px 0; }
.estprop-send { margin-top: 12px; border-top: 1px solid #f0f0f1; padding-top: 8px; }
.estprop-send summary { cursor: pointer; font-weight: 600; color: var(--estprop-accent); padding: 4px 0; }
.estprop-send form { margin-top: 8px; }
.estprop-paybar { height: 8px; border-radius: 4px; background: #f0f0f1; overflow: hidden; }
.estprop-paybar span { display: block; height: 100%; background: var(--estprop-ok); }
.estprop-paysum { display: flex; justify-content: space-between; margin: 8px 0; }
.estprop-milestones { margin: 0 0 8px; }
.estprop-ms { display: flex; justify-content: space-between; font-size: 12px; margin: 0; padding: 4px 0 4px 18px; position: relative; }
.estprop-ms::before { content: ''; position: absolute; left: 2px; top: 8px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #c3c4c7; box-sizing: border-box; }
.estprop-ms--paid::before { background: var(--estprop-ok); border-color: var(--estprop-ok); }
.estprop-ms--partial::before { border-color: var(--estprop-ok); background: linear-gradient(90deg, var(--estprop-ok) 50%, #fff 50%); }
.estprop-mini-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.estprop-mini-table td { border-top: 1px solid #f0f0f1; padding: 6px 0; vertical-align: top; }
.estprop-manage form { margin: 0; }
.estprop-manage a, .estprop-manage .button-link { display: block; margin: 6px 0; text-align: left; }
.estprop-sig-box { border: 1px solid var(--estprop-border); border-radius: 4px; padding: 8px; margin-bottom: 12px; background: #fff; }
.estprop-sig-box img { max-width: 100%; height: auto; display: block; }

@media (max-width: 1280px) {
	.estprop-editor { grid-template-columns: 1fr; }
	.estprop-editor__side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 16px; }
}
@media (max-width: 960px) {
	.estprop-pricing, .estprop-dash-grid { grid-template-columns: 1fr; }
	.estprop-grid-3 { grid-template-columns: 1fr; }
	.estprop-span-2 { grid-column: auto; }
}
.estprop-pipeline .estprop-badge { justify-self: start; }

/* v0.2: tabs, logs, email */
.estprop-tabs { margin-bottom: 8px; }
.estprop-log-table td { vertical-align: top; }
.estprop-nowrap { white-space: nowrap; }
.estprop-area { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #f0f0f1; color: #3c434a; white-space: nowrap; }
.estprop-area--estimate { background: #e5f0fa; color: #135e96; }
.estprop-area--client { background: #ede7fb; color: #5b3cc4; }
.estprop-area--item { background: #e6f6ea; color: #0a6b25; }
.estprop-area--settings { background: #fcf3dc; color: #8a6100; }
.estprop-area--email { background: #e0f4f4; color: #006b6b; }
.estprop-email-table td { vertical-align: top; }
.estprop-email-row.is-failed td { background: #fcf0f1; }
.estprop-email-table summary { cursor: pointer; }
.estprop-email-detail { margin-top: 8px; }
.estprop-email-body { white-space: pre-wrap; background: #f6f7f7; border: 1px solid var(--estprop-border); border-radius: 4px; padding: 10px; max-height: 260px; overflow: auto; font-size: 12px; }
.estprop-debug pre { white-space: pre-wrap; background: #1d2327; color: #e5e5e5; padding: 12px; border-radius: 4px; max-height: 320px; overflow: auto; font-size: 11px; }
.estprop-email-mini { margin: 0 0 4px; }
.estprop-email-mini li { font-size: 12px; margin-bottom: 6px; }
.estprop-inline-check { grid-column: 2; font-size: 12px; }
.estprop-inline-check input[type=checkbox] { margin: 0 4px 0 0; }

/* v0.3: setup wizard */
.estprop-setup__card { max-width: 760px; margin: 24px auto; background: #fff; border: 1px solid var(--estprop-border); border-radius: 8px; padding: 28px 32px; }
.estprop-setup__card h1 { font-size: 24px; margin: 4px 0 8px; padding: 0; }
.estprop-setup__step { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; color: var(--estprop-accent); margin: 0; }
.estprop-setup__note { background: #f0f6fc; border-left: 4px solid var(--estprop-accent); padding: 10px 12px; margin: 0 0 16px; }
.estprop-setup__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.estprop-setup__wide { grid-column: 1 / -1; }
.estprop-setup__label { display: block; font-weight: 600; margin-bottom: 4px; }
.estprop-setup__wide .estprop-check { margin-right: 16px; }
.estprop-setup__actions { display: flex; gap: 16px; align-items: center; margin-top: 20px; }
#estprop-setup-country { max-width: 360px; }
@media (max-width: 782px) { .estprop-setup__grid { grid-template-columns: 1fr; } .estprop-setup__card { padding: 20px; } }

/* Inbox check (Email & SMTP) */
.estprop-checks { margin: 12px 0; max-width: 820px; }
.estprop-checks li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid #f0f0f1; margin: 0; }
.estprop-checks li:first-child { border-top: 0; }
.estprop-checks b { display: block; }
.estprop-checks span:not(.estprop-check-icon) { display: block; color: #50575e; margin-top: 2px; word-break: break-word; }
.estprop-check-icon { flex: 0 0 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; line-height: 22px; text-align: center; }
.estprop-check-ok .estprop-check-icon { background: #00a32a; }
.estprop-check-warn .estprop-check-icon { background: #dba617; }
.estprop-check-fail .estprop-check-icon { background: #d63638; }

/* Proposal look (Settings → General) */
.estprop-designs { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 14px; margin: 14px 0 6px; }
.estprop-design-card { display: flex; flex-direction: column; gap: 4px; border: 2px solid #dcdcde; border-radius: 10px; padding: 12px; cursor: pointer; background: #fff; }
.estprop-design-card:has(input:checked) { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; }
.estprop-design-card input { position: absolute; opacity: 0; }
.estprop-design-card input:focus-visible + .estprop-design-thumb { outline: 2px solid #2271b1; outline-offset: 2px; }
.estprop-design-card .description { font-size: 12px; }
.estprop-design-thumb { display: flex; flex-direction: column; gap: 5px; height: 112px; border-radius: 6px; background: #fff; border: 1px solid #e0e0e0; padding: 0 12px 10px; overflow: hidden; margin-bottom: 6px; }
.estprop-design-thumb i { display: block; margin: 0 -12px 6px; height: 6px; background: #1f4e79; }
.estprop-design-thumb b { display: block; height: 7px; border-radius: 2px; background: #e5e7eb; }
.estprop-design-thumb b:first-of-type { width: 55%; background: #1f4e79; opacity: .8; }
.estprop-design-thumb em { display: block; margin-top: auto; align-self: flex-end; width: 40%; height: 12px; border-top: 2px solid #1b1f24; }
.estprop-design-thumb--modern { background: #f3f4f6; }
.estprop-design-thumb--modern i { height: 36px; border-radius: 0; }
.estprop-design-thumb--modern b { background: #fff; height: 10px; }
.estprop-design-thumb--modern b:first-of-type { background: #fff; }
.estprop-design-thumb--modern em { border: 0; height: 14px; background: #1f4e79; border-radius: 4px; }
.estprop-design-thumb--minimal i { height: 0; margin-bottom: 14px; }
.estprop-design-thumb--minimal b:first-of-type { background: #1b1f24; width: 40%; }
.estprop-design-thumb--minimal b { background: #f0f0f1; height: 5px; }
.estprop-design-thumb--minimal em { border-top-width: 1px; }
@media (max-width: 782px) { .estprop-designs { grid-template-columns: 1fr; } }

/* Templates */
.estprop-span-3 { grid-column: 1 / -1; }
.estprop-check-row { margin-top: 0; }
.estprop-check-row label { font-weight: 400; }
.estprop-from-template { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; vertical-align: middle; }
.estprop-from-template select { min-width: 190px; }
.estprop-inline-rename { display: flex; gap: 8px; align-items: center; }
.estprop-inline-rename input[type=text] { font-weight: 600; min-width: 220px; }
.estprop-row-actions form { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; }
.estprop-row-actions select { max-width: 200px; }
.estprop-save-template summary { cursor: pointer; color: #2271b1; margin: 6px 0; }
.estprop-save-template form { margin-top: 6px; }

/* Reminders */
.estprop-reminder { background: #f0f6fc; border-left: 3px solid #2271b1; padding: 7px 10px; font-size: 12.5px; margin: 10px 0; }
.estprop-reminder .dashicons { font-size: 16px; width: 16px; height: 16px; vertical-align: text-bottom; color: #2271b1; }

/* Photos & documents */
.estprop-attach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.estprop-attach-list li { position: relative; margin: 0; border: 1px solid #dcdcde; border-radius: 6px; background: #fff; overflow: hidden; cursor: move; }
.estprop-attach-list img { display: block; width: 100%; height: 90px; object-fit: cover; background: #f0f0f1; }
.estprop-attach-ext { display: flex; align-items: center; justify-content: center; height: 90px; background: #f0f6fc; color: #1f4e79; font-weight: 700; letter-spacing: .05em; }
.estprop-attach-name { display: block; padding: 5px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.estprop-attach-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 22px; cursor: pointer; padding: 0; }
.estprop-attach-remove:hover { background: #b32d2e; }
.estprop-attach-list .ui-sortable-placeholder { visibility: visible !important; border: 2px dashed #c3c4c7; background: #f6f7f7; }
