#cdcApp, #cdcApp * { box-sizing: border-box; }

#cdcApp {
	max-width: 640px;
	margin: 20px auto;
	font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	color: #3a2c1a;
}

.cdc-te { color: #7a5a2a; font-weight: 500; font-size: 0.85em; }

.cdc-topbar {
	display: flex;
	gap: 8px;
	margin-bottom: 14px;
}

.cdc-tab-btn {
	flex: 1;
	padding: 10px 8px;
	border: 2px solid #C97A1E;
	background: #FFF6E8;
	color: #A6531A;
	font-weight: 700;
	border-radius: 10px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.3;
}

.cdc-tab-btn.cdc-tab-active {
	background: #C97A1E;
	color: #fff;
}

.cdc-view { display: none; }
.cdc-view.cdc-view-active { display: block; }

.cdc-card {
	background: #FFFDF7;
	border: 2px solid #F0D9B0;
	border-radius: 14px;
	padding: 22px 18px;
	text-align: center;
	box-shadow: 0 2px 10px rgba(166,83,26,0.08);
}

.cdc-card-narrow { max-width: 360px; margin: 0 auto; }

.cdc-card h2 {
	margin: 0 0 6px 0;
	color: #A6531A;
	font-size: 20px;
}

.cdc-sub { color: #6b5432; margin: 0 0 18px 0; font-size: 14px; }

.cdc-mobile-input, .cdc-pin-input {
	width: 100%;
	padding: 14px;
	font-size: 20px;
	font-weight: 700;
	color: #3a2c1a;
	text-align: center;
	letter-spacing: 2px;
	border: 2px solid #C97A1E;
	border-radius: 10px;
	background: #FFFDF7;
	margin-bottom: 12px;
}

.cdc-mobile-input:focus, .cdc-pin-input:focus {
	outline: none;
	background: #FFF9C4;
	border-color: #A6531A;
}

.cdc-btn {
	display: inline-block;
	padding: 12px 22px;
	font-size: 15px;
	font-weight: 700;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	margin: 4px;
}

.cdc-btn-primary { background: #C97A1E; color: #fff; }
.cdc-btn-secondary { background: #FFF6E8; color: #A6531A; border: 2px solid #C97A1E; }
.cdc-btn-green { background: #4C8B45; color: #fff; }
.cdc-btn-orange { background: #C97A1E; color: #fff; }
.cdc-btn-red { background: #B03A2E; color: #fff; }

.cdc-msg { margin-top: 10px; font-weight: 700; }
.cdc-msg-error { color: #B03A2E; }
.cdc-msg-success { color: #2F7D32; }

/* Result card */
.cdc-result-card {
	margin-top: 18px;
	padding: 18px;
	border-radius: 12px;
	border: 2px solid #F0D9B0;
	background: #FFF6E8;
	text-align: left;
}

.cdc-result-card.cdc-delivered {
	background: #FFF9C4;
	border-color: #E6C94A;
}

.cdc-result-row { margin-bottom: 6px; font-size: 15px; }
.cdc-result-row b { color: #A6531A; }

.cdc-status-pill {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-weight: 700;
	font-size: 13px;
	margin-top: 8px;
}
.cdc-status-pending { background: #FFE0B2; color: #A6531A; }
.cdc-status-delivered { background: #C8E6C9; color: #2F7D32; }

.cdc-result-actions { margin-top: 14px; text-align: center; }

.cdc-not-found {
	margin-top: 18px;
	padding: 16px;
	border-radius: 12px;
	background: #FDEAEA;
	color: #B03A2E;
	font-weight: 700;
	text-align: center;
}

/* Admin */
.cdc-admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cdc-admin-header h2 { color: #A6531A; margin: 0; }

.cdc-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cdc-stat-box {
	flex: 1;
	min-width: 90px;
	background: #FFF6E8;
	border: 2px solid #F0D9B0;
	border-radius: 10px;
	padding: 10px;
	text-align: center;
}
.cdc-stat-box .cdc-stat-num { font-size: 22px; font-weight: 800; color: #A6531A; }
.cdc-stat-box .cdc-stat-label { font-size: 12px; color: #6b5432; }

.cdc-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cdc-filter-bar select, .cdc-filter-bar input[type="text"] {
	padding: 8px;
	border: 2px solid #F0D9B0;
	border-radius: 8px;
	font-size: 13px;
	color: #3a2c1a;
	font-weight: 600;
}
.cdc-filter-bar input[type="text"] { flex: 1; min-width: 160px; }

.cdc-bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: #6b5432; }

.cdc-table-wrap { overflow-x: auto; }

.cdc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cdc-table th, .cdc-table td {
	border: 1px solid #F0D9B0;
	padding: 6px 8px;
	text-align: left;
	word-break: break-word;
	color: #3a2c1a;
}
.cdc-table th { background: #FFF6E8; color: #A6531A; font-weight: 800; }
.cdc-table tr.cdc-row-delivered { background: #FFF9C4; }

.cdc-row-btn { padding: 4px 8px; font-size: 12px; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; margin: 2px; color: #fff; }
.cdc-row-btn-green { background: #4C8B45; }
.cdc-row-btn-orange { background: #C97A1E; }
.cdc-row-btn-red { background: #B03A2E; }

.cdc-pagination { margin-top: 12px; text-align: center; }
.cdc-pagination button {
	padding: 6px 14px;
	margin: 0 4px;
	border: 2px solid #C97A1E;
	background: #FFF6E8;
	color: #A6531A;
	border-radius: 8px;
	font-weight: 700;
	cursor: pointer;
}
.cdc-pagination button:disabled { opacity: 0.5; cursor: default; }

.cdc-edit-strip { background: #FFF9C4; }
.cdc-edit-strip input {
	width: 100%;
	padding: 5px;
	border: 1px solid #C97A1E;
	border-radius: 5px;
	font-size: 13px;
	font-weight: 700;
	color: #3a2c1a;
}

@media (max-width: 600px) {
	#cdcApp { margin: 10px; }
	.cdc-stats { flex-direction: row; }
}
