.uq-wrap { max-width: 1100px; margin: 20px auto; font-family: Arial, Helvetica, sans-serif; color: #222; }
.uq-locked { max-width: 400px; margin: 60px auto; text-align: center; }

.uq-dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.uq-dash-header h2 { margin: 0; }
.uq-dash-header-actions { display: flex; gap: 10px; align-items: center; }

/* Some themes force headings/labels/links/table text (including column-title
   <th> cells) to white or near-white with their own !important rules, which
   makes them invisible on our white/light backgrounds. To guarantee nothing
   is ever unreadable, force EVERY element inside the plugin wrapper to the
   brand green using a high-specificity, !important selector chain that beats
   typical theme overrides, then carve out the exceptions below (badges,
   buttons, status colors, inputs). */
html body .uq-wrap,
html body .uq-wrap *,
html body table.uq-table th,
html body table.uq-table td { color: #1e8449 !important; }

/* Exceptions: these need their own distinct colors even though the rule
   above is intentionally broad. Order matters — these come after, and reuse
   the same high-specificity chain so they aren't swallowed by the rule above. */
html body .uq-wrap .uq-badge.pending { color: #8a6d00 !important; }
html body .uq-wrap .uq-badge.approved,
html body .uq-wrap #uq-form-message.success { color: #1e7e34 !important; }
html body .uq-wrap .uq-badge.rejected,
html body .uq-wrap #uq-form-message.error { color: #a71d2a !important; }
html body .uq-wrap .uq-btn-primary,
html body .uq-wrap .uq-btn-primary *,
html body .uq-wrap .uq-btn-danger,
html body .uq-wrap .uq-btn-danger * { color: #fff !important; }
html body .uq-wrap .uq-btn-secondary,
html body .uq-wrap .uq-btn-secondary * { color: #222 !important; }
html body .uq-wrap .uq-btn-text { color: #1e8449 !important; }
html body .uq-wrap input,
html body .uq-wrap select,
html body .uq-wrap textarea { color: #222 !important; }

.uq-btn { display: inline-block; padding: 10px 18px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; text-decoration: none; font-weight: 600; }
.uq-btn-primary { background: #1e8449; color: #fff; }
.uq-btn-primary:hover { background: #166638; color:#fff; }
.uq-btn-secondary { background: #eef1ef; color: #222; }
.uq-btn-secondary:hover { background: #dfe4e1; }
.uq-btn-text { background: none; color: #1e8449; padding: 10px 8px; }
.uq-btn-danger { background: #e74c3c; color: #fff; }

.uq-stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.uq-stat-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 18px; text-align: center; border-top: 4px solid #ccc; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.uq-stat-card.total { border-top-color: #333; }
.uq-stat-card.pending { border-top-color: #e6a700; }
.uq-stat-card.approved { border-top-color: #1e8449; }
.uq-stat-card.rejected { border-top-color: #e74c3c; }
.uq-stat-num { display: block; font-size: 30px; font-weight: bold; }
.uq-stat-label { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }

/* Animated circular progress ring shown on each stat card */
.uq-stat-ring { position: relative; width: 84px; height: 84px; }
.uq-stat-ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.uq-stat-ring circle { fill: none; stroke-width: 8; }
.uq-stat-ring .uq-ring-track { stroke: #eef1ef; }
.uq-stat-ring .uq-ring-progress {
	stroke-linecap: round;
	stroke-dasharray: 219.9;
	stroke-dashoffset: 219.9;
	transition: stroke-dashoffset 1.4s cubic-bezier(.34,1.56,.64,1);
}
.uq-stat-ring.uq-ring-animate .uq-ring-progress { stroke-dashoffset: var(--uq-ring-offset, 0); }
.uq-stat-card.total .uq-ring-progress { stroke: #333; }
.uq-stat-card.pending .uq-ring-progress { stroke: #e6a700; }
.uq-stat-card.approved .uq-ring-progress { stroke: #1e8449; }
.uq-stat-card.rejected .uq-ring-progress { stroke: #e74c3c; }
.uq-stat-ring-percent {
	position: absolute; top: 0; left: 0; width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 700;
}

/* Spinning accent circle next to the dashboard title, purely decorative */
.uq-dash-spinner { display: inline-block; width: 22px; height: 22px; margin-right: 8px; vertical-align: -5px; }
.uq-dash-spinner svg { width: 100%; height: 100%; animation: uq-spin 2.2s linear infinite; }
.uq-dash-spinner circle { fill: none; stroke: #1e8449; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 80; stroke-dashoffset: 55; opacity: .8; }
@keyframes uq-spin { 100% { transform: rotate(360deg); } }

.uq-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.uq-toolbar input, .uq-toolbar select { padding: 9px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.uq-toolbar input { flex: 1; }

table.uq-table { width: 100%; border-collapse: collapse; background: #fff; }
table.uq-table th { background: #f5f6f5; text-align: left; padding: 10px; font-size: 13px; border-bottom: 2px solid #e2e2e2; }
table.uq-table td { padding: 10px; border-bottom: 1px solid #eee; font-size: 14px; vertical-align: middle; }

.uq-badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: bold; text-transform: uppercase; }
.uq-badge.pending { background: #fff3cd; color: #8a6d00; }
.uq-badge.approved { background: #d4edda; color: #1e7e34; }
.uq-badge.rejected { background: #f8d7da; color: #a71d2a; }

.uq-status-select { padding: 5px 8px; border-radius: 5px; border: 1px solid #ccc; }

.uq-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.uq-panel { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.uq-panel h3 { margin-top: 0; }
.uq-panel label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 600; color: #555; }
.uq-panel input[type=text], .uq-panel input[type=email], .uq-panel textarea, .uq-panel select {
	width: 100%; padding: 9px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
}

.uq-autocomplete-results { position: relative; background: #fff; border: 1px solid #ddd; border-radius: 6px; max-height: 180px; overflow-y: auto; margin-top: 4px; z-index: 20; }
.uq-autocomplete-results:empty { border: none; }
.uq-autocomplete-results div { padding: 8px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.uq-autocomplete-results div:hover { background: #f5f6f5; }

.uq-selected-box { margin-top: 14px; padding: 12px; background: #f5faf6; border: 1px solid #cfe8d6; border-radius: 8px; font-size: 13px; }

.uq-signature-preview { margin-top: 10px; min-height: 50px; }
.uq-signature-preview img { max-height: 60px; }

#uq-items-table td { position: relative; }
#uq-items-table input,
#uq-items-table select { width: 100%; padding: 7px 8px; border: 1px solid #ccc; border-radius: 5px; font-size: 13px; background: #fff; }
.uq-vat-cell { display: flex; align-items: center; gap: 8px; }
.uq-vat-percent-label { font-size: 12px; font-weight: 600; white-space: nowrap; }
.uq-remove-row { background: #f8d7da; color: #a71d2a; border: none; border-radius: 5px; width: 28px; height: 28px; cursor: pointer; font-size: 16px; }
.uq-line-total { font-weight: bold; text-align: right; }

.uq-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.uq-switch input { opacity: 0; width: 0; height: 0; }
.uq-switch span { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius: 22px; transition: .2s; }
.uq-switch span:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: .2s; }
.uq-switch input:checked + span { background-color: #1e8449; }
.uq-switch input:checked + span:before { transform: translateX(18px); }

.uq-totals-box { max-width: 320px; margin-left: auto; background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 16px 20px; }
.uq-totals-box div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.uq-grand-total { border-top: 2px solid #1e8449; margin-top: 6px; padding-top: 10px !important; font-size: 16px; font-weight: bold; }

.uq-actions-bar { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
#uq-form-message { margin-top: 12px; font-size: 14px; }
#uq-form-message.success { color: #1e7e34; }
#uq-form-message.error { color: #a71d2a; }

@media (max-width: 782px) {
	.uq-form-grid { grid-template-columns: 1fr; }
	.uq-stat-cards { grid-template-columns: repeat(2, 1fr); }
}
