/* =========================================================
   Brixzly Construction Admin – Draw Request Review Styles
   ========================================================= */

/* ---- Layout ---- */
.bcdr-wrap { }

.bcdr-form-row--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}
@media ( max-width: 680px ) {
	.bcdr-form-row--2col { grid-template-columns: 1fr; }
}

/* ---- Required badge ---- */
.bcdr-required-badge {
	display: inline-block;
	font-size: .7rem;
	font-weight: 700;
	background: #fee2e2;
	color: #dc2626;
	padding: 2px 8px;
	border-radius: 99px;
	letter-spacing: .04em;
	text-transform: uppercase;
}

/* ---- Dropzone ---- */
label.bcdr-dropzone {
	margin: 0;
	font-weight: inherit;
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
}
.bcdr-dropzone {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 28px 20px;
	border: 2px dashed var(--bca-border, #e5e7eb);
	border-radius: var(--bca-radius-sm, 8px);
	background: var(--bca-bg, #f8fafc);
	cursor: pointer;
	transition: border-color .2s, background .2s;
	min-height: 110px;
	text-align: center;
}
.bcdr-dropzone--sm {
	padding: 18px 16px;
	min-height: 90px;
}
.bcdr-dropzone:hover,
.bcdr-dropzone--dragover {
	border-color: var(--bca-primary, #1d4ed8);
	background: #eff6ff;
}
.bcdr-dropzone--has-file {
	border-style: solid;
	border-color: var(--bca-success, #16a34a);
	background: #f0fdf4;
}
.bcdr-dropzone__icon {
	width: 36px; height: 36px;
	color: var(--bca-muted, #6b7280);
	flex-shrink: 0;
}
.bcdr-dropzone__icon--sm { width: 26px; height: 26px; }
.bcdr-dropzone__label {
	font-size: .85rem;
	color: var(--bca-muted, #6b7280);
	margin: 0;
	pointer-events: none;
}
.bcdr-dropzone__hint {
	font-size: .78rem;
	color: var(--bca-muted, #6b7280);
	margin: 0;
	line-height: 1.35;
	opacity: 0.92;
	pointer-events: none;
	max-width: 280px;
}
/* pointer-events: none so drag/drop hits the dropzone (label) for preventDefault + drop.
   File dialog opens via native <label for="…"> activation — not synthetic input.click(). */
.bcdr-file-input {
	position: absolute; inset: 0;
	z-index: 1;
	opacity: 0;
	cursor: pointer;
	width: 100%; height: 100%;
	pointer-events: none;
}

/* Selected file chip sits above the invisible input so remove button works */
.bcdr-dropzone .bcdr-file-preview {
	position: relative;
	z-index: 2;
	width: 100%;
	min-height: 0;
}
.bcdr-dropzone .bcdr-file-preview .bcdr-chip,
.bcdr-dropzone .bcdr-file-preview .bcdr-chip-remove {
	pointer-events: auto;
}

/* ---- File chip ---- */
.bcdr-file-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #dbeafe;
	color: #1e40af;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: .8rem;
	font-weight: 600;
	max-width: 200px;
	overflow: hidden;
}
.bcdr-file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcdr-file-remove {
	background: none; border: none; cursor: pointer;
	color: inherit; font-size: 1rem; line-height: 1;
	padding: 0 2px; flex-shrink: 0;
}

/* ---- Supporting docs multi-file ---- */
.bcdr-dropzone--multi { min-height: 80px; }
.bcdr-support-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.bcdr-support-item {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 6px;
	padding: 5px 10px;
	font-size: .82rem;
	color: #166534;
}
.bcdr-support-item svg { flex-shrink: 0; color: #16a34a; }
.bcdr-support-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}
.bcdr-support-size {
	flex-shrink: 0;
	color: #4b7c59;
	font-size: .78rem;
}
.bcdr-support-remove {
	background: none; border: none; cursor: pointer;
	color: #16a34a; font-size: 1rem; line-height: 1;
	padding: 0 2px; flex-shrink: 0;
}
.bcdr-support-remove:hover { color: #dc2626; }

/* ---- Manual amount input ---- */
.bcdr-input-prefix-wrap {
	position: relative;
}
.bcdr-input-prefix {
	position: absolute; left: 12px; top: 50%;
	transform: translateY(-50%);
	color: var(--bca-muted, #6b7280);
	font-size: .9rem; pointer-events: none;
}
.bcdr-input--has-prefix { padding-left: 28px !important; }
.bcdr-field-hint {
	font-size: .78rem;
	color: var(--bca-muted, #6b7280);
	margin: 4px 0 0;
}

/* ---- Actions ---- */
.bcdr-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 8px;
}

/* ---- Previous draws checkbox list ---- */
.bcdr-prev-draws-box {
	border: 1px solid var(--bca-border, #e5e7eb);
	border-radius: var(--bca-radius-sm, 8px);
	max-height: 220px;
	overflow-y: auto;
	background: var(--bca-surface, #fff);
}
.bcdr-prev-draws-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.bcdr-prev-draw-item {
	border-bottom: 1px solid var(--bca-border, #e5e7eb);
}
.bcdr-prev-draw-item:last-child { border-bottom: none; }
.bcdr-prev-draw-label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	cursor: pointer;
	transition: background .15s;
	flex-wrap: wrap;
}
.bcdr-prev-draw-label:hover { background: var(--bca-bg, #f8fafc); }
.bcdr-prev-draw-label input[type="checkbox"] {
	flex-shrink: 0;
	width: 16px; height: 16px;
	accent-color: var(--bca-primary, #1d4ed8);
	cursor: pointer;
}
.bcdr-prev-draw-name {
	font-size: .875rem;
	font-weight: 600;
	color: var(--bca-text, #111827);
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.bcdr-prev-draw-meta {
	margin-left: auto;
	font-size: .78rem;
	color: var(--bca-muted, #6b7280);
	white-space: nowrap;
}

/* ============================================================
   Result card
   ============================================================ */
.bcdr-result-card { }

.bcdr-result-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}
.bcdr-result-title-wrap { display: flex; flex-direction: column; gap: 4px; }
.bcdr-result-title { font-size: 1.4rem; font-weight: 800; margin: 0; color: var(--bca-primary-dark, #1e3a8a); }
.bcdr-result-draw-no { font-size: .85rem; color: var(--bca-muted, #6b7280); font-weight: 500; }

/* ---- Recommendation badge ---- */
.bcdr-rec-badge {
	display: inline-block;
	padding: 8px 22px;
	border-radius: 99px;
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 14px;
}
.bcdr-rec-badge--approve      { background: var(--bca-success, #16a34a); }
.bcdr-rec-badge--conditions   { background: var(--bca-warning, #d97706); }
.bcdr-rec-badge--dispute      { background: var(--bca-danger,  #dc2626); }

.bcdr-rec-reason {
	background: #f3f4f6;
	border-left: 4px solid var(--bca-primary, #1d4ed8);
	border-radius: 0 6px 6px 0;
	padding: 12px 16px;
	font-size: .9rem;
	color: #374151;
	margin-bottom: 20px;
	line-height: 1.6;
}

/* ---- KPI row ---- */
.bcdr-kpi-row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}
.bcdr-kpi {
	flex: 1;
	min-width: 140px;
	background: var(--bca-bg, #f8fafc);
	border: 1px solid var(--bca-border, #e5e7eb);
	border-radius: var(--bca-radius-sm, 8px);
	padding: 14px 18px;
}
.bcdr-kpi__label {
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--bca-muted, #6b7280);
	margin-bottom: 4px;
}
.bcdr-kpi__value {
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--bca-text, #111827);
}

/* ---- Sections ---- */
.bcdr-section { margin-bottom: 24px; }
.bcdr-section__title {
	font-size: .95rem;
	font-weight: 700;
	border-left: 4px solid var(--bca-primary, #1d4ed8);
	padding-left: 10px;
	margin: 0 0 12px;
}
.bcdr-section--danger .bcdr-section__title,
.bcdr-section__title--danger { border-left-color: var(--bca-danger, #dc2626); color: var(--bca-danger, #dc2626); }
.bcdr-section--info { }
.bcdr-section--info .bcdr-section__title { border-left-color: var(--bca-success, #16a34a); }

.bcdr-summary-box {
	background: #eff6ff;
	border-left: 4px solid var(--bca-primary, #1d4ed8);
	border-radius: 0 6px 6px 0;
	padding: 14px 18px;
	font-size: .9rem;
	line-height: 1.65;
	color: #1e3a8a;
}

.bcdr-text { font-size: .9rem; line-height: 1.6; margin: 0 0 6px; }

/* ---- Table ---- */
.bcdr-table-wrap { overflow-x: auto; }
.bcdr-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .86rem;
}
.bcdr-table th {
	background: var(--bca-primary, #1d4ed8);
	color: #fff;
	padding: 9px 12px;
	text-align: left;
	font-size: .8rem;
	font-weight: 600;
	white-space: nowrap;
}
.bcdr-table td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--bca-border, #e5e7eb);
	vertical-align: top;
}
.bcdr-table tbody tr:last-child td { border-bottom: none; }
.bcdr-table tbody tr:hover { background: var(--bca-bg, #f8fafc); }
.bcdr-row--flagged { background: #fff9c4 !important; }
.bcdr-td--center { text-align: center; }
.bcdr-td--right  { text-align: right;  }

/* ---- Lists ---- */
.bcdr-list {
	margin: 0;
	padding-left: 20px;
	font-size: .9rem;
	line-height: 1.6;
}
.bcdr-list li { margin-bottom: 6px; }
.bcdr-list--danger { color: var(--bca-danger, #dc2626); }
.bcdr-list--ordered { list-style: decimal; }

/* ---- Severity badge ---- */
.bcdr-severity-badge {
	display: inline-block;
	font-size: .7rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 4px;
	margin-right: 4px;
	vertical-align: middle;
}
.bcdr-severity--high   { background: #fee2e2; color: #991b1b; }
.bcdr-severity--medium { background: #fef3c7; color: #92400e; }
.bcdr-severity--low    { background: #f3f4f6; color: #4b5563; }

/* ---- Run another ---- */
.bcdr-run-another {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--bca-border, #e5e7eb);
}

/* ============================================================
   History panel
   ============================================================ */

/* History item recommendation badge */
.bcdr-badge {
	display: inline-flex;
	align-items: center;
	font-size: .72rem;
	font-weight: 700;
	padding: 2px 9px;
	border-radius: 99px;
	letter-spacing: .03em;
	white-space: nowrap;
}
.bcdr-badge--approve     { background: #dcfce7; color: #15803d; }
.bcdr-badge--conditions  { background: #fef3c7; color: #b45309; }
.bcdr-badge--dispute     { background: #fee2e2; color: #b91c1c; }

/* ---- Stacked context links (right column of Row 4) ---- */
#bcdr-prev-draws-inner { margin-top: 14px; }

/* ---- Custom multi-select dropdown (Link Progress Analysis) ---- */
.bcdr-ms { position: relative; }
.bcdr-ms__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	padding-right: 10px;
}
.bcdr-ms__trigger:focus {
	border-color: var(--bca-primary);
	box-shadow: 0 0 0 3px rgba(29,78,216,.12);
	outline: none;
}
.bcdr-ms__arrow { flex-shrink: 0; color: #6b7280; transition: transform .15s; }
.bcdr-ms--open .bcdr-ms__arrow { transform: rotate(180deg); }
.bcdr-ms__dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 3px);
	left: 0; right: 0;
	z-index: 200;
	background: #fff;
	border: 1px solid var(--bca-border);
	border-radius: var(--bca-radius-sm);
	box-shadow: 0 6px 16px rgba(0,0,0,.1);
	max-height: 220px;
	overflow-y: auto;
}
.bcdr-ms__dropdown--open { display: block; }
.bcdr-ms__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	cursor: pointer;
	font-size: .875rem;
	color: var(--bca-text);
	transition: background .1s;
}
.bcdr-ms__item:hover { background: #eff6ff; }
.bcdr-ms__item input[type="checkbox"] { cursor: pointer; flex-shrink: 0; }
.bcdr-ms__item span { line-height: 1.4; }

/* ---- File Manager partial-save notice (after review) ---- */
.bcdr-fm-save-warn {
	margin: 0 0 18px;
	padding: 14px 16px;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-radius: 8px;
	color: #78350f;
	font-size: .875rem;
	line-height: 1.45;
}
.bcdr-fm-save-warn__title { display: block; margin-bottom: 8px; font-size: .9rem; }
.bcdr-fm-save-warn__intro { margin: 0 0 10px; color: #92400e; }
.bcdr-fm-save-warn__list { margin: 0; padding-left: 1.2em; }
.bcdr-fm-save-warn__list li { margin: 6px 0; }
.bcdr-fm-save-warn__lbl { font-weight: 600; color: #78350f; }
.bcdr-fm-save-warn__msg { font-weight: 400; color: #92400e; }
