/**
 * Client Dashboard — Apple-inspired, premium design system.
 * Self-contained, high-performance styles. Zero external dependencies.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================
   Design Tokens
   ============================================ */
.cd-root {
	--cd-font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
	--cd-bg: #F5F5F7;
	--cd-text: #1d1d1f;
	--cd-text-secondary: #424245;
	--cd-muted: #86868b;
	--cd-border: #d2d2d7;
	--cd-border-light: #e8e8ed;
	--cd-card: #ffffff;
	--cd-radius: 16px;
	--cd-radius-sm: 12px;
	--cd-radius-xs: 8px;
	--cd-space-1: 4px;
	--cd-space-2: 8px;
	--cd-space-3: 12px;
	--cd-space-4: 16px;
	--cd-space-5: 20px;
	--cd-space-6: 24px;
	--cd-space-7: 32px;
	--cd-space-8: 40px;
	--cd-space-9: 48px;
	--cd-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
	--cd-shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
	--cd-shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.12), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
	--cd-transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
	--cd-transition-spring: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	font-family: var(--cd-font);
	color: var(--cd-text);
	background: var(--cd-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

.cd-root * {
	box-sizing: border-box;
}

/* ============================================
   Icons — unified sizing
   ============================================ */
.cd-icon {
	display: block;
	flex-shrink: 0;
}

.cd-icon-spin {
	animation: cd-icon-spin 1s linear infinite;
}

@keyframes cd-icon-spin {
	to { transform: rotate(360deg); }
}

.cd-icon-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: var(--cd-muted);
}

.cd-icon-box--sm {
	width: 32px;
	height: 32px;
	border-radius: var(--cd-radius-xs);
}

.cd-icon-box--md {
	width: 40px;
	height: 40px;
	border-radius: var(--cd-radius-sm);
}

.cd-icon-box--lg {
	width: 72px;
	height: 72px;
	border-radius: 20px;
}

/* ============================================
   Layout & Views
   ============================================ */
.cd-view {
	max-width: 720px;
	margin: 0 auto;
	padding: var(--cd-space-8) var(--cd-space-7);
}

.cd-dashboard-view {
	display: flex;
	flex-direction: column;
	gap: var(--cd-space-6);
}

/* Top bar — settings menu */
.cd-topbar {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin: calc(-1 * var(--cd-space-8)) calc(-1 * var(--cd-space-7)) 0;
	padding: var(--cd-space-3) var(--cd-space-7);
	border-bottom: 1px solid var(--cd-border-light);
}

.cd-settings-wrap {
	position: relative;
}

.cd-settings-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 168px;
	background: var(--cd-card);
	border: 1.5px solid var(--cd-border-light);
	border-radius: var(--cd-radius-sm);
	box-shadow: var(--cd-shadow-md);
	padding: var(--cd-space-2);
	z-index: 30;
}

.cd-settings-dropdown[hidden] {
	display: none;
}

.cd-settings-item {
	display: flex;
	align-items: center;
	gap: var(--cd-space-3);
	width: 100%;
	padding: var(--cd-space-3) var(--cd-space-4);
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--cd-text);
	cursor: pointer;
	border-radius: var(--cd-radius-xs);
	text-align: left;
	transition: background 0.15s ease, color 0.15s ease;
}

.cd-settings-item:hover {
	background: #f5f5f7;
	color: var(--cd-text);
}

.cd-settings-item .cd-icon {
	color: var(--cd-muted);
	flex-shrink: 0;
}

.cd-login-view {
	max-width: 420px;
	padding-top: var(--cd-space-9);
	padding-bottom: var(--cd-space-9);
	text-align: center;
}

.cd-login-view .cd-title {
	margin-bottom: var(--cd-space-4);
}

.cd-login-view .cd-restricted-badge {
	margin-bottom: var(--cd-space-4);
}

.cd-login-view .cd-subtitle {
	margin-bottom: var(--cd-space-7);
}

.cd-login-view .cd-form {
	display: flex;
	flex-direction: column;
	gap: var(--cd-space-3);
	padding-bottom: 0;
}

.cd-login-view .cd-form .cd-btn-primary {
	width: 100%;
	margin-top: 4px;
}

.cd-login-view .cd-message {
	position: static;
	margin: 4px 0 0;
	text-align: center;
}

.cd-login-view .cd-message:empty {
	display: none;
}

/* ============================================
   Login View — Logo & Typography
   ============================================ */
.cd-logo {
	background: var(--cd-card);
	border: 1.5px solid var(--cd-border-light);
	color: var(--cd-text);
	margin: 0 auto var(--cd-space-7);
	box-shadow: var(--cd-shadow-sm);
	transition: transform var(--cd-transition), box-shadow var(--cd-transition);
}

.cd-logo:hover {
	transform: scale(1.03);
	box-shadow: var(--cd-shadow-md);
}

.cd-title {
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.025em;
	margin: 0 0 8px;
	text-align: center;
	color: var(--cd-text);
}

.cd-subtitle {
	color: var(--cd-muted);
	font-size: 15px;
	line-height: 1.55;
	margin: 0 0 var(--cd-space-7);
	text-align: center;
}

/* ============================================
   Forms & Inputs — Premium feel
   ============================================ */
.cd-form {
	position: relative;
}

.cd-form input[type="email"],
.cd-form input[type="text"],
.cd-form textarea {
	width: 100%;
	padding: var(--cd-space-4) var(--cd-space-5);
	border: 1.5px solid var(--cd-border);
	border-radius: var(--cd-radius-sm);
	background: #fff;
	font-size: 16px;
	line-height: 1.5;
	outline: none;
	transition: border-color var(--cd-transition), box-shadow var(--cd-transition), background var(--cd-transition);
	font-family: inherit;
	color: var(--cd-text);
}

.cd-form input::placeholder,
.cd-form textarea::placeholder {
	color: var(--cd-muted);
	opacity: 0.7;
}

.cd-form input:hover,
.cd-form textarea:hover {
	border-color: #b0b0b5;
}

.cd-form input:focus,
.cd-form textarea:focus {
	border-color: var(--cd-text);
	box-shadow: 0 0 0 4px rgba(29, 29, 31, 0.06);
}

.cd-form textarea {
	resize: vertical;
	min-height: 120px;
}

/* ============================================
   File Input — Apple-style drop zone
   ============================================ */
.cd-file-zone {
	position: relative;
	border: 2px dashed var(--cd-border);
	border-radius: var(--cd-radius-sm);
	padding: var(--cd-space-7) var(--cd-space-6);
	text-align: center;
	cursor: pointer;
	transition: border-color var(--cd-transition), background var(--cd-transition);
	background: #fcfcfd;
}

.cd-file-zone:hover,
.cd-file-zone.dragover {
	border-color: var(--cd-text);
	background: #f5f5f7;
}

.cd-file-zone.dragover {
	border-style: solid;
}

.cd-file-zone-icon {
	margin: 0 auto var(--cd-space-3);
	background: #f0f0f5;
	color: var(--cd-muted);
	transition: transform var(--cd-transition-spring), background var(--cd-transition);
}

.cd-file-zone:hover .cd-file-zone-icon {
	transform: scale(1.05);
	background: #e8e8ed;
}

.cd-file-zone-text {
	font-size: 14px;
	color: var(--cd-muted);
	line-height: 1.5;
}

.cd-file-zone-text strong {
	color: var(--cd-text);
	font-weight: 600;
}

.cd-file-zone-hint {
	font-size: 12px;
	color: #a1a1a6;
	margin-top: 6px;
	display: block;
}

.cd-file-zone input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

/* Attachment preview list */
#cd-attachment-preview {
	margin-top: var(--cd-space-3);
	display: flex;
	flex-direction: column;
	gap: var(--cd-space-2);
}

#cd-attachment-preview .cd-att-item {
	display: flex;
	align-items: center;
	gap: var(--cd-space-3);
	padding: var(--cd-space-3) var(--cd-space-4);
	background: #f5f5f7;
	border-radius: var(--cd-radius-xs);
	font-size: 13px;
	transition: background var(--cd-transition);
}

#cd-attachment-preview .cd-att-item:hover {
	background: #eeeef2;
}

#cd-attachment-preview .cd-att-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e8e8ed;
	border-radius: var(--cd-radius-xs);
	color: var(--cd-text-secondary);
}

#cd-attachment-preview .cd-att-name {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
	color: var(--cd-text);
}

#cd-attachment-preview .cd-att-size {
	color: var(--cd-muted);
	font-size: 12px;
	white-space: nowrap;
}

/* ============================================
   Message / Status Text
   ============================================ */
.cd-message {
	position: absolute;
	bottom: -26px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 13px;
	font-weight: 500;
	opacity: 1;
	margin: 0;
	transition: opacity var(--cd-transition);
}

.cd-message.error {
	color: #de3730;
}

/* ============================================
   Buttons — Premium with micro-interactions
   ============================================ */
.cd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--cd-space-2);
	font-weight: 500;
	font-size: 15px;
	line-height: 1;
	padding: var(--cd-space-4) var(--cd-space-6);
	border-radius: var(--cd-radius-sm);
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: all var(--cd-transition);
	font-family: inherit;
	position: relative;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

.cd-btn:active {
	transform: scale(0.97);
}

.cd-btn-primary {
	background: var(--cd-text);
	color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cd-btn-primary:hover {
	background: #333336;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.cd-btn-primary:active {
	background: #424245;
}

.cd-btn-primary:disabled {
	background: #a1a1a6;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.cd-btn-sm {
	padding: var(--cd-space-3) var(--cd-space-5);
	font-size: 14px;
	border-radius: var(--cd-radius-xs);
}

.cd-btn-icon {
	background: var(--cd-card);
	border: 1.5px solid var(--cd-border);
	color: var(--cd-muted);
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: var(--cd-radius-xs);
	transition: all var(--cd-transition);
}

.cd-btn-icon--sm {
	width: 36px;
	height: 36px;
}

.cd-btn-icon:hover {
	color: var(--cd-text);
	background: #f5f5f7;
	border-color: #b0b0b5;
}

/* ============================================
   Browser Notifications — Bell button
   ============================================ */
.cd-notify-bell-btn {
	position: relative;
}

.cd-notify-bell-btn[hidden] {
	display: none;
}

.cd-notify-dot {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #10b981;
	border: 2px solid var(--cd-card);
	display: none;
}

.cd-notify-active .cd-notify-dot {
	display: block;
}

.cd-notify-active {
	color: #047857;
	border-color: #bbf7d0;
	background: #f0fdf6;
}

.cd-notify-active:hover {
	background: #dcfce7;
	border-color: #86efac;
}

/* ============================================
   Header — Dashboard
   ============================================ */
.cd-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--cd-space-4);
	padding-bottom: var(--cd-space-6);
	border-bottom: 1px solid var(--cd-border-light);
}

.cd-header .cd-title {
	text-align: left;
	font-size: 26px;
	margin-bottom: 2px;
}

.cd-header .cd-subtitle {
	text-align: left;
	margin-bottom: 0;
	font-size: 14px;
}

.cd-header-actions {
	display: flex;
	align-items: center;
	gap: var(--cd-space-2);
}

/* ============================================
   Task List
   ============================================ */
.cd-task-list {
	display: flex;
	flex-direction: column;
	gap: var(--cd-space-4);
	padding-bottom: var(--cd-space-9);
}

.cd-task-list-active {
	display: flex;
	flex-direction: column;
	gap: var(--cd-space-4);
}

/* Completed — collapsible section */
.cd-completed-section {
	margin-top: var(--cd-space-2);
	border: 1.5px solid var(--cd-border-light);
	border-radius: var(--cd-radius);
	background: #fafafa;
	overflow: hidden;
}

.cd-completed-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--cd-space-3);
	padding: var(--cd-space-4) var(--cd-space-5);
	cursor: pointer;
	list-style: none;
	user-select: none;
	transition: background 0.15s ease;
}

.cd-completed-summary::-webkit-details-marker {
	display: none;
}

.cd-completed-summary::marker {
	content: '';
}

.cd-completed-summary:hover {
	background: #f5f5f7;
}

.cd-completed-summary-main {
	display: flex;
	align-items: center;
	gap: var(--cd-space-3);
	min-width: 0;
}

.cd-completed-summary-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: var(--cd-radius-sm);
	background: #ecfdf5;
	color: #047857;
	flex-shrink: 0;
}

.cd-completed-summary-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--cd-text);
	letter-spacing: -0.01em;
}

.cd-completed-summary-count {
	font-size: 13px;
	font-weight: 500;
	color: var(--cd-muted);
}

.cd-completed-summary-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--cd-muted);
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.cd-completed-section[open] .cd-completed-summary-chevron {
	transform: rotate(180deg);
}

.cd-completed-items {
	display: flex;
	flex-direction: column;
	gap: var(--cd-space-3);
	padding: 0 var(--cd-space-4) var(--cd-space-4);
}

.cd-completed-items .cd-task {
	opacity: 1;
}

/* ============================================
   Task Card — Refined card design
   ============================================ */
.cd-task {
	background: var(--cd-card);
	border: 1.5px solid var(--cd-border-light);
	border-radius: var(--cd-radius);
	padding: var(--cd-space-6);
	box-shadow: var(--cd-shadow-sm);
	transition: box-shadow var(--cd-transition), border-color var(--cd-transition), transform var(--cd-transition);
}

.cd-task:hover {
	box-shadow: var(--cd-shadow-md);
	border-color: var(--cd-border);
	transform: translateY(-1px);
}

.cd-task.completed {
	background: #fafafa;
	border-color: #f0f0f2;
	opacity: 0.8;
}

.cd-task.completed:hover {
	opacity: 1;
}

.cd-task-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--cd-space-4);
	margin-bottom: var(--cd-space-2);
}

.cd-task-title {
	font-weight: 600;
	font-size: 16px;
	line-height: 1.4;
	margin: 0;
	flex: 1;
	color: var(--cd-text);
}

.cd-task.completed .cd-task-title {
	color: var(--cd-muted);
	text-decoration: line-through;
	text-decoration-color: #d1d5db;
}

.cd-task-desc {
	font-size: 14px;
	color: var(--cd-text-secondary);
	line-height: 1.65;
	margin: var(--cd-space-2) 0 var(--cd-space-4);
}

.cd-task-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--cd-space-3);
	font-size: 12px;
	color: var(--cd-muted);
	font-weight: 500;
}

.cd-meta-item {
	display: inline-flex;
	align-items: center;
	gap: var(--cd-space-2);
}

.cd-meta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--cd-muted);
}

/* ============================================
   Status Pills — Polished
   ============================================ */
.cd-status-pill {
	display: inline-flex;
	align-items: center;
	gap: var(--cd-space-2);
	font-size: 12px;
	font-weight: 600;
	padding: var(--cd-space-2) var(--cd-space-3);
	border-radius: 999px;
	white-space: nowrap;
	line-height: 1;
	letter-spacing: 0.01em;
}

.cd-status-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cd-status-submitted {
	background: #f5f5f7;
	color: #424245;
}

.cd-status-seen {
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fde68a;
}

.cd-status-started {
	background: #e0e7ff;
	color: #3730a3;
	border: 1px solid #c7d2fe;
}

.cd-status-completed {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.cd-status-failed {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* ============================================
   + Add Attachment Button (inline on tasks)
   ============================================ */
.cd-add-att-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--cd-space-2);
	font-size: 12px;
	font-weight: 500;
	padding: var(--cd-space-2) var(--cd-space-3);
	border: 1.5px solid var(--cd-border);
	border-radius: var(--cd-radius-xs);
	background: var(--cd-card);
	color: var(--cd-muted);
	cursor: pointer;
	transition: all var(--cd-transition);
	font-family: inherit;
}

.cd-add-att-btn:hover {
	border-color: var(--cd-text);
	color: var(--cd-text);
	background: #f5f5f7;
}

.cd-add-att-btn:active {
	transform: scale(0.96);
}

/* Inline upload form (existing tasks) */
.cd-inline-upload {
	margin-top: var(--cd-space-4);
	padding: var(--cd-space-4);
	background: #f9f9fb;
	border: 1.5px solid var(--cd-border-light);
	border-radius: var(--cd-radius-sm);
	display: flex;
	align-items: center;
	gap: var(--cd-space-3);
}

.cd-inline-file-picker {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.cd-choose-files-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--cd-space-2);
	font-weight: 500;
	font-size: 13px;
	padding: var(--cd-space-3) var(--cd-space-4);
	border: 1.5px solid var(--cd-border);
	border-radius: var(--cd-radius-xs);
	background: var(--cd-card);
	color: var(--cd-text);
	cursor: pointer;
	transition: all var(--cd-transition);
	font-family: inherit;
	white-space: nowrap;
	flex-shrink: 0;
}

.cd-choose-files-btn:hover {
	border-color: var(--cd-text);
	background: #f5f5f7;
}

.cd-choose-files-btn input[type="file"] {
	position: absolute;
	width: 0.1px;
	height: 0.1px;
	opacity: 0;
	overflow: hidden;
	z-index: -1;
}

.cd-inline-file-name {
	font-size: 13px;
	color: var(--cd-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.cd-inline-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--cd-space-2);
	font-size: 13px;
	font-weight: 500;
	padding: var(--cd-space-3) var(--cd-space-4);
	border: none;
	border-radius: var(--cd-radius-xs);
	background: var(--cd-text);
	color: #fff;
	cursor: pointer;
	transition: all var(--cd-transition);
	font-family: inherit;
	white-space: nowrap;
	flex-shrink: 0;
}

.cd-inline-upload-btn:hover {
	background: #333336;
}

.cd-inline-upload-btn:active {
	transform: scale(0.96);
}

.cd-inline-upload-btn:disabled {
	background: #a1a1a6;
	cursor: not-allowed;
	transform: none;
}

/* ============================================
   Inline Compose Panel — New Request form
   ============================================ */
.cd-compose {
	margin: 0;
}

.cd-compose[hidden] {
	display: none;
}

.cd-compose-panel {
	background: var(--cd-card);
	border: 1.5px solid var(--cd-border);
	border-radius: var(--cd-radius);
	padding: var(--cd-space-6);
	box-shadow: var(--cd-shadow-md);
	animation: cd-compose-in 0.28s var(--cd-transition-spring) forwards;
}

@keyframes cd-compose-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cd-compose-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--cd-space-5);
	padding-bottom: var(--cd-space-4);
	border-bottom: 1px solid var(--cd-border-light);
}

.cd-compose-heading {
	display: flex;
	align-items: center;
	gap: var(--cd-space-3);
}

.cd-compose-title {
	margin: 0 0 var(--cd-space-1);
	font-size: 17px;
	font-weight: 700;
	color: var(--cd-text);
	letter-spacing: -0.02em;
}

.cd-compose-heading .cd-compose-title {
	margin: 0;
}

.cd-compose-heading-icon {
	background: #f5f5f7;
	color: var(--cd-text);
}

.cd-compose-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: var(--cd-space-3);
	padding-top: var(--cd-space-2);
}

.cd-btn-secondary {
	background: #fff;
	border: 1.5px solid var(--cd-border);
	color: var(--cd-text);
	box-shadow: none;
}

.cd-btn-secondary:hover {
	background: #f5f5f7;
	border-color: #b0b0b5;
}

.cd-btn-secondary:active {
	background: #eeeef2;
}

.cd-empty-hint {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--cd-space-2);
	width: 100%;
	text-align: center;
	color: var(--cd-muted);
	font-size: 14px;
	margin: 0;
	padding: var(--cd-space-7) var(--cd-space-6);
}

.cd-empty-hint-icon {
	display: inline-flex;
	align-items: center;
	color: var(--cd-muted);
}

/* ============================================
   Field — Consistent spacing
   ============================================ */
.cd-field {
	margin-bottom: var(--cd-space-5);
}

.cd-field-file {
	margin-bottom: var(--cd-space-6);
}

.cd-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--cd-text-secondary);
	margin-bottom: var(--cd-space-2);
	letter-spacing: 0.01em;
}

.cd-field label .cd-optional {
	font-weight: 500;
	color: var(--cd-muted);
}

.cd-compose .cd-form {
	display: flex;
	flex-direction: column;
}

/* ============================================
   Empty State
   ============================================ */
.cd-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: var(--cd-space-9) var(--cd-space-7);
	background: var(--cd-card);
	border: 1.5px dashed var(--cd-border);
	border-radius: var(--cd-radius);
	transition: border-color var(--cd-transition);
}

.cd-empty-icon {
	margin: 0 0 var(--cd-space-5);
	background: #f5f5f7;
	color: var(--cd-muted);
}

.cd-empty:hover {
	border-color: #b0b0b5;
}

.cd-empty h3 {
	width: 100%;
	max-width: 360px;
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 var(--cd-space-2);
	color: var(--cd-text);
}

.cd-empty p {
	width: 100%;
	max-width: 360px;
	color: var(--cd-muted);
	font-size: 15px;
	margin: 0 0 var(--cd-space-5);
	line-height: 1.55;
}

/* ============================================
   Skeleton Loading
   ============================================ */
.cd-skeleton {
	background: linear-gradient(90deg, #f6f7f8 25%, #eef0f2 37%, #f6f7f8 63%);
	background-size: 400% 100%;
	animation: cd-shimmer 1.4s ease infinite;
	border-radius: 8px;
	height: 16px;
}

@keyframes cd-shimmer {
	0% { background-position: 100% 0; }
	100% { background-position: -100% 0; }
}

.cd-skeleton-row {
	display: flex;
	gap: var(--cd-space-4);
	margin-bottom: var(--cd-space-4);
}

.cd-skeleton-row .cd-skeleton:nth-child(1) { flex: 2; }
.cd-skeleton-row .cd-skeleton:nth-child(2) { flex: 1; height: 24px; border-radius: 999px; }

/* ============================================
   Restricted Badge
   ============================================ */
.cd-restricted-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--cd-space-2);
	background: #f5f5f7;
	color: var(--cd-text-secondary);
	font-size: 12px;
	font-weight: 500;
	padding: var(--cd-space-2) var(--cd-space-4);
	border-radius: 999px;
	margin: 0 auto var(--cd-space-4);
	white-space: nowrap;
}

.cd-badge-icon {
	display: inline-flex;
	align-items: center;
	color: var(--cd-muted);
}

/* ============================================
   Attachments
   ============================================ */
.cd-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: var(--cd-space-2);
	margin-top: var(--cd-space-3);
}

.cd-attachment-link {
	display: inline-flex;
	align-items: center;
	gap: var(--cd-space-2);
	color: var(--cd-text-secondary);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	padding: var(--cd-space-2) var(--cd-space-3);
	background: #f5f5f7;
	border-radius: var(--cd-radius-xs);
	transition: all var(--cd-transition);
	max-width: 100%;
}

.cd-attachment-link:hover {
	color: var(--cd-text);
	background: #eeeef2;
}

.cd-attachment-icon {
	display: inline-flex;
	align-items: center;
	color: var(--cd-muted);
	flex-shrink: 0;
}

.cd-attachment-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px;
}

.cd-attachment-size {
	color: var(--cd-muted);
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
}

/* ============================================
   Responsive — Mobile-first refinements
   ============================================ */
@media (max-width: 480px) {
	.cd-view {
		padding: var(--cd-space-6) var(--cd-space-4);
	}

	.cd-topbar {
		margin: calc(-1 * var(--cd-space-6)) calc(-1 * var(--cd-space-4)) 0;
		padding: var(--cd-space-3) var(--cd-space-4);
	}

	.cd-dashboard-view {
		gap: var(--cd-space-5);
	}

	.cd-login-view {
		padding-top: var(--cd-space-8);
		padding-bottom: var(--cd-space-8);
	}

	.cd-header {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--cd-space-3);
	}

	.cd-header-actions {
		width: 100%;
		justify-content: flex-end;
	}

	.cd-title {
		font-size: 24px;
	}

	.cd-header .cd-title {
		font-size: 22px;
	}

	.cd-task,
	.cd-compose-panel {
		padding: var(--cd-space-5);
	}

	.cd-compose-actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.cd-compose-actions .cd-btn {
		width: 100%;
	}

	.cd-inline-upload {
		flex-direction: column;
		align-items: stretch;
	}

	.cd-inline-file-picker {
		width: 100%;
	}
}

/* ============================================
   Shake animation for error states
   ============================================ */
.shake {
	animation: cd-shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes cd-shake {
	10%, 90% { transform: translate3d(-1px, 0, 0); }
	20%, 80% { transform: translate3d(2px, 0, 0); }
	30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
	40%, 60% { transform: translate3d(4px, 0, 0); }
}
