/* Shared DocumentUploadFiler — chart Documents popup + Nellie Visit Prep/Review upload tab. */

.doc-upload-filer {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 16px;
	border-radius: 8px;
	transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

.doc-upload-filer--dragover {
	background: var(--nellie-surface-blue, #eff6ff);
	box-shadow: 0 0 0 2px #3b82f6;
}

.doc-upload-filer-sources {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.doc-upload-filer-source {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 104px;
	padding: 14px 10px;
	background: #fff;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	color: var(--nellie-text, #1f2937);
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.doc-upload-filer-source:hover,
.doc-upload-filer-source:focus-visible {
	border-color: #16A34A;
	border-style: solid;
	background: #f0fdf4;
	outline: none;
}

.doc-upload-filer-source:focus-visible {
	box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.doc-upload-filer-source-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-bottom: 4px;
	border-radius: 999px;
	background: var(--nellie-surface-neutral, #f3f4f6);
	color: var(--nellie-text-subtle, #6b7280);
	font-size: 17px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.doc-upload-filer-source:hover .doc-upload-filer-source-icon,
.doc-upload-filer-source:focus-visible .doc-upload-filer-source-icon {
	background: #D1FAE5;
	color: #16A34A;
}

.doc-upload-filer-source-title {
	font-size: 13px;
	font-weight: 600;
}

.doc-upload-filer-source-sub {
	font-size: 11px;
	color: var(--nellie-text-muted, #6b7280);
}

.doc-upload-filer-hint {
	margin-top: -4px;
	font-size: 11px;
	color: var(--nellie-text-muted, #6b7280);
	text-align: center;
}

/* Touch devices can't drag files in — don't offer it. */
@media (hover: none) {
	.doc-upload-filer-hint-drop {
		display: none;
	}
}

.doc-upload-filer-file {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px 8px 8px;
	background: #fff;
	border: 1px solid var(--nellie-border, #e5e7eb);
	border-radius: 8px;
}

.doc-upload-filer-thumb {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 6px;
	background: var(--nellie-surface-neutral, #f3f4f6);
	color: var(--nellie-text-muted, #6b7280);
	font-size: 20px;
}

.doc-upload-filer-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.doc-upload-filer-file-meta {
	flex: 1 1 auto;
	min-width: 0;
}

.doc-upload-filer-file-name {
	font-size: 13px;
	font-weight: 600;
	color: #1f2937;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.doc-upload-filer-file-sub {
	font-size: 11px;
	color: var(--nellie-text-muted, #6b7280);
}

.doc-upload-filer-change {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 8px;
	background: none;
	border: none;
	border-radius: 6px;
	color: #0A84FF;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.doc-upload-filer-change:hover:not(:disabled) {
	background: var(--nellie-surface-blue, #eff6ff);
}

.doc-upload-filer-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.doc-upload-filer-label {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--nellie-text-subtle, #6b7280);
}

.doc-upload-filer-input {
	width: 100%;
	padding: 8px 10px;
	background-color: #fff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	color: #1f2937;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-upload-filer-input::placeholder {
	color: #9ca3af;
}

.doc-upload-filer-input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

select.doc-upload-filer-input {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 32px;
	border-radius: 8px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 12px;
	cursor: pointer;
}

.doc-upload-filer-field-error {
	display: none;
	font-size: 12px;
	color: var(--nellie-danger, #dc2626);
}

.doc-upload-filer-field--invalid .doc-upload-filer-label {
	color: var(--nellie-danger, #dc2626);
}

.doc-upload-filer-field--invalid .doc-upload-filer-input {
	border-color: var(--nellie-danger-border, #f87171);
}

.doc-upload-filer-field--invalid .doc-upload-filer-input:focus {
	box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.doc-upload-filer-field--invalid .doc-upload-filer-field-error {
	display: block;
}

.doc-upload-filer-alert {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 8px 10px;
	background: var(--nellie-danger-bg, #fef2f2);
	border-left: 3px solid var(--nellie-danger, #dc2626);
	border-radius: 6px;
	color: #991B1B;
	font-size: 12px;
	line-height: 1.4;
}

.doc-upload-filer-alert[hidden] {
	display: none;
}

.doc-upload-filer-alert i {
	margin-top: 2px;
	color: var(--nellie-danger, #dc2626);
}

.doc-upload-filer-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

.doc-upload-filer-upload {
	flex: 1 1 auto;
	justify-content: center;
}

.doc-upload-filer--uploading .doc-upload-filer-file,
.doc-upload-filer--uploading .doc-upload-filer-field {
	opacity: 0.6;
}

@media (max-width: 768px) {
	.doc-upload-filer-source {
		min-height: 112px;
	}

	/* 16px stops iOS zooming the page when the field gains focus. */
	.doc-upload-filer-input {
		min-height: 44px;
		font-size: 16px;
	}

	.doc-upload-filer-change,
	.doc-upload-filer-actions .k-button {
		min-height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.doc-upload-filer,
	.doc-upload-filer-source,
	.doc-upload-filer-source-icon,
	.doc-upload-filer-input,
	.doc-upload-filer-change {
		transition: none;
	}
}
