.ctp-auth, .ctp-shell {
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #111827;
}

.ctp-auth { max-width: 460px; }
.ctp-shell { max-width: 1100px; display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }

.ctp-notice {
	padding: 10px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
}

.ctp-notice-success { background: #e6f6e9; color: #1a7f37; }
.ctp-notice-error { background: #fdeaea; color: #b32020; }

.ctp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ctp-field label { font-weight: 600; font-size: 14px; }
.ctp-field input { padding: 8px 10px; border: 1px solid #ccd0d4; border-radius: 6px; width: 100%; box-sizing: border-box; }
.ctp-honeypot { position: absolute; left: -9999px; }

.ctp-button {
	background: #2271b1;
	color: #fff;
	border: none;
	padding: 10px 18px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
}
.ctp-button:hover { background: #135e96; }
.ctp-button .dashicons { font-size: 16px; width: 16px; height: 16px; }

.ctp-button-blue { background: #2563eb; }
.ctp-button-blue:hover { background: #1d4ed8; }
.ctp-button-green { background: #16a34a; }
.ctp-button-green:hover { background: #15803d; }

.ctp-button-outline {
	display: inline-flex; align-items: center; gap: 6px;
	border: 1px solid #c7d2fe; color: #3730a3; background: #fff;
	padding: 9px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none;
}
.ctp-button-outline:hover { background: #eef2ff; }

/* Login / register card */
.ctp-auth-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 28px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ctp-auth-card h2 { margin: 0 0 4px; }
.ctp-auth-subtext { color: #6b7280; font-size: 14px; margin: 0 0 22px; }
.ctp-auth-switch { text-align: center; font-size: 14px; }

.ctp-input-wrap { position: relative; display: flex; align-items: center; }
.ctp-input-wrap input { padding-left: 36px; }
.ctp-input-wrap .ctp-input-icon {
	position: absolute;
	left: 10px;
	color: #9ca3af;
	pointer-events: none;
}
.ctp-toggle-pw {
	position: absolute;
	right: 8px;
	background: none;
	border: none;
	color: #9ca3af;
	cursor: pointer;
	padding: 4px;
}

.ctp-field-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	margin-bottom: 18px;
}
.ctp-checkbox { display: flex; align-items: center; gap: 6px; font-weight: normal; }

.ctp-security-note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	background: #f0fdf4;
	color: #15803d;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13px;
	margin-bottom: 16px;
}

/* ---------- Client dashboard ---------- */

.ctp-sidebar {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ctp-sidebar-user { display: flex; align-items: center; gap: 10px; }
.ctp-avatar-circle {
	width: 38px; height: 38px; border-radius: 50%;
	background: #2563eb; color: #fff; font-weight: 700;
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ctp-sidebar-name { font-weight: 600; font-size: 14px; }
.ctp-sidebar-role { font-size: 12px; color: #6b7280; }

.ctp-sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.ctp-sidebar-nav-item {
	display: flex; align-items: center; gap: 8px;
	padding: 8px 10px; border-radius: 6px; font-size: 14px; color: #4b5563;
	text-decoration: none;
}
.ctp-sidebar-nav-item:hover { background: #f3f4f6; color: #111827; }
.ctp-sidebar-nav-item.is-active { background: #eef2ff; color: #2563eb; font-weight: 600; }
.ctp-nav-label { flex: 1; }
.ctp-nav-dot {
	width: 9px; height: 9px; border-radius: 50%; background: #dc2626; flex-shrink: 0;
	box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
.ctp-nav-dot[hidden] { display: none; }

.ctp-new-tag, .ctp-unseen-tag {
	display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
	background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 700;
	text-transform: uppercase; letter-spacing: 0.03em;
}

.ctp-panel {
	background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
	padding: 22px 24px; margin-bottom: 20px;
}
.ctp-panel h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.ctp-panel-sub { margin: 0 0 18px; color: #6b7280; font-size: 13px; }

.ctp-add-case-form { display: flex; gap: 10px; }
.ctp-add-case-form input[type="text"] {
	flex: 1; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px;
	font-size: 14px; box-sizing: border-box; min-width: 0;
}
.ctp-add-case-form .ctp-button { width: auto; white-space: nowrap; }

.ctp-completed-head { display: flex; align-items: center; gap: 5px; margin-top: 18px; color: #16a34a; }
.ctp-completed-head .dashicons { font-size: 15px; width: 15px; height: 15px; }

.ctp-sidebar-logout {
	display: flex; align-items: center; gap: 8px;
	color: #6b7280; text-decoration: none; font-size: 14px; margin-top: auto;
}
.ctp-sidebar-logout:hover { color: #dc2626; }

.ctp-db-banner {
	background: linear-gradient(135deg, #eef2ff, #f5f7ff);
	border-radius: 10px;
	padding: 22px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.ctp-db-banner h2 { margin: 0 0 4px; font-size: 20px; }
.ctp-db-banner p { margin: 0; color: #4b5563; font-size: 14px; }
.ctp-db-banner-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctp-date-pill {
	display: inline-flex; align-items: center; gap: 6px;
	background: #fff; border: 1px solid #e5e7eb; border-radius: 999px;
	padding: 6px 12px; font-size: 13px; color: #4b5563;
}

.ctp-case {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 22px 24px;
	margin-bottom: 20px;
	display: grid;
	grid-template-columns: 190px 1fr 240px;
	gap: 22px;
}

.ctp-case-info { border-right: 1px solid #f0f0f1; padding-right: 22px; }
.ctp-case-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 8px;
	background: #eef2ff; color: #4f46e5; margin-bottom: 10px;
}
.ctp-case-info h3 { margin: 0 0 8px; font-size: 17px; }
.ctp-case-updated { font-size: 12px; color: #9ca3af; margin: 10px 0 0; }

.ctp-badge {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.ctp-badge .dashicons { font-size: 13px; width: 13px; height: 13px; }
.ctp-variant-green { background: #dcfce7; color: #16a34a; }
.ctp-variant-amber { background: #fef3c7; color: #d97706; }
.ctp-variant-purple { background: #e0e7ff; color: #6366f1; }
.ctp-variant-gray { background: #f3f4f6; color: #6b7280; }

.ctp-progress-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ctp-progress { background: #eee; border-radius: 999px; height: 10px; overflow: hidden; margin-bottom: 14px; }
.ctp-progress-bar { background: #2563eb; height: 100%; transition: width 0.4s ease; }

.ctp-stage-track { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; }
.ctp-stage-track li {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 5px 10px; border-radius: 999px; background: #f3f4f6; color: #9ca3af; font-size: 12px;
}
.ctp-stage-track li .dashicons { font-size: 13px; width: 13px; height: 13px; }
.ctp-stage-track li.ctp-stage-done { background: #dbeafe; color: #1d4ed8; }

.ctp-case-main h4 { margin: 0 0 8px; font-size: 13px; color: #374151; }
.ctp-documents { width: 100%; border-collapse: collapse; margin-bottom: 6px; font-size: 13px; }
.ctp-documents th { text-align: left; color: #9ca3af; font-weight: 600; font-size: 12px; padding: 4px; border-bottom: 1px solid #f0f0f1; }
.ctp-documents td { padding: 8px 4px; border-bottom: 1px solid #f6f6f7; }
.ctp-documents .dashicons { font-size: 14px; width: 14px; height: 14px; color: #9ca3af; vertical-align: text-bottom; }
.ctp-documents a { color: #2563eb; text-decoration: none; }
.ctp-documents a:hover { text-decoration: underline; }

.ctp-empty-state {
	text-align: center; padding: 22px 10px; background: #f9fafb; border-radius: 8px;
	border: 1px dashed #e5e7eb;
}
.ctp-empty-state .dashicons { font-size: 24px; width: 24px; height: 24px; color: #d1d5db; }
.ctp-empty-state p { margin: 6px 0 0; color: #9ca3af; font-size: 13px; }

.ctp-case-upload { background: #f8fafc; border-radius: 10px; padding: 18px; }
.ctp-dropzone {
	border: 2px dashed #c7d2fe; border-radius: 10px;
	padding: 20px 14px; text-align: center;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.ctp-dropzone.is-dragover { border-color: #2563eb; background: #eef2ff; }
.ctp-dropzone-icon { font-size: 30px; width: 30px; height: 30px; color: #2563eb; background: #fff; border-radius: 50%; padding: 8px; box-sizing: content-box; margin-bottom: 8px; }
.ctp-dropzone-title { font-weight: 600; font-size: 14px; margin: 4px 0 2px; }
.ctp-dropzone-hint { font-size: 12px; color: #6b7280; margin: 0 0 12px; }
.ctp-choose-file { cursor: pointer; }
.ctp-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.ctp-file-chosen { font-size: 12px; color: #9ca3af; margin: 10px 0 0; word-break: break-all; }
.ctp-upload-submit { margin-top: 10px; }

.ctp-security-bar {
	background: #eef2ff; border-radius: 10px; padding: 14px 18px;
	font-size: 13px; color: #4b5563;
}
.ctp-security-bar .dashicons { color: #2563eb; vertical-align: text-bottom; }

/* Tablet: sidebar becomes a horizontal strip, case columns stack. */
@media (max-width: 900px) {
	.ctp-shell { grid-template-columns: 1fr; gap: 16px; }

	.ctp-sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px 16px; }
	.ctp-sidebar-nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
	.ctp-sidebar-nav-item { padding: 8px 12px; }
	.ctp-nav-label { flex: 0 1 auto; }
	.ctp-sidebar-logout { margin-top: 0; }

	.ctp-case { grid-template-columns: 1fr; gap: 18px; }
	.ctp-case-info {
		border-right: none; border-bottom: 1px solid #f0f0f1;
		padding-right: 0; padding-bottom: 16px;
		display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	}
	.ctp-case-icon { margin-bottom: 0; }
	.ctp-case-info h3 { margin: 0; flex: 1; }
	.ctp-case-updated { margin: 0; width: 100%; }
}

/* Phone: single column everywhere, full-width controls, no side-scroll. */
@media (max-width: 600px) {
	.ctp-shell, .ctp-auth { max-width: 100%; }

	.ctp-db-banner { flex-direction: column; align-items: flex-start; padding: 18px; }
	.ctp-db-banner h2 { font-size: 18px; }
	.ctp-db-banner-actions { width: 100%; justify-content: space-between; }

	.ctp-case, .ctp-panel { padding: 16px; }
	.ctp-auth-card { padding: 20px; }

	.ctp-sidebar-nav-item { flex: 1 1 auto; justify-content: center; }
	.ctp-sidebar-logout { width: 100%; justify-content: center; padding-top: 10px; border-top: 1px solid #f0f0f1; }

	/* Tables reflow to stacked rows with their header as a label. */
	.ctp-documents thead { display: none; }
	.ctp-documents, .ctp-documents tbody, .ctp-documents tr, .ctp-documents td { display: block; width: 100%; }
	.ctp-documents tr {
		border: 1px solid #f0f0f1; border-radius: 8px;
		padding: 10px 12px; margin-bottom: 10px;
	}
	.ctp-documents td { border: none; padding: 3px 0; }
	.ctp-documents td:first-child { font-weight: 600; word-break: break-word; }

	.ctp-stage-track { gap: 6px; }
	.ctp-stage-track li { font-size: 11px; padding: 4px 8px; }

	.ctp-add-case-form { flex-direction: column; }
	.ctp-add-case-form .ctp-button { width: 100%; }

	.ctp-field-row { flex-direction: column; align-items: flex-start; gap: 10px; }
	.ctp-security-bar { font-size: 12px; padding: 12px 14px; }
}
